diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-10-05 08:33:08 -0400 |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2004-10-05 08:33:08 -0400 |
commit | 518de19f745a92f0dc3d6fe941f078aae1576050 (patch) | |
tree | 29b7a80a9282f8bb28adf01890ad0f0269f9efde /Modules/CheckTypeSize.c.in | |
parent | b1a1526e14970141ae80153dadcaa135baaf0e9d (diff) | |
download | cmake-518de19f745a92f0dc3d6fe941f078aae1576050.tar.gz |
ENH: Add option of adding random include files before doing CheckTypeSize
Diffstat (limited to 'Modules/CheckTypeSize.c.in')
-rw-r--r-- | Modules/CheckTypeSize.c.in | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Modules/CheckTypeSize.c.in b/Modules/CheckTypeSize.c.in new file mode 100644 index 0000000000..822d9c5e62 --- /dev/null +++ b/Modules/CheckTypeSize.c.in @@ -0,0 +1,34 @@ +#ifdef CHECK_TYPE_SIZE_TYPE + +@CHECK_TYPE_SIZE_PREINCLUDE@ + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif /* HAVE_SYS_TYPES_H */ + +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif /* HAVE_STDINT_H */ + +#ifdef HAVE_STDDEF_H +# include <stddef.h> +#endif /* HAVE_STDDEF_H */ + +@CHECK_TYPE_SIZE_PREMAIN@ + +#ifdef __CLASSIC_C__ +int main(){ + int ac; + char*av[]; +#else +int main(int ac, char*av[]){ +#endif + if(ac > 1000){return *av[0];} + return sizeof(CHECK_TYPE_SIZE_TYPE); +} + +#else /* CHECK_TYPE_SIZE_TYPE */ + +# error "CHECK_TYPE_SIZE_TYPE has to specify the type" + +#endif /* CHECK_TYPE_SIZE_TYPE */ |