openfoam/wmake/etc/lempar.c.patch
Mark Olesen 9c727abb84 COMP: increment lemon sources, fix stray comment char (wmkdepend)
COMP: compile utilites before solvers

- there are no inter-dependencies,
  so favour getting utilities working first
2022-05-11 09:53:58 +02:00

87 lines
2.5 KiB
Diff

--- lempar.c.orig 2022-05-11 05:42:38.000000000 +0200
+++ lempar.c 2022-05-11 09:13:31.688352277 +0200
@@ -89,6 +89,11 @@
/************* End control #defines *******************************************/
#define YY_NLOOKAHEAD ((int)(sizeof(yy_lookahead)/sizeof(yy_lookahead[0])))
+/* Default linkage for exposed parser routines is global */
+#ifndef YYFUNCAPI
+# define YYFUNCAPI
+#endif
+
/* Define the yytestcase() macro to be a no-op if is not already defined
** otherwise.
**
@@ -248,6 +253,7 @@
** Outputs:
** None.
*/
+YYFUNCAPI
void ParseTrace(FILE *TraceFILE, char *zTracePrompt){
yyTraceFILE = TraceFILE;
yyTracePrompt = zTracePrompt;
@@ -317,6 +323,7 @@
/* Initialize a new parser that has already been allocated.
*/
+YYFUNCAPI
void ParseInit(void *yypRawParser ParseCTX_PDECL){
yyParser *yypParser = (yyParser*)yypRawParser;
ParseCTX_STORE
@@ -356,6 +363,7 @@
** A pointer to a parser. This pointer is used in subsequent calls
** to Parse and ParseFree.
*/
+YYFUNCAPI
void *ParseAlloc(void *(*mallocProc)(YYMALLOCARGTYPE) ParseCTX_PDECL){
yyParser *yypParser;
yypParser = (yyParser*)(*mallocProc)( (YYMALLOCARGTYPE)sizeof(yyParser) );
@@ -424,6 +432,7 @@
/*
** Clear all secondary memory allocations from the parser
*/
+YYFUNCAPI
void ParseFinalize(void *p){
yyParser *pParser = (yyParser*)p;
while( pParser->yytos>pParser->yystack ) yy_pop_parser_stack(pParser);
@@ -441,6 +450,7 @@
** is defined in a %include section of the input grammar) then it is
** assumed that the input pointer is never NULL.
*/
+YYFUNCAPI
void ParseFree(
void *p, /* The parser to be deleted */
void (*freeProc)(void*) /* Function used to reclaim memory */
@@ -457,6 +467,7 @@
** Return the peak depth of the stack for a parser.
*/
#ifdef YYTRACKMAXSTACKDEPTH
+YYFUNCAPI
int ParseStackPeak(void *p){
yyParser *pParser = (yyParser*)p;
return pParser->yyhwm;
@@ -481,6 +492,7 @@
** Return the number of missed state/lookahead combinations.
*/
#if defined(YYCOVERAGE)
+YYFUNCAPI
int ParseCoverage(FILE *out){
int stateno, iLookAhead, i;
int nMissed = 0;
@@ -840,6 +852,7 @@
** Outputs:
** None.
*/
+YYFUNCAPI
void Parse(
void *yyp, /* The parser */
int yymajor, /* The major token code number */
@@ -1057,6 +1070,7 @@
** Return the fallback token corresponding to canonical token iToken, or
** 0 if iToken has no fallback.
*/
+YYFUNCAPI
int ParseFallback(int iToken){
#ifdef YYFALLBACK
assert( iToken<(int)(sizeof(yyFallback)/sizeof(yyFallback[0])) );