limits-h.m4 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. dnl Check whether limits.h has needed features.
  2. dnl Copyright 2016-2023 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 WORD_BIT, BOOL_WIDTH etc.],
  11. [gl_cv_header_limits_width],
  12. [AC_COMPILE_IFELSE(
  13. [AC_LANG_PROGRAM(
  14. [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
  15. #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
  16. #endif
  17. #include <limits.h>
  18. long long llm = LLONG_MAX;
  19. int wb = WORD_BIT;
  20. int ullw = ULLONG_WIDTH;
  21. int bw = BOOL_WIDTH;
  22. ]])],
  23. [gl_cv_header_limits_width=yes],
  24. [gl_cv_header_limits_width=no])])
  25. if test "$gl_cv_header_limits_width" = yes; then
  26. GL_GENERATE_LIMITS_H=false
  27. else
  28. GL_GENERATE_LIMITS_H=true
  29. fi
  30. ])
  31. dnl Unconditionally enables the replacement of <limits.h>.
  32. AC_DEFUN([gl_REPLACE_LIMITS_H],
  33. [
  34. AC_REQUIRE([gl_LIMITS_H])
  35. GL_GENERATE_LIMITS_H=true
  36. ])