]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Support C99 exact size int types in a way which is compatible with the upcoming
authorMartin Burnicki <burnicki@ntp.org>
Fri, 18 Jan 2013 08:44:02 +0000 (09:44 +0100)
committerMartin Burnicki <burnicki@ntp.org>
Fri, 18 Jan 2013 08:44:02 +0000 (09:44 +0100)
version of libopts which will not #include <inttypes.h> unconditionally anymore.
Fixes the build errors under Windows reported in [Bug 2321].

bk: 50f90b52F3iREj_iuswnfelrZiu3Eg

ChangeLog
ports/winnt/include/config.h

index 926bf2b83c1708cb6f8b0c53e532aa1ca57e7d58..4eb3a8f8e8e0e9fc9fb59b223282dc6209dbbe6c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* [Bug 2321] Fixed Windows build, but autogen update still required.
 (4.2.7p348) 2013/01/17 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2327] Rename sntp/ag-tpl/:Old to sntp/ag-tpl/Old.
 * Cleanup to ntpsnmpd-opts.def.
index 83b36d042372e71f6a80ab435f0311e80c02ad25..b3390e29f8ca7bd9187035c429d5d27d3d31ade0 100644 (file)
 #ifndef CONFIG_H
 #define CONFIG_H
 
+/*
+ * Known predifined MS compiler version codes:
+ *  1700: MSVC++ 11.0 (Visual Studio 2012)
+ *  1600: MSVC++ 10.0 (Visual Studio 2010)
+ *  1500: MSVC++ 9.0  (Visual Studio 2008)
+ *  1400: MSVC++ 8.0  (Visual Studio 2005)
+ *  1310: MSVC++ 7.1  (Visual Studio 2003)
+ *  1300: MSVC++ 7.0
+ *  1200: MSVC++ 6.0  (Visual C++ 6)
+ *  1100: MSVC++ 5.0
+ */
+
 #if defined(_MSC_VER) && _MSC_VER < 1400
 #error Minimum supported Microsoft compiler is Visual C++ 2005.
 #endif
@@ -433,6 +445,40 @@ typedef unsigned long uintptr_t;
 
 #define NEED_S_CHAR_TYPEDEF
 
+
+/* C99 exact size integer support. */
+#if defined(_MSC_VER)
+# define MISSING_INTTYPES_H         1  /* not provided by VS2012 and earlier */
+# define MISSING_STDBOOL_H          1  /* not provided by VS2012 and earlier */
+# if _MSC_VER < 1600
+#  define MISSING_STDINT_H          1  /* not provided before VS2010 */
+# endif
+#else
+/* add defines for non-MS compilers here, if required */
+#endif
+
+#if !defined(MISSING_INTTYPES_H)
+# define HAVE_INTTYPES_H            1
+# include <inttypes.h>
+#elif !defined(MISSING_STDINT_H)
+# define HAVE_STDINT_H              1
+# include <stdint.h>
+#elif !defined(ADDED_EXACT_SIZE_INTEGERS)
+# define ADDED_EXACT_SIZE_INTEGERS  1
+  typedef __int8 int8_t;
+  typedef unsigned __int8 uint8_t;
+
+  typedef __int16 int16_t;
+  typedef unsigned __int16 uint16_t;
+
+  typedef __int32 int32_t;
+  typedef unsigned __int32 uint32_t;
+
+  typedef __int64 int64_t;
+  typedef unsigned __int64 uint64_t;
+#endif
+
+
 /* Directory separator, usually / or \ */
 #define        DIR_SEP '\\'