diff options
-rw-r--r-- | src/type/doubleComplex.h | 25 | ||||
-rw-r--r-- | src/type/floatComplex.c | 13 | ||||
-rw-r--r-- | src/type/floatComplex.h | 26 |
3 files changed, 51 insertions, 13 deletions
diff --git a/src/type/doubleComplex.h b/src/type/doubleComplex.h index e6178698..b062703e 100644 --- a/src/type/doubleComplex.h +++ b/src/type/doubleComplex.h @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Nov 30 16:50:08 2006 jofret -** Last update Fri Feb 23 16:19:20 2007 jofret +** Last update Tue Feb 27 10:02:08 2007 jofret ** ** Copyright INRIA 2006 */ @@ -13,12 +13,13 @@ #ifndef __DOUBLECOMPLEX_H__ #define __DOUBLECOMPLEX_H__ +#include <stdbool.h> + +#ifndef STDC99 /* ** Hand made Double Complex definition ** { */ -#include <stdbool.h> - struct double_complex { double real; @@ -26,14 +27,26 @@ struct double_complex }; typedef struct double_complex doubleComplex; +/* +** } +*/ +#else +/* +** Standard C99 Complex +** { +*/ +#include <complex.h> + +typedef double complex doubleComplex; +/* +** } +*/ +#endif double zreals(doubleComplex); double zimags(doubleComplex); doubleComplex DoubleComplex(double, double); bool zisreals(doubleComplex); bool zisimags(doubleComplex); -/* -** } -*/ #endif /* !__DOUBLECOMPLEX_H__ */ diff --git a/src/type/floatComplex.c b/src/type/floatComplex.c index a23bd680..565bb6b2 100644 --- a/src/type/floatComplex.c +++ b/src/type/floatComplex.c @@ -5,11 +5,22 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Nov 30 16:27:08 2006 jofret -** Last update Fri Feb 23 16:19:54 2007 jofret +** Last update Tue Feb 27 10:03:22 2007 jofret ** ** Copyright INRIA 2006 */ +#ifdef __STDC_VERSION__ +# ifndef STDC +# define STDC +# endif +# if __STDC_VERSION__ >= 199901L +# ifndef STDC99 +# define STDC99 +# endif +# endif +#endif + #include "floatComplex.h" #ifndef STDC99 diff --git a/src/type/floatComplex.h b/src/type/floatComplex.h index 8f098956..dedd629d 100644 --- a/src/type/floatComplex.h +++ b/src/type/floatComplex.h @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Nov 30 16:50:08 2006 jofret -** Last update Fri Feb 23 16:19:10 2007 jofret +** Last update Tue Feb 27 09:58:29 2007 jofret ** ** Copyright INRIA 2006 */ @@ -13,12 +13,13 @@ #ifndef __FLOATCOMPLEX_H__ #define __FLOATCOMPLEX_H__ +#include <stdbool.h> + +#ifndef STDC99 /* ** Hand made Float Complex definition ** { */ -#include <stdbool.h> - struct float_complex { float real; @@ -26,14 +27,27 @@ struct float_complex }; typedef struct float_complex floatComplex; +/* +** } +*/ +#else +/* +** C99 Standard +** { +*/ +#include <complex.h> + +typedef float complex floatComplex; +/* +** } +*/ +#endif + float creals(floatComplex); float cimags(floatComplex); floatComplex FloatComplex(float, float); bool cisreals(floatComplex); bool cisimags(floatComplex); -/* -** } -*/ #endif /* !__FLOATCOMPLEX_H__ */ |