windows: disable C4200 directly in libusb.h

This commit is contained in:
Shawn Hoffman 2020-08-20 13:52:54 -07:00
parent 7705f7c1a3
commit 390f509bbf
4 changed files with 13 additions and 22 deletions

View File

@ -25,6 +25,9 @@
#define LIBUSB_H #define LIBUSB_H
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(push)
/* Disable: warning C4200: nonstandard extension used : zero-sized array in struct/union */
#pragma warning(disable:4200)
/* on MS environments, the inline keyword is available in C++ only */ /* on MS environments, the inline keyword is available in C++ only */
#if !defined(__cplusplus) #if !defined(__cplusplus)
#define inline __inline #define inline __inline
@ -2059,6 +2062,10 @@ enum libusb_option {
int LIBUSB_CALL libusb_set_option(libusb_context *ctx, enum libusb_option option, ...); int LIBUSB_CALL libusb_set_option(libusb_context *ctx, enum libusb_option option, ...);
#ifdef _MSC_VER
#pragma warning(pop)
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -211,15 +211,9 @@
<ClCompile Include="IOS\SDIO\SDIOSlot0.cpp" /> <ClCompile Include="IOS\SDIO\SDIOSlot0.cpp" />
<ClCompile Include="IOS\STM\STM.cpp" /> <ClCompile Include="IOS\STM\STM.cpp" />
<ClCompile Include="IOS\USB\Common.cpp" /> <ClCompile Include="IOS\USB\Common.cpp" />
<ClCompile Include="IOS\USB\LibusbDevice.cpp"> <ClCompile Include="IOS\USB\LibusbDevice.cpp" />
<DisableSpecificWarnings>4200;%(DisableSpecificWarnings)</DisableSpecificWarnings> <ClCompile Include="LibusbUtils.cpp" />
</ClCompile> <ClCompile Include="IOS\USB\Host.cpp" />
<ClCompile Include="LibusbUtils.cpp">
<DisableSpecificWarnings>4200;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="IOS\USB\Host.cpp">
<DisableSpecificWarnings>4200;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="IOS\USB\OH0\OH0.cpp" /> <ClCompile Include="IOS\USB\OH0\OH0.cpp" />
<ClCompile Include="IOS\USB\OH0\OH0Device.cpp" /> <ClCompile Include="IOS\USB\OH0\OH0Device.cpp" />
<ClCompile Include="IOS\USB\USB_HID\HIDv4.cpp" /> <ClCompile Include="IOS\USB\USB_HID\HIDv4.cpp" />
@ -232,9 +226,7 @@
<ClCompile Include="IOS\USB\Bluetooth\BTBase.cpp" /> <ClCompile Include="IOS\USB\Bluetooth\BTBase.cpp" />
<ClCompile Include="IOS\USB\Bluetooth\BTEmu.cpp" /> <ClCompile Include="IOS\USB\Bluetooth\BTEmu.cpp" />
<ClCompile Include="IOS\USB\Bluetooth\BTStub.cpp" /> <ClCompile Include="IOS\USB\Bluetooth\BTStub.cpp" />
<ClCompile Include="IOS\USB\Bluetooth\BTReal.cpp"> <ClCompile Include="IOS\USB\Bluetooth\BTReal.cpp" />
<DisableSpecificWarnings>4200;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="IOS\USB\Bluetooth\WiimoteDevice.cpp" /> <ClCompile Include="IOS\USB\Bluetooth\WiimoteDevice.cpp" />
<ClCompile Include="IOS\USB\Bluetooth\WiimoteHIDAttr.cpp" /> <ClCompile Include="IOS\USB\Bluetooth\WiimoteHIDAttr.cpp" />
<ClCompile Include="IOS\WFS\WFSI.cpp" /> <ClCompile Include="IOS\WFS\WFSI.cpp" />

View File

@ -50,13 +50,7 @@
<ClCompile Include="ControllerInterface\Wiimote\Wiimote.cpp" /> <ClCompile Include="ControllerInterface\Wiimote\Wiimote.cpp" />
<ClCompile Include="ControllerInterface\XInput\XInput.cpp" /> <ClCompile Include="ControllerInterface\XInput\XInput.cpp" />
<ClCompile Include="ControlReference\FunctionExpression.cpp" /> <ClCompile Include="ControlReference\FunctionExpression.cpp" />
<ClCompile Include="GCAdapter.cpp"> <ClCompile Include="GCAdapter.cpp" />
<!--
Disable "nonstandard extension used : zero-sized array in struct/union" warning,
which is hit in libusb.h.
-->
<DisableSpecificWarnings>4200;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="InputConfig.cpp" /> <ClCompile Include="InputConfig.cpp" />
<ClCompile Include="InputProfile.cpp" /> <ClCompile Include="InputProfile.cpp" />
</ItemGroup> </ItemGroup>

View File

@ -42,9 +42,7 @@
<ClCompile Include="ResourcePack\ResourcePack.cpp" /> <ClCompile Include="ResourcePack\ResourcePack.cpp" />
<ClCompile Include="UICommon.cpp" /> <ClCompile Include="UICommon.cpp" />
<ClCompile Include="Disassembler.cpp" /> <ClCompile Include="Disassembler.cpp" />
<ClCompile Include="USBUtils.cpp"> <ClCompile Include="USBUtils.cpp" />
<DisableSpecificWarnings>4200;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<ClCompile Include="VideoUtils.cpp" /> <ClCompile Include="VideoUtils.cpp" />
<ClCompile Include="GameFile.cpp" /> <ClCompile Include="GameFile.cpp" />
<ClCompile Include="GameFileCache.cpp" /> <ClCompile Include="GameFileCache.cpp" />