From 3f5d9074e4c40f09b015a515430715e8a66035c2 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Fri, 2 Nov 2018 23:10:44 +0100 Subject: [PATCH] Properly export the various 'use dGPU' symbols when building with MingW This fixes exporting the NvOptimusEnablement export when building with MingW. This also adds the equivalent for AMD. This fixes #23400 (cherry picked from commit 19d91f788d77227a7c00828bce6ffe91932cdcdd) --- platform/windows/os_windows.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index ae8f718fb01..2a5216a7179 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -57,11 +57,8 @@ static const WORD MAX_CONSOLE_LINES = 1500; extern "C" { -#ifdef _MSC_VER -_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; -#else -__attribute__((visibility("default"))) DWORD NvOptimusEnablement = 0x00000001; -#endif +__declspec(dllexport) DWORD NvOptimusEnablement = 1; +__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } // Workaround mingw-w64 < 4.0 bug