Replaced 'ignore' spec file directive by the -i option.

This commit is contained in:
Alexandre Julliard 2002-12-07 23:54:12 +00:00
parent 9b1df412f4
commit 2cd4ed2e15
3 changed files with 26 additions and 36 deletions

View File

@ -125,6 +125,7 @@ static void do_f_flags( const char *arg );
static void do_define( const char *arg ); static void do_define( const char *arg );
static void do_include( const char *arg ); static void do_include( const char *arg );
static void do_k_flags( const char *arg ); static void do_k_flags( const char *arg );
static void do_ignore( const char *arg );
static void do_exe_mode( const char *arg ); static void do_exe_mode( const char *arg );
static void do_module( const char *arg ); static void do_module( const char *arg );
static void do_heap( const char *arg ); static void do_heap( const char *arg );
@ -152,6 +153,7 @@ static const struct option_descr option_table[] =
{ "-D", 1, do_define, "-D sym Ignored for C flags compatibility" }, { "-D", 1, do_define, "-D sym Ignored for C flags compatibility" },
{ "-I", 1, do_include, "-I dir Ignored for C flags compatibility" }, { "-I", 1, do_include, "-I dir Ignored for C flags compatibility" },
{ "-K", 1, do_k_flags, "-K flags Compiler flags (only -KPIC is supported)" }, { "-K", 1, do_k_flags, "-K flags Compiler flags (only -KPIC is supported)" },
{ "-i", 1, do_ignore, "-i sym[,sym] Ignore specified symbols when resolving imports" },
{ "-m", 1, do_exe_mode,"-m mode Set the executable mode (cui|gui|cuiw|guiw)" }, { "-m", 1, do_exe_mode,"-m mode Set the executable mode (cui|gui|cuiw|guiw)" },
{ "-M", 1, do_module, "-M module Set the name of the main (Win32) module for a Win16 dll" }, { "-M", 1, do_module, "-M module Set the name of the main (Win32) module for a Win16 dll" },
{ "-L", 1, do_lib, "-L directory Look for imports libraries in 'directory'" }, { "-L", 1, do_lib, "-L directory Look for imports libraries in 'directory'" },
@ -229,6 +231,18 @@ static void do_k_flags( const char *arg )
/* ignore all other flags */ /* ignore all other flags */
} }
static void do_ignore( const char *arg )
{
char *str = xstrdup( arg );
char *token = strtok( str, "," );
while (token)
{
add_ignore_symbol( token );
token = strtok( NULL, "," );
}
free( str );
}
static void do_heap( const char *arg ) static void do_heap( const char *arg )
{ {
if (!isdigit(arg[0])) if (!isdigit(arg[0]))

View File

@ -126,24 +126,6 @@ static const char * GetToken( int allow_eof )
} }
/*******************************************************************
* ParseIgnore
*
* Parse an 'ignore' definition.
*/
static void ParseIgnore(void)
{
const char *token = GetToken(0);
if (*token != '(') fatal_error( "Expected '(' got '%s'\n", token );
for (;;)
{
token = GetToken(0);
if (*token == ')') break;
add_ignore_symbol( token );
}
}
/******************************************************************* /*******************************************************************
* ParseVariable * ParseVariable
* *
@ -501,13 +483,7 @@ void ParseTopLevel( FILE *file )
while ((token = GetToken(1)) != NULL) while ((token = GetToken(1)) != NULL)
{ {
if (strcmp(token, "ignore") == 0) if (strcmp(token, "@") == 0)
{
if (SpecType != SPEC_WIN32)
fatal_error( "'ignore' only supported for Win32 spec files\n" );
ParseIgnore();
}
else if (strcmp(token, "@") == 0)
{ {
if (SpecType != SPEC_WIN32) if (SpecType != SPEC_WIN32)
fatal_error( "'@' ordinals not supported for Win16\n" ); fatal_error( "'@' ordinals not supported for Win16\n" );

View File

@ -101,6 +101,12 @@ Win16 modules); default is no local heap.
.BI \-I\ directory .BI \-I\ directory
Ignored for compatibility with the C compiler. Ignored for compatibility with the C compiler.
.TP .TP
.BI \-i\ symbol[,symbol]
Specify a list of symbols that should be ignored when resolving
undefined symbols against the imported libraries. This forces these
symbols to be resolved from the Unix C library (or from another Unix
library linked with the application).
.TP
.BI \-K\ flags .BI \-K\ flags
Ignored for compatibility with the C compiler. Ignored for compatibility with the C compiler.
.TP .TP
@ -171,12 +177,8 @@ option will also work for Win32 files).
Turn on warnings. Turn on warnings.
.SH "SPEC FILE SYNTAX" .SH "SPEC FILE SYNTAX"
.SS "General syntax" .SS "General syntax"
A spec file should contain a number of optional directives, and then a A spec file should contain a list of ordinal declarations. The general
list of ordinal declarations. The general syntax is the following: syntax is the following:
.PP
.RB [ ignore\ (\ [ \fIsymbols...\fR ]\ )\ ]
.br
.BI #\ comments
.PP .PP
.I ordinal functype .I ordinal functype
.RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB)\fI\ handler .RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB)\fI\ handler
@ -195,15 +197,13 @@ list of ordinal declarations. The general syntax is the following:
.br .br
.IB ordinal\ forward .IB ordinal\ forward
.RI [ flags ]\ exportname\ forwardname .RI [ flags ]\ exportname\ forwardname
.SS "Optional directives" .br
.B ignore .BI #\ comments
specifies a list of symbols that should be ignored when
resolving undefined symbols against the imported libraries.
.PP .PP
Lines whose first character is a Lines whose first character is a
.B # .B #
will be ignored as comments. will be ignored as comments.
.SS "Ordinal specifications" .PP
.I ordinal .I ordinal
specifies the ordinal number corresponding to the entry point, or '@' specifies the ordinal number corresponding to the entry point, or '@'
for automatic ordinal allocation (Win32 only). for automatic ordinal allocation (Win32 only).