path: root/include/tgmath.h
Commit message (Collapse)AuthorAgeFilesLines
* include: General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326192
* Roll back r271012 even more aggressively.Ed Schouten2014-09-051-1/+1
| | | | | | | | | | | | | | | | | | | I've looked at the GCC sources and I now understand what's going wrong. THe C11 keywords are simply nonexistent when using C++ mode. They are marked as C-only in the parser. This is absolutely impractical for multiple reasons: - The C11 keywords do not conflict with C++ naming rules. They all start with _[A-Z]. There is no reason to make them C-only. - It makes it practically impossible for people to use these keywords in C header files and expect them to work from within C++ sources. As I said in my previous commit message: GCC is by far the weirdest compiler that I've ever used. Notes: svn path=/head/; revision=271155
* Leave the C11 keywords alone when we have a recent version of GCC.Ed Schouten2014-09-031-1/+1
| | | | | | | | | | | | | | As GCC also gained support for the C11 keywords over time, we can patch up <sys/cdefs.h> to not define these anymore. This has the advantage that error messages for static assertions are printed natively and that _Alignas() will work with even a type outside of C11 mode. All C11 keywords are supported with GCC 4.7 and higher, with the exception of _Thread_local and _Generic. These are only supported as of GCC 4.9. Notes: svn path=/head/; revision=271012
* Enable improved <tgmath.h> for Clang even when not using C11.Ed Schouten2013-04-271-1/+2
| | | | | | | | | | | By using __has_extension(c_generic_selections), we can explicitly test whether we're dealing with a version of Clang that supports _Generic(). That way we can use the improved <tgmath.h> code, even when not using -std=c11. This massively reduces the compilation time when invoking these functions. Notes: svn path=/head/; revision=249995
* Last attempt at <tgmath.h>: do enable the new code for C11 compilers.Ed Schouten2012-01-061-11/+17
| | | | | | | | | | | | | | | I was thinking by myself, if the new code doesn't work with GCC 4.2, why not simply turn it into an efficient version for C11 compilers? By changing the code to use _Generic() directly in that case, I can build the tgmath regression test in a matter of milliseconds with Clang, instead of the 8 seconds it used to take. So by the time C11 becomes the default, it will pick up the new code automatically. And now I will refrain from making more changes to <tgmath.h>. Notes: svn path=/head/; revision=229716
* Add an even faster implementation of <tgmath.h> for the future.Ed Schouten2012-01-061-0/+20
| | | | | | | | | | Instead of using an exponential number of cases with respect to the number of arguments, this version only uses a linear number. Unfortunately, it works with Clang, GCC 4.6 and GCC 4.7, but not GCC 4.2. Therefore, leave it commented out. Notes: svn path=/head/; revision=229704
* Remove _Complex_I workaround from <tgmath.h>.Ed Schouten2012-01-051-9/+4
| | | | | | | | This removes the use of __typeof() from this header, thus making it work with a plain C11 compiler. Notes: svn path=/head/; revision=229591
* Reimplement <tgmath.h> on top of __generic().Ed Schouten2012-01-051-45/+66
| | | | | | | | | | | | | | | The macro construction used now, is almost identical to the code provided in C11 proposal N1404. This new version doesn't seem to introduce any regressions according to the regression test in tools/, but still seems to malfunction with Clang on certain aspects. The new code does work successfully with GCC 4.2, 4.6 and 4.7. With 4.7, it also works when __generic() is implemented on top of _Generic(). Discussed with: stefanf Notes: svn path=/head/; revision=229575
* Properly parenthesize the __tg_is_complex() macro by moving a closingJens Schweikhardt2007-02-021-2/+2
| | | | | | | | | paren to where it belongs. MFC after: 7 days Notes: svn path=/head/; revision=166432
* Add a workaround to recognise I/_Complex_I as complex arguments. AlthoughStefan Farfeleder2004-09-031-1/+2
| | | | | | | | the GCC manual claims that the expression 1.0fi has type float _Complex, __builtin_types_compatible_p(float _Complex, __typeof__(1.0fi))) yields 0. Notes: svn path=/head/; revision=134736
* Use the keyword '_Complex' rather than the macro 'complex' sinceStefan Farfeleder2004-09-031-4/+4
| | | | | | | applications are allowed to undefine the latter. Notes: svn path=/head/; revision=134735
* Embarrassing typo: s/nextbyint/nearbyint/Stefan Farfeleder2004-09-031-1/+1
| | | | Notes: svn path=/head/; revision=134733
* Implement C99's standard header <tgmath.h>. It provides type-generic macrosStefan Farfeleder2004-08-081-0/+166
for the <math.h> and <complex.h> functions that have float, double and long double implementations. Such type-generic macros expand to an actual function, depending on the types of the macro arguments, eg. if <tgmath.h> is included, the invocation cos(1.0f) calls the function cosf(). Notes: svn path=/head/; revision=133333