6 * A little utility function to generate header info.
8 * Yes, it would be possible to do this using more "native" autoconf
9 * features, but I personally find this approach to be cleaner.
11 * The output of this program is generally written to art_config.h,
12 * which is installed in libart's include dir.
18 fprintf (stderr, "gen_art_config: %s\n", why);
23 main (int argc, char **argv)
25 printf ("/* Automatically generated by gen_art_config.c */\n"
27 "#define ART_SIZEOF_CHAR %d\n"
28 "#define ART_SIZEOF_SHORT %d\n"
29 "#define ART_SIZEOF_INT %d\n"
30 "#define ART_SIZEOF_LONG %d\n"
32 (int)sizeof(char), (int)sizeof(short), (int)sizeof(int), (int)sizeof(long));
34 if (sizeof(char) == 1)
35 printf ("typedef unsigned char art_u8;\n");
37 die ("sizeof(char) != 1");
39 if (sizeof(short) == 2)
40 printf ("typedef unsigned short art_u16;\n");
42 die ("sizeof(short) != 2");
45 printf ("typedef unsigned int art_u32;\n");
46 else if (sizeof(long) == 4)
47 printf ("typedef unsigned long art_u32;\n");
49 die ("sizeof(int) != 4 and sizeof(long) != 4");