stdint.m4 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485
  1. # stdint.m4 serial 43
  2. dnl Copyright (C) 2001-2013 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 and Bruno Haible.
  7. dnl Test whether <stdint.h> is supported or must be substituted.
  8. AC_DEFUN_ONCE([gl_STDINT_H],
  9. [
  10. AC_PREREQ([2.59])dnl
  11. dnl Check for long long int and unsigned long long int.
  12. AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
  13. if test $ac_cv_type_long_long_int = yes; then
  14. HAVE_LONG_LONG_INT=1
  15. else
  16. HAVE_LONG_LONG_INT=0
  17. fi
  18. AC_SUBST([HAVE_LONG_LONG_INT])
  19. AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
  20. if test $ac_cv_type_unsigned_long_long_int = yes; then
  21. HAVE_UNSIGNED_LONG_LONG_INT=1
  22. else
  23. HAVE_UNSIGNED_LONG_LONG_INT=0
  24. fi
  25. AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
  26. dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does.
  27. AC_CHECK_HEADERS_ONCE([wchar.h])
  28. if test $ac_cv_header_wchar_h = yes; then
  29. HAVE_WCHAR_H=1
  30. else
  31. HAVE_WCHAR_H=0
  32. fi
  33. AC_SUBST([HAVE_WCHAR_H])
  34. dnl Check for <inttypes.h>.
  35. dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
  36. if test $ac_cv_header_inttypes_h = yes; then
  37. HAVE_INTTYPES_H=1
  38. else
  39. HAVE_INTTYPES_H=0
  40. fi
  41. AC_SUBST([HAVE_INTTYPES_H])
  42. dnl Check for <sys/types.h>.
  43. dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h.
  44. if test $ac_cv_header_sys_types_h = yes; then
  45. HAVE_SYS_TYPES_H=1
  46. else
  47. HAVE_SYS_TYPES_H=0
  48. fi
  49. AC_SUBST([HAVE_SYS_TYPES_H])
  50. gl_CHECK_NEXT_HEADERS([stdint.h])
  51. if test $ac_cv_header_stdint_h = yes; then
  52. HAVE_STDINT_H=1
  53. else
  54. HAVE_STDINT_H=0
  55. fi
  56. AC_SUBST([HAVE_STDINT_H])
  57. dnl Now see whether we need a substitute <stdint.h>.
  58. if test $ac_cv_header_stdint_h = yes; then
  59. AC_CACHE_CHECK([whether stdint.h conforms to C99],
  60. [gl_cv_header_working_stdint_h],
  61. [gl_cv_header_working_stdint_h=no
  62. AC_COMPILE_IFELSE([
  63. AC_LANG_PROGRAM([[
  64. #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
  65. #include <stdint.h>
  66. /* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
  67. #if !(defined WCHAR_MIN && defined WCHAR_MAX)
  68. #error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
  69. #endif
  70. ]
  71. gl_STDINT_INCLUDES
  72. [
  73. #ifdef INT8_MAX
  74. int8_t a1 = INT8_MAX;
  75. int8_t a1min = INT8_MIN;
  76. #endif
  77. #ifdef INT16_MAX
  78. int16_t a2 = INT16_MAX;
  79. int16_t a2min = INT16_MIN;
  80. #endif
  81. #ifdef INT32_MAX
  82. int32_t a3 = INT32_MAX;
  83. int32_t a3min = INT32_MIN;
  84. #endif
  85. #ifdef INT64_MAX
  86. int64_t a4 = INT64_MAX;
  87. int64_t a4min = INT64_MIN;
  88. #endif
  89. #ifdef UINT8_MAX
  90. uint8_t b1 = UINT8_MAX;
  91. #else
  92. typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
  93. #endif
  94. #ifdef UINT16_MAX
  95. uint16_t b2 = UINT16_MAX;
  96. #endif
  97. #ifdef UINT32_MAX
  98. uint32_t b3 = UINT32_MAX;
  99. #endif
  100. #ifdef UINT64_MAX
  101. uint64_t b4 = UINT64_MAX;
  102. #endif
  103. int_least8_t c1 = INT8_C (0x7f);
  104. int_least8_t c1max = INT_LEAST8_MAX;
  105. int_least8_t c1min = INT_LEAST8_MIN;
  106. int_least16_t c2 = INT16_C (0x7fff);
  107. int_least16_t c2max = INT_LEAST16_MAX;
  108. int_least16_t c2min = INT_LEAST16_MIN;
  109. int_least32_t c3 = INT32_C (0x7fffffff);
  110. int_least32_t c3max = INT_LEAST32_MAX;
  111. int_least32_t c3min = INT_LEAST32_MIN;
  112. int_least64_t c4 = INT64_C (0x7fffffffffffffff);
  113. int_least64_t c4max = INT_LEAST64_MAX;
  114. int_least64_t c4min = INT_LEAST64_MIN;
  115. uint_least8_t d1 = UINT8_C (0xff);
  116. uint_least8_t d1max = UINT_LEAST8_MAX;
  117. uint_least16_t d2 = UINT16_C (0xffff);
  118. uint_least16_t d2max = UINT_LEAST16_MAX;
  119. uint_least32_t d3 = UINT32_C (0xffffffff);
  120. uint_least32_t d3max = UINT_LEAST32_MAX;
  121. uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
  122. uint_least64_t d4max = UINT_LEAST64_MAX;
  123. int_fast8_t e1 = INT_FAST8_MAX;
  124. int_fast8_t e1min = INT_FAST8_MIN;
  125. int_fast16_t e2 = INT_FAST16_MAX;
  126. int_fast16_t e2min = INT_FAST16_MIN;
  127. int_fast32_t e3 = INT_FAST32_MAX;
  128. int_fast32_t e3min = INT_FAST32_MIN;
  129. int_fast64_t e4 = INT_FAST64_MAX;
  130. int_fast64_t e4min = INT_FAST64_MIN;
  131. uint_fast8_t f1 = UINT_FAST8_MAX;
  132. uint_fast16_t f2 = UINT_FAST16_MAX;
  133. uint_fast32_t f3 = UINT_FAST32_MAX;
  134. uint_fast64_t f4 = UINT_FAST64_MAX;
  135. #ifdef INTPTR_MAX
  136. intptr_t g = INTPTR_MAX;
  137. intptr_t gmin = INTPTR_MIN;
  138. #endif
  139. #ifdef UINTPTR_MAX
  140. uintptr_t h = UINTPTR_MAX;
  141. #endif
  142. intmax_t i = INTMAX_MAX;
  143. uintmax_t j = UINTMAX_MAX;
  144. #include <limits.h> /* for CHAR_BIT */
  145. #define TYPE_MINIMUM(t) \
  146. ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
  147. #define TYPE_MAXIMUM(t) \
  148. ((t) ((t) 0 < (t) -1 \
  149. ? (t) -1 \
  150. : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
  151. struct s {
  152. int check_PTRDIFF:
  153. PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
  154. && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
  155. ? 1 : -1;
  156. /* Detect bug in FreeBSD 6.0 / ia64. */
  157. int check_SIG_ATOMIC:
  158. SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
  159. && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
  160. ? 1 : -1;
  161. int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
  162. int check_WCHAR:
  163. WCHAR_MIN == TYPE_MINIMUM (wchar_t)
  164. && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
  165. ? 1 : -1;
  166. /* Detect bug in mingw. */
  167. int check_WINT:
  168. WINT_MIN == TYPE_MINIMUM (wint_t)
  169. && WINT_MAX == TYPE_MAXIMUM (wint_t)
  170. ? 1 : -1;
  171. /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
  172. int check_UINT8_C:
  173. (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
  174. int check_UINT16_C:
  175. (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
  176. /* Detect bugs in OpenBSD 3.9 stdint.h. */
  177. #ifdef UINT8_MAX
  178. int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
  179. #endif
  180. #ifdef UINT16_MAX
  181. int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
  182. #endif
  183. #ifdef UINT32_MAX
  184. int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
  185. #endif
  186. #ifdef UINT64_MAX
  187. int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
  188. #endif
  189. int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
  190. int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
  191. int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
  192. int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
  193. int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
  194. int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
  195. int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
  196. int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
  197. int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
  198. int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
  199. int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
  200. };
  201. ]])],
  202. [dnl Determine whether the various *_MIN, *_MAX macros are usable
  203. dnl in preprocessor expression. We could do it by compiling a test
  204. dnl program for each of these macros. It is faster to run a program
  205. dnl that inspects the macro expansion.
  206. dnl This detects a bug on HP-UX 11.23/ia64.
  207. AC_RUN_IFELSE([
  208. AC_LANG_PROGRAM([[
  209. #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
  210. #include <stdint.h>
  211. ]
  212. gl_STDINT_INCLUDES
  213. [
  214. #include <stdio.h>
  215. #include <string.h>
  216. #define MVAL(macro) MVAL1(macro)
  217. #define MVAL1(expression) #expression
  218. static const char *macro_values[] =
  219. {
  220. #ifdef INT8_MAX
  221. MVAL (INT8_MAX),
  222. #endif
  223. #ifdef INT16_MAX
  224. MVAL (INT16_MAX),
  225. #endif
  226. #ifdef INT32_MAX
  227. MVAL (INT32_MAX),
  228. #endif
  229. #ifdef INT64_MAX
  230. MVAL (INT64_MAX),
  231. #endif
  232. #ifdef UINT8_MAX
  233. MVAL (UINT8_MAX),
  234. #endif
  235. #ifdef UINT16_MAX
  236. MVAL (UINT16_MAX),
  237. #endif
  238. #ifdef UINT32_MAX
  239. MVAL (UINT32_MAX),
  240. #endif
  241. #ifdef UINT64_MAX
  242. MVAL (UINT64_MAX),
  243. #endif
  244. NULL
  245. };
  246. ]], [[
  247. const char **mv;
  248. for (mv = macro_values; *mv != NULL; mv++)
  249. {
  250. const char *value = *mv;
  251. /* Test whether it looks like a cast expression. */
  252. if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
  253. || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
  254. || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
  255. || strncmp (value, "((int)"/*)*/, 6) == 0
  256. || strncmp (value, "((signed short)"/*)*/, 15) == 0
  257. || strncmp (value, "((signed char)"/*)*/, 14) == 0)
  258. return mv - macro_values + 1;
  259. }
  260. return 0;
  261. ]])],
  262. [gl_cv_header_working_stdint_h=yes],
  263. [],
  264. [dnl When cross-compiling, assume it works.
  265. gl_cv_header_working_stdint_h=yes
  266. ])
  267. ])
  268. ])
  269. fi
  270. if test "$gl_cv_header_working_stdint_h" = yes; then
  271. STDINT_H=
  272. else
  273. dnl Check for <sys/inttypes.h>, and for
  274. dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
  275. AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
  276. if test $ac_cv_header_sys_inttypes_h = yes; then
  277. HAVE_SYS_INTTYPES_H=1
  278. else
  279. HAVE_SYS_INTTYPES_H=0
  280. fi
  281. AC_SUBST([HAVE_SYS_INTTYPES_H])
  282. if test $ac_cv_header_sys_bitypes_h = yes; then
  283. HAVE_SYS_BITYPES_H=1
  284. else
  285. HAVE_SYS_BITYPES_H=0
  286. fi
  287. AC_SUBST([HAVE_SYS_BITYPES_H])
  288. gl_STDINT_TYPE_PROPERTIES
  289. STDINT_H=stdint.h
  290. fi
  291. AC_SUBST([STDINT_H])
  292. AM_CONDITIONAL([GL_GENERATE_STDINT_H], [test -n "$STDINT_H"])
  293. ])
  294. dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
  295. dnl Determine the size of each of the given types in bits.
  296. AC_DEFUN([gl_STDINT_BITSIZEOF],
  297. [
  298. dnl Use a shell loop, to avoid bloating configure, and
  299. dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
  300. dnl config.h.in,
  301. dnl - extra AC_SUBST calls, so that the right substitutions are made.
  302. m4_foreach_w([gltype], [$1],
  303. [AH_TEMPLATE([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
  304. [Define to the number of bits in type ']gltype['.])])
  305. for gltype in $1 ; do
  306. AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
  307. [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT],
  308. [$2
  309. #include <limits.h>], [result=unknown])
  310. eval gl_cv_bitsizeof_${gltype}=\$result
  311. ])
  312. eval result=\$gl_cv_bitsizeof_${gltype}
  313. if test $result = unknown; then
  314. dnl Use a nonempty default, because some compilers, such as IRIX 5 cc,
  315. dnl do a syntax check even on unused #if conditions and give an error
  316. dnl on valid C code like this:
  317. dnl #if 0
  318. dnl # if > 32
  319. dnl # endif
  320. dnl #endif
  321. result=0
  322. fi
  323. GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
  324. AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
  325. eval BITSIZEOF_${GLTYPE}=\$result
  326. done
  327. m4_foreach_w([gltype], [$1],
  328. [AC_SUBST([BITSIZEOF_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
  329. ])
  330. dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
  331. dnl Determine the signedness of each of the given types.
  332. dnl Define HAVE_SIGNED_TYPE if type is signed.
  333. AC_DEFUN([gl_CHECK_TYPES_SIGNED],
  334. [
  335. dnl Use a shell loop, to avoid bloating configure, and
  336. dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
  337. dnl config.h.in,
  338. dnl - extra AC_SUBST calls, so that the right substitutions are made.
  339. m4_foreach_w([gltype], [$1],
  340. [AH_TEMPLATE([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
  341. [Define to 1 if ']gltype[' is a signed integer type.])])
  342. for gltype in $1 ; do
  343. AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
  344. [AC_COMPILE_IFELSE(
  345. [AC_LANG_PROGRAM([$2[
  346. int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])],
  347. result=yes, result=no)
  348. eval gl_cv_type_${gltype}_signed=\$result
  349. ])
  350. eval result=\$gl_cv_type_${gltype}_signed
  351. GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
  352. if test "$result" = yes; then
  353. AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1])
  354. eval HAVE_SIGNED_${GLTYPE}=1
  355. else
  356. eval HAVE_SIGNED_${GLTYPE}=0
  357. fi
  358. done
  359. m4_foreach_w([gltype], [$1],
  360. [AC_SUBST([HAVE_SIGNED_]m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
  361. ])
  362. dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
  363. dnl Determine the suffix to use for integer constants of the given types.
  364. dnl Define t_SUFFIX for each such type.
  365. AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
  366. [
  367. dnl Use a shell loop, to avoid bloating configure, and
  368. dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
  369. dnl config.h.in,
  370. dnl - extra AC_SUBST calls, so that the right substitutions are made.
  371. m4_foreach_w([gltype], [$1],
  372. [AH_TEMPLATE(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
  373. [Define to l, ll, u, ul, ull, etc., as suitable for
  374. constants of type ']gltype['.])])
  375. for gltype in $1 ; do
  376. AC_CACHE_CHECK([for $gltype integer literal suffix],
  377. [gl_cv_type_${gltype}_suffix],
  378. [eval gl_cv_type_${gltype}_suffix=no
  379. eval result=\$gl_cv_type_${gltype}_signed
  380. if test "$result" = yes; then
  381. glsufu=
  382. else
  383. glsufu=u
  384. fi
  385. for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
  386. case $glsuf in
  387. '') gltype1='int';;
  388. l) gltype1='long int';;
  389. ll) gltype1='long long int';;
  390. i64) gltype1='__int64';;
  391. u) gltype1='unsigned int';;
  392. ul) gltype1='unsigned long int';;
  393. ull) gltype1='unsigned long long int';;
  394. ui64)gltype1='unsigned __int64';;
  395. esac
  396. AC_COMPILE_IFELSE(
  397. [AC_LANG_PROGRAM([$2[
  398. extern $gltype foo;
  399. extern $gltype1 foo;]])],
  400. [eval gl_cv_type_${gltype}_suffix=\$glsuf])
  401. eval result=\$gl_cv_type_${gltype}_suffix
  402. test "$result" != no && break
  403. done])
  404. GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
  405. eval result=\$gl_cv_type_${gltype}_suffix
  406. test "$result" = no && result=
  407. eval ${GLTYPE}_SUFFIX=\$result
  408. AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
  409. done
  410. m4_foreach_w([gltype], [$1],
  411. [AC_SUBST(m4_translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
  412. ])
  413. dnl gl_STDINT_INCLUDES
  414. AC_DEFUN([gl_STDINT_INCLUDES],
  415. [[
  416. /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
  417. included before <wchar.h>. */
  418. #include <stddef.h>
  419. #include <signal.h>
  420. #if HAVE_WCHAR_H
  421. # include <stdio.h>
  422. # include <time.h>
  423. # include <wchar.h>
  424. #endif
  425. ]])
  426. dnl gl_STDINT_TYPE_PROPERTIES
  427. dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
  428. dnl of interest to stdint.in.h.
  429. AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
  430. [
  431. AC_REQUIRE([gl_MULTIARCH])
  432. if test $APPLE_UNIVERSAL_BUILD = 0; then
  433. gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
  434. [gl_STDINT_INCLUDES])
  435. fi
  436. gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
  437. [gl_STDINT_INCLUDES])
  438. gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
  439. [gl_STDINT_INCLUDES])
  440. gl_cv_type_ptrdiff_t_signed=yes
  441. gl_cv_type_size_t_signed=no
  442. if test $APPLE_UNIVERSAL_BUILD = 0; then
  443. gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
  444. [gl_STDINT_INCLUDES])
  445. fi
  446. gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
  447. [gl_STDINT_INCLUDES])
  448. dnl If wint_t is smaller than 'int', it cannot satisfy the ISO C 99
  449. dnl requirement that wint_t is "unchanged by default argument promotions".
  450. dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
  451. dnl Set the variable BITSIZEOF_WINT_T accordingly.
  452. if test $BITSIZEOF_WINT_T -lt 32; then
  453. BITSIZEOF_WINT_T=32
  454. fi
  455. ])
  456. dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
  457. dnl Remove this when we can assume autoconf >= 2.61.
  458. m4_ifdef([AC_COMPUTE_INT], [], [
  459. AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
  460. ])
  461. # Hey Emacs!
  462. # Local Variables:
  463. # indent-tabs-mode: nil
  464. # End: