Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
d6c72a44
Commit
d6c72a44
authored
Aug 18, 2014
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
parent
f51842e0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
23 deletions
+30
-23
BilBuilder.cpp
BIL/BilBuilder.cpp
+1
-0
StandAlone.cpp
StandAlone/StandAlone.cpp
+27
-21
Common.h
glslang/Include/Common.h
+2
-2
No files found.
BIL/BilBuilder.cpp
View file @
d6c72a44
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
//POSSIBILITY OF SUCH DAMAGE.
//POSSIBILITY OF SUCH DAMAGE.
#include <assert.h>
#include <assert.h>
#include <stdio.h>
#include "BilBuilder.h"
#include "BilBuilder.h"
...
...
StandAlone/StandAlone.cpp
View file @
d6c72a44
...
@@ -53,10 +53,10 @@ extern "C" {
...
@@ -53,10 +53,10 @@ extern "C" {
// Command-line options
// Command-line options
enum
TOptions
{
enum
TOptions
{
EOptionNone
=
0x000
,
EOptionNone
=
0x000
,
EOptionIntermediate
=
0x001
,
EOptionIntermediate
=
0x001
,
EOptionSuppressInfolog
=
0x002
,
EOptionSuppressInfolog
=
0x002
,
EOptionMemoryLeakMode
=
0x004
,
EOptionMemoryLeakMode
=
0x004
,
EOptionRelaxedErrors
=
0x008
,
EOptionRelaxedErrors
=
0x008
,
EOptionGiveWarnings
=
0x010
,
EOptionGiveWarnings
=
0x010
,
EOptionsLinkProgram
=
0x020
,
EOptionsLinkProgram
=
0x020
,
...
@@ -887,13 +887,19 @@ int fopen_s(
...
@@ -887,13 +887,19 @@ int fopen_s(
char
**
ReadFileData
(
const
char
*
fileName
)
char
**
ReadFileData
(
const
char
*
fileName
)
{
{
FILE
*
in
;
FILE
*
in
;
int
errorCode
=
fopen_s
(
&
in
,
fileName
,
"r"
);
#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
;
char
*
fdata
;
int
count
=
0
;
int
count
=
0
;
const
int
maxSourceStrings
=
5
;
const
int
maxSourceStrings
=
5
;
char
**
return_data
=
(
char
**
)
malloc
(
sizeof
(
char
*
)
*
(
maxSourceStrings
+
1
));
char
**
return_data
=
(
char
**
)
malloc
(
sizeof
(
char
*
)
*
(
maxSourceStrings
+
1
));
if
(
errorCode
)
{
if
(
errorCode
)
{
printf
(
"Error: unable to open input file: %s
\n
"
,
fileName
);
printf
(
"Error: unable to open input file: %s
\n
"
,
fileName
);
return
0
;
return
0
;
}
}
...
@@ -901,13 +907,13 @@ char** ReadFileData(const char* fileName)
...
@@ -901,13 +907,13 @@ char** ReadFileData(const char* fileName)
while
(
fgetc
(
in
)
!=
EOF
)
while
(
fgetc
(
in
)
!=
EOF
)
count
++
;
count
++
;
fseek
(
in
,
0
,
SEEK_SET
);
fseek
(
in
,
0
,
SEEK_SET
);
if
(
!
(
fdata
=
(
char
*
)
malloc
(
count
+
2
)))
{
if
(
!
(
fdata
=
(
char
*
)
malloc
(
count
+
2
)))
{
printf
(
"Error allocating memory
\n
"
);
printf
(
"Error allocating memory
\n
"
);
return
0
;
return
0
;
}
}
if
(
fread
(
fdata
,
1
,
count
,
in
)
!=
count
)
{
if
(
fread
(
fdata
,
1
,
count
,
in
)
!=
count
)
{
printf
(
"Error reading input file: %s
\n
"
,
fileName
);
printf
(
"Error reading input file: %s
\n
"
,
fileName
);
return
0
;
return
0
;
}
}
...
@@ -921,23 +927,23 @@ char** ReadFileData(const char* fileName)
...
@@ -921,23 +927,23 @@ char** ReadFileData(const char* fileName)
}
else
}
else
NumShaderStrings
=
1
;
NumShaderStrings
=
1
;
int
len
=
(
int
)(
ceil
)((
float
)
count
/
(
float
)
NumShaderStrings
);
int
len
=
(
int
)(
ceil
)((
float
)
count
/
(
float
)
NumShaderStrings
);
int
ptr_len
=
0
,
i
=
0
;
int
ptr_len
=
0
,
i
=
0
;
while
(
count
>
0
){
while
(
count
>
0
){
return_data
[
i
]
=
(
char
*
)
malloc
(
len
+
2
);
return_data
[
i
]
=
(
char
*
)
malloc
(
len
+
2
);
memcpy
(
return_data
[
i
],
fdata
+
ptr_len
,
len
);
memcpy
(
return_data
[
i
],
fdata
+
ptr_len
,
len
);
return_data
[
i
][
len
]
=
'\0'
;
return_data
[
i
][
len
]
=
'\0'
;
count
-=
(
len
);
count
-=
(
len
);
ptr_len
+=
(
len
);
ptr_len
+=
(
len
);
if
(
count
<
len
){
if
(
count
<
len
){
if
(
count
==
0
){
if
(
count
==
0
){
NumShaderStrings
=
(
i
+
1
);
NumShaderStrings
=
(
i
+
1
);
break
;
break
;
}
}
len
=
count
;
len
=
count
;
}
}
++
i
;
++
i
;
}
}
return
return_data
;
return
return_data
;
}
}
...
...
glslang/Include/Common.h
View file @
d6c72a44
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#ifndef _COMMON_INCLUDED_
#ifndef _COMMON_INCLUDED_
#define _COMMON_INCLUDED_
#define _COMMON_INCLUDED_
#if
def _WIN32
#if
defined _WIN32 && !defined __GNUC__
#include <basetsd.h>
#include <basetsd.h>
#define snprintf sprintf_s
#define snprintf sprintf_s
#define safe_vsprintf(buf,max,format,args) vsnprintf_s((buf), (max), (max), (format), (args))
#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)
...
@@ -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
char
text
[
16
];
// 32 bit ints are at most 10 digits in base 10
#if
def _WIN32
#if
defined _WIN32 && !defined __GNUC__
_itoa_s
(
i
,
text
,
base
);
_itoa_s
(
i
,
text
,
base
);
#else
#else
// we assume base 10 for all cases
// we assume base 10 for all cases
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment