mirror of
https://github.com/reactos/reactos.git
synced 2025-05-27 21:18:15 +00:00
[WPP]
* Sync with Wine 1.7.27. CORE-8540 svn path=/trunk/; revision=64205
This commit is contained in:
parent
abb354e4da
commit
1b9bf5a3bd
9 changed files with 819 additions and 1078 deletions
|
@ -23,7 +23,7 @@ The following build tools are shared with Wine.
|
||||||
|
|
||||||
reactos/tools/unicode # Synced to Wine-1.7.27
|
reactos/tools/unicode # Synced to Wine-1.7.27
|
||||||
reactos/tools/widl # Synced to Wine-1.7.17
|
reactos/tools/widl # Synced to Wine-1.7.17
|
||||||
reactos/tools/wpp # Synced to Wine-1.7.17
|
reactos/tools/wpp # Synced to Wine-1.7.27
|
||||||
|
|
||||||
The following libraries are shared with Wine.
|
The following libraries are shared with Wine.
|
||||||
|
|
||||||
|
|
|
@ -213,7 +213,7 @@ typedef struct bufferstackentry {
|
||||||
pp_entry_t *define; /* Points to expanding define or NULL if handling includes */
|
pp_entry_t *define; /* Points to expanding define or NULL if handling includes */
|
||||||
int line_number; /* Line that we were handling */
|
int line_number; /* Line that we were handling */
|
||||||
int char_number; /* The current position on that line */
|
int char_number; /* The current position on that line */
|
||||||
const char *filename; /* Filename that we were handling */
|
char *filename; /* Filename that we were handling */
|
||||||
int if_depth; /* How many #if:s deep to check matching #endif:s */
|
int if_depth; /* How many #if:s deep to check matching #endif:s */
|
||||||
int ncontinuations; /* Remember the continuation state */
|
int ncontinuations; /* Remember the continuation state */
|
||||||
int should_pop; /* Set if we must pop the start-state on EOF */
|
int should_pop; /* Set if we must pop the start-state on EOF */
|
||||||
|
@ -1340,6 +1340,8 @@ static bufferstackentry_t *pop_buffer(void)
|
||||||
bufferstack[bufferstackidx].define->expanding = 0;
|
bufferstack[bufferstackidx].define->expanding = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
includelogicentry_t *iep = NULL;
|
||||||
|
|
||||||
if(!bufferstack[bufferstackidx].should_pop)
|
if(!bufferstack[bufferstackidx].should_pop)
|
||||||
{
|
{
|
||||||
wpp_callbacks->close(pp_status.file);
|
wpp_callbacks->close(pp_status.file);
|
||||||
|
@ -1351,10 +1353,9 @@ static bufferstackentry_t *pop_buffer(void)
|
||||||
pp_entry_t *ppp = pplookup(pp_incl_state.ppp);
|
pp_entry_t *ppp = pplookup(pp_incl_state.ppp);
|
||||||
if(ppp)
|
if(ppp)
|
||||||
{
|
{
|
||||||
includelogicentry_t *iep = pp_xmalloc(sizeof(includelogicentry_t));
|
iep = pp_xmalloc(sizeof(includelogicentry_t));
|
||||||
if(!iep)
|
if (iep)
|
||||||
return NULL;
|
{
|
||||||
|
|
||||||
iep->ppp = ppp;
|
iep->ppp = ppp;
|
||||||
ppp->iep = iep;
|
ppp->iep = iep;
|
||||||
iep->filename = bufferstack[bufferstackidx].include_filename;
|
iep->filename = bufferstack[bufferstackidx].include_filename;
|
||||||
|
@ -1364,19 +1365,25 @@ static bufferstackentry_t *pop_buffer(void)
|
||||||
iep->next->prev = iep;
|
iep->next->prev = iep;
|
||||||
pp_includelogiclist = iep;
|
pp_includelogiclist = iep;
|
||||||
if(pp_status.debug)
|
if(pp_status.debug)
|
||||||
fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename);
|
fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n",
|
||||||
|
bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
free(bufferstack[bufferstackidx].include_filename);
|
|
||||||
}
|
}
|
||||||
free(pp_incl_state.ppp);
|
free(pp_incl_state.ppp);
|
||||||
pp_incl_state = bufferstack[bufferstackidx].incl;
|
pp_incl_state = bufferstack[bufferstackidx].incl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (bufferstack[bufferstackidx].include_filename)
|
||||||
|
{
|
||||||
|
free(pp_status.input);
|
||||||
|
pp_status.input = bufferstack[bufferstackidx].filename;
|
||||||
|
}
|
||||||
pp_status.line_number = bufferstack[bufferstackidx].line_number;
|
pp_status.line_number = bufferstack[bufferstackidx].line_number;
|
||||||
pp_status.char_number = bufferstack[bufferstackidx].char_number;
|
pp_status.char_number = bufferstack[bufferstackidx].char_number;
|
||||||
pp_status.input = bufferstack[bufferstackidx].filename;
|
|
||||||
ncontinuations = bufferstack[bufferstackidx].ncontinuations;
|
ncontinuations = bufferstack[bufferstackidx].ncontinuations;
|
||||||
|
if (!iep)
|
||||||
|
free(bufferstack[bufferstackidx].include_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ppy_debug)
|
if(ppy_debug)
|
||||||
|
@ -1586,6 +1593,7 @@ void pp_do_include(char *fname, int type)
|
||||||
* If the define was deleted, then this entry would have
|
* If the define was deleted, then this entry would have
|
||||||
* been deleted too.
|
* been deleted too.
|
||||||
*/
|
*/
|
||||||
|
free(fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1595,6 +1603,7 @@ void pp_do_include(char *fname, int type)
|
||||||
if(n <= 2)
|
if(n <= 2)
|
||||||
{
|
{
|
||||||
ppy_error("Empty include filename");
|
ppy_error("Empty include filename");
|
||||||
|
free(fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1604,6 +1613,7 @@ void pp_do_include(char *fname, int type)
|
||||||
if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL)
|
if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL)
|
||||||
{
|
{
|
||||||
ppy_error("Unable to open include file %s", fname+1);
|
ppy_error("Unable to open include file %s", fname+1);
|
||||||
|
free(fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1251,7 +1251,7 @@ typedef struct bufferstackentry {
|
||||||
pp_entry_t *define; /* Points to expanding define or NULL if handling includes */
|
pp_entry_t *define; /* Points to expanding define or NULL if handling includes */
|
||||||
int line_number; /* Line that we were handling */
|
int line_number; /* Line that we were handling */
|
||||||
int char_number; /* The current position on that line */
|
int char_number; /* The current position on that line */
|
||||||
const char *filename; /* Filename that we were handling */
|
char *filename; /* Filename that we were handling */
|
||||||
int if_depth; /* How many #if:s deep to check matching #endif:s */
|
int if_depth; /* How many #if:s deep to check matching #endif:s */
|
||||||
int ncontinuations; /* Remember the continuation state */
|
int ncontinuations; /* Remember the continuation state */
|
||||||
int should_pop; /* Set if we must pop the start-state on EOF */
|
int should_pop; /* Set if we must pop the start-state on EOF */
|
||||||
|
@ -4292,6 +4292,8 @@ static bufferstackentry_t *pop_buffer(void)
|
||||||
bufferstack[bufferstackidx].define->expanding = 0;
|
bufferstack[bufferstackidx].define->expanding = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
includelogicentry_t *iep = NULL;
|
||||||
|
|
||||||
if(!bufferstack[bufferstackidx].should_pop)
|
if(!bufferstack[bufferstackidx].should_pop)
|
||||||
{
|
{
|
||||||
wpp_callbacks->close(pp_status.file);
|
wpp_callbacks->close(pp_status.file);
|
||||||
|
@ -4303,10 +4305,9 @@ static bufferstackentry_t *pop_buffer(void)
|
||||||
pp_entry_t *ppp = pplookup(pp_incl_state.ppp);
|
pp_entry_t *ppp = pplookup(pp_incl_state.ppp);
|
||||||
if(ppp)
|
if(ppp)
|
||||||
{
|
{
|
||||||
includelogicentry_t *iep = pp_xmalloc(sizeof(includelogicentry_t));
|
iep = pp_xmalloc(sizeof(includelogicentry_t));
|
||||||
if(!iep)
|
if (iep)
|
||||||
return NULL;
|
{
|
||||||
|
|
||||||
iep->ppp = ppp;
|
iep->ppp = ppp;
|
||||||
ppp->iep = iep;
|
ppp->iep = iep;
|
||||||
iep->filename = bufferstack[bufferstackidx].include_filename;
|
iep->filename = bufferstack[bufferstackidx].include_filename;
|
||||||
|
@ -4316,19 +4317,25 @@ static bufferstackentry_t *pop_buffer(void)
|
||||||
iep->next->prev = iep;
|
iep->next->prev = iep;
|
||||||
pp_includelogiclist = iep;
|
pp_includelogiclist = iep;
|
||||||
if(pp_status.debug)
|
if(pp_status.debug)
|
||||||
fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename);
|
fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n",
|
||||||
|
bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
free(bufferstack[bufferstackidx].include_filename);
|
|
||||||
}
|
}
|
||||||
free(pp_incl_state.ppp);
|
free(pp_incl_state.ppp);
|
||||||
pp_incl_state = bufferstack[bufferstackidx].incl;
|
pp_incl_state = bufferstack[bufferstackidx].incl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if (bufferstack[bufferstackidx].include_filename)
|
||||||
|
{
|
||||||
|
free(pp_status.input);
|
||||||
|
pp_status.input = bufferstack[bufferstackidx].filename;
|
||||||
|
}
|
||||||
pp_status.line_number = bufferstack[bufferstackidx].line_number;
|
pp_status.line_number = bufferstack[bufferstackidx].line_number;
|
||||||
pp_status.char_number = bufferstack[bufferstackidx].char_number;
|
pp_status.char_number = bufferstack[bufferstackidx].char_number;
|
||||||
pp_status.input = bufferstack[bufferstackidx].filename;
|
|
||||||
ncontinuations = bufferstack[bufferstackidx].ncontinuations;
|
ncontinuations = bufferstack[bufferstackidx].ncontinuations;
|
||||||
|
if (!iep)
|
||||||
|
free(bufferstack[bufferstackidx].include_filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ppy_debug)
|
if(ppy_debug)
|
||||||
|
@ -4538,6 +4545,7 @@ void pp_do_include(char *fname, int type)
|
||||||
* If the define was deleted, then this entry would have
|
* If the define was deleted, then this entry would have
|
||||||
* been deleted too.
|
* been deleted too.
|
||||||
*/
|
*/
|
||||||
|
free(fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4547,6 +4555,7 @@ void pp_do_include(char *fname, int type)
|
||||||
if(n <= 2)
|
if(n <= 2)
|
||||||
{
|
{
|
||||||
ppy_error("Empty include filename");
|
ppy_error("Empty include filename");
|
||||||
|
free(fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4556,6 +4565,7 @@ void pp_do_include(char *fname, int type)
|
||||||
if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL)
|
if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL)
|
||||||
{
|
{
|
||||||
ppy_error("Unable to open include file %s", fname+1);
|
ppy_error("Unable to open include file %s", fname+1);
|
||||||
|
free(fname);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,8 +1,8 @@
|
||||||
/* A Bison parser, made by GNU Bison 2.5. */
|
/* A Bison parser, made by GNU Bison 3.0.2. */
|
||||||
|
|
||||||
/* Bison interface for Yacc-like parsers in C
|
/* Bison interface for Yacc-like parsers in C
|
||||||
|
|
||||||
Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc.
|
Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -30,13 +30,21 @@
|
||||||
This special exception was added by the Free Software Foundation in
|
This special exception was added by the Free Software Foundation in
|
||||||
version 2.2 of Bison. */
|
version 2.2 of Bison. */
|
||||||
|
|
||||||
|
#ifndef YY_PPY_PPY_TAB_H_INCLUDED
|
||||||
|
# define YY_PPY_PPY_TAB_H_INCLUDED
|
||||||
|
/* Debug traces. */
|
||||||
|
#ifndef YYDEBUG
|
||||||
|
# define YYDEBUG 0
|
||||||
|
#endif
|
||||||
|
#if YYDEBUG
|
||||||
|
extern int ppy_debug;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Tokens. */
|
/* Token type. */
|
||||||
#ifndef YYTOKENTYPE
|
#ifndef YYTOKENTYPE
|
||||||
# define YYTOKENTYPE
|
# define YYTOKENTYPE
|
||||||
/* Put the tokens into the symbol table, so that GDB and other debuggers
|
enum yytokentype
|
||||||
know about them. */
|
{
|
||||||
enum yytokentype {
|
|
||||||
tRCINCLUDE = 258,
|
tRCINCLUDE = 258,
|
||||||
tIF = 259,
|
tIF = 259,
|
||||||
tIFDEF = 260,
|
tIFDEF = 260,
|
||||||
|
@ -74,23 +82,21 @@
|
||||||
tRCINCLUDEPATH = 292,
|
tRCINCLUDEPATH = 292,
|
||||||
tLOGOR = 293,
|
tLOGOR = 293,
|
||||||
tLOGAND = 294,
|
tLOGAND = 294,
|
||||||
tNE = 295,
|
tEQ = 295,
|
||||||
tEQ = 296,
|
tNE = 296,
|
||||||
tGTE = 297,
|
tLTE = 297,
|
||||||
tLTE = 298,
|
tGTE = 298,
|
||||||
tRSHIFT = 299,
|
tLSHIFT = 299,
|
||||||
tLSHIFT = 300
|
tRSHIFT = 300
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Value type. */
|
||||||
|
|
||||||
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
|
||||||
typedef union YYSTYPE
|
typedef union YYSTYPE YYSTYPE;
|
||||||
|
union YYSTYPE
|
||||||
{
|
{
|
||||||
|
#line 126 "ppy.y" /* yacc.c:1909 */
|
||||||
/* Line 2068 of yacc.c */
|
|
||||||
#line 126 "ppy.y"
|
|
||||||
|
|
||||||
int sint;
|
int sint;
|
||||||
unsigned int uint;
|
unsigned int uint;
|
||||||
|
@ -104,16 +110,15 @@ typedef union YYSTYPE
|
||||||
marg_t *marg;
|
marg_t *marg;
|
||||||
mtext_t *mtext;
|
mtext_t *mtext;
|
||||||
|
|
||||||
|
#line 114 "ppy.tab.h" /* yacc.c:1909 */
|
||||||
|
};
|
||||||
/* Line 2068 of yacc.c */
|
|
||||||
#line 111 "ppy.tab.h"
|
|
||||||
} YYSTYPE;
|
|
||||||
# define YYSTYPE_IS_TRIVIAL 1
|
# define YYSTYPE_IS_TRIVIAL 1
|
||||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
|
||||||
# define YYSTYPE_IS_DECLARED 1
|
# define YYSTYPE_IS_DECLARED 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
extern YYSTYPE ppy_lval;
|
extern YYSTYPE ppy_lval;
|
||||||
|
|
||||||
|
int ppy_parse (void);
|
||||||
|
|
||||||
|
#endif /* !YY_PPY_PPY_TAB_H_INCLUDED */
|
||||||
|
|
|
@ -292,7 +292,7 @@ void pp_pop_define_state(void)
|
||||||
|
|
||||||
for (i = 0; i < HASHKEY; i++)
|
for (i = 0; i < HASHKEY; i++)
|
||||||
{
|
{
|
||||||
while ((ppp = pp_def_state->defines[i]) != NULL) free_pp_entry( ppp, i );
|
while ((ppp = pp_def_state->defines[i]) != NULL) pp_del_define( ppp->ident );
|
||||||
}
|
}
|
||||||
state = pp_def_state;
|
state = pp_def_state;
|
||||||
pp_def_state = state->next;
|
pp_def_state = state->next;
|
||||||
|
@ -302,6 +302,7 @@ void pp_pop_define_state(void)
|
||||||
void pp_del_define(const char *name)
|
void pp_del_define(const char *name)
|
||||||
{
|
{
|
||||||
pp_entry_t *ppp;
|
pp_entry_t *ppp;
|
||||||
|
int idx = pphash(name);
|
||||||
|
|
||||||
if((ppp = pplookup(name)) == NULL)
|
if((ppp = pplookup(name)) == NULL)
|
||||||
{
|
{
|
||||||
|
@ -310,13 +311,13 @@ void pp_del_define(const char *name)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(pp_status.debug)
|
||||||
|
printf("Deleting (%s, %d) <%s>\n", pp_status.input, pp_status.line_number, name);
|
||||||
|
|
||||||
free( ppp->ident );
|
free( ppp->ident );
|
||||||
free( ppp->subst.text );
|
free( ppp->subst.text );
|
||||||
free( ppp->filename );
|
free( ppp->filename );
|
||||||
free_pp_entry( ppp, pphash(name) );
|
free_pp_entry( ppp, idx );
|
||||||
|
|
||||||
if(pp_status.debug)
|
|
||||||
printf("Deleted (%s, %d) <%s>\n", pp_status.input, pp_status.line_number, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pp_entry_t *pp_add_define(const char *def, const char *text)
|
pp_entry_t *pp_add_define(const char *def, const char *text)
|
||||||
|
|
|
@ -206,7 +206,7 @@ int wpp_parse( const char *input, FILE *output )
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
pp_status.input = input;
|
pp_status.input = input ? pp_xstrdup(input) : NULL;
|
||||||
|
|
||||||
ppy_out = output;
|
ppy_out = output;
|
||||||
pp_writestring("# 1 \"%s\" 1\n", input ? input : "");
|
pp_writestring("# 1 \"%s\" 1\n", input ? input : "");
|
||||||
|
@ -215,7 +215,11 @@ int wpp_parse( const char *input, FILE *output )
|
||||||
/* If there were errors during processing, return an error code */
|
/* If there were errors during processing, return an error code */
|
||||||
if (!ret && pp_status.state) ret = pp_status.state;
|
if (!ret && pp_status.state) ret = pp_status.state;
|
||||||
|
|
||||||
if (input) wpp_callbacks->close(pp_status.file);
|
if (input)
|
||||||
|
{
|
||||||
|
wpp_callbacks->close(pp_status.file);
|
||||||
|
free(pp_status.input);
|
||||||
|
}
|
||||||
/* Clean if_stack, it could remain dirty on errors */
|
/* Clean if_stack, it could remain dirty on errors */
|
||||||
while (pp_get_if_depth()) pp_pop_if();
|
while (pp_get_if_depth()) pp_pop_if();
|
||||||
del_special_defines();
|
del_special_defines();
|
||||||
|
|
|
@ -228,7 +228,7 @@ void pp_internal_error(const char *file, int line, const char *s, ...) __attribu
|
||||||
/* everything is in this structure to avoid polluting the global symbol space */
|
/* everything is in this structure to avoid polluting the global symbol space */
|
||||||
struct pp_status
|
struct pp_status
|
||||||
{
|
{
|
||||||
const char *input; /* current input file name */
|
char *input; /* current input file name */
|
||||||
void *file; /* current input file descriptor */
|
void *file; /* current input file descriptor */
|
||||||
int line_number; /* current line number */
|
int line_number; /* current line number */
|
||||||
int char_number; /* current char number in line */
|
int char_number; /* current char number in line */
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
Index: preproc.c
|
|
||||||
===================================================================
|
|
||||||
--- preproc.c (revision 28293)
|
|
||||||
+++ preproc.c (revision 28294)
|
|
||||||
@@ -328,6 +328,15 @@
|
|
||||||
char *tok;
|
|
||||||
char *cpy = pp_xstrdup(path);
|
|
||||||
|
|
||||||
+ /* check for absolute windows paths */
|
|
||||||
+ if (strchr(cpy, ':') != NULL)
|
|
||||||
+ {
|
|
||||||
+ nincludepath++;
|
|
||||||
+ includepath = pp_xrealloc(includepath, nincludepath * sizeof(*includepath));
|
|
||||||
+ includepath[nincludepath-1] = cpy;
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
tok = strtok(cpy, INCLUDESEPARATOR);
|
|
||||||
while(tok)
|
|
||||||
{
|
|
Loading…
Reference in a new issue