]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commit
vm_basic_types.h: use system headers for uint64_t, uintptr_t, size_t
authorOliver Kurth <okurth@vmware.com>
Tue, 5 Jun 2018 22:47:35 +0000 (15:47 -0700)
committerOliver Kurth <okurth@vmware.com>
Tue, 5 Jun 2018 22:47:35 +0000 (15:47 -0700)
commit140820c8bdc0d2d83909612bc0e877eaff8ff5d0
tree3b34514c7e6d247b21e3ca1b72c8b584a10238bb
parent5852956ccace7a55c3834dfbfaf15d1f45d6d0c0
vm_basic_types.h: use system headers for uint64_t, uintptr_t, size_t

Extensive rewrite. Basically standardizes on using stdint.h (C99)
and sys/types.h (POSIX) to define interesting types, with several
non-trivial caveats:
- stdint.h is not available on older Windows compilers. For now,
emulate with crtdefs.h + manual definitions.
- Linux kernel does not provide stdint.h (gcc-4.5+ does and it's
incompatible), and sys/types.h won't work at all.
However, linux/types.h gives everything we need.
- Linux kernel defines uint64_t as 'long long' (and uintptr_t as
'long' - yes, really), in contrast to Linux userlevel which defines
uint64_t as 'long'. Send Linux kernel down a different FMT64 path
so we don't get "%llx" / "%lx" mismatches.
- VMM and VMKernel don't provide sys/types.h (except VMK's FreeBSD
modules). Directly provide definitions here.

Net effect of this change is removal of two blocks of code that
provide our own definitions of uintptr_t/intptr_t/size_t/ssize_t.
Also pruned a few now-unneeded stdint.h and sys/types.h includes as well.

Curious observers will inquire why not get size_t from C99 standard
header stddef.h. Turns out that header is EXCEPTIONALLY hard to include,
which is why I'm using sys/types.h in most places. Actually using
stddef.h is left for a later change.
open-vm-tools/lib/include/vm_basic_types.h