Browse Source

include ms_stdint.h only when necessary

Julius Pfrommer 7 years ago
parent
commit
d77e1ad556
2 changed files with 8 additions and 2 deletions
  1. 7 1
      include/ua_config.h.in
  2. 1 1
      tools/amalgamate.py

+ 7 - 1
include/ua_config.h.in

@@ -50,7 +50,13 @@ extern "C" {
 #endif
 
 #include <stddef.h>
-#include "ms_stdint.h" /* Includes stdint.h or workaround for older Visual Studios */
+
+/* Include stdint.h or workaround for older Visual Studios */
+#if !defined(_MSC_VER) || _MSC_VER >= 1600
+# include <stdint.h>
+#else
+# include "ms_stdint.h"
+#endif
 
 #ifndef __cplusplus
 # include <stdbool.h> /* C99 Boolean */

+ 1 - 1
tools/amalgamate.py

@@ -21,7 +21,7 @@ if outname[-2:] == ".c":
 pos = outname.find(".")
 if pos > 0:
     outname = outname[:pos]
-include_re = re.compile("^#include (\".*\").*$")
+include_re = re.compile("^#[\s]*include (\".*\").*$")
 guard_re = re.compile("^#(?:(?:ifndef|define) [A-Z_]+_H_|endif /\* [A-Z_]+_H_ \*/|endif // [A-Z_]+_H_)")
 
 print ("Starting amalgamating file "+ args.outfile)