]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common header file change not directly applicable to open-vm-tools.
authorJohn Wolfe <jwolfe@vmware.com>
Tue, 22 Sep 2020 21:54:06 +0000 (14:54 -0700)
committerJohn Wolfe <jwolfe@vmware.com>
Tue, 22 Sep 2020 21:54:06 +0000 (14:54 -0700)
open-vm-tools/lib/include/vm_basic_types.h

index d9a1ca77c478e2c6a60793956f77d28c90039950..e46c789fbf4e31c96137465dd92d861779662df0 100644 (file)
 
 /*
  * C99 <stdint.h> or equivalent
- * Special cases:
- * - Linux kernel lacks <stdint.h>, preferring <linux/types.h>
+ * Userlevel: 100% <stdint.h>
+ * - gcc-4.5 or later, and earlier for some sysroots
+ * - vs2010 or later
+ * Kernel: <stdint.h> is often unavailable (and no common macros)
+ * - Linux: uses <linux/types.h> instead
  *   (and defines uintptr_t since 2.6.24, but not intptr_t)
- * - Solaris collides with gcc <stdint.h>, but has <sys/stdint.h>
- * - VMKernel + FreeBSD collides with gcc <stdint.h>, but has <sys/stdint.h>
- * - VMKernel (+DECODERLIB) share macros with Linux kernel
- * - Windows only added <stdint.h> in vc10/vs2010 (MSC ver 1600),
- *   and WDKs lack it.
+ * - Solaris: conflicts with gcc <stdint.h>, but has <sys/stdint.h>
+ * - VMKernel + FreeBSD combination collides with gcc <stdint.h>,
+ *   but has <sys/stdint.h>
+ * - Windows: some types in <crtdefs.h>, no definitions for other types.
  *
  * NB about LLP64 in LP64 environments:
  * - Apple uses 'long long' uint64_t
  * - Linux kernel uses 'long long' uint64_t
  * - Linux userlevel uses 'long' uint64_t
+ * - Windows uses 'long long' uint64_t
  */
 #if !defined(VMKERNEL) && !defined(DECODERLIB) && \
     defined(__linux__) && defined(__KERNEL__)
       (defined(VMKERNEL) && defined(__FreeBSD__)) || \
       defined(_SYS_STDINT_H_)
 #  include <sys/stdint.h>
-#elif !defined(_MSC_VER)
-   /* Common case */
-#  include <stdint.h>
-#else
-   /* COMPAT: until pre-vc10 is retired */
+#elif defined(_MSC_VER) && defined(_KERNEL_MODE)
+   /* Windows driver headers (km/crt) lack stdint.h */
 #  include <crtdefs.h>  // uintptr_t
    typedef unsigned __int64   uint64_t;
    typedef unsigned int       uint32_t;
    typedef int                int32_t;
    typedef short              int16_t;
    typedef signed char        int8_t;
+#else
+   /* Common case */
+#  include <stdint.h>
 #endif
 
 /*