Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2d778c5e
Commit
2d778c5e
authored
Sep 12, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wpp: Change the prefix on bison-generated names to avoid the name-prefix directive.
parent
1be6e9a6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
39 deletions
+37
-39
ppl.l
libs/wpp/ppl.l
+0
-0
ppy.y
libs/wpp/ppy.y
+13
-15
preproc.c
libs/wpp/preproc.c
+8
-8
wpp.c
libs/wpp/wpp.c
+8
-8
wpp_private.h
libs/wpp/wpp_private.h
+8
-8
No files found.
libs/wpp/ppl.l
View file @
2d778c5e
This diff is collapsed.
Click to expand it.
libs/wpp/ppy.y
View file @
2d778c5e
...
...
@@ -123,8 +123,6 @@ static int nmacro_args;
%}
%name-prefix="pp"
%union{
int sint;
unsigned int uint;
...
...
@@ -225,7 +223,7 @@ preprocessor
break;
case if_elsetrue:
case if_elsefalse:
pperror("#elif cannot follow #else");
pp
y_
error("#elif cannot follow #else");
default:
pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d) in #elif directive", s);
}
...
...
@@ -248,7 +246,7 @@ preprocessor
break;
case if_elsetrue:
case if_elsefalse:
pperror("#else clause already defined");
pp
y_
error("#else clause already defined");
default:
pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d) in #else directive", s);
}
...
...
@@ -273,21 +271,21 @@ preprocessor
| tMACRO res_arg allmargs tMACROEND opt_mtexts tNL {
pp_add_macro($1, macro_args, nmacro_args, $5);
}
| tLINE tSINT tDQSTRING tNL { fprintf(ppout, "# %d %s\n", $2 , $3); free($3); }
| tGCCLINE tSINT tDQSTRING tNL { fprintf(ppout, "# %d %s\n", $2 , $3); free($3); }
| tLINE tSINT tDQSTRING tNL { fprintf(pp
y_
out, "# %d %s\n", $2 , $3); free($3); }
| tGCCLINE tSINT tDQSTRING tNL { fprintf(pp
y_
out, "# %d %s\n", $2 , $3); free($3); }
| tGCCLINE tSINT tDQSTRING tSINT tNL
{ fprintf(ppout, "# %d %s %d\n", $2, $3, $4); free($3); }
{ fprintf(pp
y_
out, "# %d %s %d\n", $2, $3, $4); free($3); }
| tGCCLINE tSINT tDQSTRING tSINT tSINT tNL
{ fprintf(ppout, "# %d %s %d %d\n", $2 ,$3, $4, $5); free($3); }
{ fprintf(pp
y_
out, "# %d %s %d %d\n", $2 ,$3, $4, $5); free($3); }
| tGCCLINE tSINT tDQSTRING tSINT tSINT tSINT tNL
{ fprintf(ppout, "# %d %s %d %d %d\n", $2 ,$3 ,$4 ,$5, $6); free($3); }
{ fprintf(pp
y_
out, "# %d %s %d %d %d\n", $2 ,$3 ,$4 ,$5, $6); free($3); }
| tGCCLINE tSINT tDQSTRING tSINT tSINT tSINT tSINT tNL
{ fprintf(ppout, "# %d %s %d %d %d %d\n", $2 ,$3 ,$4 ,$5, $6, $7); free($3); }
{ fprintf(pp
y_
out, "# %d %s %d %d %d %d\n", $2 ,$3 ,$4 ,$5, $6, $7); free($3); }
| tGCCLINE tNL /* The null-token */
| tERROR opt_text tNL { pperror("#error directive: '%s'", $2); if($2) free($2); }
| tWARNING opt_text tNL { ppwarning("#warning directive: '%s'", $2); if($2) free($2); }
| tPRAGMA opt_text tNL { fprintf(ppout, "#pragma %s\n", $2 ? $2 : ""); if ($2) free($2); }
| tPPIDENT opt_text tNL { if(pp_status.pedantic) ppwarning("#ident ignored (arg: '%s')", $2); if($2) free($2); }
| tERROR opt_text tNL { pp
y_
error("#error directive: '%s'", $2); if($2) free($2); }
| tWARNING opt_text tNL { pp
y_
warning("#warning directive: '%s'", $2); if($2) free($2); }
| tPRAGMA opt_text tNL { fprintf(pp
y_
out, "#pragma %s\n", $2 ? $2 : ""); if ($2) free($2); }
| tPPIDENT opt_text tNL { if(pp_status.pedantic) pp
y_
warning("#ident ignored (arg: '%s')", $2); if($2) free($2); }
| tRCINCLUDE tRCINCLUDEPATH {
int nl=strlen($2) +3;
char *fn=pp_xmalloc(nl);
...
...
@@ -347,7 +345,7 @@ mtext : tLITERAL { $$ = new_mtext($1, 0, exp_text); }
| tSTRINGIZE tIDENT {
int mat = marg_index($2);
if(mat < 0)
pperror("Stringification identifier must be an argument parameter");
pp
y_
error("Stringification identifier must be an argument parameter");
$$ = new_mtext(NULL, mat, exp_stringize);
}
| tIDENT {
...
...
libs/wpp/preproc.c
View file @
2d778c5e
...
...
@@ -203,7 +203,7 @@ void pp_del_define(const char *name)
if
((
ppp
=
pplookup
(
name
))
==
NULL
)
{
if
(
pp_status
.
pedantic
)
ppwarning
(
"%s was not defined"
,
name
);
pp
y_
warning
(
"%s was not defined"
,
name
);
return
;
}
...
...
@@ -223,7 +223,7 @@ pp_entry_t *pp_add_define(char *def, char *text)
if
((
ppp
=
pplookup
(
def
))
!=
NULL
)
{
if
(
pp_status
.
pedantic
)
ppwarning
(
"Redefinition of %s
\n\t
Previous definition: %s:%d"
,
def
,
ppp
->
filename
,
ppp
->
linenumber
);
pp
y_
warning
(
"Redefinition of %s
\n\t
Previous definition: %s:%d"
,
def
,
ppp
->
filename
,
ppp
->
linenumber
);
pp_del_define
(
def
);
}
ppp
=
pp_xmalloc
(
sizeof
(
pp_entry_t
));
...
...
@@ -265,7 +265,7 @@ pp_entry_t *pp_add_macro(char *id, marg_t *args[], int nargs, mtext_t *exp)
if
((
ppp
=
pplookup
(
id
))
!=
NULL
)
{
if
(
pp_status
.
pedantic
)
ppwarning
(
"Redefinition of %s
\n\t
Previous definition: %s:%d"
,
id
,
ppp
->
filename
,
ppp
->
linenumber
);
pp
y_
warning
(
"Redefinition of %s
\n\t
Previous definition: %s:%d"
,
id
,
ppp
->
filename
,
ppp
->
linenumber
);
pp_del_define
(
id
);
}
ppp
=
pp_xmalloc
(
sizeof
(
pp_entry_t
));
...
...
@@ -524,7 +524,7 @@ void pp_push_if(pp_if_state_t s)
pp_if_state_t
pp_pop_if
(
void
)
{
if
(
if_stack_idx
<=
0
)
pperror
(
"#{endif,else,elif} without #{if,ifdef,ifndef} (#if-stack underflow)"
);
pp
y_
error
(
"#{endif,else,elif} without #{if,ifdef,ifndef} (#if-stack underflow)"
);
switch
(
pp_if_state
())
{
...
...
@@ -606,21 +606,21 @@ static void generic_msg(const char *s, const char *t, const char *n, va_list ap)
fprintf
(
stderr
,
"
\n
"
);
}
int
pperror
(
const
char
*
s
,
...)
int
pp
y_
error
(
const
char
*
s
,
...)
{
va_list
ap
;
va_start
(
ap
,
s
);
generic_msg
(
s
,
"Error"
,
pptext
,
ap
);
generic_msg
(
s
,
"Error"
,
pp
y_
text
,
ap
);
va_end
(
ap
);
exit
(
1
);
return
1
;
}
int
ppwarning
(
const
char
*
s
,
...)
int
pp
y_
warning
(
const
char
*
s
,
...)
{
va_list
ap
;
va_start
(
ap
,
s
);
generic_msg
(
s
,
"Warning"
,
pptext
,
ap
);
generic_msg
(
s
,
"Warning"
,
pp
y_
text
,
ap
);
va_end
(
ap
);
return
0
;
}
...
...
libs/wpp/wpp.c
View file @
2d778c5e
...
...
@@ -28,7 +28,7 @@
#include "wpp_private.h"
#include "wine/wpp.h"
int
ppdebug
,
pp_flex_debug
;
int
pp
y_
debug
,
pp_flex_debug
;
struct
define
{
...
...
@@ -126,7 +126,7 @@ void wpp_add_cmdline_define( const char *value )
void
wpp_set_debug
(
int
lex_debug
,
int
parser_debug
,
int
msg_debug
)
{
pp_flex_debug
=
lex_debug
;
pp
debug
=
parser_debug
;
pp
y_debug
=
parser_debug
;
pp_status
.
debug
=
msg_debug
;
}
...
...
@@ -149,8 +149,8 @@ int wpp_parse( const char *input, FILE *output )
add_cmdline_defines
();
add_special_defines
();
if
(
!
input
)
ppin
=
stdin
;
else
if
(
!
(
ppin
=
fopen
(
input
,
"rt"
)))
if
(
!
input
)
pp
y_
in
=
stdin
;
else
if
(
!
(
pp
y_
in
=
fopen
(
input
,
"rt"
)))
{
fprintf
(
stderr
,
"Could not open %s
\n
"
,
input
);
exit
(
2
);
...
...
@@ -158,12 +158,12 @@ int wpp_parse( const char *input, FILE *output )
pp_status
.
input
=
input
;
ppout
=
output
;
fprintf
(
ppout
,
"# 1
\"
%s
\"
1
\n
"
,
input
?
input
:
""
);
pp
y_
out
=
output
;
fprintf
(
pp
y_
out
,
"# 1
\"
%s
\"
1
\n
"
,
input
?
input
:
""
);
ret
=
ppparse
();
ret
=
pp
y_
parse
();
if
(
input
)
fclose
(
ppin
);
if
(
input
)
fclose
(
pp
y_
in
);
pp_pop_define_state
();
return
ret
;
}
...
...
libs/wpp/wpp_private.h
View file @
2d778c5e
...
...
@@ -217,8 +217,8 @@ int pp_get_if_depth(void);
#define __attribute__(x)
/*nothing*/
#endif
int
pperror
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
ppwarning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
pp
y_
error
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
pp
y_
warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
void
pp_internal_error
(
const
char
*
file
,
int
line
,
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
3
,
4
)));
/* current preprocessor state */
...
...
@@ -239,11 +239,11 @@ extern includelogicentry_t *pp_includelogiclist;
/*
* From ppl.l
*/
extern
FILE
*
ppin
;
extern
FILE
*
ppout
;
extern
char
*
pptext
;
extern
FILE
*
pp
y_
in
;
extern
FILE
*
pp
y_
out
;
extern
char
*
pp
y_
text
;
extern
int
pp_flex_debug
;
int
pplex
(
void
);
int
pp
y_
lex
(
void
);
void
pp_do_include
(
char
*
fname
,
int
type
);
void
pp_push_ignore_state
(
void
);
...
...
@@ -253,7 +253,7 @@ void pp_pop_ignore_state(void);
/*
* From ppy.y
*/
int
ppparse
(
void
);
extern
int
ppdebug
;
int
pp
y_
parse
(
void
);
extern
int
pp
y_
debug
;
#endif
/* __WINE_WPP_PRIVATE_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment