This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

complex.h patch


CVS GCC now knows the _Complex keyword (in both C and C++) so complex.h
doesn't need to define it to __complex__ for GCC 3.0 or later.  This patch
changes this accordingly, adds the `complex' macro, and adds __extension__
to the definition of _Complex_I (for which GCC does warn when -pedantic)
and the use of ~ for complex complementation (for which GCC doesn't yet
warn but will do so when -pedantic when it implements C99 complex
semantics).

--- math/complex.h	Thu Sep 14 07:45:17 2000
+++ math/complex.h.new	Fri Sep 15 18:37:04 2000
@@ -33,15 +33,16 @@
 /* We might need to add support for more compilers here.  But since ISO
    C99 is out hopefully all maintained compilers will soon provide the data
    types `float complex' and `double complex'.  */
-#if __GNUC_PREREQ (2, 7)
+#if __GNUC_PREREQ (2, 7) && !__GNUC_PREREQ (3, 0)
 # define _Complex __complex__
 #endif
 
+#define complex		_Complex
 
 /* Narrowest imaginary unit.  This depends on the floating-point
    evaluation method.
    XXX This probably has to go into a gcc related file.  */
-#define _Complex_I	(1.0iF)
+#define _Complex_I	(__extension__ 1.0iF)
 
 /* Another more descriptive name is `I'.
    XXX Once we have the imaginary support switch this to _Imaginary_I.  */
--- math/bits/cmathcalls.h	Thu Jul 13 19:34:03 2000
+++ math/bits/cmathcalls.h.new	Fri Sep 15 18:37:58 2000
@@ -151,7 +151,7 @@
 extern __inline _Mdouble_complex_
 __MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
 {
-  return ~__z;
+  return __extension__ ~__z;
 }
 
 #endif

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]