]> pd.if.org Git - pdclib/blobdiff - includes/complex.h
Started introducting "personality".
[pdclib] / includes / complex.h
index 59cb5b2c45facaefb2be191f02523365b48af6e0..6e7ac5ed5ec7867db01f6d156a5a9a52b7e3250b 100644 (file)
@@ -4,13 +4,14 @@
 // Public Domain C Library - http://pdclib.sourceforge.net
 // This code is Public Domain. Use, modify, and redistribute at will.
 // ----------------------------------------------------------------------------
-// Provides the types float _Complex, double _Complex and long double _Complex
-// plus math functions on those types.
+// Complex arithmetic
 // ----------------------------------------------------------------------------
 
 #ifndef __COMPLEX_H
 #define __COMPLEX_H __COMPLEX_H
 
+#include "personality.h"
+
 // ----------------------------------------------------------------------------
 // DEFINES
 
 #define complex     _Complex
 #endif
 
-#define _Complex_I  (float _Complex){0, 1}
-#define imaginary   _Imaginary             // optional
+#define _Complex_I  ( const float _Complex ) { 0, 1 }
+
+#ifdef __PERSONALITY_SUPPORTS_IMAGINARY
+#define imaginary   _Imaginary
+#endif // __PERSONALITY_SUPPORTS_IMAGINARY
 
 #ifdef imaginary
-#define _Imaginary_I ((float _Imaginary)1)
+#define _Imaginary_I ( ( const float _Imaginary ) 1 )
 #endif
 
 #ifdef imaginary