Commit 5e32d166 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Added ability to delay loading of an imported DLL until it's needed

(new -delay option for import directive in spec file).
parent 7f74824d
......@@ -7,7 +7,7 @@ type win16|win32
[mode dll|cuiexe|guiexe|cuiexe_unicode|guiexe_unicode]
[heap SIZE]
[init FUNCTION]
[import DLL]
[import [IMP_FLAGS] DLL]
[rsrc RESFILE]
[debug_channels ([CHANNEL [CHANNEL...]])]
[ignore ([SYMBOL [SYMBOL...]])]
......@@ -51,6 +51,12 @@ is loaded. This is only valid for Win32 modules.
modules at the present). The import declaration can be present several
times.
"IMP_FLAGS" is a series of optional flags, preceded by a '-'
character. The supported flags are:
"-delay": the module this module depends upon will be loaded
when the first API will be called (and not while this
module is loaded)
"rsrc" specifies the path of the compiled resource file.
"debug_channels" specifies the list of debug channels used by the dll.
......
......@@ -133,7 +133,7 @@ extern void fatal_perror( const char *msg, ... );
extern void warning( const char *msg, ... );
extern void dump_bytes( FILE *outfile, const unsigned char *data, int len,
const char *label, int constant );
extern void add_import_dll( const char *name );
extern void add_import_dll( const char *name, int delay );
extern void add_ignore_symbol( const char *name );
extern int resolve_imports( FILE *outfile );
extern int output_imports( FILE *outfile );
......
......@@ -580,9 +580,23 @@ SPEC_TYPE ParseTopLevel( FILE *file )
}
else if (strcmp(token, "import") == 0)
{
const char* name;
int delay = 0;
if (SpecType != SPEC_WIN32)
fatal_error( "Imports not supported for Win16\n" );
add_import_dll( GetToken(0) );
name = GetToken(0);
if (*name == '-')
{
name = GetToken(0);
if (!strcmp(name, "delay"))
{
name = GetToken(0);
delay = 1;
}
else fatal_error( "Unknown option '%s' for import directive\n", name );
}
add_import_dll( name, delay );
}
else if (strcmp(token, "rsrc") == 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment