From 776acf2182c9b99710aaf60dc5f3438b99eff1e0 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Thu, 24 Sep 2015 09:07:43 -0700 Subject: [PATCH 1/2] ignore gverb warnings --- libraries/audio-client/src/AudioClient.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp index 674d2f043e..b528b67745 100644 --- a/libraries/audio-client/src/AudioClient.cpp +++ b/libraries/audio-client/src/AudioClient.cpp @@ -38,11 +38,20 @@ #pragma GCC diagnostic ignored "-Wdouble-promotion" #endif +#ifdef WIN32 +#pragma warning (push) +#pragma warning (disable: 4273 4305) +#endif + extern "C" { #include #include } +#ifdef WIN32 +#pragma warning (pop) +#endif + #if defined(__GNUC__) && !defined(__clang__) #pragma GCC diagnostic pop #endif From 2eaeb26b2ae7475e11b45a6103e11e1841d9d2f6 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Thu, 24 Sep 2015 09:14:51 -0700 Subject: [PATCH 2/2] fix GetVersionEx warning --- interface/src/devices/3DConnexionClient.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/interface/src/devices/3DConnexionClient.cpp b/interface/src/devices/3DConnexionClient.cpp index b6f2aa8718..d49fafa3e0 100755 --- a/interface/src/devices/3DConnexionClient.cpp +++ b/interface/src/devices/3DConnexionClient.cpp @@ -160,6 +160,8 @@ ConnexionClient& ConnexionClient::getInstance() { #ifdef Q_OS_WIN +#include + void ConnexionClient::toggleConnexion(bool shouldEnable) { ConnexionData& connexiondata = ConnexionData::getInstance(); if (shouldEnable && connexiondata.getDeviceID() == 0) { @@ -425,18 +427,13 @@ bool ConnexionClient::InitializeRawInput(HWND hwndTarget) { return false; } - // FIXME - http://www.codeproject.com/Articles/678606/Part-Overcoming-Windows-s-deprecation-of-GetVe - // Get OS version. - OSVERSIONINFO osvi = { sizeof(OSVERSIONINFO), 0 }; - ::GetVersionEx(&osvi); - unsigned int cbSize = sizeof(devicesToRegister[0]); for (size_t i = 0; i < numDevices; i++) { // Set the target window to use //devicesToRegister[i].hwndTarget = hwndTarget; // If Vista or newer, enable receiving the WM_INPUT_DEVICE_CHANGE message. - if (osvi.dwMajorVersion >= 6) { + if (IsWindowsVistaOrGreater()) { devicesToRegister[i].dwFlags |= RIDEV_DEVNOTIFY; } }