Mercurial > hg > octave-nkf
diff liboctave/oct-types.h.in @ 5828:22e23bee74c8
[project @ 2006-05-23 06:05:14 by jwe]
author | jwe |
---|---|
date | Tue, 23 May 2006 06:05:14 +0000 |
parents | 4c8a2e4e0717 |
children | cb4324a4fbb5 |
line wrap: on
line diff
--- a/liboctave/oct-types.h.in +++ b/liboctave/oct-types.h.in @@ -26,6 +26,49 @@ typedef @OCTAVE_IDX_TYPE@ octave_idx_type; +#if defined (HAVE_STDINT_H) +#include <stdint.h> +#elif defined (HAVE_INTTYPES_H) +#include <inttypes.h> +#else + +#if CHAR_BIT == 8 +typedef signed char int8_t; +typedef unsigned char uint8_t; +#else +#error "CHAR_BIT is not 8!" +#endif + +#if SIZEOF_SHORT == 2 +typedef short int16_t; +typedef unsigned short uint16_t; +#elif SIZEOF_INT == 2 +typedef long int16_t; +typedef unsigned long uint16_t; +#else +#error "No 2 byte integer type found!" +#endif + +#if SIZEOF_INT == 4 +typedef int int32_t; +typedef unsigned int uint32_t; +#elif SIZEOF_LONG == 4 +typedef long int32_t; +typedef unsigned long uint32_t; +#else +#error "No 4 byte integer type found!" +#endif + +#if SIZEOF_LONG == 8 +typedef long int64_t; +typedef unsigned long uint64_t; +#elif SIZEOF_LONG_LONG == 8 +typedef long long int64_t; +typedef unsigned long long uint64_t; +#endif + +#endif + #endif /*