main.hh
changeset 890 499486ece119
parent 760 d736dc9e9e51
child 946 c012a64dc2fa
equal deleted inserted replaced
889:5f380b99e95e 890:499486ece119
    76  *  e.g.:  static_assert(offsetof(struct header_t, c) == 8, "Compile time error message.");
    76  *  e.g.:  static_assert(offsetof(struct header_t, c) == 8, "Compile time error message.");
    77  */
    77  */
    78 
    78 
    79 #include <float.h>
    79 #include <float.h>
    80 #if    (LDBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */
    80 #if    (LDBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */
    81   #define long_double long double
    81   #define real64_tX long_double /* so we can later use #if (real64_t == long_double) directives in the code! */
    82   #define real64_t long_double /* so we can later use #if (real64_t == long_double) directives in the code! */
    82   #define real64_t  long double /* NOTE: no underscore '_' between 'long' and 'double' */
    83   #define REAL64_MAX  LDBL_MAX
    83   #define REAL64_MAX  LDBL_MAX
    84 #elif  ( DBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */
    84 #elif  ( DBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */
    85   #define real64_t double
    85   #define real64_tX double
       
    86   #define real64_t  double
    86   #define REAL64_MAX  DBL_MAX
    87   #define REAL64_MAX  DBL_MAX
    87 #elif  ( FLT_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */
    88 #elif  ( FLT_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */
    88   #define real64_t float
    89   #define real64_tX float
       
    90   #define real64_t  float
    89   #define REAL64_MAX  FLT_MAX
    91   #define REAL64_MAX  FLT_MAX
    90 #else 
    92 #else 
    91   #error Could not find a 64 bit floating point data type on this platform. Aborting...
    93   #error Could not find a 64 bit floating point data type on this platform. Aborting...
    92 #endif
    94 #endif
    93 
    95 
    94 
    96 
    95 #if    (LDBL_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */
    97 #if    (LDBL_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */
    96   #ifndef long_double 
    98   #define real32_tX long_double /* so we can later use #if (real32_t == long_double) directives in the code! */
    97     #define long_double long double
    99   #define real32_t  long double /* NOTE: no underscore '_' between 'long' and 'double' */
    98   #endif  
       
    99   #define real32_t long_double /* so we can later use #if (real32_t == long_double) directives in the code! */
       
   100   #define REAL32_MAX  LDBL_MAX
   100   #define REAL32_MAX  LDBL_MAX
   101 #elif  ( DBL_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */
   101 #elif  ( DBL_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */
   102   #define real32_t double
   102   #define real32_tX double
       
   103   #define real32_t  double
   103   #define REAL32_MAX  DBL_MAX
   104   #define REAL32_MAX  DBL_MAX
   104 #elif  ( FLT_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */
   105 #elif  ( FLT_MANT_DIG == 24) /* NOTE: 32 bit IEC559 real has 24 bits for mantissa! */
   105   #define real32_t float
   106   #define real32_tX float
       
   107   #define real32_t  float
   106   #define REAL32_MAX  FLT_MAX
   108   #define REAL32_MAX  FLT_MAX
   107 #else 
   109 #else 
   108   #error Could not find a 32 bit floating point data type on this platform. Aborting...
   110   #error Could not find a 32 bit floating point data type on this platform. Aborting...
   109 #endif
   111 #endif
   110 
   112