Skip to content

Commit

Permalink
Clean up type size checks in configure.ac (HDFGroup#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins committed May 29, 2021
1 parent 1a9c08a commit f105b1a
Showing 1 changed file with 10 additions and 29 deletions.
39 changes: 10 additions & 29 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1365,16 +1365,15 @@ CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS"
## Checkpoint the cache
AC_CACHE_SAVE

## Posix.1g types (C9x)
## Write the confdefs.h header for checking sizes
cat >>confdefs.h <<\EOF
#include <sys/types.h>
EOF

if test "X$C9x" = "Xyes"; then
cat >>confdefs.h <<\EOF
#include <stdbool.h>
#include <stdint.h>
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#endif
#include <time.h>
EOF
fi

AC_CHECK_SIZEOF( [int8_t])
AC_CHECK_SIZEOF( [uint8_t])
Expand Down Expand Up @@ -1404,30 +1403,12 @@ AC_CHECK_SIZEOF([uint_least64_t])
AC_CHECK_SIZEOF( [int_fast64_t])
AC_CHECK_SIZEOF( [uint_fast64_t])

AC_CHECK_SIZEOF([bool])
AC_CHECK_SIZEOF([off_t])
AC_CHECK_SIZEOF([ptrdiff_t])
AC_CHECK_SIZEOF([size_t])
AC_CHECK_SIZEOF([ssize_t])
AC_CHECK_SIZEOF([ptrdiff_t])

cat >>confdefs.h <<\EOF
#include <sys/types.h> /*for off_t definition*/
EOF
AC_CHECK_SIZEOF([off_t])

if test "X$C9x" = "Xyes"; then
cat >>confdefs.h <<\EOF
#include <stdbool.h>
EOF
AC_CHECK_SIZEOF([bool])
fi

AC_CHECK_SIZEOF(time_t, [], [
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#endif
])
AC_CHECK_SIZEOF([time_t])

## Checkpoint the cache
AC_CACHE_SAVE
Expand Down

0 comments on commit f105b1a

Please sign in to comment.