Thread: [cvs] bogofilter configure.ac,1.17,1.18 system.h,1.9,1.10
Fast Bayesian spam filter along lines suggested by Paul Graham
Brought to you by:
m-a
From: <m-...@us...> - 2003-01-31 02:36:55
|
Update of /cvsroot/bogofilter/bogofilter In directory sc8-pr-cvs1:/tmp/cvs-serv14275 Modified Files: configure.ac system.h Log Message: Try harder to get uint32_t defined. Index: configure.ac =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/configure.ac,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- configure.ac 30 Jan 2003 03:02:40 -0000 1.17 +++ configure.ac 31 Jan 2003 02:36:52 -0000 1.18 @@ -185,6 +185,7 @@ AC_HEADER_TIME AC_CHECK_HEADERS([syslog.h sys/param.h fcntl.h stdlib.h string.h sys/socket.h]) AC_CHECK_HEADERS([unistd.h sys/file.h stddef.h sys/time.h sys/select.h]) +AC_CHECK_HEADERS([inttypes.h stdint.h]) AC_CHECK_HEADERS([limits.h float.h],,[AC_CHECK_HEADERS(values.h)]) # Checks for typedefs, structures, and compiler characteristics. @@ -194,6 +195,10 @@ AC_TYPE_UID_T AC_TYPE_SIGNAL AC_FUNC_SELECT_ARGTYPES +AC_CHECK_TYPES([uint32_t, u_int32_t]) +AC_CHECK_SIZEOF(unsigned short) +AC_CHECK_SIZEOF(unsigned int) +AC_CHECK_SIZEOF(unsigned long) # Checks for library functions. dnl AC_FUNC_MALLOC Index: system.h =================================================================== RCS file: /cvsroot/bogofilter/bogofilter/system.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- system.h 12 Jan 2003 14:02:00 -0000 1.9 +++ system.h 31 Jan 2003 02:36:53 -0000 1.10 @@ -1,10 +1,13 @@ -/* from autoconf.info */ +/* parts were taken from autoconf.info */ + +/* + * this file shall define the bool and uint32_t types. + * it shall include inttypes.h and stdbool.h if present + */ #ifndef SYSTEM_H #define SYSTEM_H -#include <string.h> - #include "config.h" #if HAVE_STDBOOL_H @@ -58,4 +61,25 @@ # endif #endif +/* obtain uint32_t */ +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#elif HAVE_STDINT_H +#include <stdint.h> +#endif + +#ifndef HAVE_UINT32_T +#ifdef HAVE_U_INT32_T +typedef u_int32_t uint32_t; +#elif SIZEOF_UNSIGNED_LONG == 4 +typedef unsigned long uint32_t; +#elif SIZEOF_UNSIGNED_INT == 4 +typedef unsigned int uint32_t; +#elif SIZEOF_UNSIGNED_SHORT == 4 +typedef unsigned short uint32_t; +#else +choke me because we do not know how to define uint32_t #endif +#endif /* HAVE_UINT32_T */ + +#endif /* SYSTEM_H */ |