1 /***********************************************************************/
5 /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */
7 /* Copyright 1996 Institut National de Recherche en Informatique et */
8 /* en Automatique. All rights reserved. This file is distributed */
9 /* under the terms of the GNU Library General Public License, with */
10 /* the special exception on linking described in file ../../LICENSE. */
12 /***********************************************************************/
19 /* Check for the availability of "long long" type as per ISO C9X */
21 /* Meaning of return code:
22 0 long long OK, printf with %ll
23 1 long long OK, printf with %q
24 2 long long OK, no printf
25 3 long long not suitable */
27 int main(int argc
, char **argv
)
33 if (sizeof(long long) != 8) return 3;
34 l
= 123456789123456789LL;
36 sprintf(buffer
, "%lld", l
);
37 if (strcmp(buffer
, "123456789123456789") == 0) return 0;
38 /* the MacOS X library uses qd to format long longs */
40 sprintf (buffer
, "%qd", l
);
41 if (strcmp (buffer
, "123456789123456789") == 0) return 1;