detect if stdint.h is available. if not, use inttypes. this should fix #239 and make...
authoroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 25 Aug 2009 09:01:16 +0000 (09:01 +0000)
committeroetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa>
Tue, 25 Aug 2009 09:01:16 +0000 (09:01 +0000)
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1906 a5681a0c-68f1-0310-ab6d-d61299d08faa

configure.ac
src/rrd_client.h
src/rrd_daemon.c

index 49f1281..65aa310 100644 (file)
@@ -182,7 +182,7 @@ CONFIGURE_PART(Checking for Header Files)
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_DIRENT
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_DIRENT
-AC_CHECK_HEADERS(libgen.h features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h)
+AC_CHECK_HEADERS(stdint.h inttypes.h libgen.h features.h sys/stat.h sys/types.h fcntl.h locale.h fp_class.h malloc.h unistd.h ieeefp.h math.h sys/times.h sys/param.h sys/resource.h signal.h float.h stdio.h stdlib.h errno.h string.h ctype.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
index 90b78f8..787c2b6 100644 (file)
 #ifndef __RRD_CLIENT_H
 #define __RRD_CLIENT_H 1
 
 #ifndef __RRD_CLIENT_H
 #define __RRD_CLIENT_H 1
 
+#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__) && !defined(HAVE_CONFIG_H)
+#include "../win32/config.h"
+#else
+#ifdef HAVE_CONFIG_H
+#include "../rrd_config.h"
+#endif
+#endif
+
 #ifndef WIN32
 #ifndef WIN32
-#include <stdint.h>
+# ifdef HAVE_STDINT_H
+#  include <stdint.h>
+# else
+#   ifdef HAVE_INTTYPES_H
+#      include <inttypes.h>
+#   else
+#      error "you should have stdint.h or inttypes.h to compile this"
+#   endif
+# endif
 #else
 #      include <stdlib.h>
        typedef signed char     int8_t;
 #else
 #      include <stdlib.h>
        typedef signed char     int8_t;
index b4bc1ee..16b5df5 100644 (file)
 #include <stdlib.h>
 
 #ifndef WIN32
 #include <stdlib.h>
 
 #ifndef WIN32
-#include <stdint.h>
+#ifdef HAVE_STDINT_H
+#  include <stdint.h>
+#endif
 #include <unistd.h>
 #include <strings.h>
 #include <inttypes.h>
 #include <unistd.h>
 #include <strings.h>
 #include <inttypes.h>
-#      include <sys/socket.h>
+#include <sys/socket.h>
 
 #else
 
 
 #else