Common: include standard headers before doing any defines
authorChristopher Degawa <ccom@randomderp.com>
Sun, 12 Jul 2020 00:02:20 +0000 (00:02 +0000)
committerChristopher Degawa <ccom@randomderp.com>
Sun, 12 Jul 2020 00:06:35 +0000 (00:06 +0000)
commit8486b2e0db150a3e0761db6930a7b41cc7a8c83f
tree114a602cf485a7d3ecf34c5eaa80e42913b8f281
parent1ee5d1c0bb683daea245e8329fd619940a35a5b4
Common: include standard headers before doing any defines

currently, due to

```c++
\#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || defined MINGW_HAS_SECURE_API
    #include <basetsd.h>
    #ifndef snprintf
    #define snprintf sprintf_s
    #endif
    #define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args))
```

defining `snprintf` to `sprintf_s` essentially unconditionally, this will break the
stdio.h+cstdio system header for mingw-w64 g++ in msys2 with shaderc
https://github.com/google/shaderc/issues/1065

an alternative change would be
https://raw.githubusercontent.com/shinchiro/mpv-winbuild-cmake/master/packages/glslang-0001-fix-gcc-10.1-error.patch
in which the `|| defined MINGW_HAS_SECURE_API` part is removed

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
glslang/Include/Common.h