]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
vm_basic_types.h: enable stdint.h for c99
authorOliver Kurth <okurth@vmware.com>
Tue, 6 Mar 2018 18:38:42 +0000 (10:38 -0800)
committerOliver Kurth <okurth@vmware.com>
Tue, 6 Mar 2018 18:38:42 +0000 (10:38 -0800)
C99 mode (a.k.a. __STDC_VERSION__ >= 199901L) guarantees
the stdint.h header will be present, which means we can use it
for standard types instead of rolling our own.

open-vm-tools/lib/include/vm_basic_types.h

index 6ed62f54788d14c62897991a6c3c121cc7ea7194..32e2a09d2dca6ad257326bd24897fbb492b30c1f 100644 (file)
 #endif
 
 #if defined(__cplusplus) && __cplusplus >= 201103L || \
+    defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L || \
     defined(__APPLE__) || defined(HAVE_STDINT_H)
 /*
- * TODO: C99 a.k.a. defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- * really should be in the above conditional. However, a non-trivial amount
- * of code tries to compile in C99 mode with broken stdint.h headers, so
- * C99 will need to use the fallback for now.
- */
-
-/*
- * We're using stdint.h instead of cstdint below because of libstdcpp.cpp.
- * It looks like a C++ file. When being preprocessed all the C++ specific
- * defines(e.g. __cplusplus) are set, but the C++ include paths are not.
+ * We're using <stdint.h> instead of <cstdint> below because some C++ code
+ * deliberately compiles without C++ include paths.
  */
 #include <stdint.h>