From: John Wolfe Date: Fri, 11 Sep 2020 19:11:05 +0000 (-0700) Subject: hostinfo.h: stop including x86cpuid.h X-Git-Tag: stable-11.2.0~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c40ef8aa76485edbc322711cae34cb75df56d2a;p=thirdparty%2Fopen-vm-tools.git hostinfo.h: stop including x86cpuid.h With the removal of Hostinfo_GetAllCpuid in an earlier change, hostinfo.h can stop including x86cpuid.h and only needs vendor IDs from x86vendor.h. Unfortunately, quite a few source files depended in hostinfo.h's automatic inclusion of x86cpuid.h. Fix them to include what they need. The lib/include/guestStats.h is a special case that happened to succeed because of a warning that was disabled in x86cpuid.h which also happens to have been included earlier than this header. Re-disable the warning. --- diff --git a/open-vm-tools/lib/include/guestStats.h b/open-vm-tools/lib/include/guestStats.h index 4f5fa6d88..a52df0c6a 100644 --- a/open-vm-tools/lib/include/guestStats.h +++ b/open-vm-tools/lib/include/guestStats.h @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2008-2018 VMware, Inc. All rights reserved. + * Copyright (C) 2008-2018,2020 VMware, Inc. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as published @@ -121,6 +121,10 @@ struct GuestStatHeader { #include "vmware_pack_end.h" GuestStatHeader; +#ifdef _MSC_VER +#pragma warning (disable :4200) // non-std extension: zero-sized array in struct +#endif + typedef #include "vmware_pack_begin.h" struct GuestDatumHeader { diff --git a/open-vm-tools/lib/include/hostinfo.h b/open-vm-tools/lib/include/hostinfo.h index 74142a204..40552d0f9 100644 --- a/open-vm-tools/lib/include/hostinfo.h +++ b/open-vm-tools/lib/include/hostinfo.h @@ -32,7 +32,7 @@ #include "vm_basic_types.h" #include "vm_basic_defs.h" -#include "x86cpuid.h" +#include "x86vendor.h" #include "unicodeTypes.h" #if defined(__cplusplus) diff --git a/open-vm-tools/lib/vmCheck/vmcheck.c b/open-vm-tools/lib/vmCheck/vmcheck.c index bd857b44d..3277f0c4b 100644 --- a/open-vm-tools/lib/vmCheck/vmcheck.c +++ b/open-vm-tools/lib/vmCheck/vmcheck.c @@ -42,6 +42,7 @@ #if !defined(WINNT_DDK) # include "hostinfo.h" # include "str.h" +# include "x86cpuid.h" #endif /*