Add flex version selection of the yywrap() function to support

the new and more correct version 2.5.34.
This commit is contained in:
henry 2008-05-29 23:29:28 +01:00
parent ff6dd11bc2
commit 8dc018bb53
6 changed files with 81 additions and 56 deletions

View File

@ -70,7 +70,11 @@ PtrList<SLList<label> > slPatchCellFaces;
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
#if YY_FLEX_SUBMINOR_VERSION < 34
extern "C" int yywrap()
#else
int yyFlexLexer::yywrap()
#endif
{
return 1;
}

View File

@ -116,7 +116,11 @@ void uniquify(word& name, HashSet<word>& patchNames)
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
#if YY_FLEX_SUBMINOR_VERSION < 34
extern "C" int yywrap()
#else
int yyFlexLexer::yywrap()
#endif
{
return 1;
}

View File

@ -102,7 +102,11 @@ wordList patchNameIDs(maxZoneID);
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
#if YY_FLEX_SUBMINOR_VERSION < 34
extern "C" int yywrap()
#else
int yyFlexLexer::yywrap()
#endif
{
return 1;
}

View File

@ -78,7 +78,11 @@ label nValuesForPatchFaces = 0;
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
#if YY_FLEX_SUBMINOR_VERSION < 34
extern "C" int yywrap()
#else
int yyFlexLexer::yywrap()
#endif
{
return 1;
}

View File

@ -50,7 +50,11 @@ int yyFlexLexer::yylex()
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
#if YY_FLEX_SUBMINOR_VERSION < 34
extern "C" int yywrap()
#else
int yyFlexLexer::yywrap()
#endif
{
return 1;
}

View File

@ -51,7 +51,11 @@ int yyFlexLexer::yylex()
// Dummy yywrap to keep yylex happy at compile time.
// It is called by yylex but is not used as the mechanism to change file.
// See <<EOF>>
#if YY_FLEX_SUBMINOR_VERSION < 34
extern "C" int yywrap()
#else
int yyFlexLexer::yywrap()
#endif
{
return 1;
}
@ -391,7 +395,8 @@ bool triSurface::readSTLASCII(const fileName& STLfileName)
// Create the lexer obtaining the approximate number of vertices in the STL
// from the file size
STLLexer lexer(&STLstream.stdStream(), Foam::size(STLfileName)/400);
while(lexer.lex() != 0);
while(lexer.lex() != 0)
{}
DynamicList<STLpoint>& STLpoints = lexer.STLpoints();