Document use of "init" in build-spec.txt, and make build.c print a
warning if someone tries to use "init" in a Win16 spec file.
This commit is contained in:
parent
a21fe34596
commit
c4c129dc50
|
@ -1,8 +1,12 @@
|
||||||
|
Spec file format
|
||||||
|
----------------
|
||||||
|
|
||||||
name NAME
|
name NAME
|
||||||
type win16|win32
|
type win16|win32
|
||||||
[file WINFILENAME]
|
[file WINFILENAME]
|
||||||
[base ORDINAL]
|
[base ORDINAL]
|
||||||
[heap SIZE]
|
[heap SIZE]
|
||||||
|
[init FUNCTION]
|
||||||
[import DLL]
|
[import DLL]
|
||||||
|
|
||||||
ORDINAL VARTYPE EXPORTNAME (DATA [DATA [DATA [...]]])
|
ORDINAL VARTYPE EXPORTNAME (DATA [DATA [DATA [...]]])
|
||||||
|
@ -36,6 +40,9 @@ modules); default is no local heap.
|
||||||
builtin. <name>.DLL is assumed if none is given. (This is important
|
builtin. <name>.DLL is assumed if none is given. (This is important
|
||||||
for kernel, which lives in the Windows file KRNL386.EXE).
|
for kernel, which lives in the Windows file KRNL386.EXE).
|
||||||
|
|
||||||
|
"init" specifies a function which will be called when this dll
|
||||||
|
is loaded. This is only valid for Win32 modules.
|
||||||
|
|
||||||
"import" names a module that this one depends on (only for Win32
|
"import" names a module that this one depends on (only for Win32
|
||||||
modules at the present). The import declaration can be present several
|
modules at the present). The import declaration can be present several
|
||||||
times.
|
times.
|
||||||
|
|
|
@ -749,8 +749,17 @@ static int ParseTopLevel(void)
|
||||||
else if (strcmp(token, "init") == 0)
|
else if (strcmp(token, "init") == 0)
|
||||||
{
|
{
|
||||||
strcpy(DLLInitFunc, GetToken());
|
strcpy(DLLInitFunc, GetToken());
|
||||||
|
if (SpecType == SPEC_WIN16)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "%s:%d: init cannot be used for Win16 spec files\n",
|
||||||
|
SpecName, Line);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (!DLLInitFunc[0])
|
if (!DLLInitFunc[0])
|
||||||
|
{
|
||||||
fprintf(stderr, "%s:%d: Expected function name after init\n", SpecName, Line);
|
fprintf(stderr, "%s:%d: Expected function name after init\n", SpecName, Line);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(token, "import") == 0)
|
else if (strcmp(token, "import") == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue