gecko-dev/other-licenses/libart_lgpl/gen_art_config.c
alex.fritze%crocodile-clips.com 5c676d4a47 Landing of SVG_20020806_BRANCH, Bug 182533. Refactoring of SVG backend, new GDI+ and Libart rendering
backends, text support on Windows (GDI+), rudimentary text support on Linux (libart/freetype2), presentation
attributes, lots of bug fixes (see bug 182533 for dependency list).

Not part of default build; code is #ifdef'ed out.

r=sicking, sr=jst for dom and htmlparser changes
r=bsmedberg, sr=tor for config changes
r=dbaron, sr=bzbarsky for content and layout changes
r=tor, sr=bzbarsky for gfx changes
2004-02-07 12:39:26 +00:00

53 lines
1.2 KiB
C

#include <stdio.h>
#include "config.h"
#include <stdlib.h>
/**
* A little utility function to generate header info.
*
* Yes, it would be possible to do this using more "native" autoconf
* features, but I personally find this approach to be cleaner.
*
* The output of this program is generally written to art_config.h,
* which is installed in libart's include dir.
**/
static void
die (char *why)
{
fprintf (stderr, "gen_art_config: %s\n", why);
exit (1);
}
int
main (int argc, char **argv)
{
printf ("/* Automatically generated by gen_art_config.c */\n"
"\n"
"#define ART_SIZEOF_CHAR %d\n"
"#define ART_SIZEOF_SHORT %d\n"
"#define ART_SIZEOF_INT %d\n"
"#define ART_SIZEOF_LONG %d\n"
"\n",
(int)sizeof(char), (int)sizeof(short), (int)sizeof(int), (int)sizeof(long));
if (sizeof(char) == 1)
printf ("typedef unsigned char art_u8;\n");
else
die ("sizeof(char) != 1");
if (sizeof(short) == 2)
printf ("typedef unsigned short art_u16;\n");
else
die ("sizeof(short) != 2");
if (sizeof(int) == 4)
printf ("typedef unsigned int art_u32;\n");
else if (sizeof(long) == 4)
printf ("typedef unsigned long art_u32;\n");
else
die ("sizeof(int) != 4 and sizeof(long) != 4");
return 0;
}