Ticket #47184: nwntools-bison3.patch
File nwntools-bison3.patch, 77.4 KB (added by larryv (Lawrence Velázquez), 10 years ago) |
---|
-
dports/games/nwntools/Portfile
commit 38d417363d950a19123aeb58092d06c54aae6afe Author: Lawrence Velázquez <larryv@macports.org> Date: 22 minutes ago nwntools: Fix build with Bison 3 (comment:47:ticket:41600) diff --git a/dports/games/nwntools/Portfile b/dports/games/nwntools/Portfile index c00ce15..e78556d 100644
a b configure.python ${prefix}/bin/python2.7 21 21 checksums sha1 cab2c8af5b0b2834444a018d87663614f8c057cf 22 22 use_parallel_build no 23 23 24 patchfiles fno-default-inline.patch \ 25 _NscLib__NscCompiler.cpp.patch \ 26 _NscLib__NscContext.cpp.patch \ 27 _NscLib__NscParserRoutines.cpp.patch \ 28 _NscLib__NscParser.ypp.patch \ 29 configure.patch \ 30 nwnnsscomp__python__Makefile.in.patch 24 use_autoreconf yes 25 26 patchfiles remove-fno-default-inline.patch \ 27 python2.7.patch \ 28 bison.patch -
deleted file dports/games/nwntools/files/_NscLib__NscCompiler.cpp.patch
diff --git a/dports/games/nwntools/files/_NscLib__NscCompiler.cpp.patch b/dports/games/nwntools/files/_NscLib__NscCompiler.cpp.patch deleted file mode 100644 index 13cd16f..0000000
+ - 1 --- _NscLib/NscCompiler.cpp.orig 2005-11-12 10:25:46.000000000 +11002 +++ _NscLib/NscCompiler.cpp 2014-12-17 14:21:42.000000000 +11003 @@ -107,31 +107,31 @@ bool NscCompilerInitialize (CNwnLoader *4 // Add the reserved words5 //6 7 - NscAddToken ("int", INT_TYPE);8 - NscAddToken ("float", FLOAT_TYPE);9 - NscAddToken ("object", OBJECT_TYPE);10 - NscAddToken ("string", STRING_TYPE);11 - NscAddToken ("struct", STRUCT_TYPE);12 - NscAddToken ("void", VOID_TYPE);13 - NscAddToken ("vector", VECTOR_TYPE);14 - NscAddToken ("action", ACTION_TYPE);15 -16 - NscAddToken ("break", BREAK);17 - NscAddToken ("case", CASE);18 - NscAddToken ("continue", CONTINUE);19 - NscAddToken ("default", DEFAULT);20 - NscAddToken ("do", DO);21 - NscAddToken ("else", ELSE);22 - NscAddToken ("for", FOR);23 - NscAddToken ("if", IF);24 - NscAddToken ("return", RETURN);25 - NscAddToken ("switch", SWITCH);26 - NscAddToken ("while", WHILE);27 + NscAddToken ("int", yy::parser::token::INT_TYPE);28 + NscAddToken ("float", yy::parser::token::FLOAT_TYPE);29 + NscAddToken ("object", yy::parser::token::OBJECT_TYPE);30 + NscAddToken ("string", yy::parser::token::STRING_TYPE);31 + NscAddToken ("struct", yy::parser::token::STRUCT_TYPE);32 + NscAddToken ("void", yy::parser::token::VOID_TYPE);33 + NscAddToken ("vector", yy::parser::token::VECTOR_TYPE);34 + NscAddToken ("action", yy::parser::token::ACTION_TYPE);35 +36 + NscAddToken ("break", yy::parser::token::BREAK);37 + NscAddToken ("case", yy::parser::token::CASE);38 + NscAddToken ("continue", yy::parser::token::CONTINUE);39 + NscAddToken ("default", yy::parser::token::DEFAULT);40 + NscAddToken ("do", yy::parser::token::DO);41 + NscAddToken ("else", yy::parser::token::ELSE);42 + NscAddToken ("for", yy::parser::token::FOR);43 + NscAddToken ("if", yy::parser::token::IF);44 + NscAddToken ("return", yy::parser::token::RETURN);45 + NscAddToken ("switch", yy::parser::token::SWITCH);46 + NscAddToken ("while", yy::parser::token::WHILE);47 if (fEnableExtensions || nVersion >= 999)48 - NscAddToken ("const", NWCONST);49 + NscAddToken ("const", yy::parser::token::NWCONST);50 51 - NscAddToken ("OBJECT_SELF", OBJECT_SELF_CONST);52 - NscAddToken ("OBJECT_INVALID", OBJECT_INVALID_CONST);53 + NscAddToken ("OBJECT_SELF", yy::parser::token::OBJECT_SELF_CONST);54 + NscAddToken ("OBJECT_INVALID", yy::parser::token::OBJECT_INVALID_CONST);55 56 //57 // Read NWSCRIPT -
deleted file dports/games/nwntools/files/_NscLib__NscContext.cpp.patch
diff --git a/dports/games/nwntools/files/_NscLib__NscContext.cpp.patch b/dports/games/nwntools/files/_NscLib__NscContext.cpp.patch deleted file mode 100644 index 5f4f237..0000000
+ - 1 --- _NscLib/NscContext.cpp.orig 2005-11-12 10:25:46.000000000 +11002 +++ _NscLib/NscContext.cpp 2014-12-17 14:30:38.000000000 +11003 @@ -230,7 +230,7 @@ read_another_line:;4 if (pSymbol != NULL)5 {6 assert (pSymbol ->nSymType == NscSymType_Token);7 - if (pSymbol ->nToken == ENGINE_TYPE)8 + if (pSymbol ->nToken == yy::parser::token::ENGINE_TYPE)9 {10 CNscPStackEntry *pEntry = GetPStackEntry (__FILE__, __LINE__);11 pEntry ->SetType ((NscType) (12 @@ -246,7 +246,7 @@ read_another_line:;13 CNscPStackEntry *pEntry = GetPStackEntry (__FILE__, __LINE__);14 pEntry ->SetIdentifier (pszStart, nCount);15 *yylval = pEntry;16 - return IDENTIFIER;17 + return yy::parser::token::IDENTIFIER;18 }19 }20 21 @@ -305,7 +305,7 @@ read_another_line:;22 pEntry ->SetType (NscType_Integer);23 pEntry ->PushConstantInteger (nValue);24 *yylval = pEntry;25 - return INTEGER_CONST;26 + return yy::parser::token::INTEGER_CONST;27 }28 29 //30 @@ -359,13 +359,13 @@ read_another_line:;31 {32 pEntry ->SetType (NscType_Float);33 pEntry ->PushConstantFloat ((float) atof (psz));34 - return FLOAT_CONST;35 + return yy::parser::token::FLOAT_CONST;36 }37 else38 {39 pEntry ->SetType (NscType_Integer);40 pEntry ->PushConstantInteger (atol (psz));41 - return INTEGER_CONST;42 + return yy::parser::token::INTEGER_CONST;43 }44 }45 }46 @@ -414,7 +414,7 @@ read_another_line:;47 else if (c == '=')48 {49 m_pStreamTop ->pszNextTokenPos++;50 - return DIVEQ;51 + return yy::parser::token::DIVEQ;52 }53 else54 {55 @@ -441,12 +441,12 @@ read_another_line:;56 if (c == '=')57 {58 m_pStreamTop ->pszNextTokenPos++;59 - return ADDEQ;60 + return yy::parser::token::ADDEQ;61 }62 else if (c == '+')63 {64 m_pStreamTop ->pszNextTokenPos++;65 - return PLUSPLUS;66 + return yy::parser::token::PLUSPLUS;67 }68 else69 return '+';70 @@ -457,12 +457,12 @@ read_another_line:;71 if (c == '=')72 {73 m_pStreamTop ->pszNextTokenPos++;74 - return SUBEQ;75 + return yy::parser::token::SUBEQ;76 }77 else if (c == '-')78 {79 m_pStreamTop ->pszNextTokenPos++;80 - return MINUSMINUS;81 + return yy::parser::token::MINUSMINUS;82 }83 else84 return '-';85 @@ -473,7 +473,7 @@ read_another_line:;86 if (c == '=')87 {88 m_pStreamTop ->pszNextTokenPos++;89 - return MULEQ;90 + return yy::parser::token::MULEQ;91 }92 else93 return '*';94 @@ -484,7 +484,7 @@ read_another_line:;95 if (c == '=')96 {97 m_pStreamTop ->pszNextTokenPos++;98 - return MODEQ;99 + return yy::parser::token::MODEQ;100 }101 else102 return '%';103 @@ -495,7 +495,7 @@ read_another_line:;104 if (c == '=')105 {106 m_pStreamTop ->pszNextTokenPos++;107 - return XOREQ;108 + return yy::parser::token::XOREQ;109 }110 else111 return '^';112 @@ -506,12 +506,12 @@ read_another_line:;113 if (c == '=')114 {115 m_pStreamTop ->pszNextTokenPos++;116 - return ANDEQ;117 + return yy::parser::token::ANDEQ;118 }119 else if (c == '&')120 {121 m_pStreamTop ->pszNextTokenPos++;122 - return ANDAND;123 + return yy::parser::token::ANDAND;124 }125 else126 return '&';127 @@ -522,12 +522,12 @@ read_another_line:;128 if (c == '=')129 {130 m_pStreamTop ->pszNextTokenPos++;131 - return OREQ;132 + return yy::parser::token::OREQ;133 }134 else if (c == '|')135 {136 m_pStreamTop ->pszNextTokenPos++;137 - return OROR;138 + return yy::parser::token::OROR;139 }140 else141 return '|';142 @@ -538,7 +538,7 @@ read_another_line:;143 if (c == '=')144 {145 m_pStreamTop ->pszNextTokenPos++;146 - return NOTEQ;147 + return yy::parser::token::NOTEQ;148 }149 else150 return '!';151 @@ -549,7 +549,7 @@ read_another_line:;152 if (c == '=')153 {154 m_pStreamTop ->pszNextTokenPos++;155 - return EQ;156 + return yy::parser::token::EQ;157 }158 else159 return '=';160 @@ -560,7 +560,7 @@ read_another_line:;161 if (c == '=')162 {163 m_pStreamTop ->pszNextTokenPos++;164 - return LTEQ;165 + return yy::parser::token::LTEQ;166 }167 else if (c == '<')168 {169 @@ -569,10 +569,10 @@ read_another_line:;170 if (c == '=')171 {172 m_pStreamTop ->pszNextTokenPos++;173 - return SLEQ;174 + return yy::parser::token::SLEQ;175 }176 else177 - return SL;178 + return yy::parser::token::SL;179 }180 else181 return '<';182 @@ -583,7 +583,7 @@ read_another_line:;183 if (c == '=')184 {185 m_pStreamTop ->pszNextTokenPos++;186 - return GTEQ;187 + return yy::parser::token::GTEQ;188 }189 else if (c == '>')190 {191 @@ -592,7 +592,7 @@ read_another_line:;192 if (c == '=')193 {194 m_pStreamTop ->pszNextTokenPos++;195 - return SREQ;196 + return yy::parser::token::SREQ;197 }198 else if (c == '>')199 {200 @@ -601,13 +601,13 @@ read_another_line:;201 if (c == '=')202 {203 m_pStreamTop ->pszNextTokenPos++;204 - return USREQ;205 + return yy::parser::token::USREQ;206 }207 else208 - return USR;209 + return yy::parser::token::USR;210 }211 else212 - return SR;213 + return yy::parser::token::SR;214 }215 else216 return '>';217 @@ -626,7 +626,7 @@ read_another_line:;218 pEntry ->SetType (NscType_String);219 pEntry ->PushConstantString (pszStart, (int) (pszOut - pszStart));220 *yylval = pEntry;221 - return STRING_CONST;222 + return yy::parser::token::STRING_CONST;223 }224 else if (c == '\\')225 {226 @@ -646,7 +646,7 @@ read_another_line:;227 pEntry ->PushConstantString (pszStart, (int) (pszOut - pszStart));228 *yylval = pEntry;229 GenerateError ("Unterminated string");230 - return STRING_CONST;231 + return yy::parser::token::STRING_CONST;232 }233 else234 *pszOut++ = c;235 @@ -898,7 +898,7 @@ try_again:;236 {237 NscSymbol *pSymbol = g_sNscReservedWords .Add (238 pszVTmp, NscSymType_Token);239 - pSymbol ->nToken = ENGINE_TYPE;240 + pSymbol ->nToken = yy::parser::token::ENGINE_TYPE;241 pSymbol ->nEngineObject = nIndex;242 }243 } -
deleted file dports/games/nwntools/files/_NscLib__NscParser.ypp.patch
diff --git a/dports/games/nwntools/files/_NscLib__NscParser.ypp.patch b/dports/games/nwntools/files/_NscLib__NscParser.ypp.patch deleted file mode 100644 index e8e4230..0000000
+ - 1 --- _NscLib/NscParser.ypp.orig 2005-11-12 10:25:46.000000000 +11002 +++ _NscLib/NscParser.ypp 2014-12-17 15:29:03.000000000 +11003 @@ -273,15 +273,15 @@ shift_expression:4 }5 | shift_expression SL additive_expression6 {7 - $$ = NscBuildBinaryOp (SL, $1, $3);8 + $$ = NscBuildBinaryOp (token::SL, $1, $3);9 }10 | shift_expression SR additive_expression11 {12 - $$ = NscBuildBinaryOp (SR, $1, $3);13 + $$ = NscBuildBinaryOp (token::SR, $1, $3);14 }15 | shift_expression USR additive_expression16 {17 - $$ = NscBuildBinaryOp (USR, $1, $3);18 + $$ = NscBuildBinaryOp (token::USR, $1, $3);19 }20 ;21 22 @@ -300,11 +300,11 @@ relational_expression:23 }24 | relational_expression LTEQ shift_expression25 {26 - $$ = NscBuildBinaryOp (LTEQ, $1, $3);27 + $$ = NscBuildBinaryOp (token::LTEQ, $1, $3);28 }29 | relational_expression GTEQ shift_expression30 {31 - $$ = NscBuildBinaryOp (GTEQ, $1, $3);32 + $$ = NscBuildBinaryOp (token::GTEQ, $1, $3);33 }34 ;35 36 @@ -315,11 +315,11 @@ equality_expression:37 }38 | equality_expression EQ relational_expression39 {40 - $$ = NscBuildBinaryOp (EQ, $1, $3);41 + $$ = NscBuildBinaryOp (token::EQ, $1, $3);42 }43 | equality_expression NOTEQ relational_expression44 {45 - $$ = NscBuildBinaryOp (NOTEQ, $1, $3);46 + $$ = NscBuildBinaryOp (token::NOTEQ, $1, $3);47 }48 ;49 50 @@ -363,7 +363,7 @@ logical_and_expression:51 }52 | logical_and_expression ANDAND inclusive_or_expression53 {54 - $$ = NscBuildLogicalOp (ANDAND, $1, $3);55 + $$ = NscBuildLogicalOp (token::ANDAND, $1, $3);56 }57 ;58 59 @@ -374,7 +374,7 @@ logical_or_expression:60 }61 | logical_or_expression OROR logical_and_expression62 {63 - $$ = NscBuildLogicalOp (OROR, $1, $3);64 + $$ = NscBuildLogicalOp (token::OROR, $1, $3);65 }66 ;67 68 @@ -400,47 +400,47 @@ assignment_expression:69 }70 | unary_expression MULEQ assignment_expression71 {72 - $$ = NscBuildBinaryOp (MULEQ, $1, $3);73 + $$ = NscBuildBinaryOp (token::MULEQ, $1, $3);74 }75 | unary_expression DIVEQ assignment_expression76 {77 - $$ = NscBuildBinaryOp (DIVEQ, $1, $3);78 + $$ = NscBuildBinaryOp (token::DIVEQ, $1, $3);79 }80 | unary_expression MODEQ assignment_expression81 {82 - $$ = NscBuildBinaryOp (MODEQ, $1, $3);83 + $$ = NscBuildBinaryOp (token::MODEQ, $1, $3);84 }85 | unary_expression ADDEQ assignment_expression86 {87 - $$ = NscBuildBinaryOp (ADDEQ, $1, $3);88 + $$ = NscBuildBinaryOp (token::ADDEQ, $1, $3);89 }90 | unary_expression SUBEQ assignment_expression91 {92 - $$ = NscBuildBinaryOp (SUBEQ, $1, $3);93 + $$ = NscBuildBinaryOp (token::SUBEQ, $1, $3);94 }95 | unary_expression SLEQ assignment_expression96 {97 - $$ = NscBuildBinaryOp (SLEQ, $1, $3);98 + $$ = NscBuildBinaryOp (token::SLEQ, $1, $3);99 }100 | unary_expression SREQ assignment_expression101 {102 - $$ = NscBuildBinaryOp (SREQ, $1, $3);103 + $$ = NscBuildBinaryOp (token::SREQ, $1, $3);104 }105 | unary_expression USREQ assignment_expression106 {107 - $$ = NscBuildBinaryOp (USREQ, $1, $3);108 + $$ = NscBuildBinaryOp (token::USREQ, $1, $3);109 }110 | unary_expression ANDEQ assignment_expression111 {112 - $$ = NscBuildBinaryOp (ANDEQ, $1, $3);113 + $$ = NscBuildBinaryOp (token::ANDEQ, $1, $3);114 }115 | unary_expression XOREQ assignment_expression116 {117 - $$ = NscBuildBinaryOp (XOREQ, $1, $3);118 + $$ = NscBuildBinaryOp (token::XOREQ, $1, $3);119 }120 | unary_expression OREQ assignment_expression121 {122 - $$ = NscBuildBinaryOp (OREQ, $1, $3);123 + $$ = NscBuildBinaryOp (token::OREQ, $1, $3);124 }125 ;126 127 @@ -480,39 +480,39 @@ qualified_type_specifier:128 type_specifier:129 VOID_TYPE130 {131 - $$ = NscBuildType (VOID_TYPE, NULL);132 + $$ = NscBuildType (token::VOID_TYPE, NULL);133 }134 | INT_TYPE135 {136 - $$ = NscBuildType (INT_TYPE, NULL);137 + $$ = NscBuildType (token::INT_TYPE, NULL);138 }139 | FLOAT_TYPE140 {141 - $$ = NscBuildType (FLOAT_TYPE, NULL);142 + $$ = NscBuildType (token::FLOAT_TYPE, NULL);143 }144 | OBJECT_TYPE145 {146 - $$ = NscBuildType (OBJECT_TYPE, NULL);147 + $$ = NscBuildType (token::OBJECT_TYPE, NULL);148 }149 | STRING_TYPE150 {151 - $$ = NscBuildType (STRING_TYPE, NULL);152 + $$ = NscBuildType (token::STRING_TYPE, NULL);153 }154 | ACTION_TYPE155 {156 - $$ = NscBuildType (ACTION_TYPE, NULL);157 + $$ = NscBuildType (token::ACTION_TYPE, NULL);158 }159 | VECTOR_TYPE160 {161 - $$ = NscBuildType (VECTOR_TYPE, NULL);162 + $$ = NscBuildType (token::VECTOR_TYPE, NULL);163 }164 | struct_type_start IDENTIFIER165 {166 - $$ = NscBuildType (STRUCT_TYPE, $2);167 + $$ = NscBuildType (token::STRUCT_TYPE, $2);168 }169 | ENGINE_TYPE170 {171 - $$ = NscBuildType (ENGINE_TYPE, $1);172 + $$ = NscBuildType (token::ENGINE_TYPE, $1);173 }174 ;175 176 @@ -600,11 +600,11 @@ labeled_statement:177 case_statement:178 CASE { NscBuildSaveLine (0); } constant_expression ':'179 {180 - $$ = NscBuildCase (CASE, $3);181 + $$ = NscBuildCase (token::CASE, $3);182 }183 | DEFAULT { NscBuildSaveLine (0); } ':'184 {185 - $$ = NscBuildCase (DEFAULT, NULL);186 + $$ = NscBuildCase (token::DEFAULT, NULL);187 }188 ;189 190 @@ -680,15 +680,15 @@ expression_statement:191 selection_statement:192 if_start statement_blank_error193 {194 - $$ = NscBuild5Block (IF, $1, 0, NULL, NULL, NULL, $2, NULL);195 + $$ = NscBuild5Block (token::IF, $1, 0, NULL, NULL, NULL, $2, NULL);196 }197 | if_else_start statement_blank_error198 {199 - $$ = NscBuild5Block (IF, $1, 0, NULL, NULL, NULL, NULL, $2);200 + $$ = NscBuild5Block (token::IF, $1, 0, NULL, NULL, NULL, NULL, $2);201 }202 | switch_start statement203 {204 - $$ = NscBuild5Block (SWITCH, $1, 0, NULL, NULL, NULL, $2, NULL);205 + $$ = NscBuild5Block (token::SWITCH, $1, 0, NULL, NULL, NULL, $2, NULL);206 }207 ;208 209 @@ -696,21 +696,21 @@ if_else_start:210 if_start statement_blank_error ELSE211 {212 NscBuildSaveLine (0);213 - $$ = NscBuild5Block (IF, $1, 1, NULL, NULL, NULL, $2, NULL);214 + $$ = NscBuild5Block (token::IF, $1, 1, NULL, NULL, NULL, $2, NULL);215 }216 ;217 218 if_start:219 IF '(' { NscBuildSaveLine (0); } expression ')'220 {221 - $$ = NscBuild5Block (IF, NULL, 1, NULL, $4, NULL, NULL, NULL);222 + $$ = NscBuild5Block (token::IF, NULL, 1, NULL, $4, NULL, NULL, NULL);223 }224 ;225 226 switch_start:227 SWITCH { NscBuildSaveLine (0); } '(' expression ')'228 {229 - $$ = NscBuild5Block (SWITCH, NULL, 1, NULL, $4, NULL, NULL, NULL);230 + $$ = NscBuild5Block (token::SWITCH, NULL, 1, NULL, $4, NULL, NULL, NULL);231 }232 ;233 234 @@ -723,50 +723,50 @@ switch_start:235 iteration_statement:236 while_start statement237 {238 - $$ = NscBuild5Block (WHILE, $1, 0, NULL, NULL, NULL, $2, NULL);239 + $$ = NscBuild5Block (token::WHILE, $1, 0, NULL, NULL, NULL, $2, NULL);240 }241 | do_start statement WHILE { NscBuildSaveLine (0); } '(' expression ')' ';'242 {243 - $$ = NscBuild5Block (DO, $1, 0, NULL, $6, NULL, $2, NULL);244 + $$ = NscBuild5Block (token::DO, $1, 0, NULL, $6, NULL, $2, NULL);245 }246 | for_start statement247 {248 - $$ = NscBuild5Block (FOR, $1, 0, NULL, NULL, NULL, $2, NULL);249 + $$ = NscBuild5Block (token::FOR, $1, 0, NULL, NULL, NULL, $2, NULL);250 }251 ;252 253 for_start:254 for_start_start ';' ';' ')'255 {256 - $$ = NscBuild5Block (FOR, NULL, 1, NULL, NULL, NULL, NULL, NULL);257 + $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, NULL, NULL, NULL, NULL);258 }259 | for_start_start expression ';' ';' ')'260 {261 - $$ = NscBuild5Block (FOR, NULL, 1, $2, NULL, NULL, NULL, NULL);262 + $$ = NscBuild5Block (token::FOR, NULL, 1, $2, NULL, NULL, NULL, NULL);263 }264 | for_start_start ';' expression ';' ')'265 {266 - $$ = NscBuild5Block (FOR, NULL, 1, NULL, $3, NULL, NULL, NULL);267 + $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, $3, NULL, NULL, NULL);268 }269 | for_start_start expression ';' expression ';' ')'270 {271 - $$ = NscBuild5Block (FOR, NULL, 1, $2, $4, NULL, NULL, NULL);272 + $$ = NscBuild5Block (token::FOR, NULL, 1, $2, $4, NULL, NULL, NULL);273 }274 | for_start_start ';' ';' expression ')'275 {276 - $$ = NscBuild5Block (FOR, NULL, 1, NULL, NULL, $4, NULL, NULL);277 + $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, NULL, $4, NULL, NULL);278 }279 | for_start_start expression ';' ';' expression ')'280 {281 - $$ = NscBuild5Block (FOR, NULL, 1, $2, NULL, $5, NULL, NULL);282 + $$ = NscBuild5Block (token::FOR, NULL, 1, $2, NULL, $5, NULL, NULL);283 }284 | for_start_start ';' expression ';' expression ')'285 {286 - $$ = NscBuild5Block (FOR, NULL, 1, NULL, $3, $5, NULL, NULL);287 + $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, $3, $5, NULL, NULL);288 }289 | for_start_start expression ';' expression ';' expression ')'290 {291 - $$ = NscBuild5Block (FOR, NULL, 1, $2, $4, $6, NULL, NULL);292 + $$ = NscBuild5Block (token::FOR, NULL, 1, $2, $4, $6, NULL, NULL);293 }294 ;295 296 @@ -780,14 +780,14 @@ for_start_start:297 while_start:298 WHILE '(' { NscBuildSaveLine (0); } expression ')'299 {300 - $$ = NscBuild5Block (WHILE, NULL, 1, NULL, $4, NULL, NULL, NULL);301 + $$ = NscBuild5Block (token::WHILE, NULL, 1, NULL, $4, NULL, NULL, NULL);302 }303 ;304 305 do_start:306 DO307 {308 - $$ = NscBuild5Block (DO, NULL, 1, NULL, NULL, NULL, NULL, NULL);309 + $$ = NscBuild5Block (token::DO, NULL, 1, NULL, NULL, NULL, NULL, NULL);310 }311 ;312 313 @@ -800,11 +800,11 @@ do_start:314 jump_statement:315 CONTINUE { NscBuildSaveLine (0); } ';'316 {317 - $$ = NscBuildBreakContinue (CONTINUE);318 + $$ = NscBuildBreakContinue (token::CONTINUE);319 }320 | BREAK { NscBuildSaveLine (0); } ';'321 {322 - $$ = NscBuildBreakContinue (BREAK);323 + $$ = NscBuildBreakContinue (token::BREAK);324 }325 | return_start ';'326 { -
deleted file dports/games/nwntools/files/_NscLib__NscParserRoutines.cpp.patch
diff --git a/dports/games/nwntools/files/_NscLib__NscParserRoutines.cpp.patch b/dports/games/nwntools/files/_NscLib__NscParserRoutines.cpp.patch deleted file mode 100644 index 93e9362..0000000
+ - 1 --- _NscLib/NscParserRoutines.cpp.orig 2005-02-05 08:33:24.000000000 +11002 +++ _NscLib/NscParserRoutines.cpp 2014-12-17 14:39:36.000000000 +11003 @@ -396,142 +396,142 @@ bool NscBuildSyntaxError (int nToken, YY4 5 switch (nToken)6 {7 - case IDENTIFIER:8 + case yy::parser::token::IDENTIFIER:9 if (yylval)10 pszToken = yylval ->GetIdentifier ();11 else12 pszToken = "identifier";13 break;14 15 - case INTEGER_CONST:16 + case yy::parser::token::INTEGER_CONST:17 pszToken = "integer constant";18 break;19 20 - case FLOAT_CONST:21 + case yy::parser::token::FLOAT_CONST:22 pszToken = "float constant";23 break;24 25 - case STRING_CONST:26 + case yy::parser::token::STRING_CONST:27 pszToken = "string constant";28 break;29 30 - case ADDEQ:31 + case yy::parser::token::ADDEQ:32 pszToken = "+=";33 break;34 35 - case SUBEQ:36 + case yy::parser::token::SUBEQ:37 pszToken = "-=";38 break;39 40 - case MULEQ:41 + case yy::parser::token::MULEQ:42 pszToken = "*=";43 break;44 45 - case DIVEQ:46 + case yy::parser::token::DIVEQ:47 pszToken = "/=";48 break;49 50 - case MODEQ:51 + case yy::parser::token::MODEQ:52 pszToken = "%=";53 break;54 55 - case XOREQ:56 + case yy::parser::token::XOREQ:57 pszToken = "^=";58 break;59 60 - case ANDEQ:61 + case yy::parser::token::ANDEQ:62 pszToken = "&=";63 break;64 65 - case OREQ:66 + case yy::parser::token::OREQ:67 pszToken = "|=";68 break;69 70 - case SL:71 + case yy::parser::token::SL:72 pszToken = "<<";73 break;74 75 - case SR:76 + case yy::parser::token::SR:77 pszToken = ">>";78 break;79 80 - case USR:81 + case yy::parser::token::USR:82 pszToken = ">>>";83 break;84 85 - case SLEQ:86 + case yy::parser::token::SLEQ:87 pszToken = "<<=";88 break;89 90 - case SREQ:91 + case yy::parser::token::SREQ:92 pszToken = ">>=";93 break;94 95 - case USREQ:96 + case yy::parser::token::USREQ:97 pszToken = ">>>=";98 break;99 100 - case EQ:101 + case yy::parser::token::EQ:102 pszToken = "==";103 break;104 105 - case NOTEQ:106 + case yy::parser::token::NOTEQ:107 pszToken = "!=";108 break;109 110 - case LTEQ:111 + case yy::parser::token::LTEQ:112 pszToken = "<=";113 break;114 115 - case GTEQ:116 + case yy::parser::token::GTEQ:117 pszToken = ">=";118 break;119 120 - case ANDAND:121 + case yy::parser::token::ANDAND:122 pszToken = "&&";123 break;124 125 - case OROR:126 + case yy::parser::token::OROR:127 pszToken = "||";128 break;129 130 - case PLUSPLUS:131 + case yy::parser::token::PLUSPLUS:132 pszToken = "++";133 break;134 135 - case MINUSMINUS:136 + case yy::parser::token::MINUSMINUS:137 pszToken = "--";138 break;139 140 - case FLOAT_TYPE:141 + case yy::parser::token::FLOAT_TYPE:142 pszToken = "float";143 break;144 145 - case INT_TYPE:146 + case yy::parser::token::INT_TYPE:147 pszToken = "int";148 break;149 150 - case OBJECT_TYPE:151 + case yy::parser::token::OBJECT_TYPE:152 pszToken = "object";153 break;154 155 - case STRING_TYPE:156 + case yy::parser::token::STRING_TYPE:157 pszToken = "string";158 break;159 160 - case VOID_TYPE:161 + case yy::parser::token::VOID_TYPE:162 pszToken = "void";163 break;164 165 - case STRUCT_TYPE:166 + case yy::parser::token::STRUCT_TYPE:167 pszToken = "struct";168 break;169 170 - case VECTOR_TYPE:171 + case yy::parser::token::VECTOR_TYPE:172 pszToken = "vector";173 break;174 175 - case ENGINE_TYPE:176 + case yy::parser::token::ENGINE_TYPE:177 if (yylval)178 {179 int nIndex = yylval ->GetType () - NscType_Engine_0;180 @@ -541,63 +541,63 @@ bool NscBuildSyntaxError (int nToken, YY181 pszToken = "engine-type";182 break;183 184 - case ACTION_TYPE:185 + case yy::parser::token::ACTION_TYPE:186 pszToken = "action";187 break;188 189 - case OBJECT_SELF_CONST:190 + case yy::parser::token::OBJECT_SELF_CONST:191 pszToken = "OBJECT_SELF";192 break;193 194 - case OBJECT_INVALID_CONST:195 + case yy::parser::token::OBJECT_INVALID_CONST:196 pszToken = "OBJECT_INVALID";197 break;198 199 - case BREAK:200 + case yy::parser::token::BREAK:201 pszToken = "break";202 break;203 204 - case CASE:205 + case yy::parser::token::CASE:206 pszToken = "case";207 break;208 209 - case CONTINUE:210 + case yy::parser::token::CONTINUE:211 pszToken = "continue";212 break;213 214 - case DEFAULT:215 + case yy::parser::token::DEFAULT:216 pszToken = "default";217 break;218 219 - case DO:220 + case yy::parser::token::DO:221 pszToken = "do";222 break;223 224 - case ELSE:225 + case yy::parser::token::ELSE:226 pszToken = "else";227 break;228 229 - case FOR:230 + case yy::parser::token::FOR:231 pszToken = "for";232 break;233 234 - case IF:235 + case yy::parser::token::IF:236 pszToken = "if";237 break;238 239 - case RETURN:240 + case yy::parser::token::RETURN:241 pszToken = "return";242 break;243 244 - case SWITCH:245 + case yy::parser::token::SWITCH:246 pszToken = "switch";247 break;248 249 - case WHILE:250 + case yy::parser::token::WHILE:251 pszToken = "while";252 break;253 254 - case NWCONST:255 + case yy::parser::token::NWCONST:256 pszToken = "const";257 break;258 259 @@ -657,31 +657,31 @@ YYSTYPE NscBuildType (int nType, YYSTYPE260 261 switch (nType)262 {263 - case VOID_TYPE:264 + case yy::parser::token::VOID_TYPE:265 pOut ->SetType (NscType_Void);266 break;267 268 - case INT_TYPE:269 + case yy::parser::token::INT_TYPE:270 pOut ->SetType (NscType_Integer);271 break;272 273 - case FLOAT_TYPE:274 + case yy::parser::token::FLOAT_TYPE:275 pOut ->SetType (NscType_Float);276 break;277 278 - case OBJECT_TYPE:279 + case yy::parser::token::OBJECT_TYPE:280 pOut ->SetType (NscType_Object);281 break;282 283 - case STRING_TYPE:284 + case yy::parser::token::STRING_TYPE:285 pOut ->SetType (NscType_String);286 break;287 288 - case VECTOR_TYPE:289 + case yy::parser::token::VECTOR_TYPE:290 pOut ->SetType (NscType_Vector);291 break;292 293 - case ACTION_TYPE:294 + case yy::parser::token::ACTION_TYPE:295 if (!g_pCtx ->IsNWScript ())296 {297 g_pCtx ->GenerateError ("\"action\" identifier only "298 @@ -692,7 +692,7 @@ YYSTYPE NscBuildType (int nType, YYSTYPE299 pOut ->SetType (NscType_Action);300 break;301 302 - case STRUCT_TYPE:303 + case yy::parser::token::STRUCT_TYPE:304 assert (pId != NULL);305 {306 if (!g_pCtx ->IsPhase2 () && !g_pCtx ->IsNWScript ())307 @@ -723,7 +723,7 @@ YYSTYPE NscBuildType (int nType, YYSTYPE308 }309 break;310 311 - case ENGINE_TYPE:312 + case yy::parser::token::ENGINE_TYPE:313 assert (pId != NULL);314 {315 pOut ->SetType (pId ->GetType ());316 @@ -2923,7 +2923,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY317 }318 break;319 320 - case SL:321 + case yy::parser::token::SL:322 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer)323 {324 if (g_pCtx ->GetOptExpression () &&325 @@ -2948,7 +2948,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY326 }327 break;328 329 - case SR:330 + case yy::parser::token::SR:331 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer)332 {333 #ifdef NOT_ENABLED_YET334 @@ -2975,7 +2975,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY335 }336 break;337 338 - case USR:339 + case yy::parser::token::USR:340 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer)341 {342 #ifdef NOT_ENABLED_YET343 @@ -3086,7 +3086,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY344 }345 break;346 347 - case LTEQ:348 + case yy::parser::token::LTEQ:349 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer)350 {351 if (g_pCtx ->GetOptExpression () &&352 @@ -3128,7 +3128,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY353 }354 break;355 356 - case GTEQ:357 + case yy::parser::token::GTEQ:358 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer)359 {360 if (g_pCtx ->GetOptExpression () &&361 @@ -3170,7 +3170,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY362 }363 break;364 365 - case EQ:366 + case yy::parser::token::EQ:367 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer)368 {369 if (g_pCtx ->GetOptExpression () &&370 @@ -3260,7 +3260,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY371 }372 break;373 374 - case NOTEQ:375 + case yy::parser::token::NOTEQ:376 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer)377 {378 if (g_pCtx ->GetOptExpression () &&379 @@ -3440,7 +3440,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY380 }381 break;382 383 - case MULEQ:384 + case yy::parser::token::MULEQ:385 if (nLhsType == NscType_Vector && nRhsType == NscType_Float)386 {387 NscPushAssignment (pOut, NscPCode_AsnMultiply,388 @@ -3468,7 +3468,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY389 }390 break;391 392 - case DIVEQ:393 + case yy::parser::token::DIVEQ:394 if (nLhsType == NscType_Vector && nRhsType == NscType_Float)395 {396 NscPushAssignment (pOut, NscPCode_AsnDivide,397 @@ -3496,7 +3496,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY398 }399 break;400 401 - case MODEQ:402 + case yy::parser::token::MODEQ:403 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer)404 {405 NscPushAssignment (pOut, NscPCode_AsnModulus,406 @@ -3509,7 +3509,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY407 }408 break;409 410 - case ADDEQ:411 + case yy::parser::token::ADDEQ:412 if (nLhsType == NscType_Vector && nRhsType == NscType_Vector)413 {414 NscPushAssignment (pOut, NscPCode_AsnAdd,415 @@ -3542,7 +3542,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY416 }417 break;418 419 - case SUBEQ:420 + case yy::parser::token::SUBEQ:421 if (nLhsType == NscType_Vector && nRhsType == NscType_Vector)422 {423 NscPushAssignment (pOut, NscPCode_AsnSubtract,424 @@ -3570,7 +3570,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY425 }426 break;427 428 - case SLEQ:429 + case yy::parser::token::SLEQ:430 pszOp = "<<=";431 nOp = NscPCode_AsnShiftLeft;432 asn_shift_operator:;433 @@ -3586,17 +3586,17 @@ asn_shift_operator:;434 }435 break;436 437 - case SREQ:438 + case yy::parser::token::SREQ:439 pszOp = ">>=";440 nOp = NscPCode_AsnShiftRight;441 goto asn_shift_operator;442 443 - case USREQ:444 + case yy::parser::token::USREQ:445 pszOp = ">>>=";446 nOp = NscPCode_AsnUnsignedShiftRight;447 goto asn_shift_operator;448 449 - case ANDEQ:450 + case yy::parser::token::ANDEQ:451 pszOp = "&=";452 nOp = NscPCode_AsnBitwiseAND;453 asn_bitwise_expression:;454 @@ -3612,12 +3612,12 @@ asn_bitwise_expression:;455 }456 break;457 458 - case XOREQ:459 + case yy::parser::token::XOREQ:460 pszOp = "^=";461 nOp = NscPCode_AsnBitwiseXOR;462 goto asn_bitwise_expression;463 464 - case OREQ:465 + case yy::parser::token::OREQ:466 pszOp = "|=";467 nOp = NscPCode_AsnBitwiseOR;468 goto asn_bitwise_expression;469 @@ -3696,12 +3696,12 @@ YYSTYPE NscBuildLogicalOp (int nToken, Y470 471 const char *pszOp;472 NscPCode nOp;473 - if (nToken == ANDAND)474 + if (nToken == yy::parser::token::ANDAND)475 {476 pszOp = "&&";477 nOp = NscPCode_LogicalAND;478 }479 - else if (nToken == OROR)480 + else if (nToken == yy::parser::token::OROR)481 {482 pszOp = "||";483 nOp = NscPCode_LogicalOR;484 @@ -3750,12 +3750,12 @@ YYSTYPE NscBuildLogicalOp (int nToken, Y485 // If the operation is known to be true or false by the lhs486 //487 488 - else if (nToken == ANDAND && nLhsConstant == 0)489 + else if (nToken == yy::parser::token::ANDAND && nLhsConstant == 0)490 {491 pOut ->PushConstantInteger (0);492 pOut ->SetType (NscType_Integer);493 }494 - else if (nToken == OROR && nLhsConstant == 1)495 + else if (nToken == yy::parser::token::OROR && nLhsConstant == 1)496 {497 pOut ->PushConstantInteger (1);498 pOut ->SetType (NscType_Integer);499 @@ -4706,7 +4706,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST500 bool fCheckCond;501 switch (nToken)502 {503 - case IF:504 + case yy::parser::token::IF:505 nPCode = NscPCode_If;506 nFenceType = NscFenceType_If;507 pszToken = "if";508 @@ -4714,7 +4714,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST509 fCheckCond = pPrev == NULL;510 break;511 512 - case WHILE:513 + case yy::parser::token::WHILE:514 nPCode = NscPCode_While;515 nFenceType = NscFenceType_While;516 pszToken = "while";517 @@ -4722,7 +4722,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST518 fCheckCond = pPrev == NULL;519 break;520 521 - case DO:522 + case yy::parser::token::DO:523 nPCode = NscPCode_Do;524 nFenceType = NscFenceType_Do;525 pszToken = "do";526 @@ -4730,7 +4730,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST527 fCheckCond = pPrev != NULL;528 break;529 530 - case FOR:531 + case yy::parser::token::FOR:532 nPCode = NscPCode_For;533 nFenceType = NscFenceType_For;534 pszToken = "for";535 @@ -4738,7 +4738,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST536 fCheckCond = pPrev == NULL;537 break;538 539 - case SWITCH:540 + case yy::parser::token::SWITCH:541 nPCode = NscPCode_Switch;542 nFenceType = NscFenceType_Switch;543 pszToken = "switch";544 @@ -4787,7 +4787,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST545 // for this546 //547 548 - if (nToken == SWITCH)549 + if (nToken == yy::parser::token::SWITCH)550 {551 NscSymbolFence *pFence = g_pCtx ->GetCurrentFence ();552 pFence ->nPrevLocals++;553 @@ -4806,7 +4806,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST554 // then set return555 //556 557 - if (nToken == IF && pFalse)558 + if (nToken == yy::parser::token::IF && pFalse)559 {560 if (fHadReturn)561 NscSetFenceReturn (true);562 @@ -4992,7 +4992,7 @@ YYSTYPE NscBuildCase (int nToken, YYSTYP563 // If this is a case564 //565 566 - if (nToken == CASE)567 + if (nToken == yy::parser::token::CASE)568 {569 570 //571 @@ -5061,7 +5061,7 @@ YYSTYPE NscBuildCase (int nToken, YYSTYP572 // Test for only one default573 //574 575 - if (nToken == DEFAULT)576 + if (nToken == yy::parser::token::DEFAULT)577 {578 if (pFence ->fHasDefault)579 {580 @@ -5086,9 +5086,9 @@ YYSTYPE NscBuildCase (int nToken, YYSTYP581 //582 583 NscPCode nPCode;584 - if (nToken == CASE)585 + if (nToken == yy::parser::token::CASE)586 nPCode = NscPCode_Case;587 - else if (nToken == DEFAULT)588 + else if (nToken == yy::parser::token::DEFAULT)589 nPCode = NscPCode_Default;590 else591 {592 @@ -5262,9 +5262,9 @@ YYSTYPE NscBuildBreakContinue (int nToke593 //594 595 NscPCode nPCode;596 - if (nToken == BREAK)597 + if (nToken == yy::parser::token::BREAK)598 nPCode = NscPCode_Break;599 - else if (nToken == CONTINUE)600 + else if (nToken == yy::parser::token::CONTINUE)601 nPCode = NscPCode_Continue;602 else603 {604 @@ -5279,7 +5279,7 @@ YYSTYPE NscBuildBreakContinue (int nToke605 NscSymbolFence *pFence = g_pCtx ->GetCurrentFence ();606 while (pFence)607 {608 - if ((pFence ->nFenceType == NscFenceType_Switch && nToken == BREAK) ||609 + if ((pFence ->nFenceType == NscFenceType_Switch && nToken == yy::parser::token::BREAK) ||610 pFence ->nFenceType == NscFenceType_Do ||611 pFence ->nFenceType == NscFenceType_While ||612 pFence ->nFenceType == NscFenceType_For)613 @@ -5288,12 +5288,12 @@ YYSTYPE NscBuildBreakContinue (int nToke614 }615 if (pFence == NULL)616 {617 - if (nToken == BREAK)618 + if (nToken == yy::parser::token::BREAK)619 {620 g_pCtx ->GenerateError ("\"break\" statement only allowed in "621 "\"switch\", \"do\", \"while\", and \"for\" statements");622 }623 - else if (nToken == CONTINUE)624 + else if (nToken == yy::parser::token::CONTINUE)625 {626 g_pCtx ->GenerateError ("\"continue\" statement only allowed in "627 "\"do\", \"while\", and \"for\" statements"); -
new file dports/games/nwntools/files/bison.patch
diff --git a/dports/games/nwntools/files/bison.patch b/dports/games/nwntools/files/bison.patch new file mode 100644 index 0000000..454a619
- + 1 Index: configure.ac 2 =================================================================== 3 --- configure.ac.orig 4 +++ configure.ac 5 @@ -19,22 +19,24 @@ AC_PROG_YACC 6 7 # Check bison version, substitute name for yychar 8 bison_version=`bison -V | grep "^bison" | awk '{print $4}'` 9 -bison_v=`echo $bison_version | awk 'BEGIN { FS="." } {printf "%d", $1*10+$2;}'` 10 AC_MSG_RESULT([checking bison version: $bison_version]) 11 12 -if test -n "$bison_v" && test "$bison_v" -lt 20 13 -then 14 +case $bison_version in 15 + 1.*) 16 AC_MSG_ERROR([need a bison version >= 2.0]) 17 -fi 18 - 19 -if test -n "$bison_v" && test "$bison_v" -eq 20 20 -then 21 + ;; 22 + 2.0|2.0.*) 23 AC_MSG_RESULT([setting bison lalr1 yychar variable name to yylooka_]) 24 AC_DEFINE(YYCHAR_NAME,yylooka_,[name of yychar lookahead var in bison lalr1.cc]) 25 -else 26 + ;; 27 + 2.*) 28 AC_MSG_RESULT([setting bison lalr1 yychar variable name to yylooka]) 29 AC_DEFINE(YYCHAR_NAME,yylooka,[name of yychar lookahead var in bison lalr1.cc]) 30 -fi 31 + ;; 32 + *) 33 + AC_MSG_RESULT([setting bison lalr1 to use symbols]) 34 + ;; 35 +esac 36 37 # Check for python 38 AM_PATH_PYTHON(2.2,, :) 39 Index: _NscLib/NscCompiler.cpp 40 =================================================================== 41 --- _NscLib/NscCompiler.cpp.orig 42 +++ _NscLib/NscCompiler.cpp 43 @@ -44,6 +44,9 @@ 44 #include "NscSymbolTable.h" 45 #include "NscCodeGenerator.h" 46 47 +// "Import" token definitions. 48 +typedef yy::parser::token token; 49 + 50 // 51 // Globals 52 // 53 @@ -107,31 +110,31 @@ bool NscCompilerInitialize (CNwnLoader * 54 // Add the reserved words 55 // 56 57 - NscAddToken ("int", INT_TYPE); 58 - NscAddToken ("float", FLOAT_TYPE); 59 - NscAddToken ("object", OBJECT_TYPE); 60 - NscAddToken ("string", STRING_TYPE); 61 - NscAddToken ("struct", STRUCT_TYPE); 62 - NscAddToken ("void", VOID_TYPE); 63 - NscAddToken ("vector", VECTOR_TYPE); 64 - NscAddToken ("action", ACTION_TYPE); 65 - 66 - NscAddToken ("break", BREAK); 67 - NscAddToken ("case", CASE); 68 - NscAddToken ("continue", CONTINUE); 69 - NscAddToken ("default", DEFAULT); 70 - NscAddToken ("do", DO); 71 - NscAddToken ("else", ELSE); 72 - NscAddToken ("for", FOR); 73 - NscAddToken ("if", IF); 74 - NscAddToken ("return", RETURN); 75 - NscAddToken ("switch", SWITCH); 76 - NscAddToken ("while", WHILE); 77 + NscAddToken ("int", token::INT_TYPE); 78 + NscAddToken ("float", token::FLOAT_TYPE); 79 + NscAddToken ("object", token::OBJECT_TYPE); 80 + NscAddToken ("string", token::STRING_TYPE); 81 + NscAddToken ("struct", token::STRUCT_TYPE); 82 + NscAddToken ("void", token::VOID_TYPE); 83 + NscAddToken ("vector", token::VECTOR_TYPE); 84 + NscAddToken ("action", token::ACTION_TYPE); 85 + 86 + NscAddToken ("break", token::BREAK); 87 + NscAddToken ("case", token::CASE); 88 + NscAddToken ("continue", token::CONTINUE); 89 + NscAddToken ("default", token::DEFAULT); 90 + NscAddToken ("do", token::DO); 91 + NscAddToken ("else", token::ELSE); 92 + NscAddToken ("for", token::FOR); 93 + NscAddToken ("if", token::IF); 94 + NscAddToken ("return", token::RETURN); 95 + NscAddToken ("switch", token::SWITCH); 96 + NscAddToken ("while", token::WHILE); 97 if (fEnableExtensions || nVersion >= 999) 98 - NscAddToken ("const", NWCONST); 99 + NscAddToken ("const", token::NWCONST); 100 101 - NscAddToken ("OBJECT_SELF", OBJECT_SELF_CONST); 102 - NscAddToken ("OBJECT_INVALID", OBJECT_INVALID_CONST); 103 + NscAddToken ("OBJECT_SELF", token::OBJECT_SELF_CONST); 104 + NscAddToken ("OBJECT_INVALID", token::OBJECT_INVALID_CONST); 105 106 // 107 // Read NWSCRIPT 108 @@ -373,8 +376,7 @@ const char *NscGetActionName (int nActio 109 // 110 //---------------------------------------------------------------------------- 111 112 -void yy::parser::error (const yy::parser::location_type& l, 113 - const std::string& m) { 114 +void yy::parser::error (const std::string& m) { 115 context.yyerror(m.c_str()); 116 } 117 118 Index: _NscLib/NscContext.cpp 119 =================================================================== 120 --- _NscLib/NscContext.cpp.orig 121 +++ _NscLib/NscContext.cpp 122 @@ -43,6 +43,9 @@ 123 #include "NscPStackEntry.h" 124 #include "NscSymbolTable.h" 125 126 +// "Import" token definitions. 127 +typedef yy::parser::token token; 128 + 129 // 130 // Externals 131 // 132 @@ -230,7 +233,7 @@ read_another_line:; 133 if (pSymbol != NULL) 134 { 135 assert (pSymbol ->nSymType == NscSymType_Token); 136 - if (pSymbol ->nToken == ENGINE_TYPE) 137 + if (pSymbol ->nToken == token::ENGINE_TYPE) 138 { 139 CNscPStackEntry *pEntry = GetPStackEntry (__FILE__, __LINE__); 140 pEntry ->SetType ((NscType) ( 141 @@ -246,7 +249,7 @@ read_another_line:; 142 CNscPStackEntry *pEntry = GetPStackEntry (__FILE__, __LINE__); 143 pEntry ->SetIdentifier (pszStart, nCount); 144 *yylval = pEntry; 145 - return IDENTIFIER; 146 + return token::IDENTIFIER; 147 } 148 } 149 150 @@ -305,7 +308,7 @@ read_another_line:; 151 pEntry ->SetType (NscType_Integer); 152 pEntry ->PushConstantInteger (nValue); 153 *yylval = pEntry; 154 - return INTEGER_CONST; 155 + return token::INTEGER_CONST; 156 } 157 158 // 159 @@ -359,13 +362,13 @@ read_another_line:; 160 { 161 pEntry ->SetType (NscType_Float); 162 pEntry ->PushConstantFloat ((float) atof (psz)); 163 - return FLOAT_CONST; 164 + return token::FLOAT_CONST; 165 } 166 else 167 { 168 pEntry ->SetType (NscType_Integer); 169 pEntry ->PushConstantInteger (atol (psz)); 170 - return INTEGER_CONST; 171 + return token::INTEGER_CONST; 172 } 173 } 174 } 175 @@ -414,7 +417,7 @@ read_another_line:; 176 else if (c == '=') 177 { 178 m_pStreamTop ->pszNextTokenPos++; 179 - return DIVEQ; 180 + return token::DIVEQ; 181 } 182 else 183 { 184 @@ -441,12 +444,12 @@ read_another_line:; 185 if (c == '=') 186 { 187 m_pStreamTop ->pszNextTokenPos++; 188 - return ADDEQ; 189 + return token::ADDEQ; 190 } 191 else if (c == '+') 192 { 193 m_pStreamTop ->pszNextTokenPos++; 194 - return PLUSPLUS; 195 + return token::PLUSPLUS; 196 } 197 else 198 return '+'; 199 @@ -457,12 +460,12 @@ read_another_line:; 200 if (c == '=') 201 { 202 m_pStreamTop ->pszNextTokenPos++; 203 - return SUBEQ; 204 + return token::SUBEQ; 205 } 206 else if (c == '-') 207 { 208 m_pStreamTop ->pszNextTokenPos++; 209 - return MINUSMINUS; 210 + return token::MINUSMINUS; 211 } 212 else 213 return '-'; 214 @@ -473,7 +476,7 @@ read_another_line:; 215 if (c == '=') 216 { 217 m_pStreamTop ->pszNextTokenPos++; 218 - return MULEQ; 219 + return token::MULEQ; 220 } 221 else 222 return '*'; 223 @@ -484,7 +487,7 @@ read_another_line:; 224 if (c == '=') 225 { 226 m_pStreamTop ->pszNextTokenPos++; 227 - return MODEQ; 228 + return token::MODEQ; 229 } 230 else 231 return '%'; 232 @@ -495,7 +498,7 @@ read_another_line:; 233 if (c == '=') 234 { 235 m_pStreamTop ->pszNextTokenPos++; 236 - return XOREQ; 237 + return token::XOREQ; 238 } 239 else 240 return '^'; 241 @@ -506,12 +509,12 @@ read_another_line:; 242 if (c == '=') 243 { 244 m_pStreamTop ->pszNextTokenPos++; 245 - return ANDEQ; 246 + return token::ANDEQ; 247 } 248 else if (c == '&') 249 { 250 m_pStreamTop ->pszNextTokenPos++; 251 - return ANDAND; 252 + return token::ANDAND; 253 } 254 else 255 return '&'; 256 @@ -522,12 +525,12 @@ read_another_line:; 257 if (c == '=') 258 { 259 m_pStreamTop ->pszNextTokenPos++; 260 - return OREQ; 261 + return token::OREQ; 262 } 263 else if (c == '|') 264 { 265 m_pStreamTop ->pszNextTokenPos++; 266 - return OROR; 267 + return token::OROR; 268 } 269 else 270 return '|'; 271 @@ -538,7 +541,7 @@ read_another_line:; 272 if (c == '=') 273 { 274 m_pStreamTop ->pszNextTokenPos++; 275 - return NOTEQ; 276 + return token::NOTEQ; 277 } 278 else 279 return '!'; 280 @@ -549,7 +552,7 @@ read_another_line:; 281 if (c == '=') 282 { 283 m_pStreamTop ->pszNextTokenPos++; 284 - return EQ; 285 + return token::EQ; 286 } 287 else 288 return '='; 289 @@ -560,7 +563,7 @@ read_another_line:; 290 if (c == '=') 291 { 292 m_pStreamTop ->pszNextTokenPos++; 293 - return LTEQ; 294 + return token::LTEQ; 295 } 296 else if (c == '<') 297 { 298 @@ -569,10 +572,10 @@ read_another_line:; 299 if (c == '=') 300 { 301 m_pStreamTop ->pszNextTokenPos++; 302 - return SLEQ; 303 + return token::SLEQ; 304 } 305 else 306 - return SL; 307 + return token::SL; 308 } 309 else 310 return '<'; 311 @@ -583,7 +586,7 @@ read_another_line:; 312 if (c == '=') 313 { 314 m_pStreamTop ->pszNextTokenPos++; 315 - return GTEQ; 316 + return token::GTEQ; 317 } 318 else if (c == '>') 319 { 320 @@ -592,7 +595,7 @@ read_another_line:; 321 if (c == '=') 322 { 323 m_pStreamTop ->pszNextTokenPos++; 324 - return SREQ; 325 + return token::SREQ; 326 } 327 else if (c == '>') 328 { 329 @@ -601,13 +604,13 @@ read_another_line:; 330 if (c == '=') 331 { 332 m_pStreamTop ->pszNextTokenPos++; 333 - return USREQ; 334 + return token::USREQ; 335 } 336 else 337 - return USR; 338 + return token::USR; 339 } 340 else 341 - return SR; 342 + return token::SR; 343 } 344 else 345 return '>'; 346 @@ -626,7 +629,7 @@ read_another_line:; 347 pEntry ->SetType (NscType_String); 348 pEntry ->PushConstantString (pszStart, (int) (pszOut - pszStart)); 349 *yylval = pEntry; 350 - return STRING_CONST; 351 + return token::STRING_CONST; 352 } 353 else if (c == '\\') 354 { 355 @@ -646,7 +649,7 @@ read_another_line:; 356 pEntry ->PushConstantString (pszStart, (int) (pszOut - pszStart)); 357 *yylval = pEntry; 358 GenerateError ("Unterminated string"); 359 - return STRING_CONST; 360 + return token::STRING_CONST; 361 } 362 else 363 *pszOut++ = c; 364 @@ -898,7 +901,7 @@ try_again:; 365 { 366 NscSymbol *pSymbol = g_sNscReservedWords .Add ( 367 pszVTmp, NscSymType_Token); 368 - pSymbol ->nToken = ENGINE_TYPE; 369 + pSymbol ->nToken = token::ENGINE_TYPE; 370 pSymbol ->nEngineObject = nIndex; 371 } 372 } 373 Index: _NscLib/NscParser.ypp 374 =================================================================== 375 --- _NscLib/NscParser.ypp.orig 376 +++ _NscLib/NscParser.ypp 377 @@ -273,15 +273,15 @@ shift_expression: 378 } 379 | shift_expression SL additive_expression 380 { 381 - $$ = NscBuildBinaryOp (SL, $1, $3); 382 + $$ = NscBuildBinaryOp (token::SL, $1, $3); 383 } 384 | shift_expression SR additive_expression 385 { 386 - $$ = NscBuildBinaryOp (SR, $1, $3); 387 + $$ = NscBuildBinaryOp (token::SR, $1, $3); 388 } 389 | shift_expression USR additive_expression 390 { 391 - $$ = NscBuildBinaryOp (USR, $1, $3); 392 + $$ = NscBuildBinaryOp (token::USR, $1, $3); 393 } 394 ; 395 396 @@ -300,11 +300,11 @@ relational_expression: 397 } 398 | relational_expression LTEQ shift_expression 399 { 400 - $$ = NscBuildBinaryOp (LTEQ, $1, $3); 401 + $$ = NscBuildBinaryOp (token::LTEQ, $1, $3); 402 } 403 | relational_expression GTEQ shift_expression 404 { 405 - $$ = NscBuildBinaryOp (GTEQ, $1, $3); 406 + $$ = NscBuildBinaryOp (token::GTEQ, $1, $3); 407 } 408 ; 409 410 @@ -315,11 +315,11 @@ equality_expression: 411 } 412 | equality_expression EQ relational_expression 413 { 414 - $$ = NscBuildBinaryOp (EQ, $1, $3); 415 + $$ = NscBuildBinaryOp (token::EQ, $1, $3); 416 } 417 | equality_expression NOTEQ relational_expression 418 { 419 - $$ = NscBuildBinaryOp (NOTEQ, $1, $3); 420 + $$ = NscBuildBinaryOp (token::NOTEQ, $1, $3); 421 } 422 ; 423 424 @@ -363,7 +363,7 @@ logical_and_expression: 425 } 426 | logical_and_expression ANDAND inclusive_or_expression 427 { 428 - $$ = NscBuildLogicalOp (ANDAND, $1, $3); 429 + $$ = NscBuildLogicalOp (token::ANDAND, $1, $3); 430 } 431 ; 432 433 @@ -374,7 +374,7 @@ logical_or_expression: 434 } 435 | logical_or_expression OROR logical_and_expression 436 { 437 - $$ = NscBuildLogicalOp (OROR, $1, $3); 438 + $$ = NscBuildLogicalOp (token::OROR, $1, $3); 439 } 440 ; 441 442 @@ -400,47 +400,47 @@ assignment_expression: 443 } 444 | unary_expression MULEQ assignment_expression 445 { 446 - $$ = NscBuildBinaryOp (MULEQ, $1, $3); 447 + $$ = NscBuildBinaryOp (token::MULEQ, $1, $3); 448 } 449 | unary_expression DIVEQ assignment_expression 450 { 451 - $$ = NscBuildBinaryOp (DIVEQ, $1, $3); 452 + $$ = NscBuildBinaryOp (token::DIVEQ, $1, $3); 453 } 454 | unary_expression MODEQ assignment_expression 455 { 456 - $$ = NscBuildBinaryOp (MODEQ, $1, $3); 457 + $$ = NscBuildBinaryOp (token::MODEQ, $1, $3); 458 } 459 | unary_expression ADDEQ assignment_expression 460 { 461 - $$ = NscBuildBinaryOp (ADDEQ, $1, $3); 462 + $$ = NscBuildBinaryOp (token::ADDEQ, $1, $3); 463 } 464 | unary_expression SUBEQ assignment_expression 465 { 466 - $$ = NscBuildBinaryOp (SUBEQ, $1, $3); 467 + $$ = NscBuildBinaryOp (token::SUBEQ, $1, $3); 468 } 469 | unary_expression SLEQ assignment_expression 470 { 471 - $$ = NscBuildBinaryOp (SLEQ, $1, $3); 472 + $$ = NscBuildBinaryOp (token::SLEQ, $1, $3); 473 } 474 | unary_expression SREQ assignment_expression 475 { 476 - $$ = NscBuildBinaryOp (SREQ, $1, $3); 477 + $$ = NscBuildBinaryOp (token::SREQ, $1, $3); 478 } 479 | unary_expression USREQ assignment_expression 480 { 481 - $$ = NscBuildBinaryOp (USREQ, $1, $3); 482 + $$ = NscBuildBinaryOp (token::USREQ, $1, $3); 483 } 484 | unary_expression ANDEQ assignment_expression 485 { 486 - $$ = NscBuildBinaryOp (ANDEQ, $1, $3); 487 + $$ = NscBuildBinaryOp (token::ANDEQ, $1, $3); 488 } 489 | unary_expression XOREQ assignment_expression 490 { 491 - $$ = NscBuildBinaryOp (XOREQ, $1, $3); 492 + $$ = NscBuildBinaryOp (token::XOREQ, $1, $3); 493 } 494 | unary_expression OREQ assignment_expression 495 { 496 - $$ = NscBuildBinaryOp (OREQ, $1, $3); 497 + $$ = NscBuildBinaryOp (token::OREQ, $1, $3); 498 } 499 ; 500 501 @@ -480,39 +480,39 @@ qualified_type_specifier: 502 type_specifier: 503 VOID_TYPE 504 { 505 - $$ = NscBuildType (VOID_TYPE, NULL); 506 + $$ = NscBuildType (token::VOID_TYPE, NULL); 507 } 508 | INT_TYPE 509 { 510 - $$ = NscBuildType (INT_TYPE, NULL); 511 + $$ = NscBuildType (token::INT_TYPE, NULL); 512 } 513 | FLOAT_TYPE 514 { 515 - $$ = NscBuildType (FLOAT_TYPE, NULL); 516 + $$ = NscBuildType (token::FLOAT_TYPE, NULL); 517 } 518 | OBJECT_TYPE 519 { 520 - $$ = NscBuildType (OBJECT_TYPE, NULL); 521 + $$ = NscBuildType (token::OBJECT_TYPE, NULL); 522 } 523 | STRING_TYPE 524 { 525 - $$ = NscBuildType (STRING_TYPE, NULL); 526 + $$ = NscBuildType (token::STRING_TYPE, NULL); 527 } 528 | ACTION_TYPE 529 { 530 - $$ = NscBuildType (ACTION_TYPE, NULL); 531 + $$ = NscBuildType (token::ACTION_TYPE, NULL); 532 } 533 | VECTOR_TYPE 534 { 535 - $$ = NscBuildType (VECTOR_TYPE, NULL); 536 + $$ = NscBuildType (token::VECTOR_TYPE, NULL); 537 } 538 | struct_type_start IDENTIFIER 539 { 540 - $$ = NscBuildType (STRUCT_TYPE, $2); 541 + $$ = NscBuildType (token::STRUCT_TYPE, $2); 542 } 543 | ENGINE_TYPE 544 { 545 - $$ = NscBuildType (ENGINE_TYPE, $1); 546 + $$ = NscBuildType (token::ENGINE_TYPE, $1); 547 } 548 ; 549 550 @@ -600,11 +600,11 @@ labeled_statement: 551 case_statement: 552 CASE { NscBuildSaveLine (0); } constant_expression ':' 553 { 554 - $$ = NscBuildCase (CASE, $3); 555 + $$ = NscBuildCase (token::CASE, $3); 556 } 557 | DEFAULT { NscBuildSaveLine (0); } ':' 558 { 559 - $$ = NscBuildCase (DEFAULT, NULL); 560 + $$ = NscBuildCase (token::DEFAULT, NULL); 561 } 562 ; 563 564 @@ -657,6 +657,7 @@ expression_statement: 565 | error 566 { 567 $$ = NULL; 568 +#ifdef YYCHAR_NAME 569 if (NscBuildSyntaxError (YYCHAR_NAME, yylval)) 570 YYABORT; 571 while (YYCHAR_NAME != EOF && YYCHAR_NAME != ';' && YYCHAR_NAME != '{' && YYCHAR_NAME != '}') 572 @@ -668,6 +669,18 @@ expression_statement: 573 } 574 if (YYCHAR_NAME == ';') 575 YYCHAR_NAME = yyempty_; 576 +#else 577 + if (NscBuildSyntaxError (yyla.type, yyla.value)) 578 + YYABORT; 579 + while (yyla.type != EOF && yyla.type != ';' && yyla.type != '{' && yyla.type != '}') 580 + { 581 + if (yyla.value != NULL) 582 + yyla.value; //FIXME 583 + yyla.type = yytranslate_ (yylex (&yyla.value, context)); 584 + } 585 + if (yyla.type == ';') 586 + yyla.clear (); 587 +#endif // YYCHAR_NAME 588 } 589 ; 590 591 @@ -680,15 +693,15 @@ expression_statement: 592 selection_statement: 593 if_start statement_blank_error 594 { 595 - $$ = NscBuild5Block (IF, $1, 0, NULL, NULL, NULL, $2, NULL); 596 + $$ = NscBuild5Block (token::IF, $1, 0, NULL, NULL, NULL, $2, NULL); 597 } 598 | if_else_start statement_blank_error 599 { 600 - $$ = NscBuild5Block (IF, $1, 0, NULL, NULL, NULL, NULL, $2); 601 + $$ = NscBuild5Block (token::IF, $1, 0, NULL, NULL, NULL, NULL, $2); 602 } 603 | switch_start statement 604 { 605 - $$ = NscBuild5Block (SWITCH, $1, 0, NULL, NULL, NULL, $2, NULL); 606 + $$ = NscBuild5Block (token::SWITCH, $1, 0, NULL, NULL, NULL, $2, NULL); 607 } 608 ; 609 610 @@ -696,21 +709,21 @@ if_else_start: 611 if_start statement_blank_error ELSE 612 { 613 NscBuildSaveLine (0); 614 - $$ = NscBuild5Block (IF, $1, 1, NULL, NULL, NULL, $2, NULL); 615 + $$ = NscBuild5Block (token::IF, $1, 1, NULL, NULL, NULL, $2, NULL); 616 } 617 ; 618 619 if_start: 620 IF '(' { NscBuildSaveLine (0); } expression ')' 621 { 622 - $$ = NscBuild5Block (IF, NULL, 1, NULL, $4, NULL, NULL, NULL); 623 + $$ = NscBuild5Block (token::IF, NULL, 1, NULL, $4, NULL, NULL, NULL); 624 } 625 ; 626 627 switch_start: 628 SWITCH { NscBuildSaveLine (0); } '(' expression ')' 629 { 630 - $$ = NscBuild5Block (SWITCH, NULL, 1, NULL, $4, NULL, NULL, NULL); 631 + $$ = NscBuild5Block (token::SWITCH, NULL, 1, NULL, $4, NULL, NULL, NULL); 632 } 633 ; 634 635 @@ -723,50 +736,50 @@ switch_start: 636 iteration_statement: 637 while_start statement 638 { 639 - $$ = NscBuild5Block (WHILE, $1, 0, NULL, NULL, NULL, $2, NULL); 640 + $$ = NscBuild5Block (token::WHILE, $1, 0, NULL, NULL, NULL, $2, NULL); 641 } 642 | do_start statement WHILE { NscBuildSaveLine (0); } '(' expression ')' ';' 643 { 644 - $$ = NscBuild5Block (DO, $1, 0, NULL, $6, NULL, $2, NULL); 645 + $$ = NscBuild5Block (token::DO, $1, 0, NULL, $6, NULL, $2, NULL); 646 } 647 | for_start statement 648 { 649 - $$ = NscBuild5Block (FOR, $1, 0, NULL, NULL, NULL, $2, NULL); 650 + $$ = NscBuild5Block (token::FOR, $1, 0, NULL, NULL, NULL, $2, NULL); 651 } 652 ; 653 654 for_start: 655 for_start_start ';' ';' ')' 656 { 657 - $$ = NscBuild5Block (FOR, NULL, 1, NULL, NULL, NULL, NULL, NULL); 658 + $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, NULL, NULL, NULL, NULL); 659 } 660 | for_start_start expression ';' ';' ')' 661 { 662 - $$ = NscBuild5Block (FOR, NULL, 1, $2, NULL, NULL, NULL, NULL); 663 + $$ = NscBuild5Block (token::FOR, NULL, 1, $2, NULL, NULL, NULL, NULL); 664 } 665 | for_start_start ';' expression ';' ')' 666 { 667 - $$ = NscBuild5Block (FOR, NULL, 1, NULL, $3, NULL, NULL, NULL); 668 + $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, $3, NULL, NULL, NULL); 669 } 670 | for_start_start expression ';' expression ';' ')' 671 { 672 - $$ = NscBuild5Block (FOR, NULL, 1, $2, $4, NULL, NULL, NULL); 673 + $$ = NscBuild5Block (token::FOR, NULL, 1, $2, $4, NULL, NULL, NULL); 674 } 675 | for_start_start ';' ';' expression ')' 676 { 677 - $$ = NscBuild5Block (FOR, NULL, 1, NULL, NULL, $4, NULL, NULL); 678 + $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, NULL, $4, NULL, NULL); 679 } 680 | for_start_start expression ';' ';' expression ')' 681 { 682 - $$ = NscBuild5Block (FOR, NULL, 1, $2, NULL, $5, NULL, NULL); 683 + $$ = NscBuild5Block (token::FOR, NULL, 1, $2, NULL, $5, NULL, NULL); 684 } 685 | for_start_start ';' expression ';' expression ')' 686 { 687 - $$ = NscBuild5Block (FOR, NULL, 1, NULL, $3, $5, NULL, NULL); 688 + $$ = NscBuild5Block (token::FOR, NULL, 1, NULL, $3, $5, NULL, NULL); 689 } 690 | for_start_start expression ';' expression ';' expression ')' 691 { 692 - $$ = NscBuild5Block (FOR, NULL, 1, $2, $4, $6, NULL, NULL); 693 + $$ = NscBuild5Block (token::FOR, NULL, 1, $2, $4, $6, NULL, NULL); 694 } 695 ; 696 697 @@ -780,14 +793,14 @@ for_start_start: 698 while_start: 699 WHILE '(' { NscBuildSaveLine (0); } expression ')' 700 { 701 - $$ = NscBuild5Block (WHILE, NULL, 1, NULL, $4, NULL, NULL, NULL); 702 + $$ = NscBuild5Block (token::WHILE, NULL, 1, NULL, $4, NULL, NULL, NULL); 703 } 704 ; 705 706 do_start: 707 DO 708 { 709 - $$ = NscBuild5Block (DO, NULL, 1, NULL, NULL, NULL, NULL, NULL); 710 + $$ = NscBuild5Block (token::DO, NULL, 1, NULL, NULL, NULL, NULL, NULL); 711 } 712 ; 713 714 @@ -800,11 +813,11 @@ do_start: 715 jump_statement: 716 CONTINUE { NscBuildSaveLine (0); } ';' 717 { 718 - $$ = NscBuildBreakContinue (CONTINUE); 719 + $$ = NscBuildBreakContinue (token::CONTINUE); 720 } 721 | BREAK { NscBuildSaveLine (0); } ';' 722 { 723 - $$ = NscBuildBreakContinue (BREAK); 724 + $$ = NscBuildBreakContinue (token::BREAK); 725 } 726 | return_start ';' 727 { 728 @@ -984,6 +997,7 @@ translation_unit: 729 | error 730 { 731 $$ = NULL; 732 +#ifdef YYCHAR_NAME 733 if (NscBuildSyntaxError (YYCHAR_NAME, yylval)) 734 YYABORT; 735 while (YYCHAR_NAME != EOF && YYCHAR_NAME != ';' && YYCHAR_NAME != '{' && YYCHAR_NAME != '}') 736 @@ -994,6 +1008,17 @@ translation_unit: 737 YYCHAR_NAME = yylex (&yylval, context); 738 } 739 YYCHAR_NAME = yyempty_; 740 +#else 741 + if (NscBuildSyntaxError (yyla.type, yyla.value)) 742 + YYABORT; 743 + while (yyla.type != EOF && yyla.type != ';' && yyla.type != '{' && yyla.type != '}') 744 + { 745 + if (yyla.value != NULL) 746 + yyla.value; //FIXME 747 + yyla.type = yytranslate_ (yylex (&yyla.value, context)); 748 + } 749 + yyla.clear (); 750 +#endif // YYCHAR_NAME 751 } 752 ; 753 754 Index: _NscLib/NscParserRoutines.cpp 755 =================================================================== 756 --- _NscLib/NscParserRoutines.cpp.orig 757 +++ _NscLib/NscParserRoutines.cpp 758 @@ -43,6 +43,9 @@ 759 #include "NscPStackEntry.h" 760 #include "NscSymbolTable.h" 761 762 +// "Import" token definitions. 763 +typedef yy::parser::token token; 764 + 765 // 766 // Externals 767 // 768 @@ -396,142 +399,142 @@ bool NscBuildSyntaxError (int nToken, YY 769 770 switch (nToken) 771 { 772 - case IDENTIFIER: 773 + case token::IDENTIFIER: 774 if (yylval) 775 pszToken = yylval ->GetIdentifier (); 776 else 777 pszToken = "identifier"; 778 break; 779 780 - case INTEGER_CONST: 781 + case token::INTEGER_CONST: 782 pszToken = "integer constant"; 783 break; 784 785 - case FLOAT_CONST: 786 + case token::FLOAT_CONST: 787 pszToken = "float constant"; 788 break; 789 790 - case STRING_CONST: 791 + case token::STRING_CONST: 792 pszToken = "string constant"; 793 break; 794 795 - case ADDEQ: 796 + case token::ADDEQ: 797 pszToken = "+="; 798 break; 799 800 - case SUBEQ: 801 + case token::SUBEQ: 802 pszToken = "-="; 803 break; 804 805 - case MULEQ: 806 + case token::MULEQ: 807 pszToken = "*="; 808 break; 809 810 - case DIVEQ: 811 + case token::DIVEQ: 812 pszToken = "/="; 813 break; 814 815 - case MODEQ: 816 + case token::MODEQ: 817 pszToken = "%="; 818 break; 819 820 - case XOREQ: 821 + case token::XOREQ: 822 pszToken = "^="; 823 break; 824 825 - case ANDEQ: 826 + case token::ANDEQ: 827 pszToken = "&="; 828 break; 829 830 - case OREQ: 831 + case token::OREQ: 832 pszToken = "|="; 833 break; 834 835 - case SL: 836 + case token::SL: 837 pszToken = "<<"; 838 break; 839 840 - case SR: 841 + case token::SR: 842 pszToken = ">>"; 843 break; 844 845 - case USR: 846 + case token::USR: 847 pszToken = ">>>"; 848 break; 849 850 - case SLEQ: 851 + case token::SLEQ: 852 pszToken = "<<="; 853 break; 854 855 - case SREQ: 856 + case token::SREQ: 857 pszToken = ">>="; 858 break; 859 860 - case USREQ: 861 + case token::USREQ: 862 pszToken = ">>>="; 863 break; 864 865 - case EQ: 866 + case token::EQ: 867 pszToken = "=="; 868 break; 869 870 - case NOTEQ: 871 + case token::NOTEQ: 872 pszToken = "!="; 873 break; 874 875 - case LTEQ: 876 + case token::LTEQ: 877 pszToken = "<="; 878 break; 879 880 - case GTEQ: 881 + case token::GTEQ: 882 pszToken = ">="; 883 break; 884 885 - case ANDAND: 886 + case token::ANDAND: 887 pszToken = "&&"; 888 break; 889 890 - case OROR: 891 + case token::OROR: 892 pszToken = "||"; 893 break; 894 895 - case PLUSPLUS: 896 + case token::PLUSPLUS: 897 pszToken = "++"; 898 break; 899 900 - case MINUSMINUS: 901 + case token::MINUSMINUS: 902 pszToken = "--"; 903 break; 904 905 - case FLOAT_TYPE: 906 + case token::FLOAT_TYPE: 907 pszToken = "float"; 908 break; 909 910 - case INT_TYPE: 911 + case token::INT_TYPE: 912 pszToken = "int"; 913 break; 914 915 - case OBJECT_TYPE: 916 + case token::OBJECT_TYPE: 917 pszToken = "object"; 918 break; 919 920 - case STRING_TYPE: 921 + case token::STRING_TYPE: 922 pszToken = "string"; 923 break; 924 925 - case VOID_TYPE: 926 + case token::VOID_TYPE: 927 pszToken = "void"; 928 break; 929 930 - case STRUCT_TYPE: 931 + case token::STRUCT_TYPE: 932 pszToken = "struct"; 933 break; 934 935 - case VECTOR_TYPE: 936 + case token::VECTOR_TYPE: 937 pszToken = "vector"; 938 break; 939 940 - case ENGINE_TYPE: 941 + case token::ENGINE_TYPE: 942 if (yylval) 943 { 944 int nIndex = yylval ->GetType () - NscType_Engine_0; 945 @@ -541,63 +544,63 @@ bool NscBuildSyntaxError (int nToken, YY 946 pszToken = "engine-type"; 947 break; 948 949 - case ACTION_TYPE: 950 + case token::ACTION_TYPE: 951 pszToken = "action"; 952 break; 953 954 - case OBJECT_SELF_CONST: 955 + case token::OBJECT_SELF_CONST: 956 pszToken = "OBJECT_SELF"; 957 break; 958 959 - case OBJECT_INVALID_CONST: 960 + case token::OBJECT_INVALID_CONST: 961 pszToken = "OBJECT_INVALID"; 962 break; 963 964 - case BREAK: 965 + case token::BREAK: 966 pszToken = "break"; 967 break; 968 969 - case CASE: 970 + case token::CASE: 971 pszToken = "case"; 972 break; 973 974 - case CONTINUE: 975 + case token::CONTINUE: 976 pszToken = "continue"; 977 break; 978 979 - case DEFAULT: 980 + case token::DEFAULT: 981 pszToken = "default"; 982 break; 983 984 - case DO: 985 + case token::DO: 986 pszToken = "do"; 987 break; 988 989 - case ELSE: 990 + case token::ELSE: 991 pszToken = "else"; 992 break; 993 994 - case FOR: 995 + case token::FOR: 996 pszToken = "for"; 997 break; 998 999 - case IF: 1000 + case token::IF: 1001 pszToken = "if"; 1002 break; 1003 1004 - case RETURN: 1005 + case token::RETURN: 1006 pszToken = "return"; 1007 break; 1008 1009 - case SWITCH: 1010 + case token::SWITCH: 1011 pszToken = "switch"; 1012 break; 1013 1014 - case WHILE: 1015 + case token::WHILE: 1016 pszToken = "while"; 1017 break; 1018 1019 - case NWCONST: 1020 + case token::NWCONST: 1021 pszToken = "const"; 1022 break; 1023 1024 @@ -657,31 +660,31 @@ YYSTYPE NscBuildType (int nType, YYSTYPE 1025 1026 switch (nType) 1027 { 1028 - case VOID_TYPE: 1029 + case token::VOID_TYPE: 1030 pOut ->SetType (NscType_Void); 1031 break; 1032 1033 - case INT_TYPE: 1034 + case token::INT_TYPE: 1035 pOut ->SetType (NscType_Integer); 1036 break; 1037 1038 - case FLOAT_TYPE: 1039 + case token::FLOAT_TYPE: 1040 pOut ->SetType (NscType_Float); 1041 break; 1042 1043 - case OBJECT_TYPE: 1044 + case token::OBJECT_TYPE: 1045 pOut ->SetType (NscType_Object); 1046 break; 1047 1048 - case STRING_TYPE: 1049 + case token::STRING_TYPE: 1050 pOut ->SetType (NscType_String); 1051 break; 1052 1053 - case VECTOR_TYPE: 1054 + case token::VECTOR_TYPE: 1055 pOut ->SetType (NscType_Vector); 1056 break; 1057 1058 - case ACTION_TYPE: 1059 + case token::ACTION_TYPE: 1060 if (!g_pCtx ->IsNWScript ()) 1061 { 1062 g_pCtx ->GenerateError ("\"action\" identifier only " 1063 @@ -692,7 +695,7 @@ YYSTYPE NscBuildType (int nType, YYSTYPE 1064 pOut ->SetType (NscType_Action); 1065 break; 1066 1067 - case STRUCT_TYPE: 1068 + case token::STRUCT_TYPE: 1069 assert (pId != NULL); 1070 { 1071 if (!g_pCtx ->IsPhase2 () && !g_pCtx ->IsNWScript ()) 1072 @@ -723,7 +726,7 @@ YYSTYPE NscBuildType (int nType, YYSTYPE 1073 } 1074 break; 1075 1076 - case ENGINE_TYPE: 1077 + case token::ENGINE_TYPE: 1078 assert (pId != NULL); 1079 { 1080 pOut ->SetType (pId ->GetType ()); 1081 @@ -2923,7 +2926,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1082 } 1083 break; 1084 1085 - case SL: 1086 + case token::SL: 1087 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 1088 { 1089 if (g_pCtx ->GetOptExpression () && 1090 @@ -2948,7 +2951,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1091 } 1092 break; 1093 1094 - case SR: 1095 + case token::SR: 1096 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 1097 { 1098 #ifdef NOT_ENABLED_YET 1099 @@ -2975,7 +2978,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1100 } 1101 break; 1102 1103 - case USR: 1104 + case token::USR: 1105 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 1106 { 1107 #ifdef NOT_ENABLED_YET 1108 @@ -3086,7 +3089,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1109 } 1110 break; 1111 1112 - case LTEQ: 1113 + case token::LTEQ: 1114 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 1115 { 1116 if (g_pCtx ->GetOptExpression () && 1117 @@ -3128,7 +3131,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1118 } 1119 break; 1120 1121 - case GTEQ: 1122 + case token::GTEQ: 1123 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 1124 { 1125 if (g_pCtx ->GetOptExpression () && 1126 @@ -3170,7 +3173,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1127 } 1128 break; 1129 1130 - case EQ: 1131 + case token::EQ: 1132 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 1133 { 1134 if (g_pCtx ->GetOptExpression () && 1135 @@ -3260,7 +3263,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1136 } 1137 break; 1138 1139 - case NOTEQ: 1140 + case token::NOTEQ: 1141 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 1142 { 1143 if (g_pCtx ->GetOptExpression () && 1144 @@ -3440,7 +3443,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1145 } 1146 break; 1147 1148 - case MULEQ: 1149 + case token::MULEQ: 1150 if (nLhsType == NscType_Vector && nRhsType == NscType_Float) 1151 { 1152 NscPushAssignment (pOut, NscPCode_AsnMultiply, 1153 @@ -3468,7 +3471,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1154 } 1155 break; 1156 1157 - case DIVEQ: 1158 + case token::DIVEQ: 1159 if (nLhsType == NscType_Vector && nRhsType == NscType_Float) 1160 { 1161 NscPushAssignment (pOut, NscPCode_AsnDivide, 1162 @@ -3496,7 +3499,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1163 } 1164 break; 1165 1166 - case MODEQ: 1167 + case token::MODEQ: 1168 if (nLhsType == NscType_Integer && nRhsType == NscType_Integer) 1169 { 1170 NscPushAssignment (pOut, NscPCode_AsnModulus, 1171 @@ -3509,7 +3512,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1172 } 1173 break; 1174 1175 - case ADDEQ: 1176 + case token::ADDEQ: 1177 if (nLhsType == NscType_Vector && nRhsType == NscType_Vector) 1178 { 1179 NscPushAssignment (pOut, NscPCode_AsnAdd, 1180 @@ -3542,7 +3545,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1181 } 1182 break; 1183 1184 - case SUBEQ: 1185 + case token::SUBEQ: 1186 if (nLhsType == NscType_Vector && nRhsType == NscType_Vector) 1187 { 1188 NscPushAssignment (pOut, NscPCode_AsnSubtract, 1189 @@ -3570,7 +3573,7 @@ YYSTYPE NscBuildBinaryOp (int nToken, YY 1190 } 1191 break; 1192 1193 - case SLEQ: 1194 + case token::SLEQ: 1195 pszOp = "<<="; 1196 nOp = NscPCode_AsnShiftLeft; 1197 asn_shift_operator:; 1198 @@ -3586,17 +3589,17 @@ asn_shift_operator:; 1199 } 1200 break; 1201 1202 - case SREQ: 1203 + case token::SREQ: 1204 pszOp = ">>="; 1205 nOp = NscPCode_AsnShiftRight; 1206 goto asn_shift_operator; 1207 1208 - case USREQ: 1209 + case token::USREQ: 1210 pszOp = ">>>="; 1211 nOp = NscPCode_AsnUnsignedShiftRight; 1212 goto asn_shift_operator; 1213 1214 - case ANDEQ: 1215 + case token::ANDEQ: 1216 pszOp = "&="; 1217 nOp = NscPCode_AsnBitwiseAND; 1218 asn_bitwise_expression:; 1219 @@ -3612,12 +3615,12 @@ asn_bitwise_expression:; 1220 } 1221 break; 1222 1223 - case XOREQ: 1224 + case token::XOREQ: 1225 pszOp = "^="; 1226 nOp = NscPCode_AsnBitwiseXOR; 1227 goto asn_bitwise_expression; 1228 1229 - case OREQ: 1230 + case token::OREQ: 1231 pszOp = "|="; 1232 nOp = NscPCode_AsnBitwiseOR; 1233 goto asn_bitwise_expression; 1234 @@ -3696,12 +3699,12 @@ YYSTYPE NscBuildLogicalOp (int nToken, Y 1235 1236 const char *pszOp; 1237 NscPCode nOp; 1238 - if (nToken == ANDAND) 1239 + if (nToken == token::ANDAND) 1240 { 1241 pszOp = "&&"; 1242 nOp = NscPCode_LogicalAND; 1243 } 1244 - else if (nToken == OROR) 1245 + else if (nToken == token::OROR) 1246 { 1247 pszOp = "||"; 1248 nOp = NscPCode_LogicalOR; 1249 @@ -3750,12 +3753,12 @@ YYSTYPE NscBuildLogicalOp (int nToken, Y 1250 // If the operation is known to be true or false by the lhs 1251 // 1252 1253 - else if (nToken == ANDAND && nLhsConstant == 0) 1254 + else if (nToken == token::ANDAND && nLhsConstant == 0) 1255 { 1256 pOut ->PushConstantInteger (0); 1257 pOut ->SetType (NscType_Integer); 1258 } 1259 - else if (nToken == OROR && nLhsConstant == 1) 1260 + else if (nToken == token::OROR && nLhsConstant == 1) 1261 { 1262 pOut ->PushConstantInteger (1); 1263 pOut ->SetType (NscType_Integer); 1264 @@ -4706,7 +4709,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST 1265 bool fCheckCond; 1266 switch (nToken) 1267 { 1268 - case IF: 1269 + case token::IF: 1270 nPCode = NscPCode_If; 1271 nFenceType = NscFenceType_If; 1272 pszToken = "if"; 1273 @@ -4714,7 +4717,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST 1274 fCheckCond = pPrev == NULL; 1275 break; 1276 1277 - case WHILE: 1278 + case token::WHILE: 1279 nPCode = NscPCode_While; 1280 nFenceType = NscFenceType_While; 1281 pszToken = "while"; 1282 @@ -4722,7 +4725,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST 1283 fCheckCond = pPrev == NULL; 1284 break; 1285 1286 - case DO: 1287 + case token::DO: 1288 nPCode = NscPCode_Do; 1289 nFenceType = NscFenceType_Do; 1290 pszToken = "do"; 1291 @@ -4730,7 +4733,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST 1292 fCheckCond = pPrev != NULL; 1293 break; 1294 1295 - case FOR: 1296 + case token::FOR: 1297 nPCode = NscPCode_For; 1298 nFenceType = NscFenceType_For; 1299 pszToken = "for"; 1300 @@ -4738,7 +4741,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST 1301 fCheckCond = pPrev == NULL; 1302 break; 1303 1304 - case SWITCH: 1305 + case token::SWITCH: 1306 nPCode = NscPCode_Switch; 1307 nFenceType = NscFenceType_Switch; 1308 pszToken = "switch"; 1309 @@ -4787,7 +4790,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST 1310 // for this 1311 // 1312 1313 - if (nToken == SWITCH) 1314 + if (nToken == token::SWITCH) 1315 { 1316 NscSymbolFence *pFence = g_pCtx ->GetCurrentFence (); 1317 pFence ->nPrevLocals++; 1318 @@ -4806,7 +4809,7 @@ YYSTYPE NscBuild5Block (int nToken, YYST 1319 // then set return 1320 // 1321 1322 - if (nToken == IF && pFalse) 1323 + if (nToken == token::IF && pFalse) 1324 { 1325 if (fHadReturn) 1326 NscSetFenceReturn (true); 1327 @@ -4992,7 +4995,7 @@ YYSTYPE NscBuildCase (int nToken, YYSTYP 1328 // If this is a case 1329 // 1330 1331 - if (nToken == CASE) 1332 + if (nToken == token::CASE) 1333 { 1334 1335 // 1336 @@ -5061,7 +5064,7 @@ YYSTYPE NscBuildCase (int nToken, YYSTYP 1337 // Test for only one default 1338 // 1339 1340 - if (nToken == DEFAULT) 1341 + if (nToken == token::DEFAULT) 1342 { 1343 if (pFence ->fHasDefault) 1344 { 1345 @@ -5086,9 +5089,9 @@ YYSTYPE NscBuildCase (int nToken, YYSTYP 1346 // 1347 1348 NscPCode nPCode; 1349 - if (nToken == CASE) 1350 + if (nToken == token::CASE) 1351 nPCode = NscPCode_Case; 1352 - else if (nToken == DEFAULT) 1353 + else if (nToken == token::DEFAULT) 1354 nPCode = NscPCode_Default; 1355 else 1356 { 1357 @@ -5262,9 +5265,9 @@ YYSTYPE NscBuildBreakContinue (int nToke 1358 // 1359 1360 NscPCode nPCode; 1361 - if (nToken == BREAK) 1362 + if (nToken == token::BREAK) 1363 nPCode = NscPCode_Break; 1364 - else if (nToken == CONTINUE) 1365 + else if (nToken == token::CONTINUE) 1366 nPCode = NscPCode_Continue; 1367 else 1368 { 1369 @@ -5279,7 +5282,7 @@ YYSTYPE NscBuildBreakContinue (int nToke 1370 NscSymbolFence *pFence = g_pCtx ->GetCurrentFence (); 1371 while (pFence) 1372 { 1373 - if ((pFence ->nFenceType == NscFenceType_Switch && nToken == BREAK) || 1374 + if ((pFence ->nFenceType == NscFenceType_Switch && nToken == token::BREAK) || 1375 pFence ->nFenceType == NscFenceType_Do || 1376 pFence ->nFenceType == NscFenceType_While || 1377 pFence ->nFenceType == NscFenceType_For) 1378 @@ -5288,12 +5291,12 @@ YYSTYPE NscBuildBreakContinue (int nToke 1379 } 1380 if (pFence == NULL) 1381 { 1382 - if (nToken == BREAK) 1383 + if (nToken == token::BREAK) 1384 { 1385 g_pCtx ->GenerateError ("\"break\" statement only allowed in " 1386 "\"switch\", \"do\", \"while\", and \"for\" statements"); 1387 } 1388 - else if (nToken == CONTINUE) 1389 + else if (nToken == token::CONTINUE) 1390 { 1391 g_pCtx ->GenerateError ("\"continue\" statement only allowed in " 1392 "\"do\", \"while\", and \"for\" statements"); -
deleted file dports/games/nwntools/files/fno-default-inline.patch
diff --git a/dports/games/nwntools/files/fno-default-inline.patch b/dports/games/nwntools/files/fno-default-inline.patch deleted file mode 100644 index 786d06d..0000000
+ - 1 --- _MathLib/Makefile.in.orig 2006-01-31 11:39:10.000000000 +11002 +++ _MathLib/Makefile.in 2014-12-17 14:02:09.000000000 +11003 @@ -193,7 +193,6 @@4 Vector4.h5 6 libmath_a_LIBADD = @LIBOBJS@7 -AM_CXXFLAGS = -fno-default-inline8 EXTRA_DIST = \9 _MathLib.vcproj10 11 --- _NscLib/Makefile.in.orig 2006-01-31 11:39:10.000000000 +110012 +++ _NscLib/Makefile.in 2014-12-17 14:04:25.000000000 +110013 @@ -178,7 +178,6 @@14 sharedstatedir = @sharedstatedir@15 sysconfdir = @sysconfdir@16 target_alias = @target_alias@17 -AM_CXXFLAGS = -fno-default-inline18 AM_YFLAGS = --defines=NscParser.h --skeleton=lalr1.cc19 noinst_LIBRARIES = libnsc.a20 libnsc_a_SOURCES = \21 --- _NwnLib/Makefile.in.orig 2006-01-31 11:39:10.000000000 +110022 +++ _NwnLib/Makefile.in 2014-12-17 14:03:39.000000000 +110023 @@ -212,7 +212,6 @@24 NwnTexturePlt.h25 26 libnwn_a_LIBADD = @LIBOBJS@27 -AM_CXXFLAGS = -fno-default-inline28 EXTRA_DIST = \29 _NwnLib.vcproj30 31 --- nwnmdlcomp/Makefile.in.orig 2006-01-31 11:39:10.000000000 +110032 +++ nwnmdlcomp/Makefile.in 2014-12-17 15:18:37.000000000 +110033 @@ -172,7 +172,6 @@34 target_alias = @target_alias@35 nwnmdlcomp_SOURCES = nwnmdlcomp.cpp36 nwnmdlcomp_LDADD = ../_NmcLib/libnmc.a ../_NwnLib/libnwn.a ../_MathLib/libmath.a37 -AM_CXXFLAGS = -fno-default-inline38 EXTRA_DIST = \39 nwnmdlcomp.vcproj40 41 --- nwnnsscomp/Makefile.in.orig 2006-01-31 11:39:11.000000000 +110042 +++ nwnnsscomp/Makefile.in 2014-12-17 15:17:23.000000000 +110043 @@ -179,7 +179,6 @@44 SUBDIRS = python45 nwnnsscomp_SOURCES = nwnnsscomp.cpp46 nwnnsscomp_LDADD = ../_NwnLib/libnwn.a ../_NscLib/libnsc.a47 -AM_CXXFLAGS = -fno-default-inline48 EXTRA_DIST = \49 nwnnsscomp.vcproj50 -
new file dports/games/nwntools/files/python2.7.patch
diff --git a/dports/games/nwntools/files/python2.7.patch b/dports/games/nwntools/files/python2.7.patch new file mode 100644 index 0000000..1f2a168
- + 1 Index: aclocal.m4 2 =================================================================== 3 --- aclocal.m4.orig 4 +++ aclocal.m4 5 @@ -786,7 +786,7 @@ python2.1 python2.0 python1.6 python1.5] 6 dnl doesn't work. 7 AC_CACHE_CHECK([for $am_display_PYTHON script directory], 8 [am_cv_python_pythondir], 9 - [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || 10 + [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0)" 2>/dev/null || 11 echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) 12 AC_SUBST([pythondir], [$am_cv_python_pythondir]) 13 14 @@ -803,7 +803,7 @@ python2.1 python2.0 python1.6 python1.5] 15 dnl doesn't work. 16 AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], 17 [am_cv_python_pyexecdir], 18 - [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || 19 + [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0)" 2>/dev/null || 20 echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) 21 AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) 22 23 Index: nwnnsscomp/python/Makefile.am 24 =================================================================== 25 --- nwnnsscomp/python/Makefile.am.orig 26 +++ nwnnsscomp/python/Makefile.am 27 @@ -1,8 +1,8 @@ 28 all-local: setup.py compiler.cpp __init__.py 29 - $(PYTHON) setup.py build 30 + $(PYTHON) setup.py --no-user-cfg build 31 32 install-exec-local: 33 - $(PYTHON) setup.py install --prefix=${DESTDIR}${prefix} 34 + $(PYTHON) setup.py --no-user-cfg install --root=${DESTDIR} 35 36 EXTRA_DIST = \ 37 compiler.cpp \ -
new file dports/games/nwntools/files/remove-fno-default-inline.patch
diff --git a/dports/games/nwntools/files/remove-fno-default-inline.patch b/dports/games/nwntools/files/remove-fno-default-inline.patch new file mode 100644 index 0000000..e1bf861
- + 1 Index: _MathLib/Makefile.am 2 =================================================================== 3 --- _MathLib/Makefile.am.orig 4 +++ _MathLib/Makefile.am 5 @@ -19,8 +19,6 @@ libmath_a_SOURCES = \ 6 7 libmath_a_LIBADD = @LIBOBJS@ 8 9 -AM_CXXFLAGS = -fno-default-inline 10 - 11 EXTRA_DIST = \ 12 _MathLib.vcproj 13 14 Index: _NscLib/Makefile.am 15 =================================================================== 16 --- _NscLib/Makefile.am.orig 17 +++ _NscLib/Makefile.am 18 @@ -1,6 +1,3 @@ 19 - 20 -AM_CXXFLAGS = -fno-default-inline 21 - 22 AM_YFLAGS = --defines=NscParser.h --skeleton=lalr1.cc 23 24 noinst_LIBRARIES = libnsc.a 25 Index: _NwnLib/Makefile.am 26 =================================================================== 27 --- _NwnLib/Makefile.am.orig 28 +++ _NwnLib/Makefile.am 29 @@ -35,8 +35,6 @@ libnwn_a_SOURCES = \ 30 31 libnwn_a_LIBADD = @LIBOBJS@ 32 33 -AM_CXXFLAGS = -fno-default-inline 34 - 35 EXTRA_DIST = \ 36 _NwnLib.vcproj 37 38 Index: nwnmdlcomp/Makefile.am 39 =================================================================== 40 --- nwnmdlcomp/Makefile.am.orig 41 +++ nwnmdlcomp/Makefile.am 42 @@ -4,8 +4,6 @@ nwnmdlcomp_SOURCES = nwnmdlcomp.cpp 43 44 nwnmdlcomp_LDADD = ../_NmcLib/libnmc.a ../_NwnLib/libnwn.a ../_MathLib/libmath.a 45 46 -AM_CXXFLAGS = -fno-default-inline 47 - 48 EXTRA_DIST = \ 49 nwnmdlcomp.vcproj 50 51 Index: nwnnsscomp/Makefile.am 52 =================================================================== 53 --- nwnnsscomp/Makefile.am.orig 54 +++ nwnnsscomp/Makefile.am 55 @@ -6,8 +6,6 @@ nwnnsscomp_SOURCES = nwnnsscomp.cpp 56 57 nwnnsscomp_LDADD = ../_NwnLib/libnwn.a ../_NscLib/libnsc.a 58 59 -AM_CXXFLAGS = -fno-default-inline 60 - 61 EXTRA_DIST = \ 62 nwnnsscomp.vcproj 63