annotate m4/inttypes.m4 @ 9921:01cfd65cc7e0

Fix underquoting of AC_LANG_PROGRAM arguments.
author Bruno Haible <bruno@clisp.org>
date Tue, 15 Apr 2008 01:52:03 +0200
parents 8c3f82d802ec
children cf1b1ca0bb08
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9921
01cfd65cc7e0 Fix underquoting of AC_LANG_PROGRAM arguments.
Bruno Haible <bruno@clisp.org>
parents: 9473
diff changeset
1 # inttypes.m4 serial 12
01cfd65cc7e0 Fix underquoting of AC_LANG_PROGRAM arguments.
Bruno Haible <bruno@clisp.org>
parents: 9473
diff changeset
2 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3 dnl This file is free software; the Free Software Foundation
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl gives unlimited permission to copy and/or distribute it,
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl with or without modifications, as long as this notice is preserved.
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 dnl From Derek Price, Bruno Haible.
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 dnl Test whether <inttypes.h> is supported or must be substituted.
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 AC_DEFUN([gl_INTTYPES_H],
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 [
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 AC_REQUIRE([gl_STDINT_H])
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 AC_REQUIRE([gt_INTTYPES_PRI])
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 AC_CHECK_DECLS_ONCE([imaxabs])
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 AC_CHECK_DECLS_ONCE([imaxdiv])
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 AC_CHECK_DECLS_ONCE([strtoimax])
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 AC_CHECK_DECLS_ONCE([strtoumax])
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 dnl Now see if we need a substitute <inttypes.h>.
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 dnl A complete <inttypes.h> requires
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 dnl - a complete <stdint.h>,
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 dnl - the existence of an <inttypes.h>,
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 dnl - that imaxabs, imaxdiv, strtoimax, strtoumax are declared,
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 dnl - some additional tests.
7657
60d54899043e * m4/inttypes.m4 (gl_INTTYPES_H): Use AC_CACHE_CHECK so that the
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
parents: 7330
diff changeset
25 AC_CACHE_CHECK([whether inttypes.h conforms to C99],
7658
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
26 [gl_cv_header_working_inttypes_h],
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
27 [gl_cv_header_working_inttypes_h=no
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
28 if test "$gl_cv_header_working_stdint_h" = yes \
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
29 && test $ac_cv_header_inttypes_h = yes \
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
30 && test "$ac_cv_have_decl_imaxabs" = yes \
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
31 && test "$ac_cv_have_decl_imaxdiv" = yes \
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
32 && test "$ac_cv_have_decl_strtoimax" = yes \
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
33 && test "$ac_cv_have_decl_strtoumax" = yes; then
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
34 AC_COMPILE_IFELSE([
9921
01cfd65cc7e0 Fix underquoting of AC_LANG_PROGRAM arguments.
Bruno Haible <bruno@clisp.org>
parents: 9473
diff changeset
35 AC_LANG_PROGRAM([[
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36 #include <stddef.h>
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 #define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38 #define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 #define __STDC_FORMAT_MACROS 1 /* to make it work also in C++ mode */
8995
1025663f7658 * m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents: 8185
diff changeset
40 #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H /* work if build isn't clean */
1025663f7658 * m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents: 8185
diff changeset
41 #include <inttypes.h>
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 /* No need to duplicate the tests of stdint.m4; they are subsumed by
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 $gl_cv_header_working_stdint_h = yes. */
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 /* Tests for macros supposed to be defined in inttypes.h. */
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 const char *k = /* implicit string concatenation */
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 #ifdef INT8_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 PRId8 PRIi8
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 #ifdef UINT8_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 PRIo8 PRIu8 PRIx8 PRIX8
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 #ifdef INT16_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 PRId16 PRIi16
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 #ifdef UINT16_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 PRIo16 PRIu16 PRIx16 PRIX16
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61 #ifdef INT32_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 PRId32 PRIi32
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 #ifdef UINT32_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 PRIo32 PRIu32 PRIx32 PRIX32
7224
c42a57e8d187 * inttypes.m4 (gl_INTTYPES_H): Fix missing #endif.
Eric Blake <ebb9@byu.net>
parents: 7223
diff changeset
66 #endif
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 #ifdef INT64_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 PRId64 PRIi64
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
69 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
70 #ifdef UINT64_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
71 PRIo64 PRIu64 PRIx64 PRIX64
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
72 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
73 PRIdLEAST8 PRIiLEAST8 PRIoLEAST8 PRIuLEAST8 PRIxLEAST8 PRIXLEAST8
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
74 PRIdLEAST16 PRIiLEAST16 PRIoLEAST16 PRIuLEAST16 PRIxLEAST16 PRIXLEAST16
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
75 PRIdLEAST32 PRIiLEAST32 PRIoLEAST32 PRIuLEAST32 PRIxLEAST32 PRIXLEAST32
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
76 PRIdLEAST64 PRIiLEAST64
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
77 PRIoLEAST64 PRIuLEAST64 PRIxLEAST64 PRIXLEAST64
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
78 PRIdFAST8 PRIiFAST8 PRIoFAST8 PRIuFAST8 PRIxFAST8 PRIXFAST8
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
79 PRIdFAST16 PRIiFAST16 PRIoFAST16 PRIuFAST16 PRIxFAST16 PRIXFAST16
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
80 PRIdFAST32 PRIiFAST32 PRIoFAST32 PRIuFAST32 PRIxFAST32 PRIXFAST32
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
81 PRIdFAST64 PRIiFAST64
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
82 PRIoFAST64 PRIuFAST64 PRIxFAST64 PRIXFAST64
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
83 PRIdMAX PRIiMAX PRIoMAX PRIuMAX PRIxMAX PRIXMAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
84 #ifdef INTPTR_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
85 PRIdPTR PRIiPTR
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
86 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
87 #ifdef UINTPTR_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
88 PRIoPTR PRIuPTR PRIxPTR PRIXPTR
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
89 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
90 ;
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
91 const char *l = /* implicit string concatenation */
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
92 #ifdef INT8_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
93 SCNd8 SCNi8
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
94 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
95 #ifdef UINT8_MAX
7219
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
96 SCNo8 SCNu8 SCNx8
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
97 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
98 #ifdef INT16_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
99 SCNd16 SCNi16
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
100 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
101 #ifdef UINT16_MAX
7219
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
102 SCNo16 SCNu16 SCNx16
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
103 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
104 #ifdef INT32_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
105 SCNd32 SCNi32
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
106 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
107 #ifdef UINT32_MAX
7219
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
108 SCNo32 SCNu32 SCNx32
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
109 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
110 #ifdef INT64_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
111 SCNd64 SCNi64
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
112 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
113 #ifdef UINT64_MAX
7219
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
114 SCNo64 SCNu64 SCNx64
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
115 #endif
7219
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
116 SCNdLEAST8 SCNiLEAST8 SCNoLEAST8 SCNuLEAST8 SCNxLEAST8
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
117 SCNdLEAST16 SCNiLEAST16 SCNoLEAST16 SCNuLEAST16 SCNxLEAST16
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
118 SCNdLEAST32 SCNiLEAST32 SCNoLEAST32 SCNuLEAST32 SCNxLEAST32
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
119 SCNdLEAST64 SCNiLEAST64
7219
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
120 SCNoLEAST64 SCNuLEAST64 SCNxLEAST64
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
121 SCNdFAST8 SCNiFAST8 SCNoFAST8 SCNuFAST8 SCNxFAST8
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
122 SCNdFAST16 SCNiFAST16 SCNoFAST16 SCNuFAST16 SCNxFAST16
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
123 SCNdFAST32 SCNiFAST32 SCNoFAST32 SCNuFAST32 SCNxFAST32
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
124 SCNdFAST64 SCNiFAST64
7219
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
125 SCNoFAST64 SCNuFAST64 SCNxFAST64
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
126 SCNdMAX SCNiMAX SCNoMAX SCNuMAX SCNxMAX
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
127 #ifdef INTPTR_MAX
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
128 SCNdPTR SCNiPTR
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
129 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
130 #ifdef UINTPTR_MAX
7219
f9bfde719d72 SCNX* macros don't exist.
Bruno Haible <bruno@clisp.org>
parents: 7204
diff changeset
131 SCNoPTR SCNuPTR SCNxPTR
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
132 #endif
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
133 ;
9921
01cfd65cc7e0 Fix underquoting of AC_LANG_PROGRAM arguments.
Bruno Haible <bruno@clisp.org>
parents: 9473
diff changeset
134 ]])],
7658
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
135 [gl_cv_header_working_inttypes_h=yes])
7ac7691c20b6 Reindent for consistency.
Paul Eggert <eggert@cs.ucla.edu>
parents: 7657
diff changeset
136 fi])
8185
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
137
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
138 dnl Override <inttypes.h> always, so that the portability warnings work.
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
139 if false && test $gl_cv_header_working_inttypes_h = yes; then
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
140 dnl Use the existing <inttypes.h>.
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
141 INTTYPES_H=''
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
142 else
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
143
8185
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
144 AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
8995
1025663f7658 * m4/include_next.m4 (gl_INCLUDE_NEXT): Define and AC_SUBST
Paul Eggert <eggert@cs.ucla.edu>
parents: 8185
diff changeset
145 gl_CHECK_NEXT_HEADERS([inttypes.h])
7223
dabe23a32d21 * lib/inttypes_.h [defined _GL_JUST_INCLUDE_ABSOLUTE_INTTYPES_H]:
Paul Eggert <eggert@cs.ucla.edu>
parents: 7219
diff changeset
146
9039
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
147 dnl Ensure that <stdint.h> defines the limit macros, since gnulib's
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
148 dnl <inttypes.h> relies on them. This macro is only needed when a
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
149 dnl C++ compiler is in use; it has no effect for a C compiler.
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
150 dnl Also be careful to define __STDC_LIMIT_MACROS only when gnulib's
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
151 dnl <inttypes.h> is going to be created, and to avoid redefinition warnings
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
152 dnl if the __STDC_LIMIT_MACROS is already defined through the CPPFLAGS.
9139
c68fd65692fd Avoid gcc warning: "__STDC_LIMIT_MACROS_TRIGGER" redefined
Bruno Haible <bruno@clisp.org>
parents: 9039
diff changeset
153 AC_DEFINE([GL_TRIGGER_STDC_LIMIT_MACROS], 1,
9039
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
154 [Define to make the limit macros in <stdint.h> visible.])
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
155 AH_VERBATIM([__STDC_LIMIT_MACROS_ZZZ],
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
156 [/* Ensure that <stdint.h> defines the limit macros, since gnulib's
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
157 <inttypes.h> relies on them. */
9139
c68fd65692fd Avoid gcc warning: "__STDC_LIMIT_MACROS_TRIGGER" redefined
Bruno Haible <bruno@clisp.org>
parents: 9039
diff changeset
158 #if defined __cplusplus && !defined __STDC_LIMIT_MACROS && GL_TRIGGER_STDC_LIMIT_MACROS
9039
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
159 # define __STDC_LIMIT_MACROS 1
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
160 #endif
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
161 ])
c2aa15b918a5 Ensure that <stdint.h> defines all the *_MAX and *_MIN macros that gnulib's
Bruno Haible <bruno@clisp.org>
parents: 8995
diff changeset
162
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
163 PRIPTR_PREFIX=
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
164 if test -n "$STDINT_H"; then
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
165 dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
166 PRIPTR_PREFIX='"l"'
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
167 else
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
168 dnl Using the system's <stdint.h>.
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
169 for glpfx in '' l ll I64; do
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
170 case $glpfx in
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
171 '') gltype1='int';;
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
172 l) gltype1='long int';;
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
173 ll) gltype1='long long int';;
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
174 I64) gltype1='__int64';;
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
175 esac
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
176 AC_COMPILE_IFELSE(
9921
01cfd65cc7e0 Fix underquoting of AC_LANG_PROGRAM arguments.
Bruno Haible <bruno@clisp.org>
parents: 9473
diff changeset
177 [AC_LANG_PROGRAM([[#include <stdint.h>
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
178 extern intptr_t foo;
9921
01cfd65cc7e0 Fix underquoting of AC_LANG_PROGRAM arguments.
Bruno Haible <bruno@clisp.org>
parents: 9473
diff changeset
179 extern $gltype1 foo;]])],
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
180 [PRIPTR_PREFIX='"'$glpfx'"'])
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
181 test -n "$PRIPTR_PREFIX" && break
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
182 done
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
183 fi
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
184 AC_SUBST([PRIPTR_PREFIX])
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
185
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
186 if test "$ac_cv_have_decl_imaxabs" = yes; then
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
187 HAVE_DECL_IMAXABS=1
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
188 else
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
189 HAVE_DECL_IMAXABS=0
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
190 fi
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
191
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
192 if test "$ac_cv_have_decl_imaxdiv" = yes; then
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
193 HAVE_DECL_IMAXDIV=1
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
194 else
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
195 HAVE_DECL_IMAXDIV=0
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
196 fi
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
197
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
198 if test "$ac_cv_have_decl_strtoimax" = yes; then
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
199 HAVE_DECL_STRTOIMAX=1
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
200 else
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
201 HAVE_DECL_STRTOIMAX=0
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
202 fi
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
203
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
204 if test "$ac_cv_have_decl_strtoumax" = yes; then
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
205 HAVE_DECL_STRTOUMAX=1
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
206 else
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
207 HAVE_DECL_STRTOUMAX=0
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
208 fi
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
209
9473
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
210 gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
211 [INT32_MAX_LT_INTMAX_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
212 [defined INT32_MAX && defined INTMAX_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
213 [INT32_MAX < INTMAX_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
214 [sizeof (int) < sizeof (long long int)])
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
215 gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
216 [INT64_MAX_EQ_LONG_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
217 [defined INT64_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
218 [INT64_MAX == LONG_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
219 [sizeof (long long int) == sizeof (long int)])
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
220 gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
221 [UINT32_MAX_LT_UINTMAX_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
222 [defined UINT32_MAX && defined UINTMAX_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
223 [UINT32_MAX < UINTMAX_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
224 [sizeof (unsigned int) < sizeof (unsigned long long int)])
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
225 gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION(
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
226 [UINT64_MAX_EQ_ULONG_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
227 [defined UINT64_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
228 [UINT64_MAX == ULONG_MAX],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
229 [sizeof (unsigned long long int) == sizeof (unsigned long int)])
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
230
7204
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
231 INTTYPES_H='inttypes.h'
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
232 fi
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
233 AC_SUBST(INTTYPES_H)
a402f0d05767 Rewritten 'inttypes' module.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
234 ])
8185
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
235
9473
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
236 # Define the symbol $1 to be 1 if the condition is true, 0 otherwise.
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
237 # If $2 is true, the condition is $3; otherwise if long long int is supported
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
238 # approximate the condition with $4; otherwise, assume the condition is false.
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
239 # The condition should work on all C99 platforms; the approximations should be
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
240 # good enough to work on all practical pre-C99 platforms.
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
241 # $2 is evaluated by the C preprocessor, $3 and $4 as compile-time constants.
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
242 AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
243 [
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
244 AC_CACHE_CHECK([whether $3],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
245 [gl_cv_test_$1],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
246 [AC_COMPILE_IFELSE(
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
247 [AC_LANG_PROGRAM(
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
248 [[/* Work also in C++ mode. */
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
249 #define __STDC_LIMIT_MACROS 1
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
250
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
251 /* Work if build is not clean. */
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
252 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
253
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
254 #include <limits.h>
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
255 #if HAVE_STDINT_H
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
256 #include <stdint.h>
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
257 #endif
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
258
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
259 #if $2
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
260 #define CONDITION ($3)
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
261 #elif HAVE_LONG_LONG_INT
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
262 #define CONDITION ($4)
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
263 #else
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
264 #define CONDITION 0
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
265 #endif
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
266 int test[CONDITION ? 1 : -1];]])],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
267 [gl_cv_test_$1=yes],
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
268 [gl_cv_test_$1=no])])
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
269 if test $gl_cv_test_$1 = yes; then
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
270 $1=1;
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
271 else
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
272 $1=0;
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
273 fi
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
274 AC_SUBST([$1])
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
275 ])
8c3f82d802ec Don't insist on 'long long int' support in the preprocessor. It
Paul Eggert <eggert@cs.ucla.edu>
parents: 9139
diff changeset
276
8185
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
277 AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
278 [
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
279 dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
280 AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
281 GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
282 ])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
283
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
284 AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
285 [
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
286 GNULIB_IMAXABS=0; AC_SUBST([GNULIB_IMAXABS])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
287 GNULIB_IMAXDIV=0; AC_SUBST([GNULIB_IMAXDIV])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
288 GNULIB_STRTOIMAX=0; AC_SUBST([GNULIB_STRTOIMAX])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
289 GNULIB_STRTOUMAX=0; AC_SUBST([GNULIB_STRTOUMAX])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
290 dnl Assume proper GNU behavior unless another module says otherwise.
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
291 HAVE_DECL_IMAXABS=1; AC_SUBST([HAVE_DECL_IMAXABS])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
292 HAVE_DECL_IMAXDIV=1; AC_SUBST([HAVE_DECL_IMAXDIV])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
293 HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
294 HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
a1e147e70a3b Emit linker warnings for imaxabs, imaxdiv, strtoimax, strtoumax when these
Bruno Haible <bruno@clisp.org>
parents: 7658
diff changeset
295 ])