Skip to content

Commit

Permalink
Assume frexpl/f and fabsl/f, which are C99 (HDFGroup#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
derobins committed Jun 30, 2021
1 parent e0d4e78 commit e25abcd
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 52 deletions.
6 changes: 0 additions & 6 deletions config/cmake/H5pubconf.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@
/* Define to 1 if you have the `fork' function. */
#cmakedefine H5_HAVE_FORK @H5_HAVE_FORK@

/* Define to 1 if you have the `frexpf' function. */
#cmakedefine H5_HAVE_FREXPF @H5_HAVE_FREXPF@

/* Define to 1 if you have the `frexpl' function. */
#cmakedefine H5_HAVE_FREXPL @H5_HAVE_FREXPL@

/* Define to 1 if you have the `fseeko' function. */
#cmakedefine H5_HAVE_FSEEKO @H5_HAVE_FSEEKO@

Expand Down
2 changes: 0 additions & 2 deletions config/cmake_ext_mod/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,6 @@ CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM)
CHECK_FUNCTION_EXISTS (fcntl ${HDF_PREFIX}_HAVE_FCNTL)
CHECK_FUNCTION_EXISTS (flock ${HDF_PREFIX}_HAVE_FLOCK)
CHECK_FUNCTION_EXISTS (fork ${HDF_PREFIX}_HAVE_FORK)
CHECK_FUNCTION_EXISTS (frexpf ${HDF_PREFIX}_HAVE_FREXPF)
CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL)

CHECK_FUNCTION_EXISTS (gethostname ${HDF_PREFIX}_HAVE_GETHOSTNAME)
CHECK_FUNCTION_EXISTS (getrusage ${HDF_PREFIX}_HAVE_GETRUSAGE)
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2001,8 +2001,8 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
## NOTE: clock_gettime may require linking to the rt or posix4 library
## so we'll search for it before calling AC_CHECK_FUNCS.
AC_SEARCH_LIBS([clock_gettime], [rt posix4])
AC_CHECK_FUNCS([alarm clock_gettime difftime fcntl flock fork frexpf])
AC_CHECK_FUNCS([frexpl gethostname getrusage gettimeofday])
AC_CHECK_FUNCS([alarm clock_gettime difftime fcntl flock fork])
AC_CHECK_FUNCS([gethostname getrusage gettimeofday])
AC_CHECK_FUNCS([lstat rand_r random setsysinfo])
AC_CHECK_FUNCS([siglongjmp sigsetjmp sigprocmask])
AC_CHECK_FUNCS([srandom strdup symlink])
Expand Down
14 changes: 2 additions & 12 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -773,12 +773,11 @@ typedef struct {
#ifndef HDfabs
#define HDfabs(X) fabs(X)
#endif /* HDfabs */
/* use ABS() because fabsf() fabsl() are not common yet. */
#ifndef HDfabsf
#define HDfabsf(X) ABS(X)
#define HDfabsf(X) fabsf(X)
#endif /* HDfabsf */
#ifndef HDfabsl
#define HDfabsl(X) ABS(X)
#define HDfabsl(X) fabsl(X)
#endif /* HDfabsl */
#ifndef HDfclose
#define HDfclose(F) fclose(F)
Expand Down Expand Up @@ -870,20 +869,11 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation);
#ifndef HDfrexp
#define HDfrexp(X, N) frexp(X, N)
#endif /* HDfrexp */
/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
#ifndef HDfrexpf
#ifdef H5_HAVE_FREXPF
#define HDfrexpf(X, N) frexpf(X, N)
#else /* H5_HAVE_FREXPF */
#define HDfrexpf(X, N) frexp(X, N)
#endif /* H5_HAVE_FREXPF */
#endif /* HDfrexpf */
#ifndef HDfrexpl
#ifdef H5_HAVE_FREXPL
#define HDfrexpl(X, N) frexpl(X, N)
#else /* H5_HAVE_FREXPL */
#define HDfrexpl(X, N) frexp(X, N)
#endif /* H5_HAVE_FREXPL */
#endif /* HDfrexpl */
/* fscanf() variable arguments */
#ifndef HDfseek
Expand Down
20 changes: 5 additions & 15 deletions tools/test/perform/pio_standalone.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@
#define HD_exit(N) _exit(N)
#define HDexp(X) exp(X)
#define HDfabs(X) fabs(X)
/* use ABS() because fabsf() fabsl() are not common yet. */
#define HDfabsf(X) ABS(X)
#define HDfabsl(X) ABS(X)
#define HDfclose(F) fclose(F)
#define HDfabsf(X) fabsf(X)
#define HDfabsl(X) fabsl(X)
#define HDfclose(F) fclose(F)
/* fcntl() variable arguments */
#define HDfdopen(N, S) fdopen(N, S)
#define HDfeof(F) feof(F)
Expand All @@ -137,17 +136,8 @@
#define HDfree(M) free(M)
#define HDfreopen(S, M, F) freopen(S, M, F)
#define HDfrexp(X, N) frexp(X, N)
/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
#ifdef H5_HAVE_FREXPF
#define HDfrexpf(X, N) frexpf(X, N)
#else /* H5_HAVE_FREXPF */
#define HDfrexpf(X, N) frexp(X, N)
#endif /* H5_HAVE_FREXPF */
#ifdef H5_HAVE_FREXPL
#define HDfrexpl(X, N) frexpl(X, N)
#else /* H5_HAVE_FREXPL */
#define HDfrexpl(X, N) frexp(X, N)
#endif /* H5_HAVE_FREXPL */
#define HDfrexpf(X, N) frexpf(X, N)
#define HDfrexpl(X, N) frexpl(X, N)
/* fscanf() variable arguments */
#ifdef H5_HAVE_FSEEKO
#define HDfseek(F, O, W) fseeko(F, O, W)
Expand Down
20 changes: 5 additions & 15 deletions tools/test/perform/sio_standalone.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,9 @@
#define HD_exit(N) _exit(N)
#define HDexp(X) exp(X)
#define HDfabs(X) fabs(X)
/* use ABS() because fabsf() fabsl() are not common yet. */
#define HDfabsf(X) ABS(X)
#define HDfabsl(X) ABS(X)
#define HDfclose(F) fclose(F)
#define HDfabsf(X) fabsf(X)
#define HDfabsl(X) fabsl(X)
#define HDfclose(F) fclose(F)
/* fcntl() variable arguments */
#define HDfdopen(N, S) fdopen(N, S)
#define HDfeof(F) feof(F)
Expand All @@ -152,17 +151,8 @@
#define HDfree(M) free(M)
#define HDfreopen(S, M, F) freopen(S, M, F)
#define HDfrexp(X, N) frexp(X, N)
/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
#ifdef H5_HAVE_FREXPF
#define HDfrexpf(X, N) frexpf(X, N)
#else /* H5_HAVE_FREXPF */
#define HDfrexpf(X, N) frexp(X, N)
#endif /* H5_HAVE_FREXPF */
#ifdef H5_HAVE_FREXPL
#define HDfrexpl(X, N) frexpl(X, N)
#else /* H5_HAVE_FREXPL */
#define HDfrexpl(X, N) frexp(X, N)
#endif /* H5_HAVE_FREXPL */
#define HDfrexpf(X, N) frexpf(X, N)
#define HDfrexpl(X, N) frexpl(X, N)
/* fscanf() variable arguments */
#ifdef H5_HAVE_FSEEKO
#define HDfseek(F, O, W) fseeko(F, O, W)
Expand Down

0 comments on commit e25abcd

Please sign in to comment.