X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2FsfmP.h;h=29e8c7cff091c4c2a5aab598873945b2ce885d73;hb=5cf163b77cda54d0a6fa531ab4eb0a72d030969f;hp=6734087e197ff935a73f4b7275fe07b886b7d9c4;hpb=b321086267ad1014dc5d09886396cde30f094437;p=pspp diff --git a/src/sfmP.h b/src/sfmP.h index 6734087e19..29e8c7cff0 100644 --- a/src/sfmP.h +++ b/src/sfmP.h @@ -27,6 +27,40 @@ #pragma option -a- /* Turn off alignment. */ #endif +/* Find 32-bit signed integer type. */ +#if SIZEOF_SHORT == 4 + #define int32 short +#elif SIZEOF_INT == 4 + #define int32 int +#elif SIZEOF_LONG == 4 + #define int32 long +#else + #error Which one of your basic types is 32-bit signed integer? +#endif + +/* Find 64-bit floating-point type. */ +#if SIZEOF_FLOAT == 8 + #define flt64 float + #define FLT64_MAX FLT_MAX +#elif SIZEOF_DOUBLE == 8 + #define flt64 double + #define FLT64_MAX DBL_MAX +#elif SIZEOF_LONG_DOUBLE == 8 + #define flt64 long double + #define FLT64_MAX LDBL_MAX +#else + #error Which one of your basic types is 64-bit floating point? + #define flt64 double + #define FLT64_MAX DBL_MAX +#endif + +/* Figure out SYSMIS value for flt64. */ +#if SIZEOF_DOUBLE == 8 +#define second_lowest_flt64 second_lowest_value +#else +#error Must define second_lowest_flt64 for your architecture. +#endif + /* Record Type 1: General Information. */ struct sysfile_header { @@ -54,7 +88,7 @@ struct sysfile_variable int32 n_missing_values P; /* Missing value code of -3,-2,0,1,2, or 3. */ int32 print P; /* Print format. */ int32 write P; /* Write format. */ - char name[8] P; /* Variable name. */ + char name[SHORT_NAME_LEN] P; /* Variable name. */ /* The rest of the structure varies. */ };