diff --git a/MobileGL/Defines.h b/MobileGL/Defines.h index 532df8dc..5fc3f202 100644 --- a/MobileGL/Defines.h +++ b/MobileGL/Defines.h @@ -6,7 +6,9 @@ #endif #ifdef _WIN32 -#define NOMINMAX // prevent Windows.h from defining min and max macros +# ifndef NOMINMAX +#define NOMINMAX 1 // prevent Windows.h from defining min and max macros +#endif #endif // ================== MobileGL definitions and macros =================== // diff --git a/MobileGL/Includes.h b/MobileGL/Includes.h index ebb5afdc..41de2941 100644 --- a/MobileGL/Includes.h +++ b/MobileGL/Includes.h @@ -63,7 +63,9 @@ #endif #ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN 1 +#endif #include #include #endif diff --git a/MobileGL/MG_Test/Buffer/BufferTest.cpp b/MobileGL/MG_Test/Buffer/BufferTest.cpp index 8c80e955..e3261e99 100644 --- a/MobileGL/MG_Test/Buffer/BufferTest.cpp +++ b/MobileGL/MG_Test/Buffer/BufferTest.cpp @@ -4,6 +4,10 @@ #include #include "Includes.h" +#include + +#include +#include using namespace MobileGL; diff --git a/MobileGL/MG_Test/Program/ProgramUtilTest.cpp b/MobileGL/MG_Test/Program/ProgramUtilTest.cpp index 454127f4..b6249bd1 100644 --- a/MobileGL/MG_Test/Program/ProgramUtilTest.cpp +++ b/MobileGL/MG_Test/Program/ProgramUtilTest.cpp @@ -4,6 +4,9 @@ #include #include "Includes.h" +#include +#include +#include using namespace MobileGL; class ProgramUtilTest : public ::testing::Test { diff --git a/MobileGL/MG_Test/VertexArray/VertexArrayTest.cpp b/MobileGL/MG_Test/VertexArray/VertexArrayTest.cpp index edfb9abc..af914b6b 100644 --- a/MobileGL/MG_Test/VertexArray/VertexArrayTest.cpp +++ b/MobileGL/MG_Test/VertexArray/VertexArrayTest.cpp @@ -1,5 +1,9 @@ #include #include "Includes.h" +#include +#include +#include +#include using namespace MobileGL; diff --git a/MobileGL/MG_Util/Debug/Log.cpp b/MobileGL/MG_Util/Debug/Log.cpp index dd3ee4cf..759acd37 100644 --- a/MobileGL/MG_Util/Debug/Log.cpp +++ b/MobileGL/MG_Util/Debug/Log.cpp @@ -21,13 +21,13 @@ namespace MobileGL { std::string GetThreadName() { char buffer[64] = { 0 }; -#if defined(_WIN32) +#if defined(_WIN32) && !defined(__MINGW32__) PWSTR desc = nullptr; if (SUCCEEDED(GetThreadDescription(GetCurrentThread(), &desc))) { WideCharToMultiByte(CP_UTF8, 0, desc, -1, buffer, sizeof(buffer), nullptr, nullptr); LocalFree(desc); } -#elif defined(__ANDROID__) || defined(__linux__) || defined(__APPLE__) +#elif defined(__ANDROID__) || defined(__linux__) || defined(__APPLE__) || defined(__MINGW32__) pthread_getname_np(pthread_self(), buffer, sizeof(buffer)); #endif return buffer[0] ? buffer : "UnknownThread";