Removed the compile flag to select between preprocessors, always using the new one.

TRAC #21966 Signed-off-by: Daniel Koch Author: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1324 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent ca9a3c87
......@@ -10,7 +10,6 @@
'defines': [
'ANGLE_DISABLE_TRACE',
'ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0',
'ANGLE_USE_NEW_PREPROCESSOR=1',
],
},
'targets': [
......
#define MAJOR_VERSION 1
#define MINOR_VERSION 0
#define BUILD_VERSION 0
#define BUILD_REVISION 1323
#define BUILD_REVISION 1324
#define STRINGIFY(x) #x
#define MACRO_STRINGIFY(x) STRINGIFY(x)
......
......@@ -400,18 +400,12 @@ void updateExtensionBehavior(const char* extName, const char* behavior)
} // extern "C"
int string_input(char* buf, int max_size, yyscan_t yyscanner) {
int len = 0;
#if ANGLE_USE_NEW_PREPROCESSOR
pp::Token token;
yyget_extra(yyscanner)->preprocessor.lex(&token);
len = token.type == pp::Token::LAST ? 0 : token.text.size();
int len = token.type == pp::Token::LAST ? 0 : token.text.size();
if ((len > 0) && (len < max_size))
memcpy(buf, token.text.c_str(), len);
yyset_lineno(EncodeSourceLoc(token.location.file, token.location.line), yyscanner);
#else
len = yylex_CPP(buf, max_size);
#endif // ANGLE_USE_NEW_PREPROCESSOR
if (len >= max_size)
YY_FATAL_ERROR("Input buffer overflow");
......@@ -471,9 +465,6 @@ int glslang_finalize(TParseContext* context) {
context->scanner = NULL;
yylex_destroy(scanner);
#if !ANGLE_USE_NEW_PREPROCESSOR
FinalizePreprocessor();
#endif
return 0;
}
......@@ -484,27 +475,14 @@ int glslang_scan(int count, const char* const string[], const int length[],
context->AfterEOF = false;
// Initialize preprocessor.
#if ANGLE_USE_NEW_PREPROCESSOR
if (!context->preprocessor.init(count, string, length))
return 1;
#else
if (InitPreprocessor())
return 1;
cpp->pC = context;
cpp->pastFirstStatement = 0;
if (InitScannerInput(cpp, count, string, length))
return 1;
#endif // ANGLE_USE_NEW_PREPROCESSOR
// Define extension macros.
const TExtensionBehavior& extBehavior = context->extensionBehavior();
for (TExtensionBehavior::const_iterator iter = extBehavior.begin();
iter != extBehavior.end(); ++iter) {
#if ANGLE_USE_NEW_PREPROCESSOR
context->preprocessor.predefineMacro(iter->first.c_str(), 1);
#else
PredefineIntMacro(iter->first.c_str(), 1);
#endif
}
return 0;
}
......
......@@ -3076,18 +3076,12 @@ void updateExtensionBehavior(const char* extName, const char* behavior)
} // extern "C"
int string_input(char* buf, int max_size, yyscan_t yyscanner) {
int len = 0;
#if ANGLE_USE_NEW_PREPROCESSOR
pp::Token token;
yyget_extra(yyscanner)->preprocessor.lex(&token);
len = token.type == pp::Token::LAST ? 0 : token.text.size();
int len = token.type == pp::Token::LAST ? 0 : token.text.size();
if ((len > 0) && (len < max_size))
memcpy(buf, token.text.c_str(), len);
yyset_lineno(EncodeSourceLoc(token.location.file, token.location.line),yyscanner);
#else
len = yylex_CPP(buf, max_size);
#endif // ANGLE_USE_NEW_PREPROCESSOR
if (len >= max_size)
YY_FATAL_ERROR("Input buffer overflow");
......@@ -3147,9 +3141,6 @@ int glslang_finalize(TParseContext* context) {
context->scanner = NULL;
yylex_destroy(scanner);
#if !ANGLE_USE_NEW_PREPROCESSOR
FinalizePreprocessor();
#endif
return 0;
}
......@@ -3160,27 +3151,14 @@ int glslang_scan(int count, const char* const string[], const int length[],
context->AfterEOF = false;
// Initialize preprocessor.
#if ANGLE_USE_NEW_PREPROCESSOR
if (!context->preprocessor.init(count, string, length))
return 1;
#else
if (InitPreprocessor())
return 1;
cpp->pC = context;
cpp->pastFirstStatement = 0;
if (InitScannerInput(cpp, count, string, length))
return 1;
#endif // ANGLE_USE_NEW_PREPROCESSOR
// Define extension macros.
const TExtensionBehavior& extBehavior = context->extensionBehavior();
for (TExtensionBehavior::const_iterator iter = extBehavior.begin();
iter != extBehavior.end(); ++iter) {
#if ANGLE_USE_NEW_PREPROCESSOR
context->preprocessor.predefineMacro(iter->first.c_str(), 1);
#else
PredefineIntMacro(iter->first.c_str(), 1);
#endif
}
return 0;
}
......
......@@ -73,7 +73,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;ANGLE_USE_NEW_PREPROCESSOR=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
......@@ -109,7 +109,7 @@
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;ANGLE_USE_NEW_PREPROCESSOR=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment