| From d456b8d857ab761523a04834b68d067f600b9f34 Mon Sep 17 00:00:00 2001 |
| From: Ray Donnelly <mingw.android@gmail.com> |
| Date: Wed, 22 Jul 2015 15:26:23 +0100 |
| Subject: [PATCH 3/4] hlsl2glsltest: Change _MSC_VER to _WIN32 |
| |
| So that it can be build with MinGW-w64 |
| --- |
| tests/hlsl2glsltest/hlsl2glsltest.cpp | 14 +++++++------- |
| 1 file changed, 7 insertions(+), 7 deletions(-) |
| |
| diff --git a/tests/hlsl2glsltest/hlsl2glsltest.cpp b/tests/hlsl2glsltest/hlsl2glsltest.cpp |
| index a9df844..6de5308 100644 |
| --- a/tests/hlsl2glsltest/hlsl2glsltest.cpp |
| +++ b/tests/hlsl2glsltest/hlsl2glsltest.cpp |
| @@ -10,7 +10,7 @@ |
| static const bool kDumpShaderAST = false; |
| |
| |
| -#ifdef _MSC_VER |
| +#ifdef _WIN32 |
| #include <windows.h> |
| #include <gl/GL.h> |
| #include <cstdarg> |
| @@ -95,7 +95,7 @@ static StringVector GetFiles (const std::string& folder, const std::string& ends |
| { |
| StringVector res; |
| |
| - #ifdef _MSC_VER |
| + #ifdef _WIN32 |
| WIN32_FIND_DATAA FindFileData; |
| HANDLE hFind = FindFirstFileA ((folder+"/*"+endsWith).c_str(), &FindFileData); |
| if (hFind == INVALID_HANDLE_VALUE) |
| @@ -133,7 +133,7 @@ static StringVector GetFiles (const std::string& folder, const std::string& ends |
| |
| static void DeleteFile (const std::string& path) |
| { |
| - #ifdef _MSC_VER |
| + #ifdef _WIN32 |
| DeleteFileA (path.c_str()); |
| #else |
| unlink (path.c_str()); |
| @@ -142,15 +142,15 @@ static void DeleteFile (const std::string& path) |
| |
| static bool ReadStringFromFile (const char* pathName, std::string& output) |
| { |
| -# ifdef _MSC_VER |
| +# ifdef _WIN32 |
| wchar_t widePath[MAX_PATH]; |
| int res = ::MultiByteToWideChar (CP_UTF8, 0, pathName, -1, widePath, MAX_PATH); |
| if (res == 0) |
| widePath[0] = 0; |
| FILE* file = _wfopen(widePath, L"rb"); |
| -# else // ifdef _MSC_VER |
| +# else // ifdef _WIN32 |
| FILE* file = fopen(pathName, "rb"); |
| -# endif // !ifdef _MSC_VER |
| +# endif // !ifdef _WIN32 |
| |
| if (file == NULL) |
| return false; |
| @@ -196,7 +196,7 @@ static bool InitializeOpenGL () |
| |
| bool hasGLSL = false; |
| |
| -#ifdef _MSC_VER |
| +#ifdef _WIN32 |
| // setup minimal required GL |
| HWND wnd = CreateWindowA( |
| "STATIC", |
| -- |
| 2.5.0 |
| |