Ignore imports and resources when building a .def file.

This commit is contained in:
Alexandre Julliard 2002-03-26 01:55:25 +00:00
parent e8d977011b
commit add0b5d28f
3 changed files with 11 additions and 7 deletions

View File

@ -223,7 +223,7 @@ extern void BuildRelays32( FILE *outfile );
extern void BuildSpec16File( FILE *outfile ); extern void BuildSpec16File( FILE *outfile );
extern void BuildSpec32File( FILE *outfile ); extern void BuildSpec32File( FILE *outfile );
extern void BuildDef32File( FILE *outfile ); extern void BuildDef32File( FILE *outfile );
extern SPEC_TYPE ParseTopLevel( FILE *file ); extern SPEC_TYPE ParseTopLevel( FILE *file, int def_only );
/* global variables */ /* global variables */

View File

@ -270,7 +270,7 @@ int main(int argc, char **argv)
switch(exec_mode) switch(exec_mode)
{ {
case MODE_SPEC: case MODE_SPEC:
switch (ParseTopLevel( input_file )) switch (ParseTopLevel( input_file, 0 ))
{ {
case SPEC_WIN16: case SPEC_WIN16:
BuildSpec16File( output_file ); BuildSpec16File( output_file );
@ -282,7 +282,7 @@ int main(int argc, char **argv)
} }
break; break;
case MODE_DEF: case MODE_DEF:
switch (ParseTopLevel( input_file )) switch (ParseTopLevel( input_file, 1 ))
{ {
case SPEC_WIN16: case SPEC_WIN16:
fatal_error( "Cannot yet build .def file for 16-bit dlls\n" ); fatal_error( "Cannot yet build .def file for 16-bit dlls\n" );

View File

@ -508,7 +508,7 @@ static void sort_names(void)
* *
* Parse a spec file. * Parse a spec file.
*/ */
SPEC_TYPE ParseTopLevel( FILE *file ) SPEC_TYPE ParseTopLevel( FILE *file, int def_only )
{ {
const char *token; const char *token;
@ -582,13 +582,17 @@ SPEC_TYPE ParseTopLevel( FILE *file )
} }
else fatal_error( "Unknown option '%s' for import directive\n", name ); else fatal_error( "Unknown option '%s' for import directive\n", name );
} }
add_import_dll( name, delay ); if (!def_only) add_import_dll( name, delay );
} }
else if (strcmp(token, "rsrc") == 0) else if (strcmp(token, "rsrc") == 0)
{
if (!def_only)
{ {
if (SpecType != SPEC_WIN16) load_res32_file( GetToken(0) ); if (SpecType != SPEC_WIN16) load_res32_file( GetToken(0) );
else load_res16_file( GetToken(0) ); else load_res16_file( GetToken(0) );
} }
else GetToken(0); /* skip it */
}
else if (strcmp(token, "owner") == 0) else if (strcmp(token, "owner") == 0)
{ {
if (SpecType != SPEC_WIN16) if (SpecType != SPEC_WIN16)