Generate Win32 dll descriptor structure in the .spec.c file so that we

don't need to depend on builtin32.h.
This commit is contained in:
Alexandre Julliard 2000-09-27 01:20:01 +00:00
parent 124657f5a9
commit a80d8c6cf0
5 changed files with 17 additions and 8 deletions

View File

@ -12,7 +12,6 @@
#include "wine/winbase16.h" #include "wine/winbase16.h"
#include "wine/winestring.h" #include "wine/winestring.h"
#include "builtin16.h" #include "builtin16.h"
#include "builtin32.h"
#include "global.h" #include "global.h"
#include "heap.h" #include "heap.h"
#include "module.h" #include "module.h"

View File

@ -7,6 +7,7 @@
#ifndef __WINE_BUILTIN32_H #ifndef __WINE_BUILTIN32_H
#define __WINE_BUILTIN32_H #define __WINE_BUILTIN32_H
/* Warning: this must match the definition in tools/winebuild/spec32.c */
typedef struct typedef struct
{ {
const char* filename; /* DLL file name */ const char* filename; /* DLL file name */
@ -21,7 +22,6 @@ typedef struct
} BUILTIN32_DESCRIPTOR; } BUILTIN32_DESCRIPTOR;
extern void BUILTIN32_RegisterDLL( const BUILTIN32_DESCRIPTOR *descr ); extern void BUILTIN32_RegisterDLL( const BUILTIN32_DESCRIPTOR *descr );
extern void BUILTIN32_Unimplemented( const char *dllname, const char *funcname );
extern void RELAY_SetupDLL( const char *module ); extern void RELAY_SetupDLL( const char *module );
#endif /* __WINE_BUILTIN32_H */ #endif /* __WINE_BUILTIN32_H */

View File

@ -9,7 +9,6 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include "winnt.h" #include "winnt.h"
#include "builtin32.h"
#include "selectors.h" #include "selectors.h"
#include "stackframe.h" #include "stackframe.h"
#include "syslevel.h" #include "syslevel.h"

View File

@ -12,7 +12,6 @@
#include "winbase.h" #include "winbase.h"
#include "winnt.h" #include "winnt.h"
#include "heap.h" #include "heap.h"
#include "builtin32.h"
#include "snoop.h" #include "snoop.h"
#include "neexe.h" #include "neexe.h"
#include "selectors.h" #include "selectors.h"

View File

@ -288,7 +288,7 @@ void BuildSpec32File( FILE *outfile )
fprintf( outfile, "/* File generated automatically from %s; do not edit! */\n\n", fprintf( outfile, "/* File generated automatically from %s; do not edit! */\n\n",
input_file_name ); input_file_name );
fprintf( outfile, "#include \"builtin32.h\"\n\n" ); fprintf( outfile, "extern void BUILTIN32_Unimplemented( const char *dllname, const char *funcname );\n\n" );
/* Reserve some space for the PE header */ /* Reserve some space for the PE header */
@ -439,7 +439,18 @@ void BuildSpec32File( FILE *outfile )
if (rsrc_name[0]) fprintf( outfile, "extern char %s[];\n\n", rsrc_name ); if (rsrc_name[0]) fprintf( outfile, "extern char %s[];\n\n", rsrc_name );
fprintf( outfile, "static const BUILTIN32_DESCRIPTOR descriptor =\n{\n" ); /* Warning: this must match the definition in builtin32.h */
fprintf( outfile, "static const struct dll_descriptor\n{\n" );
fprintf( outfile, " const char* filename;\n" );
fprintf( outfile, " int nb_imports;\n" );
fprintf( outfile, " void *pe_header;\n" );
fprintf( outfile, " void *exports;\n" );
fprintf( outfile, " unsigned int exports_size;\n" );
fprintf( outfile, " const char * const *imports;\n" );
fprintf( outfile, " void (*dllentrypoint)();\n" );
fprintf( outfile, " int characteristics;\n" );
fprintf( outfile, " void *rsrc;\n" );
fprintf( outfile, "} descriptor = {\n" );
fprintf( outfile, " \"%s\",\n", DLLFileName ); fprintf( outfile, " \"%s\",\n", DLLFileName );
fprintf( outfile, " %d,\n", nb_imports ); fprintf( outfile, " %d,\n", nb_imports );
fprintf( outfile, " pe_header,\n" ); fprintf( outfile, " pe_header,\n" );
@ -462,6 +473,7 @@ void BuildSpec32File( FILE *outfile )
fprintf( outfile, " \"\\t.previous\\n\");\n" ); fprintf( outfile, " \"\\t.previous\\n\");\n" );
fprintf( outfile, "}\n" ); fprintf( outfile, "}\n" );
fprintf( outfile, "#endif /* defined(__GNUC__) */\n" ); fprintf( outfile, "#endif /* defined(__GNUC__) */\n" );
fprintf( outfile, "static void %s_init(void) { BUILTIN32_RegisterDLL( &descriptor ); }\n", fprintf( outfile, "static void %s_init(void)\n{\n", DLLName );
DLLName ); fprintf( outfile, " extern void BUILTIN32_RegisterDLL( const struct dll_descriptor * );\n" );
fprintf( outfile, " BUILTIN32_RegisterDLL( &descriptor );\n}\n" );
} }