Skip to content

Commit

Permalink
Removes type guesses when C99 types are missing (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins authored Jun 29, 2021
1 parent 2090a52 commit 9ac96e5
Showing 1 changed file with 0 additions and 68 deletions.
68 changes: 0 additions & 68 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,74 +355,6 @@
#define TRUE true
#endif

/*
* Numeric data types. Some of these might be defined in Posix.1g, otherwise
* we define them with the closest available type which is at least as large
* as the number of bits indicated in the type name. The `int8' types *must*
* be exactly one byte wide because we use it for pointer calculations to
* void* memory.
*/
#if H5_SIZEOF_INT8_T == 0
typedef signed char int8_t;
#undef H5_SIZEOF_INT8_T
#define H5_SIZEOF_INT8_T H5_SIZEOF_CHAR
#elif H5_SIZEOF_INT8_T == 1
#else
#error "the int8_t type must be 1 byte wide"
#endif

#if H5_SIZEOF_UINT8_T == 0
typedef unsigned char uint8_t;
#undef H5_SIZEOF_UINT8_T
#define H5_SIZEOF_UINT8_T H5_SIZEOF_CHAR
#elif H5_SIZEOF_UINT8_T == 1
#else
#error "the uint8_t type must be 1 byte wide"
#endif

#if H5_SIZEOF_INT16_T >= 2
#elif H5_SIZEOF_SHORT >= 2
typedef short int16_t;
#undef H5_SIZEOF_INT16_T
#define H5_SIZEOF_INT16_T H5_SIZEOF_SHORT
#elif H5_SIZEOF_INT >= 2
typedef int int16_t;
#undef H5_SIZEOF_INT16_T
#define H5_SIZEOF_INT16_T H5_SIZEOF_INT
#else
#error "nothing appropriate for int16_t"
#endif

#if H5_SIZEOF_UINT16_T >= 2
#elif H5_SIZEOF_SHORT >= 2
typedef unsigned short uint16_t;
#undef H5_SIZEOF_UINT16_T
#define H5_SIZEOF_UINT16_T H5_SIZEOF_SHORT
#elif H5_SIZEOF_INT >= 2
typedef unsigned uint16_t;
#undef H5_SIZEOF_UINT16_T
#define H5_SIZEOF_UINT16_T H5_SIZEOF_INT
#else
#error "nothing appropriate for uint16_t"
#endif

#if H5_SIZEOF_INT32_T >= 4
#elif H5_SIZEOF_SHORT >= 4
typedef short int32_t;
#undef H5_SIZEOF_INT32_T
#define H5_SIZEOF_INT32_T H5_SIZEOF_SHORT
#elif H5_SIZEOF_INT >= 4
typedef int int32_t;
#undef H5_SIZEOF_INT32_T
#define H5_SIZEOF_INT32_T H5_SIZEOF_INT
#elif H5_SIZEOF_LONG >= 4
typedef long int32_t;
#undef H5_SIZEOF_INT32_T
#define H5_SIZEOF_INT32_T H5_SIZEOF_LONG
#else
#error "nothing appropriate for int32_t"
#endif

/*
* Maximum and minimum values. These should be defined in <limits.h> for the
* most part.
Expand Down

0 comments on commit 9ac96e5

Please sign in to comment.