A patch submitted for MinGW building.

git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@27757 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
John Kessenich 2014-08-18 19:42:35 +00:00
parent f51842e028
commit d6c72a44ab
3 changed files with 30 additions and 23 deletions

View File

@ -33,6 +33,7 @@
//POSSIBILITY OF SUCH DAMAGE.
#include <assert.h>
#include <stdio.h>
#include "BilBuilder.h"

View File

@ -887,7 +887,13 @@ int fopen_s(
char** ReadFileData(const char* fileName)
{
FILE *in;
#if defined(_WIN32) && defined(__GNUC__)
in = fopen(fileName, "r");
int errorCode = in ? 0 : 1;
#else
int errorCode = fopen_s(&in, fileName, "r");
#endif
char *fdata;
int count = 0;
const int maxSourceStrings = 5;

View File

@ -37,7 +37,7 @@
#ifndef _COMMON_INCLUDED_
#define _COMMON_INCLUDED_
#ifdef _WIN32
#if defined _WIN32 && !defined __GNUC__
#include <basetsd.h>
#define snprintf sprintf_s
#define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args))
@ -166,7 +166,7 @@ inline const TString String(const int i, const int base = 10)
{
char text[16]; // 32 bit ints are at most 10 digits in base 10
#ifdef _WIN32
#if defined _WIN32 && !defined __GNUC__
_itoa_s(i, text, base);
#else
// we assume base 10 for all cases