wpp: Move the preprocessor code into wrc.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2021-09-23 22:00:36 +02:00
parent 176654fa29
commit b69ce3472d
15 changed files with 36 additions and 80 deletions

2
configure vendored
View File

@ -1789,7 +1789,6 @@ enable_fonts
enable_include
enable_port
enable_wine
enable_wpp
enable_loader
enable_nls
enable_po
@ -21101,7 +21100,6 @@ wine_fn_config_makefile fonts enable_fonts
wine_fn_config_makefile include enable_include
wine_fn_config_makefile libs/port enable_port
wine_fn_config_makefile libs/wine enable_wine
wine_fn_config_makefile libs/wpp enable_wpp
wine_fn_config_makefile loader enable_loader
wine_fn_config_makefile nls enable_nls
wine_fn_config_makefile po enable_po

View File

@ -3871,7 +3871,6 @@ WINE_CONFIG_MAKEFILE(fonts)
WINE_CONFIG_MAKEFILE(include)
WINE_CONFIG_MAKEFILE(libs/port)
WINE_CONFIG_MAKEFILE(libs/wine)
WINE_CONFIG_MAKEFILE(libs/wpp)
WINE_CONFIG_MAKEFILE(loader)
WINE_CONFIG_MAKEFILE(nls)
WINE_CONFIG_MAKEFILE(po)

View File

@ -1,36 +0,0 @@
/*
* Exported functions of the Wine preprocessor
*
* Copyright 2002 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef __WINE_WPP_H
#define __WINE_WPP_H
#include <stdio.h>
#include <stdarg.h>
extern void wpp_del_define( const char *name );
extern void wpp_add_cmdline_define( const char *value );
extern void wpp_set_debug( int lex_debug, int parser_debug, int msg_debug );
extern void wpp_set_pedantic( int on );
extern void wpp_add_include_path( const char *path );
extern char *wpp_find_include( const char *name, const char *parent_name );
/* Return value == 0 means successful execution */
extern int wpp_parse( const char *input, FILE *output );
#endif /* __WINE_WPP_H */

View File

@ -1,6 +0,0 @@
STATICLIB = libwpp.a
C_SRCS = wpp.c
LEX_SRCS = ppl.l
BISON_SRCS = ppy.y

View File

@ -1,5 +1,5 @@
PROGRAMS = widl
MANPAGES = widl.man.in
PARENTSRC = ../wrc
C_SRCS = \
client.c \
@ -14,15 +14,21 @@ C_SRCS = \
typetree.c \
utils.c \
widl.c \
wpp.c \
write_msft.c
LEX_SRCS = parser.l
BISON_SRCS = parser.y
LEX_SRCS = \
parser.l \
ppl.l
BISON_SRCS = \
parser.y \
ppy.y
MANPAGES = widl.man.in
widl_EXTRADEFS = \
-DINCLUDEDIR="\"${includedir}\"" \
-DBIN_TO_INCLUDEDIR=\"`${MAKEDEP} -R ${bindir} ${includedir}`\"
EXTRALIBS = -lwpp
INSTALL_DEV = $(PROGRAMS)

View File

@ -62,7 +62,7 @@ double [0-9]+\.[0-9]+([eE][+-]?[0-9]+)*
#include "widl.h"
#include "utils.h"
#include "parser.h"
#include "wine/wpp.h"
#include "wpp_private.h"
#include "parser.tab.h"

View File

@ -21,7 +21,6 @@
#include "config.h"
#include "wine/port.h"
#include "wine/wpp.h"
#include <stdio.h>
#include <stdlib.h>
@ -37,6 +36,7 @@
#include "widl.h"
#include "utils.h"
#include "wpp_private.h"
#include "parser.h"
#include "header.h"
#include "typelib.h"

View File

@ -40,7 +40,7 @@
#include "widl.h"
#include "utils.h"
#include "parser.h"
#include "wine/wpp.h"
#include "wpp_private.h"
#include "header.h"
static const char usage[] =

View File

@ -1,5 +1,5 @@
PROGRAMS = wrc
MANPAGES = wrc.man.in
EXTRALIBS = $(GETTEXTPO_LIBS)
C_SRCS = \
dumpres.c \
@ -8,11 +8,19 @@ C_SRCS = \
po.c \
translation.c \
utils.c \
wpp.c \
wrc.c \
writeres.c
LEX_SRCS = parser.l
BISON_SRCS = parser.y
LEX_SRCS = \
parser.l \
ppl.l
BISON_SRCS = \
parser.y \
ppy.y
MANPAGES = wrc.man.in
wrc_EXTRADEFS = \
-DNLSDIR="\"${nlsdir}\"" \
@ -20,6 +28,4 @@ wrc_EXTRADEFS = \
-DBIN_TO_NLSDIR=\"`${MAKEDEP} -R ${bindir} ${nlsdir}`\" \
-DBIN_TO_INCLUDEDIR=\"`${MAKEDEP} -R ${bindir} ${includedir}`\"
EXTRALIBS = $(GETTEXTPO_LIBS) -lwpp
INSTALL_DEV = $(PROGRAMS)

View File

@ -134,7 +134,7 @@
#include "utils.h"
#include "newstruc.h"
#include "dumpres.h"
#include "wine/wpp.h"
#include "wpp_private.h"
#include "parser.h"
#include "windef.h"
#include "winbase.h"

View File

@ -17,16 +17,6 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* History:
* 24-Apr-2000 BS - Started from scratch to restructure everything
* and reintegrate the source into the wine-tree.
* 04-Jan-2000 BS - Added comments about the lexicographical
* grammar to give some insight in the complexity.
* 28-Dec-1999 BS - Eliminated backing-up of the flexer by running
* `flex -b' on the source. This results in some
* weirdo extra rules, but a much faster scanner.
* 23-Dec-1999 BS - Started this file
*
*-------------------------------------------------------------------------
* The preprocessor's lexographical grammar (approximately):
*
@ -182,7 +172,6 @@ ul [uUlL]|[uUlL][lL]|[lL][uU]|[lL][lL][uU]|[uU][lL][lL]|[lL][uU][lL]
#define YY_NO_UNISTD_H
#endif
#include "wine/wpp.h"
#include "wpp_private.h"
#include "ppy.tab.h"

View File

@ -3,7 +3,6 @@
*
* Copyright 1999-2000 Bertho A. Stultiens (BS)
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@ -18,13 +17,6 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
* History:
* 24-Apr-2000 BS Restructured the lot to fit the new scanner
* and reintegrate into the wine-tree.
* 01-Jan-2000 BS FIXME: win16 preprocessor calculates with
* 16 bit ints and overflows...?
* 26-Dec-1999 BS Started this file
*
*/
%{

View File

@ -35,7 +35,6 @@
#endif
#include "wpp_private.h"
#include "wine/wpp.h"
struct pp_status pp_status;

View File

@ -24,6 +24,15 @@
#include <string.h>
#include "wine/list.h"
extern void wpp_del_define( const char *name );
extern void wpp_add_cmdline_define( const char *value );
extern void wpp_set_debug( int lex_debug, int parser_debug, int msg_debug );
extern void wpp_set_pedantic( int on );
extern void wpp_add_include_path( const char *path );
extern char *wpp_find_include( const char *name, const char *parent_name );
/* Return value == 0 means successful execution */
extern int wpp_parse( const char *input, FILE *output );
struct pp_entry; /* forward */
/*
* Include logic

View File

@ -41,7 +41,7 @@
#include "genres.h"
#include "newstruc.h"
#include "parser.h"
#include "wine/wpp.h"
#include "wpp_private.h"
#ifdef WORDS_BIGENDIAN
#define ENDIAN "big"