int nb_entry_points; /* number of used entry points */
int alloc_entry_points; /* number of allocated entry points */
int nb_names; /* number of entry points with names */
- int nb_resources; /* number of resources */
+ unsigned int nb_resources; /* number of resources */
int characteristics; /* characteristics for the PE header */
int subsystem; /* subsystem id */
int subsystem_major; /* subsystem version major number */
extern int kill_at;
extern char *input_file_name;
+extern char *spec_file_name;
extern const char *output_file_name;
extern char **debug_channels;
extern char **lib_path;
char **lib_path = NULL;
char *input_file_name = NULL;
+char *spec_file_name = NULL;
const char *output_file_name = NULL;
char *ld_command = "ld";
static const char *current_src_dir;
static int nb_res_files;
static char **res_files;
-static char *spec_file_name;
/* execution mode */
enum exec_mode_values
else
fprintf( outfile, "\tmovw " __ASM_NAME("CallTo16_TebSelector") ", %%fs\n" );
- fprintf( outfile, "\t.byte 0x64\n\tmovl (%d),%%gs\n", STRUCTOFFSET(TEB,gs_sel) );
+ fprintf( outfile, "\t.byte 0x64\n\tmov (%d),%%gs\n", STRUCTOFFSET(TEB,gs_sel) );
/* Get address of wine_ldt_copy array into %ecx */
if ( UsePIC )
fprintf( outfile, "\tpushl %%ebx\n" );
fprintf( outfile, "\tpushl %%esi\n" );
fprintf( outfile, "\tpushl %%edi\n" );
- fprintf( outfile, "\t.byte 0x64\n\tmovl %%gs,(%d)\n", STRUCTOFFSET(TEB,gs_sel) );
+ fprintf( outfile, "\t.byte 0x64\n\tmov %%gs,(%d)\n", STRUCTOFFSET(TEB,gs_sel) );
/* Setup exception frame */
fprintf( outfile, "\t.byte 0x64\n\tpushl (%d)\n", STACKOFFSET );
#endif
fprintf( outfile, "\tmovw %%di,%%es\n" );
- fprintf( outfile, "\t.byte 0x2e\n\tmovl " __ASM_NAME("CallTo16_TebSelector") "-" __ASM_NAME("Call16_Ret_Start") ",%%fs\n" );
+ fprintf( outfile, "\t.byte 0x2e\n\tmov " __ASM_NAME("CallTo16_TebSelector") "-" __ASM_NAME("Call16_Ret_Start") ",%%fs\n" );
- fprintf( outfile, "\t.byte 0x64\n\tmovl (%d),%%gs\n", STRUCTOFFSET(TEB,gs_sel) );
+ fprintf( outfile, "\t.byte 0x64\n\tmov (%d),%%gs\n", STRUCTOFFSET(TEB,gs_sel) );
/* Restore the 32-bit stack */
/* build the 2-level (type,name) resource tree */
static struct res_tree *build_resource_tree( DLLSPEC *spec )
{
- int i;
+ unsigned int i;
struct res_tree *tree;
struct res_type *type = NULL;
{
const struct resource *res;
unsigned char *buffer, *p;
- int i, total;
+ unsigned int i;
+ int total;
if (!spec->nb_resources) return 0;
/* output the resource definitions */
int output_res16_directory( unsigned char *buffer, DLLSPEC *spec )
{
- int i, offset, res_offset = 0;
- unsigned int j;
+ int offset, res_offset = 0;
+ unsigned int i, j;
struct res_tree *tree;
const struct res_type *type;
const struct resource *res;
/* build the 3-level (type,name,language) resource tree */
static struct res_tree *build_resource_tree( DLLSPEC *spec )
{
- int i;
+ unsigned int i;
struct res_tree *tree;
struct res_type *type = NULL;
struct res_name *name = NULL;
/* free the resource tree */
static void free_resource_tree( struct res_tree *tree )
{
- int i;
+ unsigned int i;
for (i = 0; i < tree->nb_types; i++) free( tree->types[i].names );
free( tree->types );
/* output the resource definitions */
void output_resources( FILE *outfile, DLLSPEC *spec )
{
- int i, j, k, nb_id_types;
- unsigned int n, offset, data_offset;
+ int j, k, nb_id_types;
+ unsigned int i, n, offset, data_offset;
struct res_tree *tree;
struct res_type *type;
struct res_name *name;
const char *name;
int i;
- fprintf(outfile, "; File generated automatically from %s; do not edit!\n\n",
- input_file_name );
+ if (spec_file_name)
+ fprintf( outfile, "; File generated automatically from %s; do not edit!\n\n",
+ spec_file_name );
+ else
+ fprintf( outfile, "; File generated automatically; do not edit!\n\n" );
fprintf(outfile, "LIBRARY %s\n\n", spec->file_name);
void *xrealloc (void *ptr, size_t size)
{
void *res = realloc (ptr, size);
- if (res == NULL)
+ if (size && res == NULL)
{
fprintf (stderr, "Virtual memory exhausted.\n");
exit (1);
/* output a standard header for generated files */
void output_standard_file_header( FILE *outfile )
{
- if (input_file_name)
+ if (spec_file_name)
fprintf( outfile, "/* File generated automatically from %s; do not edit! */\n",
- input_file_name );
+ spec_file_name );
else
fprintf( outfile, "/* File generated automatically; do not edit! */\n" );
fprintf( outfile,