limits-h.m4 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. dnl Check whether limits.h has needed features.
  2. dnl Copyright 2016-2017 Free Software Foundation, Inc.
  3. dnl This file is free software; the Free Software Foundation
  4. dnl gives unlimited permission to copy and/or distribute it,
  5. dnl with or without modifications, as long as this notice is preserved.
  6. dnl From Paul Eggert.
  7. AC_DEFUN_ONCE([gl_LIMITS_H],
  8. [
  9. gl_CHECK_NEXT_HEADERS([limits.h])
  10. AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
  11. [gl_cv_header_limits_width],
  12. [AC_COMPILE_IFELSE(
  13. [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
  14. #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
  15. #endif
  16. #include <limits.h>
  17. int ullw = ULLONG_WIDTH;]])],
  18. [gl_cv_header_limits_width=yes],
  19. [gl_cv_header_limits_width=no])])
  20. if test "$gl_cv_header_limits_width" = yes; then
  21. LIMITS_H=
  22. else
  23. LIMITS_H=limits.h
  24. fi
  25. AC_SUBST([LIMITS_H])
  26. AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
  27. ])