mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-10 04:20:06 +00:00
Get a clean g++/gcc build. Runs and gets correct results on linux.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20820 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
cfd643e447
commit
20169715df
@ -9,4 +9,11 @@ oanot */
|
||||
// escape nothing \o oeu
|
||||
// escape newline \
|
||||
still in a comment
|
||||
// escape newline \
|
||||
|
||||
// a different comment
|
||||
#version 430 core
|
||||
varying vec4 v;
|
||||
void main() {}
|
||||
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
//POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
|
||||
#include "float.h"
|
||||
#include "localintermediate.h"
|
||||
|
||||
namespace {
|
||||
|
@ -87,7 +87,6 @@ struct TParseContext {
|
||||
EProfile profile; // the declared profile in the shader (core by default)
|
||||
bool forwardCompatible; // true if errors are to be given for use of deprecated features
|
||||
EShMessages messages; // errors/warnings
|
||||
bool futureCompatibility; // true if requesting errors for future compatibility (false by default)
|
||||
TMap<TString, TBehavior> extensionBehavior; // for each extension string, what it's current enablement is
|
||||
|
||||
struct TPragma contextPragma;
|
||||
|
@ -212,42 +212,42 @@ bool ConsumeWhitespaceComment(const char*& s)
|
||||
const char* startPoint = s;
|
||||
|
||||
// first, skip white space
|
||||
while (*s == ' ' || *s == '\t' || *s == '\n' || *s == '\r') {
|
||||
while (*s == ' ' || *s == '\t' || *s == '\r' || *s == '\n') {
|
||||
++s;
|
||||
}
|
||||
|
||||
// then, check for a comment
|
||||
if (*s == '/') {
|
||||
if (*(s+1) == '/') {
|
||||
|
||||
// a '//' style comment
|
||||
s += 2;
|
||||
do {
|
||||
while (*s && *s != '\\' && *s != '\n')
|
||||
while (*s && *s != '\\' && *s != '\r' && *s != '\n')
|
||||
++s;
|
||||
|
||||
if (*s == '\n' || *s == 0) {
|
||||
if (*s == '\n') {
|
||||
if (*s == '\r' || *s == '\n' || *s == 0) {
|
||||
while (*s == '\r' || *s == '\n')
|
||||
++s;
|
||||
if (*s == '\r')
|
||||
++s;
|
||||
} // else it's 0, end of string
|
||||
|
||||
// we reached the end of the comment
|
||||
break;
|
||||
} else {
|
||||
// it's a '\', so we need to keep going, after skipping what's escaped
|
||||
++s;
|
||||
if (*s == '\n') {
|
||||
++s;
|
||||
if (*s == '\r')
|
||||
++s;
|
||||
} else {
|
||||
if (*s == '\r' && *(s+1) == '\n')
|
||||
s += 2;
|
||||
else {
|
||||
// skip the escaped character
|
||||
if (*s)
|
||||
++s;
|
||||
}
|
||||
}
|
||||
} while (true);
|
||||
|
||||
} else if (*(s+1) == '*') {
|
||||
|
||||
// a '/*' style comment
|
||||
s += 2;
|
||||
do {
|
||||
while (*s && *s != '*')
|
||||
@ -318,7 +318,7 @@ void ScanVersion(const char* const shaderStrings[], int numStrings, int& version
|
||||
|
||||
// profile
|
||||
const char* end = s;
|
||||
while (*end != ' ' && *end != '\t' && *end != '\n') {
|
||||
while (*end != ' ' && *end != '\t' && *end != '\n' && *end != '\r') {
|
||||
if (*end == 0)
|
||||
return;
|
||||
++end;
|
||||
|
@ -44,7 +44,7 @@
|
||||
|
||||
#include "ParseHelper.h"
|
||||
|
||||
char* StageName[EShLangCount] = {
|
||||
const char* StageName[EShLangCount] = {
|
||||
"vertex",
|
||||
"tessellation control",
|
||||
"tessellation evaluation",
|
||||
@ -52,7 +52,7 @@ char* StageName[EShLangCount] = {
|
||||
"fragment"
|
||||
};
|
||||
|
||||
char* ProfileName[EProfileCount] = {
|
||||
const char* ProfileName[EProfileCount] = {
|
||||
"none",
|
||||
"core",
|
||||
"compatibility",
|
||||
|
@ -527,7 +527,7 @@ int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseCon
|
||||
return 0;
|
||||
}
|
||||
|
||||
void yyerror(char *s)
|
||||
void yyerror(const char *s)
|
||||
{
|
||||
TParseContext& pc = *((TParseContext *)cpp->pC);
|
||||
|
||||
@ -572,7 +572,7 @@ int PaIdentOrReserved(bool reserved, TParseContext& pc, int line, const char* te
|
||||
|
||||
pyylval->lex.line = line;
|
||||
pyylval->lex.string = NewPoolTString(text);
|
||||
if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);
|
||||
pc.infoSink.info.message(EPrefixWarning, "using future reserved keyword", yylineno);
|
||||
}
|
||||
@ -586,7 +586,7 @@ int PaES30ReservedFromGLSL(int version, TParseContext& pc, int line, const char*
|
||||
pc.profile != EEsProfile && pc.version < version) {
|
||||
pyylval->lex.line = yylineno;
|
||||
pyylval->lex.string = NewPoolTString(yytext);
|
||||
if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);
|
||||
pc.infoSink.info.message(EPrefixWarning, "future reserved word in ES 300 and keyword in GLSL", yylineno);
|
||||
}
|
||||
@ -609,7 +609,7 @@ int PaPrecisionKeyword(TParseContext& pc, int line, const char* text, YYSTYPE* p
|
||||
|
||||
pyylval->lex.line = line;
|
||||
pyylval->lex.string = NewPoolTString(text);
|
||||
if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);
|
||||
pc.infoSink.info.message(EPrefixWarning, "using ES precision qualifier keyword", yylineno);
|
||||
}
|
||||
@ -624,7 +624,7 @@ int PaMatNxM(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, in
|
||||
|
||||
pyylval->lex.line = line;
|
||||
pyylval->lex.string = NewPoolTString(text);
|
||||
if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);
|
||||
pc.infoSink.info.message(EPrefixWarning, "using future non-square matrix type keyword", yylineno);
|
||||
}
|
||||
@ -644,7 +644,7 @@ int PaDMat(TParseContext& pc, int line, const char* text, YYSTYPE* pyylval, int
|
||||
|
||||
pyylval->lex.line = line;
|
||||
pyylval->lex.string = NewPoolTString(text);
|
||||
if (pc.futureCompatibility && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
if (pc.forwardCompatible && ! (pc.messages & EShMsgSuppressWarnings)) {
|
||||
pc.infoSink.info.message(EPrefixWarning, pyylval->lex.string->c_str(), yylineno);
|
||||
pc.infoSink.info.message(EPrefixWarning, "using future type keyword", yylineno);
|
||||
}
|
||||
|
@ -69,9 +69,10 @@ Jutta Degener, 1995
|
||||
#define parseContext (*((TParseContext*)(parseContextLocal)))
|
||||
#define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal)
|
||||
#define YYLEX_PARAM (void*)(parseContextLocal)
|
||||
extern void yyerror(char*);
|
||||
#endif
|
||||
|
||||
extern void yyerror(const char*);
|
||||
|
||||
%}
|
||||
|
||||
%union {
|
||||
|
@ -78,14 +78,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <stdint.h>
|
||||
#elif defined (_WIN64)
|
||||
typedef unsigned __int64 uintptr_t;
|
||||
#else
|
||||
typedef unsigned int uintptr_t;
|
||||
#endif
|
||||
|
||||
#include "memory.h"
|
||||
|
||||
|
@ -39,10 +39,6 @@
|
||||
// This file contains any Linux specific functions.
|
||||
//
|
||||
|
||||
#if !(defined(linux))
|
||||
#error Trying to include a Linux specific file in a non-Linux build.
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
#include <assert.h>
|
||||
|
@ -38,11 +38,6 @@
|
||||
#include "osinclude.h"
|
||||
#include "InitializeDll.h"
|
||||
|
||||
#if !(defined(linux))
|
||||
#error Trying to build a Linux specific file in a non-Linux build.
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Thread cleanup
|
||||
//
|
||||
|
@ -87,7 +87,7 @@ typedef enum {
|
||||
EShLangFragmentMask = (1 << EShLangFragment),
|
||||
} EShLanguageMask;
|
||||
|
||||
extern char* StageName[EShLangCount];
|
||||
extern const char* StageName[EShLangCount];
|
||||
|
||||
//
|
||||
// Types of output the linker will create.
|
||||
@ -121,7 +121,7 @@ enum EShMessages {
|
||||
// attributes, uniforms, globals, etc., as needed.
|
||||
//
|
||||
typedef struct {
|
||||
char* name;
|
||||
const char* name;
|
||||
int binding;
|
||||
} ShBinding;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user