summaryrefslogtreecommitdiffstats
path: root/gl/m4/stdint.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/stdint.m4')
-rw-r--r--gl/m4/stdint.m441
1 files changed, 25 insertions, 16 deletions
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index bb6c34fe..b4194c8a 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,5 +1,5 @@
1# stdint.m4 serial 29 1# stdint.m4 serial 33
2dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@ dnl Test whether <stdint.h> is supported or must be substituted.
9 9
10AC_DEFUN([gl_STDINT_H], 10AC_DEFUN([gl_STDINT_H],
11[ 11[
12 AC_PREREQ(2.59)dnl 12 AC_PREREQ([2.59])dnl
13 13
14 dnl Check for long long int and unsigned long long int. 14 dnl Check for long long int and unsigned long long int.
15 AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) 15 AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
@@ -229,7 +229,7 @@ struct s {
229 gl_STDINT_TYPE_PROPERTIES 229 gl_STDINT_TYPE_PROPERTIES
230 STDINT_H=stdint.h 230 STDINT_H=stdint.h
231 fi 231 fi
232 AC_SUBST(STDINT_H) 232 AC_SUBST([STDINT_H])
233]) 233])
234 234
235dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) 235dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
@@ -240,7 +240,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
240 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into 240 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
241 dnl config.h.in, 241 dnl config.h.in,
242 dnl - extra AC_SUBST calls, so that the right substitutions are made. 242 dnl - extra AC_SUBST calls, so that the right substitutions are made.
243 AC_FOREACH([gltype], [$1], 243 m4_foreach_w([gltype], [$1],
244 [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), 244 [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
245 [Define to the number of bits in type ']gltype['.])]) 245 [Define to the number of bits in type ']gltype['.])])
246 for gltype in $1 ; do 246 for gltype in $1 ; do
@@ -265,7 +265,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
265 AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result]) 265 AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
266 eval BITSIZEOF_${GLTYPE}=\$result 266 eval BITSIZEOF_${GLTYPE}=\$result
267 done 267 done
268 AC_FOREACH([gltype], [$1], 268 m4_foreach_w([gltype], [$1],
269 [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) 269 [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
270]) 270])
271 271
@@ -278,7 +278,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
278 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into 278 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
279 dnl config.h.in, 279 dnl config.h.in,
280 dnl - extra AC_SUBST calls, so that the right substitutions are made. 280 dnl - extra AC_SUBST calls, so that the right substitutions are made.
281 AC_FOREACH([gltype], [$1], 281 m4_foreach_w([gltype], [$1],
282 [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]), 282 [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
283 [Define to 1 if ']gltype[' is a signed integer type.])]) 283 [Define to 1 if ']gltype[' is a signed integer type.])])
284 for gltype in $1 ; do 284 for gltype in $1 ; do
@@ -292,13 +292,13 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
292 eval result=\$gl_cv_type_${gltype}_signed 292 eval result=\$gl_cv_type_${gltype}_signed
293 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` 293 GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
294 if test "$result" = yes; then 294 if test "$result" = yes; then
295 AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1) 295 AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1])
296 eval HAVE_SIGNED_${GLTYPE}=1 296 eval HAVE_SIGNED_${GLTYPE}=1
297 else 297 else
298 eval HAVE_SIGNED_${GLTYPE}=0 298 eval HAVE_SIGNED_${GLTYPE}=0
299 fi 299 fi
300 done 300 done
301 AC_FOREACH([gltype], [$1], 301 m4_foreach_w([gltype], [$1],
302 [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))]) 302 [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
303]) 303])
304 304
@@ -311,7 +311,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
311 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into 311 dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
312 dnl config.h.in, 312 dnl config.h.in,
313 dnl - extra AC_SUBST calls, so that the right substitutions are made. 313 dnl - extra AC_SUBST calls, so that the right substitutions are made.
314 AC_FOREACH([gltype], [$1], 314 m4_foreach_w([gltype], [$1],
315 [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX], 315 [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
316 [Define to l, ll, u, ul, ull, etc., as suitable for 316 [Define to l, ll, u, ul, ull, etc., as suitable for
317 constants of type ']gltype['.])]) 317 constants of type ']gltype['.])])
@@ -337,9 +337,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
337 ui64)gltype1='unsigned __int64';; 337 ui64)gltype1='unsigned __int64';;
338 esac 338 esac
339 AC_COMPILE_IFELSE( 339 AC_COMPILE_IFELSE(
340 [AC_LANG_PROGRAM([$2 340 [AC_LANG_PROGRAM([$2[
341 extern $gltype foo; 341 extern $gltype foo;
342 extern $gltype1 foo;])], 342 extern $gltype1 foo;]])],
343 [eval gl_cv_type_${gltype}_suffix=\$glsuf]) 343 [eval gl_cv_type_${gltype}_suffix=\$glsuf])
344 eval result=\$gl_cv_type_${gltype}_suffix 344 eval result=\$gl_cv_type_${gltype}_suffix
345 test "$result" != no && break 345 test "$result" != no && break
@@ -348,9 +348,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
348 eval result=\$gl_cv_type_${gltype}_suffix 348 eval result=\$gl_cv_type_${gltype}_suffix
349 test "$result" = no && result= 349 test "$result" = no && result=
350 eval ${GLTYPE}_SUFFIX=\$result 350 eval ${GLTYPE}_SUFFIX=\$result
351 AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) 351 AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
352 done 352 done
353 AC_FOREACH([gltype], [$1], 353 m4_foreach_w([gltype], [$1],
354 [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) 354 [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
355]) 355])
356 356
@@ -373,13 +373,22 @@ dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
373dnl of interest to stdint.in.h. 373dnl of interest to stdint.in.h.
374AC_DEFUN([gl_STDINT_TYPE_PROPERTIES], 374AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
375[ 375[
376 gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], 376 AC_REQUIRE([gl_MULTIARCH])
377 if test $APPLE_UNIVERSAL_BUILD = 0; then
378 gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
379 [gl_STDINT_INCLUDES])
380 fi
381 gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
377 [gl_STDINT_INCLUDES]) 382 [gl_STDINT_INCLUDES])
378 gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t], 383 gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
379 [gl_STDINT_INCLUDES]) 384 [gl_STDINT_INCLUDES])
380 gl_cv_type_ptrdiff_t_signed=yes 385 gl_cv_type_ptrdiff_t_signed=yes
381 gl_cv_type_size_t_signed=no 386 gl_cv_type_size_t_signed=no
382 gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t], 387 if test $APPLE_UNIVERSAL_BUILD = 0; then
388 gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
389 [gl_STDINT_INCLUDES])
390 fi
391 gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
383 [gl_STDINT_INCLUDES]) 392 [gl_STDINT_INCLUDES])
384]) 393])
385 394