Define NOMINMAX to avoid defining MIN/MAX macros on Windows. Without defining NOMINMAX, MIN/MAX macro would affect other header/c++ files. Fixes #143

This commit is contained in:
Syoyo Fujita 2019-02-19 16:03:23 +09:00
parent 7ece5c8275
commit 7d9a0bda3a

View File

@ -1086,7 +1086,21 @@ class TinyGLTF {
#endif
#ifdef _WIN32
#include <windows.h>
// issue 143.
// Define NOMINMAX to avoid min/max defines,
// but undef it after included windows.h
#ifndef NOMINMAX
#define TINYGLTF_INTERNAL_NOMINMAX
#define NOMINMAX
#endif
#include <windows.h> // include API for expanding a file path
#if defined(TINYGLTF_INTERNAL_NOMINMAX)
#undef NOMINMAX
#endif
#elif !defined(__ANDROID__)
#include <wordexp.h>
#endif