- Update wpp to Wine-20081105.

svn path=/trunk/; revision=37204
This commit is contained in:
Aleksey Bragin 2008-11-05 14:47:55 +00:00
parent ca08af6ba3
commit c3be025536
8 changed files with 342 additions and 307 deletions

View file

@ -22,7 +22,7 @@ When porting a new DLL from Wine to ReactOS, please do the following steps
The following build tools are shared with Wine. The following build tools are shared with Wine.
reactos/tools/unicode # Synced to Wine-20081105 (~Wine-1.1.7) reactos/tools/unicode # Synced to Wine-20081105 (~Wine-1.1.7)
reactos/tools/wpp # Synced to Wine-0_9_5 reactos/tools/wpp # Synced to Wine-20081105 (~Wine-1.1.7)
reactos/tools/winebuild # Synced to Wine-20071217 reactos/tools/winebuild # Synced to Wine-20071217
reactos/tools/wmc # Synced to Wine-20071201 reactos/tools/wmc # Synced to Wine-20071201
reactos/tools/wrc # Synced to Wine-0_9_53 reactos/tools/wrc # Synced to Wine-0_9_53

File diff suppressed because it is too large Load diff

View file

@ -126,7 +126,7 @@
*/ */
%option stack %option stack
%option 8bit never-interactive %option 8bit never-interactive
%option nounput %option noinput nounput
%option prefix="ppy_" %option prefix="ppy_"
%x pp_pp %x pp_pp
@ -156,12 +156,27 @@ cident [a-zA-Z_][0-9a-zA-Z_]*
ul [uUlL]|[uUlL][lL]|[lL][uU]|[lL][lL][uU]|[uU][lL][lL]|[lL][uU][lL] ul [uUlL]|[uUlL][lL]|[lL][uU]|[lL][lL][uU]|[uU][lL][lL]|[lL][uU][lL]
%{ %{
#include <config.h> #include "config.h"
#include "wine/port.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <assert.h> #include <assert.h>
#include <errno.h>
#include <limits.h>
#ifndef LLONG_MAX
# define LLONG_MAX ((long long)0x7fffffff << 32 | 0xffffffff)
# define LLONG_MIN (-LLONG_MAX - 1)
#endif
#ifndef ULLONG_MAX
# define ULLONG_MAX ((long long)0xffffffff << 32 | 0xffffffff)
#endif
#ifndef HAVE_UNISTD_H
#define YY_NO_UNISTD_H
#endif
#include "wpp_private.h" #include "wpp_private.h"
#include "ppy.tab.h" #include "ppy.tab.h"
@ -200,7 +215,6 @@ typedef struct bufferstackentry {
/* Include management */ /* Include management */
include_state_t incl; include_state_t incl;
char *include_filename; char *include_filename;
int pass_data;
} bufferstackentry_t; } bufferstackentry_t;
#define ALLOCBLOCKSIZE (1 << 10) /* Allocate these chunks at a time for string-buffers */ #define ALLOCBLOCKSIZE (1 << 10) /* Allocate these chunks at a time for string-buffers */
@ -233,7 +247,6 @@ typedef struct macexpstackentry {
static void newline(int); static void newline(int);
static int make_number(int radix, YYSTYPE *val, const char *str, int len); static int make_number(int radix, YYSTYPE *val, const char *str, int len);
static void put_buffer(const char *s, int len); static void put_buffer(const char *s, int len);
static int is_c_h_include(char *fname, int quoted);
/* Buffer management */ /* Buffer management */
static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop); static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop);
static bufferstackentry_t *pop_buffer(void); static bufferstackentry_t *pop_buffer(void);
@ -272,8 +285,6 @@ static int macexpstackidx = 0;
static bufferstackentry_t bufferstack[MAXBUFFERSTACK]; static bufferstackentry_t bufferstack[MAXBUFFERSTACK];
static int bufferstackidx = 0; static int bufferstackidx = 0;
static int pass_data=1;
/* /*
* Global variables * Global variables
*/ */
@ -559,8 +570,6 @@ includelogicentry_t *pp_includelogiclist = NULL;
return tDQSTRING; return tDQSTRING;
case pp_line: case pp_line:
ppy_lval.cptr = get_string(); ppy_lval.cptr = get_string();
if (is_c_h_include(ppy_lval.cptr, 1)) pass_data=0;
else pass_data=1;
return tDQSTRING; return tDQSTRING;
default: default:
put_string(); put_string();
@ -791,6 +800,7 @@ static int make_number(int radix, YYSTYPE *val, const char *str, int len)
int is_ll = 0; int is_ll = 0;
int is_u = 0; int is_u = 0;
char ext[4]; char ext[4];
long l;
ext[3] = '\0'; ext[3] = '\0';
ext[2] = toupper(str[len-1]); ext[2] = toupper(str[len-1]);
@ -828,12 +838,18 @@ static int make_number(int radix, YYSTYPE *val, const char *str, int len)
#ifdef HAVE_LONG_LONG #ifdef HAVE_LONG_LONG
if (is_u) if (is_u)
{ {
errno = 0;
val->ull = strtoull(str, NULL, radix); val->ull = strtoull(str, NULL, radix);
if (val->ull == ULLONG_MAX && errno == ERANGE)
ppy_error("integer constant %s is too large\n", str);
return tULONGLONG; return tULONGLONG;
} }
else else
{ {
errno = 0;
val->sll = strtoll(str, NULL, radix); val->sll = strtoll(str, NULL, radix);
if ((val->sll == LLONG_MIN || val->sll == LLONG_MAX) && errno == ERANGE)
ppy_error("integer constant %s is too large\n", str);
return tSLONGLONG; return tSLONGLONG;
} }
#else #else
@ -842,22 +858,38 @@ static int make_number(int radix, YYSTYPE *val, const char *str, int len)
} }
else if(is_u && is_l) else if(is_u && is_l)
{ {
errno = 0;
val->ulong = strtoul(str, NULL, radix); val->ulong = strtoul(str, NULL, radix);
if (val->ulong == ULONG_MAX && errno == ERANGE)
ppy_error("integer constant %s is too large\n", str);
return tULONG; return tULONG;
} }
else if(!is_u && is_l) else if(!is_u && is_l)
{ {
errno = 0;
val->slong = strtol(str, NULL, radix); val->slong = strtol(str, NULL, radix);
if ((val->slong == LONG_MIN || val->slong == LONG_MAX) && errno == ERANGE)
ppy_error("integer constant %s is too large\n", str);
return tSLONG; return tSLONG;
} }
else if(is_u && !is_l) else if(is_u && !is_l)
{ {
val->uint = (unsigned int)strtoul(str, NULL, radix); unsigned long ul;
errno = 0;
ul = strtoul(str, NULL, radix);
if ((ul == ULONG_MAX && errno == ERANGE) || (ul > UINT_MAX))
ppy_error("integer constant %s is too large\n", str);
val->uint = (unsigned int)ul;
return tUINT; return tUINT;
} }
/* Else it must be an int... */ /* Else it must be an int... */
val->sint = (int)strtol(str, NULL, radix); errno = 0;
l = strtol(str, NULL, radix);
if (((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) ||
(l > INT_MAX) || (l < INT_MIN))
ppy_error("integer constant %s is too large\n", str);
val->sint = (int)l;
return tSINT; return tSINT;
} }
@ -1191,7 +1223,6 @@ static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop)
bufferstack[bufferstackidx].ncontinuations = ncontinuations; bufferstack[bufferstackidx].ncontinuations = ncontinuations;
bufferstack[bufferstackidx].incl = pp_incl_state; bufferstack[bufferstackidx].incl = pp_incl_state;
bufferstack[bufferstackidx].include_filename = incname; bufferstack[bufferstackidx].include_filename = incname;
bufferstack[bufferstackidx].pass_data = pass_data;
if(ppp) if(ppp)
ppp->expanding = 1; ppp->expanding = 1;
@ -1254,7 +1285,6 @@ static bufferstackentry_t *pop_buffer(void)
} }
free(pp_incl_state.ppp); free(pp_incl_state.ppp);
pp_incl_state = bufferstack[bufferstackidx].incl; pp_incl_state = bufferstack[bufferstackidx].incl;
pass_data = bufferstack[bufferstackidx].pass_data;
} }
} }
@ -1410,10 +1440,8 @@ static void put_buffer(const char *s, int len)
{ {
if(top_macro()) if(top_macro())
add_text_to_macro(s, len); add_text_to_macro(s, len);
else { else
if(pass_data)
fwrite(s, 1, len, ppy_out); fwrite(s, 1, len, ppy_out);
}
} }
@ -1422,15 +1450,6 @@ static void put_buffer(const char *s, int len)
* Include management * Include management
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
static int is_c_h_include(char *fname, int quoted)
{
int sl=strlen(fname);
if (sl < 2 + 2 * quoted) return 0;
if ((toupper(fname[sl-1-quoted])!='H') && (toupper(fname[sl-1-quoted])!='C')) return 0;
if (fname[sl-2-quoted]!='.') return 0;
return 1;
}
void pp_do_include(char *fname, int type) void pp_do_include(char *fname, int type)
{ {
char *newpath; char *newpath;
@ -1466,12 +1485,10 @@ void pp_do_include(char *fname, int type)
pp_incl_state.seen_junk = 0; pp_incl_state.seen_junk = 0;
pp_incl_state.state = 0; pp_incl_state.state = 0;
pp_incl_state.ppp = NULL; pp_incl_state.ppp = NULL;
if (is_c_h_include(newpath, 0)) pass_data=0;
else pass_data=1;
if(pp_status.debug) if(pp_status.debug)
fprintf(stderr, "pp_do_include: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d ,pass_data=%d\n", fprintf(stderr, "pp_do_include: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n",
pp_status.input, pp_status.line_number, pp_incl_state.state, pp_incl_state.ppp, pp_incl_state.ifdepth, pass_data); pp_status.input, pp_status.line_number, pp_incl_state.state, pp_incl_state.ppp, pp_incl_state.ifdepth);
ppy__switch_to_buffer(ppy__create_buffer(ppy_in, YY_BUF_SIZE)); ppy__switch_to_buffer(ppy__create_buffer(ppy_in, YY_BUF_SIZE));
fprintf(ppy_out, "# 1 \"%s\" 1%s\n", newpath, type ? "" : " 3"); fprintf(ppy_out, "# 1 \"%s\" 1%s\n", newpath, type ? "" : " 3");

View file

@ -158,7 +158,7 @@
/* Copy the first part of user declarations. */ /* Copy the first part of user declarations. */
#line 30 "tools\\wpp_new\\ppy.y" #line 30 "ppy.y"
#include "config.h" #include "config.h"
#include "wine/port.h" #include "wine/port.h"
@ -274,7 +274,7 @@ static int nmacro_args;
#endif #endif
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 126 "tools\\wpp_new\\ppy.y" #line 126 "ppy.y"
typedef union YYSTYPE { typedef union YYSTYPE {
int sint; int sint;
unsigned int uint; unsigned int uint;
@ -289,7 +289,7 @@ typedef union YYSTYPE {
mtext_t *mtext; mtext_t *mtext;
} YYSTYPE; } YYSTYPE;
/* Line 196 of yacc.c. */ /* Line 196 of yacc.c. */
#line 293 "tools\\wpp_new\\ppy.tab.c" #line 293 "ppy.tab.c"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1
@ -301,7 +301,7 @@ typedef union YYSTYPE {
/* Line 219 of yacc.c. */ /* Line 219 of yacc.c. */
#line 305 "tools\\wpp_new\\ppy.tab.c" #line 305 "ppy.tab.c"
#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
# define YYSIZE_T __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__
@ -1457,27 +1457,27 @@ yyreduce:
switch (yyn) switch (yyn)
{ {
case 4: case 4:
#line 186 "tools\\wpp_new\\ppy.y" #line 186 "ppy.y"
{ pp_do_include((yyvsp[-1].cptr), 1); ;} { pp_do_include((yyvsp[-1].cptr), 1); ;}
break; break;
case 5: case 5:
#line 187 "tools\\wpp_new\\ppy.y" #line 187 "ppy.y"
{ pp_do_include((yyvsp[-1].cptr), 0); ;} { pp_do_include((yyvsp[-1].cptr), 0); ;}
break; break;
case 6: case 6:
#line 188 "tools\\wpp_new\\ppy.y" #line 188 "ppy.y"
{ pp_next_if_state(boolean(&(yyvsp[-1].cval))); ;} { pp_next_if_state(boolean(&(yyvsp[-1].cval))); ;}
break; break;
case 7: case 7:
#line 189 "tools\\wpp_new\\ppy.y" #line 189 "ppy.y"
{ pp_next_if_state(pplookup((yyvsp[-1].cptr)) != NULL); free((yyvsp[-1].cptr)); ;} { pp_next_if_state(pplookup((yyvsp[-1].cptr)) != NULL); free((yyvsp[-1].cptr)); ;}
break; break;
case 8: case 8:
#line 190 "tools\\wpp_new\\ppy.y" #line 190 "ppy.y"
{ {
int t = pplookup((yyvsp[-1].cptr)) == NULL; int t = pplookup((yyvsp[-1].cptr)) == NULL;
if(pp_incl_state.state == 0 && t && !pp_incl_state.seen_junk) if(pp_incl_state.state == 0 && t && !pp_incl_state.seen_junk)
@ -1501,7 +1501,7 @@ yyreduce:
break; break;
case 9: case 9:
#line 210 "tools\\wpp_new\\ppy.y" #line 210 "ppy.y"
{ {
pp_if_state_t s = pp_pop_if(); pp_if_state_t s = pp_pop_if();
switch(s) switch(s)
@ -1526,7 +1526,7 @@ yyreduce:
break; break;
case 10: case 10:
#line 231 "tools\\wpp_new\\ppy.y" #line 231 "ppy.y"
{ {
pp_if_state_t s = pp_pop_if(); pp_if_state_t s = pp_pop_if();
switch(s) switch(s)
@ -1553,7 +1553,7 @@ yyreduce:
break; break;
case 11: case 11:
#line 254 "tools\\wpp_new\\ppy.y" #line 254 "ppy.y"
{ {
pp_pop_if(); pp_pop_if();
if(pp_incl_state.ifdepth == pp_get_if_depth() && pp_incl_state.state == 1) if(pp_incl_state.ifdepth == pp_get_if_depth() && pp_incl_state.state == 1)
@ -1572,74 +1572,74 @@ yyreduce:
break; break;
case 12: case 12:
#line 269 "tools\\wpp_new\\ppy.y" #line 269 "ppy.y"
{ pp_del_define((yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;} { pp_del_define((yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;}
break; break;
case 13: case 13:
#line 270 "tools\\wpp_new\\ppy.y" #line 270 "ppy.y"
{ pp_add_define((yyvsp[-2].cptr), (yyvsp[-1].cptr)); ;} { pp_add_define((yyvsp[-2].cptr), (yyvsp[-1].cptr)); ;}
break; break;
case 14: case 14:
#line 271 "tools\\wpp_new\\ppy.y" #line 271 "ppy.y"
{ {
pp_add_macro((yyvsp[-5].cptr), macro_args, nmacro_args, (yyvsp[-1].mtext)); pp_add_macro((yyvsp[-5].cptr), macro_args, nmacro_args, (yyvsp[-1].mtext));
;} ;}
break; break;
case 15: case 15:
#line 274 "tools\\wpp_new\\ppy.y" #line 274 "ppy.y"
{ fprintf(ppy_out, "# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;} { fprintf(ppy_out, "# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;}
break; break;
case 16: case 16:
#line 275 "tools\\wpp_new\\ppy.y" #line 275 "ppy.y"
{ fprintf(ppy_out, "# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;} { fprintf(ppy_out, "# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;}
break; break;
case 17: case 17:
#line 277 "tools\\wpp_new\\ppy.y" #line 277 "ppy.y"
{ fprintf(ppy_out, "# %d %s %d\n", (yyvsp[-3].sint), (yyvsp[-2].cptr), (yyvsp[-1].sint)); free((yyvsp[-2].cptr)); ;} { fprintf(ppy_out, "# %d %s %d\n", (yyvsp[-3].sint), (yyvsp[-2].cptr), (yyvsp[-1].sint)); free((yyvsp[-2].cptr)); ;}
break; break;
case 18: case 18:
#line 279 "tools\\wpp_new\\ppy.y" #line 279 "ppy.y"
{ fprintf(ppy_out, "# %d %s %d %d\n", (yyvsp[-4].sint) ,(yyvsp[-3].cptr), (yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-3].cptr)); ;} { fprintf(ppy_out, "# %d %s %d %d\n", (yyvsp[-4].sint) ,(yyvsp[-3].cptr), (yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-3].cptr)); ;}
break; break;
case 19: case 19:
#line 281 "tools\\wpp_new\\ppy.y" #line 281 "ppy.y"
{ fprintf(ppy_out, "# %d %s %d %d %d\n", (yyvsp[-5].sint) ,(yyvsp[-4].cptr) ,(yyvsp[-3].sint) ,(yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-4].cptr)); ;} { fprintf(ppy_out, "# %d %s %d %d %d\n", (yyvsp[-5].sint) ,(yyvsp[-4].cptr) ,(yyvsp[-3].sint) ,(yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-4].cptr)); ;}
break; break;
case 20: case 20:
#line 283 "tools\\wpp_new\\ppy.y" #line 283 "ppy.y"
{ fprintf(ppy_out, "# %d %s %d %d %d %d\n", (yyvsp[-6].sint) ,(yyvsp[-5].cptr) ,(yyvsp[-4].sint) ,(yyvsp[-3].sint), (yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-5].cptr)); ;} { fprintf(ppy_out, "# %d %s %d %d %d %d\n", (yyvsp[-6].sint) ,(yyvsp[-5].cptr) ,(yyvsp[-4].sint) ,(yyvsp[-3].sint), (yyvsp[-2].sint), (yyvsp[-1].sint)); free((yyvsp[-5].cptr)); ;}
break; break;
case 22: case 22:
#line 285 "tools\\wpp_new\\ppy.y" #line 285 "ppy.y"
{ ppy_error("#error directive: '%s'", (yyvsp[-1].cptr)); if((yyvsp[-1].cptr)) free((yyvsp[-1].cptr)); ;} { ppy_error("#error directive: '%s'", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;}
break; break;
case 23: case 23:
#line 286 "tools\\wpp_new\\ppy.y" #line 286 "ppy.y"
{ ppy_warning("#warning directive: '%s'", (yyvsp[-1].cptr)); if((yyvsp[-1].cptr)) free((yyvsp[-1].cptr)); ;} { ppy_warning("#warning directive: '%s'", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;}
break; break;
case 24: case 24:
#line 287 "tools\\wpp_new\\ppy.y" #line 287 "ppy.y"
{ fprintf(ppy_out, "#pragma %s\n", (yyvsp[-1].cptr) ? (yyvsp[-1].cptr) : ""); if ((yyvsp[-1].cptr)) free((yyvsp[-1].cptr)); ;} { fprintf(ppy_out, "#pragma %s\n", (yyvsp[-1].cptr) ? (yyvsp[-1].cptr) : ""); free((yyvsp[-1].cptr)); ;}
break; break;
case 25: case 25:
#line 288 "tools\\wpp_new\\ppy.y" #line 288 "ppy.y"
{ if(pp_status.pedantic) ppy_warning("#ident ignored (arg: '%s')", (yyvsp[-1].cptr)); if((yyvsp[-1].cptr)) free((yyvsp[-1].cptr)); ;} { if(pp_status.pedantic) ppy_warning("#ident ignored (arg: '%s')", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); ;}
break; break;
case 26: case 26:
#line 289 "tools\\wpp_new\\ppy.y" #line 289 "ppy.y"
{ {
int nl=strlen((yyvsp[0].cptr)) +3; int nl=strlen((yyvsp[0].cptr)) +3;
char *fn=pp_xmalloc(nl); char *fn=pp_xmalloc(nl);
@ -1650,94 +1650,94 @@ yyreduce:
break; break;
case 27: case 27:
#line 296 "tools\\wpp_new\\ppy.y" #line 296 "ppy.y"
{ {
pp_do_include((yyvsp[0].cptr),1); pp_do_include((yyvsp[0].cptr),1);
;} ;}
break; break;
case 28: case 28:
#line 302 "tools\\wpp_new\\ppy.y" #line 302 "ppy.y"
{ (yyval.cptr) = NULL; ;} { (yyval.cptr) = NULL; ;}
break; break;
case 29: case 29:
#line 303 "tools\\wpp_new\\ppy.y" #line 303 "ppy.y"
{ (yyval.cptr) = (yyvsp[0].cptr); ;} { (yyval.cptr) = (yyvsp[0].cptr); ;}
break; break;
case 30: case 30:
#line 306 "tools\\wpp_new\\ppy.y" #line 306 "ppy.y"
{ (yyval.cptr) = (yyvsp[0].cptr); ;} { (yyval.cptr) = (yyvsp[0].cptr); ;}
break; break;
case 31: case 31:
#line 307 "tools\\wpp_new\\ppy.y" #line 307 "ppy.y"
{ (yyval.cptr) = (yyvsp[0].cptr); ;} { (yyval.cptr) = (yyvsp[0].cptr); ;}
break; break;
case 32: case 32:
#line 308 "tools\\wpp_new\\ppy.y" #line 308 "ppy.y"
{ (yyval.cptr) = (yyvsp[0].cptr); ;} { (yyval.cptr) = (yyvsp[0].cptr); ;}
break; break;
case 33: case 33:
#line 309 "tools\\wpp_new\\ppy.y" #line 309 "ppy.y"
{ (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); ;} { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); ;}
break; break;
case 34: case 34:
#line 310 "tools\\wpp_new\\ppy.y" #line 310 "ppy.y"
{ (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); ;} { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); ;}
break; break;
case 35: case 35:
#line 311 "tools\\wpp_new\\ppy.y" #line 311 "ppy.y"
{ (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); ;} { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); ;}
break; break;
case 36: case 36:
#line 314 "tools\\wpp_new\\ppy.y" #line 314 "ppy.y"
{ macro_args = NULL; nmacro_args = 0; ;} { macro_args = NULL; nmacro_args = 0; ;}
break; break;
case 37: case 37:
#line 317 "tools\\wpp_new\\ppy.y" #line 317 "ppy.y"
{ (yyval.sint) = 0; macro_args = NULL; nmacro_args = 0; ;} { (yyval.sint) = 0; macro_args = NULL; nmacro_args = 0; ;}
break; break;
case 38: case 38:
#line 318 "tools\\wpp_new\\ppy.y" #line 318 "ppy.y"
{ (yyval.sint) = nmacro_args; ;} { (yyval.sint) = nmacro_args; ;}
break; break;
case 39: case 39:
#line 321 "tools\\wpp_new\\ppy.y" #line 321 "ppy.y"
{ (yyval.marg) = (yyvsp[0].marg); ;} { (yyval.marg) = (yyvsp[0].marg); ;}
break; break;
case 40: case 40:
#line 322 "tools\\wpp_new\\ppy.y" #line 322 "ppy.y"
{ (yyval.marg) = add_new_marg(NULL, arg_list); nmacro_args *= -1; ;} { (yyval.marg) = add_new_marg(NULL, arg_list); nmacro_args *= -1; ;}
break; break;
case 41: case 41:
#line 325 "tools\\wpp_new\\ppy.y" #line 325 "ppy.y"
{ (yyval.marg) = add_new_marg((yyvsp[0].cptr), arg_single); ;} { (yyval.marg) = add_new_marg((yyvsp[0].cptr), arg_single); ;}
break; break;
case 42: case 42:
#line 326 "tools\\wpp_new\\ppy.y" #line 326 "ppy.y"
{ (yyval.marg) = add_new_marg((yyvsp[0].cptr), arg_single); ;} { (yyval.marg) = add_new_marg((yyvsp[0].cptr), arg_single); ;}
break; break;
case 43: case 43:
#line 330 "tools\\wpp_new\\ppy.y" #line 330 "ppy.y"
{ (yyval.mtext) = NULL; ;} { (yyval.mtext) = NULL; ;}
break; break;
case 44: case 44:
#line 331 "tools\\wpp_new\\ppy.y" #line 331 "ppy.y"
{ {
for((yyval.mtext) = (yyvsp[0].mtext); (yyval.mtext) && (yyval.mtext)->prev; (yyval.mtext) = (yyval.mtext)->prev) for((yyval.mtext) = (yyvsp[0].mtext); (yyval.mtext) && (yyval.mtext)->prev; (yyval.mtext) = (yyval.mtext)->prev)
; ;
@ -1745,37 +1745,37 @@ yyreduce:
break; break;
case 45: case 45:
#line 337 "tools\\wpp_new\\ppy.y" #line 337 "ppy.y"
{ (yyval.mtext) = (yyvsp[0].mtext); ;} { (yyval.mtext) = (yyvsp[0].mtext); ;}
break; break;
case 46: case 46:
#line 338 "tools\\wpp_new\\ppy.y" #line 338 "ppy.y"
{ (yyval.mtext) = combine_mtext((yyvsp[-1].mtext), (yyvsp[0].mtext)); ;} { (yyval.mtext) = combine_mtext((yyvsp[-1].mtext), (yyvsp[0].mtext)); ;}
break; break;
case 47: case 47:
#line 341 "tools\\wpp_new\\ppy.y" #line 341 "ppy.y"
{ (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); ;} { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); ;}
break; break;
case 48: case 48:
#line 342 "tools\\wpp_new\\ppy.y" #line 342 "ppy.y"
{ (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); ;} { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); ;}
break; break;
case 49: case 49:
#line 343 "tools\\wpp_new\\ppy.y" #line 343 "ppy.y"
{ (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); ;} { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); ;}
break; break;
case 50: case 50:
#line 344 "tools\\wpp_new\\ppy.y" #line 344 "ppy.y"
{ (yyval.mtext) = new_mtext(NULL, 0, exp_concat); ;} { (yyval.mtext) = new_mtext(NULL, 0, exp_concat); ;}
break; break;
case 51: case 51:
#line 345 "tools\\wpp_new\\ppy.y" #line 345 "ppy.y"
{ {
int mat = marg_index((yyvsp[0].cptr)); int mat = marg_index((yyvsp[0].cptr));
if(mat < 0) if(mat < 0)
@ -1785,7 +1785,7 @@ yyreduce:
break; break;
case 52: case 52:
#line 351 "tools\\wpp_new\\ppy.y" #line 351 "ppy.y"
{ {
int mat = marg_index((yyvsp[0].cptr)); int mat = marg_index((yyvsp[0].cptr));
if(mat >= 0) if(mat >= 0)
@ -1796,162 +1796,162 @@ yyreduce:
break; break;
case 53: case 53:
#line 360 "tools\\wpp_new\\ppy.y" #line 360 "ppy.y"
{ (yyval.cval).type = cv_sint; (yyval.cval).val.si = (yyvsp[0].sint); ;} { (yyval.cval).type = cv_sint; (yyval.cval).val.si = (yyvsp[0].sint); ;}
break; break;
case 54: case 54:
#line 361 "tools\\wpp_new\\ppy.y" #line 361 "ppy.y"
{ (yyval.cval).type = cv_uint; (yyval.cval).val.ui = (yyvsp[0].uint); ;} { (yyval.cval).type = cv_uint; (yyval.cval).val.ui = (yyvsp[0].uint); ;}
break; break;
case 55: case 55:
#line 362 "tools\\wpp_new\\ppy.y" #line 362 "ppy.y"
{ (yyval.cval).type = cv_slong; (yyval.cval).val.sl = (yyvsp[0].slong); ;} { (yyval.cval).type = cv_slong; (yyval.cval).val.sl = (yyvsp[0].slong); ;}
break; break;
case 56: case 56:
#line 363 "tools\\wpp_new\\ppy.y" #line 363 "ppy.y"
{ (yyval.cval).type = cv_ulong; (yyval.cval).val.ul = (yyvsp[0].ulong); ;} { (yyval.cval).type = cv_ulong; (yyval.cval).val.ul = (yyvsp[0].ulong); ;}
break; break;
case 57: case 57:
#line 364 "tools\\wpp_new\\ppy.y" #line 364 "ppy.y"
{ (yyval.cval).type = cv_sll; (yyval.cval).val.sll = (yyvsp[0].sll); ;} { (yyval.cval).type = cv_sll; (yyval.cval).val.sll = (yyvsp[0].sll); ;}
break; break;
case 58: case 58:
#line 365 "tools\\wpp_new\\ppy.y" #line 365 "ppy.y"
{ (yyval.cval).type = cv_ull; (yyval.cval).val.ull = (yyvsp[0].ull); ;} { (yyval.cval).type = cv_ull; (yyval.cval).val.ull = (yyvsp[0].ull); ;}
break; break;
case 59: case 59:
#line 366 "tools\\wpp_new\\ppy.y" #line 366 "ppy.y"
{ (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[0].cptr)) != NULL; ;} { (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[0].cptr)) != NULL; ;}
break; break;
case 60: case 60:
#line 367 "tools\\wpp_new\\ppy.y" #line 367 "ppy.y"
{ (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[-1].cptr)) != NULL; ;} { (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[-1].cptr)) != NULL; ;}
break; break;
case 61: case 61:
#line 368 "tools\\wpp_new\\ppy.y" #line 368 "ppy.y"
{ (yyval.cval).type = cv_sint; (yyval.cval).val.si = 0; ;} { (yyval.cval).type = cv_sint; (yyval.cval).val.si = 0; ;}
break; break;
case 62: case 62:
#line 369 "tools\\wpp_new\\ppy.y" #line 369 "ppy.y"
{ (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) || boolean(&(yyvsp[0].cval)); ;} { (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) || boolean(&(yyvsp[0].cval)); ;}
break; break;
case 63: case 63:
#line 370 "tools\\wpp_new\\ppy.y" #line 370 "ppy.y"
{ (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) && boolean(&(yyvsp[0].cval)); ;} { (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) && boolean(&(yyvsp[0].cval)); ;}
break; break;
case 64: case 64:
#line 371 "tools\\wpp_new\\ppy.y" #line 371 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ==) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ==) ;}
break; break;
case 65: case 65:
#line 372 "tools\\wpp_new\\ppy.y" #line 372 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), !=) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), !=) ;}
break; break;
case 66: case 66:
#line 373 "tools\\wpp_new\\ppy.y" #line 373 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <) ;}
break; break;
case 67: case 67:
#line 374 "tools\\wpp_new\\ppy.y" #line 374 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >) ;}
break; break;
case 68: case 68:
#line 375 "tools\\wpp_new\\ppy.y" #line 375 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <=) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <=) ;}
break; break;
case 69: case 69:
#line 376 "tools\\wpp_new\\ppy.y" #line 376 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >=) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >=) ;}
break; break;
case 70: case 70:
#line 377 "tools\\wpp_new\\ppy.y" #line 377 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), +) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), +) ;}
break; break;
case 71: case 71:
#line 378 "tools\\wpp_new\\ppy.y" #line 378 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), -) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), -) ;}
break; break;
case 72: case 72:
#line 379 "tools\\wpp_new\\ppy.y" #line 379 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ^) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ^) ;}
break; break;
case 73: case 73:
#line 380 "tools\\wpp_new\\ppy.y" #line 380 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), &) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), &) ;}
break; break;
case 74: case 74:
#line 381 "tools\\wpp_new\\ppy.y" #line 381 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), |) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), |) ;}
break; break;
case 75: case 75:
#line 382 "tools\\wpp_new\\ppy.y" #line 382 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), *) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), *) ;}
break; break;
case 76: case 76:
#line 383 "tools\\wpp_new\\ppy.y" #line 383 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), /) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), /) ;}
break; break;
case 77: case 77:
#line 384 "tools\\wpp_new\\ppy.y" #line 384 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <<) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <<) ;}
break; break;
case 78: case 78:
#line 385 "tools\\wpp_new\\ppy.y" #line 385 "ppy.y"
{ promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >>) ;} { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >>) ;}
break; break;
case 79: case 79:
#line 386 "tools\\wpp_new\\ppy.y" #line 386 "ppy.y"
{ (yyval.cval) = (yyvsp[0].cval); ;} { (yyval.cval) = (yyvsp[0].cval); ;}
break; break;
case 80: case 80:
#line 387 "tools\\wpp_new\\ppy.y" #line 387 "ppy.y"
{ UNARY_OP((yyval.cval), (yyvsp[0].cval), -) ;} { UNARY_OP((yyval.cval), (yyvsp[0].cval), -) ;}
break; break;
case 81: case 81:
#line 388 "tools\\wpp_new\\ppy.y" #line 388 "ppy.y"
{ UNARY_OP((yyval.cval), (yyvsp[0].cval), ~) ;} { UNARY_OP((yyval.cval), (yyvsp[0].cval), ~) ;}
break; break;
case 82: case 82:
#line 389 "tools\\wpp_new\\ppy.y" #line 389 "ppy.y"
{ (yyval.cval).type = cv_sint; (yyval.cval).val.si = !boolean(&(yyvsp[0].cval)); ;} { (yyval.cval).type = cv_sint; (yyval.cval).val.si = !boolean(&(yyvsp[0].cval)); ;}
break; break;
case 83: case 83:
#line 390 "tools\\wpp_new\\ppy.y" #line 390 "ppy.y"
{ (yyval.cval) = (yyvsp[-1].cval); ;} { (yyval.cval) = (yyvsp[-1].cval); ;}
break; break;
case 84: case 84:
#line 391 "tools\\wpp_new\\ppy.y" #line 391 "ppy.y"
{ (yyval.cval) = boolean(&(yyvsp[-4].cval)) ? (yyvsp[-2].cval) : (yyvsp[0].cval); ;} { (yyval.cval) = boolean(&(yyvsp[-4].cval)) ? (yyvsp[-2].cval) : (yyvsp[0].cval); ;}
break; break;
@ -1960,7 +1960,7 @@ yyreduce:
} }
/* Line 1126 of yacc.c. */ /* Line 1126 of yacc.c. */
#line 1964 "tools\\wpp_new\\ppy.tab.c" #line 1964 "ppy.tab.c"
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
@ -2228,7 +2228,7 @@ yyreturn:
} }
#line 394 "tools\\wpp_new\\ppy.y" #line 394 "ppy.y"
/* /*

View file

@ -123,7 +123,7 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#line 126 "tools\\wpp_new\\ppy.y" #line 126 "ppy.y"
typedef union YYSTYPE { typedef union YYSTYPE {
int sint; int sint;
unsigned int uint; unsigned int uint;
@ -138,7 +138,7 @@ typedef union YYSTYPE {
mtext_t *mtext; mtext_t *mtext;
} YYSTYPE; } YYSTYPE;
/* Line 1447 of yacc.c. */ /* Line 1447 of yacc.c. */
#line 142 "tools\\wpp_new\\ppy.tab.h" #line 142 "ppy.tab.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_TRIVIAL 1

View file

@ -282,10 +282,10 @@ preprocessor
| tGCCLINE tSINT tDQSTRING tSINT tSINT tSINT tSINT tNL | tGCCLINE tSINT tDQSTRING tSINT tSINT tSINT tSINT tNL
{ fprintf(ppy_out, "# %d %s %d %d %d %d\n", $2 ,$3 ,$4 ,$5, $6, $7); free($3); } { fprintf(ppy_out, "# %d %s %d %d %d %d\n", $2 ,$3 ,$4 ,$5, $6, $7); free($3); }
| tGCCLINE tNL /* The null-token */ | tGCCLINE tNL /* The null-token */
| tERROR opt_text tNL { ppy_error("#error directive: '%s'", $2); if($2) free($2); } | tERROR opt_text tNL { ppy_error("#error directive: '%s'", $2); free($2); }
| tWARNING opt_text tNL { ppy_warning("#warning directive: '%s'", $2); if($2) free($2); } | tWARNING opt_text tNL { ppy_warning("#warning directive: '%s'", $2); free($2); }
| tPRAGMA opt_text tNL { fprintf(ppy_out, "#pragma %s\n", $2 ? $2 : ""); if ($2) free($2); } | tPRAGMA opt_text tNL { fprintf(ppy_out, "#pragma %s\n", $2 ? $2 : ""); free($2); }
| tPPIDENT opt_text tNL { if(pp_status.pedantic) ppy_warning("#ident ignored (arg: '%s')", $2); if($2) free($2); } | tPPIDENT opt_text tNL { if(pp_status.pedantic) ppy_warning("#ident ignored (arg: '%s')", $2); free($2); }
| tRCINCLUDE tRCINCLUDEPATH { | tRCINCLUDE tRCINCLUDEPATH {
int nl=strlen($2) +3; int nl=strlen($2) +3;
char *fn=pp_xmalloc(nl); char *fn=pp_xmalloc(nl);

View file

@ -1,7 +1,7 @@
/* /*
* Exported functions of the Wine preprocessor * Exported functions of the Wine preprocessor
* *
* Copyrignt 1998 Bertho A. Stultiens * Copyright 1998 Bertho A. Stultiens
* Copyright 2002 Alexandre Julliard * Copyright 2002 Alexandre Julliard
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or

View file

@ -181,7 +181,7 @@ typedef struct cval {
ctype_t type; ctype_t type;
union { union {
#if 0 #if 0
signed char sc; /* Explicitely signed because compilers are stupid */ signed char sc; /* Explicitly signed because compilers are stupid */
unsigned char uc; unsigned char uc;
short ss; short ss;
unsigned short us; unsigned short us;