Commit 65c6d385 authored by Alexandre Julliard's avatar Alexandre Julliard

Replace all uses of PREFIX and @function by the __ASM_NAME and

__ASM_FUNC macros.
parent 15fc2369
...@@ -148,7 +148,7 @@ __ASM_GLOBAL_FUNC(vm86_enter, ...@@ -148,7 +148,7 @@ __ASM_GLOBAL_FUNC(vm86_enter,
"pushl %fs\n\t" "pushl %fs\n\t"
"int $0x80\n" "int $0x80\n"
".globl " __ASM_NAME("vm86_return") "\n\t" ".globl " __ASM_NAME("vm86_return") "\n\t"
".type " __ASM_NAME("vm86_return") ",@function\n" __ASM_FUNC("vm86_return") "\n"
__ASM_NAME("vm86_return") ":\n\t" __ASM_NAME("vm86_return") ":\n\t"
"popl %fs\n\t" "popl %fs\n\t"
"popl %ecx\n\t" "popl %ecx\n\t"
...@@ -162,7 +162,7 @@ __ASM_GLOBAL_FUNC(vm86_enter, ...@@ -162,7 +162,7 @@ __ASM_GLOBAL_FUNC(vm86_enter,
"movl 4(%esp),%ecx\n\t" /* vm86_ptr */ "movl 4(%esp),%ecx\n\t" /* vm86_ptr */
"movl $0,(%ecx)\n\t" "movl $0,(%ecx)\n\t"
".globl " __ASM_NAME("vm86_return_end") "\n\t" ".globl " __ASM_NAME("vm86_return_end") "\n\t"
".type " __ASM_NAME("vm86_return_end") ",@function\n" __ASM_FUNC("vm86_return_end") "\n"
__ASM_NAME("vm86_return_end") ":\n\t" __ASM_NAME("vm86_return_end") ":\n\t"
"ret" ); "ret" );
......
...@@ -50,12 +50,6 @@ extern const char **debug_snoop_includelist; ...@@ -50,12 +50,6 @@ extern const char **debug_snoop_includelist;
extern void WINAPI SNOOP_Entry(); extern void WINAPI SNOOP_Entry();
extern void WINAPI SNOOP_Return(); extern void WINAPI SNOOP_Return();
#ifdef NEED_UNDERSCORE_PREFIX
# define PREFIX "_"
#else
# define PREFIX
#endif
#include "pshpack1.h" #include "pshpack1.h"
typedef struct tagSNOOP_FUN { typedef struct tagSNOOP_FUN {
......
...@@ -53,13 +53,7 @@ void PTHREAD_init_done(void) ...@@ -53,13 +53,7 @@ void PTHREAD_init_done(void)
#include <pthread.h> #include <pthread.h>
#include <signal.h> #include <signal.h>
#ifdef NEED_UNDERSCORE_PREFIX #define PSTR(str) __ASM_NAME(#str)
# define PREFIX "_"
#else
# define PREFIX
#endif
#define PSTR(str) PREFIX #str
/* adapt as necessary (a construct like this is used in glibc sources) */ /* adapt as necessary (a construct like this is used in glibc sources) */
#define strong_alias(orig, alias) \ #define strong_alias(orig, alias) \
...@@ -70,11 +64,7 @@ void PTHREAD_init_done(void) ...@@ -70,11 +64,7 @@ void PTHREAD_init_done(void)
* so for those, we need to use the pogo stick */ * so for those, we need to use the pogo stick */
#if defined(__i386__) && !defined(__PIC__) #if defined(__i386__) && !defined(__PIC__)
/* FIXME: PIC */ /* FIXME: PIC */
#define jump_alias(orig, alias) \ #define jump_alias(orig, alias) __ASM_GLOBAL_FUNC( alias, "jmp " PSTR(orig))
asm(".globl " PSTR(alias) "\n" \
"\t.type " PSTR(alias) ",@function\n" \
PSTR(alias) ":\n" \
"\tjmp " PSTR(orig))
#endif #endif
/* get necessary libc symbols */ /* get necessary libc symbols */
......
...@@ -31,12 +31,6 @@ ...@@ -31,12 +31,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef NEED_UNDERSCORE_PREFIX
# define PREFIX "_"
#else
# define PREFIX
#endif
#ifdef HAVE_ASM_STRING #ifdef HAVE_ASM_STRING
# define STRING ".string" # define STRING ".string"
#else #else
......
...@@ -470,13 +470,9 @@ static int output_immediate_imports( FILE *outfile ) ...@@ -470,13 +470,9 @@ static int output_immediate_imports( FILE *outfile )
{ {
fprintf( outfile, " \"\\t" __ASM_FUNC("%s") "\\n\"\n", fprintf( outfile, " \"\\t" __ASM_FUNC("%s") "\\n\"\n",
dll_imports[i]->imports[j] ); dll_imports[i]->imports[j] );
fprintf( outfile, " \"\\t.globl " PREFIX "%s\\n\"\n", fprintf( outfile, " \"\\t.globl " __ASM_NAME("%s") "\\n\"\n",
dll_imports[i]->imports[j] ); dll_imports[i]->imports[j] );
fprintf( outfile, " \"" __ASM_NAME("%s") ":\\n\\t", dll_imports[i]->imports[j] );
fprintf( outfile, " \"" PREFIX "%s:\\n\\t", dll_imports[i]->imports[j] );
#if defined(__i386__) #if defined(__i386__)
if (strstr( dll_imports[i]->imports[j], "__wine_call_from_16" )) if (strstr( dll_imports[i]->imports[j], "__wine_call_from_16" ))
...@@ -651,7 +647,7 @@ static int output_delayed_imports( FILE *outfile ) ...@@ -651,7 +647,7 @@ static int output_delayed_imports( FILE *outfile )
fprintf( outfile, "asm(\".align %d\\n\"\n", get_alignment(8) ); fprintf( outfile, "asm(\".align %d\\n\"\n", get_alignment(8) );
fprintf( outfile, " \"\\t" __ASM_FUNC("__wine_delay_load_asm") "\\n\"\n" ); fprintf( outfile, " \"\\t" __ASM_FUNC("__wine_delay_load_asm") "\\n\"\n" );
fprintf( outfile, " \"" PREFIX "__wine_delay_load_asm:\\n\"\n" ); fprintf( outfile, " \"" __ASM_NAME("__wine_delay_load_asm") ":\\n\"\n" );
#if defined(__i386__) #if defined(__i386__)
fprintf( outfile, " \"\\tpushl %%ecx\\n\\tpushl %%edx\\n\\tpushl %%eax\\n\"\n" ); fprintf( outfile, " \"\\tpushl %%ecx\\n\\tpushl %%edx\\n\\tpushl %%eax\\n\"\n" );
fprintf( outfile, " \"\\tcall __wine_delay_load\\n\"\n" ); fprintf( outfile, " \"\\tcall __wine_delay_load\\n\"\n" );
...@@ -675,7 +671,7 @@ static int output_delayed_imports( FILE *outfile ) ...@@ -675,7 +671,7 @@ static int output_delayed_imports( FILE *outfile )
char buffer[128]; char buffer[128];
sprintf( buffer, "__wine_delay_imp_%d_%s", i, dll_imports[i]->imports[j]); sprintf( buffer, "__wine_delay_imp_%d_%s", i, dll_imports[i]->imports[j]);
fprintf( outfile, " \"\\t" __ASM_FUNC("%s") "\\n\"\n", buffer ); fprintf( outfile, " \"\\t" __ASM_FUNC("%s") "\\n\"\n", buffer );
fprintf( outfile, " \"" PREFIX "%s:\\n\"\n", buffer ); fprintf( outfile, " \"" __ASM_NAME("%s") ":\\n\"\n", buffer );
#if defined(__i386__) #if defined(__i386__)
fprintf( outfile, " \"\\tmovl $%d, %%eax\\n\"\n", (idx << 16) | j ); fprintf( outfile, " \"\\tmovl $%d, %%eax\\n\"\n", (idx << 16) | j );
fprintf( outfile, " \"\\tjmp __wine_delay_load_asm\\n\"\n" ); fprintf( outfile, " \"\\tjmp __wine_delay_load_asm\\n\"\n" );
...@@ -700,9 +696,9 @@ static int output_delayed_imports( FILE *outfile ) ...@@ -700,9 +696,9 @@ static int output_delayed_imports( FILE *outfile )
{ {
fprintf( outfile, " \"\\t" __ASM_FUNC("%s") "\\n\"\n", fprintf( outfile, " \"\\t" __ASM_FUNC("%s") "\\n\"\n",
dll_imports[i]->imports[j] ); dll_imports[i]->imports[j] );
fprintf( outfile, " \"\\t.globl " PREFIX "%s\\n\"\n", fprintf( outfile, " \"\\t.globl " __ASM_NAME("%s") "\\n\"\n",
dll_imports[i]->imports[j] ); dll_imports[i]->imports[j] );
fprintf( outfile, " \"" PREFIX "%s:\\n\\t", dll_imports[i]->imports[j] ); fprintf( outfile, " \"" __ASM_NAME("%s") ":\\n\\t", dll_imports[i]->imports[j] );
#if defined(__i386__) #if defined(__i386__)
if (strstr( dll_imports[i]->imports[j], "__wine_call_from_16" )) if (strstr( dll_imports[i]->imports[j], "__wine_call_from_16" ))
fprintf( outfile, ".byte 0x2e\\n\\tjmp *(delay_imports+%d)\\n\\tnop\\n", pos ); fprintf( outfile, ".byte 0x2e\\n\\tjmp *(delay_imports+%d)\\n\\tnop\\n", pos );
......
...@@ -43,14 +43,11 @@ static const int use_stabs = 0; ...@@ -43,14 +43,11 @@ static const int use_stabs = 0;
static void function_header( FILE *outfile, const char *name ) static void function_header( FILE *outfile, const char *name )
{ {
fprintf( outfile, "\n\t.align %d\n", get_alignment(4) ); fprintf( outfile, "\n\t.align %d\n", get_alignment(4) );
if (use_stabs) fprintf( outfile, "\t.stabs \"%s:F1\",36,0,0," PREFIX "%s\n", name, name); if (use_stabs)
#ifdef NEED_TYPE_IN_DEF fprintf( outfile, "\t.stabs \"%s:F1\",36,0,0," __ASM_NAME("%s") "\n", name, name);
fprintf( outfile, "\t.def " PREFIX "%s; .scl 2; .type 32; .endef\n", name ); fprintf( outfile, "\t" __ASM_FUNC("%s") "\n", name );
#else fprintf( outfile, "\t.globl " __ASM_NAME("%s") "\n", name );
fprintf( outfile, "\t.type " PREFIX "%s,@function\n", name ); fprintf( outfile, __ASM_NAME("%s") ":\n", name );
#endif
fprintf( outfile, "\t.globl " PREFIX "%s\n", name );
fprintf( outfile, PREFIX "%s:\n", name );
} }
...@@ -154,11 +151,11 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho ...@@ -154,11 +151,11 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
if (UsePIC) if (UsePIC)
{ {
fprintf( outfile, "\t.byte 0x2e\n\tmovl " PREFIX "CallTo16_DataSelector@GOT(%%ecx), %%edx\n" ); fprintf( outfile, "\t.byte 0x2e\n\tmovl " __ASM_NAME("CallTo16_DataSelector@GOT") "(%%ecx), %%edx\n" );
fprintf( outfile, "\t.byte 0x2e\n\tmovl (%%edx), %%edx\n" ); fprintf( outfile, "\t.byte 0x2e\n\tmovl (%%edx), %%edx\n" );
} }
else else
fprintf( outfile, "\t.byte 0x2e\n\tmovl " PREFIX "CallTo16_DataSelector,%%edx\n" ); fprintf( outfile, "\t.byte 0x2e\n\tmovl " __ASM_NAME("CallTo16_DataSelector") ",%%edx\n" );
/* Load 32-bit segment registers */ /* Load 32-bit segment registers */
#ifdef __svr4__ #ifdef __svr4__
...@@ -172,17 +169,17 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho ...@@ -172,17 +169,17 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
if ( UsePIC ) if ( UsePIC )
{ {
fprintf( outfile, "\tmovl " PREFIX "SYSLEVEL_Win16CurrentTeb@GOT(%%ecx), %%edx\n" ); fprintf( outfile, "\tmovl " __ASM_NAME("SYSLEVEL_Win16CurrentTeb@GOT") "(%%ecx), %%edx\n" );
fprintf( outfile, "\tmovw (%%edx), %%fs\n" ); fprintf( outfile, "\tmovw (%%edx), %%fs\n" );
} }
else else
fprintf( outfile, "\tmovw " PREFIX "SYSLEVEL_Win16CurrentTeb, %%fs\n" ); fprintf( outfile, "\tmovw " __ASM_NAME("SYSLEVEL_Win16CurrentTeb") ", %%fs\n" );
/* Get address of wine_ldt_copy array into %ecx */ /* Get address of wine_ldt_copy array into %ecx */
if ( UsePIC ) if ( UsePIC )
fprintf( outfile, "\tmovl " PREFIX "wine_ldt_copy@GOT(%%ecx), %%ecx\n" ); fprintf( outfile, "\tmovl " __ASM_NAME("wine_ldt_copy@GOT") "(%%ecx), %%ecx\n" );
else else
fprintf( outfile, "\tmovl $" PREFIX "wine_ldt_copy, %%ecx\n" ); fprintf( outfile, "\tmovl $" __ASM_NAME("wine_ldt_copy") ", %%ecx\n" );
/* Translate STACK16FRAME base to flat offset in %edx */ /* Translate STACK16FRAME base to flat offset in %edx */
fprintf( outfile, "\tmovw %%ss, %%dx\n" ); fprintf( outfile, "\tmovw %%ss, %%dx\n" );
...@@ -325,9 +322,9 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho ...@@ -325,9 +322,9 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
fprintf( outfile, "\tpushl $0\n" ); fprintf( outfile, "\tpushl $0\n" );
if ( UsePIC ) if ( UsePIC )
fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16@PLT\n "); fprintf( outfile, "\tcall " __ASM_NAME("RELAY_DebugCallFrom16@PLT") "\n ");
else else
fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16\n "); fprintf( outfile, "\tcall " __ASM_NAME("RELAY_DebugCallFrom16") "\n ");
fprintf( outfile, "\tpopl %%edx\n" ); fprintf( outfile, "\tpopl %%edx\n" );
fprintf( outfile, "\tpopl %%edx\n" ); fprintf( outfile, "\tpopl %%edx\n" );
...@@ -364,9 +361,9 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho ...@@ -364,9 +361,9 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
fprintf( outfile, "\tpushl $0\n" ); fprintf( outfile, "\tpushl $0\n" );
if ( UsePIC ) if ( UsePIC )
fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16Ret@PLT\n "); fprintf( outfile, "\tcall " __ASM_NAME("RELAY_DebugCallFrom16Ret@PLT") "\n ");
else else
fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallFrom16Ret\n "); fprintf( outfile, "\tcall " __ASM_NAME("RELAY_DebugCallFrom16Ret") "\n ");
fprintf( outfile, "\tpopl %%eax\n" ); fprintf( outfile, "\tpopl %%eax\n" );
fprintf( outfile, "\tpopl %%eax\n" ); fprintf( outfile, "\tpopl %%eax\n" );
...@@ -506,9 +503,9 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) ...@@ -506,9 +503,9 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Enter Win16 Mutex */ /* Enter Win16 Mutex */
if ( UsePIC ) if ( UsePIC )
fprintf( outfile, "\tcall " PREFIX "_EnterWin16Lock@PLT\n" ); fprintf( outfile, "\tcall " __ASM_NAME("_EnterWin16Lock@PLT") "\n" );
else else
fprintf( outfile, "\tcall " PREFIX "_EnterWin16Lock\n" ); fprintf( outfile, "\tcall " __ASM_NAME("_EnterWin16Lock") "\n" );
/* Print debugging info */ /* Print debugging info */
if (debugging) if (debugging)
...@@ -519,9 +516,9 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) ...@@ -519,9 +516,9 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
fprintf( outfile, "\tpushl 8(%%ebp)\n" ); fprintf( outfile, "\tpushl 8(%%ebp)\n" );
if ( UsePIC ) if ( UsePIC )
fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16@PLT\n" ); fprintf( outfile, "\tcall " __ASM_NAME("RELAY_DebugCallTo16@PLT") "\n" );
else else
fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16\n" ); fprintf( outfile, "\tcall " __ASM_NAME("RELAY_DebugCallTo16") "\n" );
fprintf( outfile, "\taddl $12, %%esp\n" ); fprintf( outfile, "\taddl $12, %%esp\n" );
} }
...@@ -529,11 +526,11 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) ...@@ -529,11 +526,11 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Get return address */ /* Get return address */
if ( UsePIC ) if ( UsePIC )
{ {
fprintf( outfile, "\tmovl " PREFIX "CallTo16_RetAddr@GOT(%%ebx), %%ecx\n" ); fprintf( outfile, "\tmovl " __ASM_NAME("CallTo16_RetAddr@GOT") "(%%ebx), %%ecx\n" );
fprintf( outfile, "\tmovl " PREFIX "(%%ecx), %%ecx\n" ); fprintf( outfile, "\tmovl (%%ecx), %%ecx\n" );
} }
else else
fprintf( outfile, "\tmovl " PREFIX "CallTo16_RetAddr, %%ecx\n" ); fprintf( outfile, "\tmovl " __ASM_NAME("CallTo16_RetAddr") ", %%ecx\n" );
/* Call the actual CallTo16 routine (simulate a lcall) */ /* Call the actual CallTo16 routine (simulate a lcall) */
fprintf( outfile, "\tpushl %%cs\n" ); fprintf( outfile, "\tpushl %%cs\n" );
...@@ -593,18 +590,18 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func ) ...@@ -593,18 +590,18 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
fprintf( outfile, "\tpushl $%d\n", reg_func ); fprintf( outfile, "\tpushl $%d\n", reg_func );
if ( UsePIC ) if ( UsePIC )
fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16Ret@PLT\n" ); fprintf( outfile, "\tcall " __ASM_NAME("RELAY_DebugCallTo16Ret@PLT") "\n" );
else else
fprintf( outfile, "\tcall " PREFIX "RELAY_DebugCallTo16Ret\n" ); fprintf( outfile, "\tcall " __ASM_NAME("RELAY_DebugCallTo16Ret") "\n" );
fprintf( outfile, "\taddl $4, %%esp\n" ); fprintf( outfile, "\taddl $4, %%esp\n" );
} }
/* Leave Win16 Mutex */ /* Leave Win16 Mutex */
if ( UsePIC ) if ( UsePIC )
fprintf( outfile, "\tcall " PREFIX "_LeaveWin16Lock@PLT\n" ); fprintf( outfile, "\tcall " __ASM_NAME("_LeaveWin16Lock@PLT") "\n" );
else else
fprintf( outfile, "\tcall " PREFIX "_LeaveWin16Lock\n" ); fprintf( outfile, "\tcall " __ASM_NAME("_LeaveWin16Lock") "\n" );
/* Get return value */ /* Get return value */
fprintf( outfile, "\tpopl %%eax\n" ); fprintf( outfile, "\tpopl %%eax\n" );
...@@ -723,7 +720,7 @@ static void BuildRet16Func( FILE *outfile ) ...@@ -723,7 +720,7 @@ static void BuildRet16Func( FILE *outfile )
/* Restore 32-bit segment registers */ /* Restore 32-bit segment registers */
fprintf( outfile, "\t.byte 0x2e\n\tmovl " PREFIX "CallTo16_DataSelector-" PREFIX "Call16_Ret_Start,%%edi\n" ); fprintf( outfile, "\t.byte 0x2e\n\tmovl " __ASM_NAME("CallTo16_DataSelector") "-" __ASM_NAME("Call16_Ret_Start") ",%%edi\n" );
#ifdef __svr4__ #ifdef __svr4__
fprintf( outfile, "\tdata16\n"); fprintf( outfile, "\tdata16\n");
#endif #endif
...@@ -733,7 +730,7 @@ static void BuildRet16Func( FILE *outfile ) ...@@ -733,7 +730,7 @@ static void BuildRet16Func( FILE *outfile )
#endif #endif
fprintf( outfile, "\tmovw %%di,%%es\n" ); fprintf( outfile, "\tmovw %%di,%%es\n" );
fprintf( outfile, "\tmovw " PREFIX "SYSLEVEL_Win16CurrentTeb,%%fs\n" ); fprintf( outfile, "\tmovw " __ASM_NAME("SYSLEVEL_Win16CurrentTeb") ",%%fs\n" );
/* Restore the 32-bit stack */ /* Restore the 32-bit stack */
...@@ -751,10 +748,10 @@ static void BuildRet16Func( FILE *outfile ) ...@@ -751,10 +748,10 @@ static void BuildRet16Func( FILE *outfile )
/* Declare the return address and data selector variables */ /* Declare the return address and data selector variables */
fprintf( outfile, "\n\t.align %d\n", get_alignment(4) ); fprintf( outfile, "\n\t.align %d\n", get_alignment(4) );
fprintf( outfile, "\t.globl " PREFIX "CallTo16_DataSelector\n" ); fprintf( outfile, "\t.globl " __ASM_NAME("CallTo16_DataSelector") "\n" );
fprintf( outfile, PREFIX "CallTo16_DataSelector:\t.long 0\n" ); fprintf( outfile, __ASM_NAME("CallTo16_DataSelector") ":\t.long 0\n" );
fprintf( outfile, "\t.globl " PREFIX "CallTo16_RetAddr\n" ); fprintf( outfile, "\t.globl " __ASM_NAME("CallTo16_RetAddr") "\n" );
fprintf( outfile, PREFIX "CallTo16_RetAddr:\t.long 0\n" ); fprintf( outfile, __ASM_NAME("CallTo16_RetAddr") ":\t.long 0\n" );
} }
...@@ -857,9 +854,10 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx ) ...@@ -857,9 +854,10 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx )
fprintf( outfile, "\n\t.align %d\n", get_alignment(4) ); fprintf( outfile, "\n\t.align %d\n", get_alignment(4) );
if (use_stabs) if (use_stabs)
fprintf( outfile, ".stabs \"CALL32_%s:F1\",36,0,0," PREFIX "CALL32_%s\n", name, name ); fprintf( outfile, ".stabs \"CALL32_%s:F1\",36,0,0," __ASM_NAME("CALL32_%s") "\n",
fprintf( outfile, "\t.globl " PREFIX "CALL32_%s\n", name ); name, name );
fprintf( outfile, PREFIX "CALL32_%s:\n", name ); fprintf( outfile, "\t.globl " __ASM_NAME("CALL32_%s") "\n", name );
fprintf( outfile, __ASM_NAME("CALL32_%s") ":\n", name );
/* Entry code */ /* Entry code */
...@@ -878,7 +876,7 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx ) ...@@ -878,7 +876,7 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx )
fprintf( outfile, "\tshldl $16,%%ebx,%%eax\n" ); fprintf( outfile, "\tshldl $16,%%ebx,%%eax\n" );
fprintf( outfile, "\tandl $0xfff8,%%eax\n" ); fprintf( outfile, "\tandl $0xfff8,%%eax\n" );
fprintf( outfile, "\tshrl $1,%%eax\n" ); fprintf( outfile, "\tshrl $1,%%eax\n" );
fprintf( outfile, "\tmovl " PREFIX "wine_ldt_copy(%%eax),%%esi\n" ); fprintf( outfile, "\tmovl " __ASM_NAME("wine_ldt_copy") "(%%eax),%%esi\n" );
fprintf( outfile, "\tmovw %%bx,%%ax\n" ); fprintf( outfile, "\tmovw %%bx,%%ax\n" );
fprintf( outfile, "\taddl %%eax,%%esi\n" ); fprintf( outfile, "\taddl %%eax,%%esi\n" );
...@@ -911,7 +909,7 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx ) ...@@ -911,7 +909,7 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx )
fprintf( outfile, "\taddl $%d, %%ebx\n", sizeof(STACK16FRAME)-size+4 + 4 ); fprintf( outfile, "\taddl $%d, %%ebx\n", sizeof(STACK16FRAME)-size+4 + 4 );
fprintf( outfile, "\tmovl %%ebx, 0(%%edi)\n" ); /* 16-bit ss:sp */ fprintf( outfile, "\tmovl %%ebx, 0(%%edi)\n" ); /* 16-bit ss:sp */
fprintf( outfile, "\tmovl " PREFIX "CALL32_%s_RetAddr, %%eax\n", name ); fprintf( outfile, "\tmovl " __ASM_NAME("CALL32_%s_RetAddr") ", %%eax\n", name );
fprintf( outfile, "\tmovl %%eax, 4(%%edi)\n" ); /* overwrite return address */ fprintf( outfile, "\tmovl %%eax, 4(%%edi)\n" ); /* overwrite return address */
} }
else else
...@@ -932,7 +930,7 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx ) ...@@ -932,7 +930,7 @@ static void BuildCallTo32CBClient( FILE *outfile, BOOL isEx )
fprintf( outfile, "\tandl $0x0000ffff, %%eax\n" ); fprintf( outfile, "\tandl $0x0000ffff, %%eax\n" );
fprintf( outfile, "\tmovl %%eax, 16(%%edi)\n" ); fprintf( outfile, "\tmovl %%eax, 16(%%edi)\n" );
fprintf( outfile, "\tmovl " PREFIX "CALL32_%s_RetAddr, %%eax\n", name ); fprintf( outfile, "\tmovl " __ASM_NAME("CALL32_%s_RetAddr") ", %%eax\n", name );
fprintf( outfile, "\tmovl %%eax, 20(%%edi)\n" ); fprintf( outfile, "\tmovl %%eax, 20(%%edi)\n" );
} }
...@@ -989,8 +987,8 @@ static void BuildCallTo32CBClientRet( FILE *outfile, BOOL isEx ) ...@@ -989,8 +987,8 @@ static void BuildCallTo32CBClientRet( FILE *outfile, BOOL isEx )
/* '16-bit' return stub */ /* '16-bit' return stub */
fprintf( outfile, "\n\t.globl " PREFIX "CALL32_%s_Ret\n", name ); fprintf( outfile, "\n\t.globl " __ASM_NAME("CALL32_%s_Ret") "\n", name );
fprintf( outfile, PREFIX "CALL32_%s_Ret:\n", name ); fprintf( outfile, __ASM_NAME("CALL32_%s_Ret") ":\n", name );
if ( !isEx ) if ( !isEx )
{ {
...@@ -1008,8 +1006,8 @@ static void BuildCallTo32CBClientRet( FILE *outfile, BOOL isEx ) ...@@ -1008,8 +1006,8 @@ static void BuildCallTo32CBClientRet( FILE *outfile, BOOL isEx )
/* Declare the return address variable */ /* Declare the return address variable */
fprintf( outfile, "\n\t.globl " PREFIX "CALL32_%s_RetAddr\n", name ); fprintf( outfile, "\n\t.globl " __ASM_NAME("CALL32_%s_RetAddr") "\n", name );
fprintf( outfile, PREFIX "CALL32_%s_RetAddr:\t.long 0\n", name ); fprintf( outfile, __ASM_NAME("CALL32_%s_RetAddr") ":\t.long 0\n", name );
} }
...@@ -1172,8 +1170,8 @@ void BuildRelays16( FILE *outfile ) ...@@ -1172,8 +1170,8 @@ void BuildRelays16( FILE *outfile )
fprintf( outfile, "Code_Start:\n\n" ); fprintf( outfile, "Code_Start:\n\n" );
} }
fprintf( outfile, PREFIX"Call16_Start:\n" ); fprintf( outfile, __ASM_NAME("Call16_Start") ":\n" );
fprintf( outfile, "\t.globl "PREFIX"Call16_Start\n" ); fprintf( outfile, "\t.globl " __ASM_NAME("Call16_Start") "\n" );
fprintf( outfile, "\t.byte 0\n\n" ); fprintf( outfile, "\t.byte 0\n\n" );
/* Standard CallFrom16 routine (WORD return) */ /* Standard CallFrom16 routine (WORD return) */
...@@ -1206,8 +1204,8 @@ void BuildRelays16( FILE *outfile ) ...@@ -1206,8 +1204,8 @@ void BuildRelays16( FILE *outfile )
/* CBClientThunkSLEx routine */ /* CBClientThunkSLEx routine */
BuildCallTo32CBClient( outfile, TRUE ); BuildCallTo32CBClient( outfile, TRUE );
fprintf( outfile, PREFIX"Call16_End:\n" ); fprintf( outfile, __ASM_NAME("Call16_End") ":\n" );
fprintf( outfile, "\t.globl "PREFIX"Call16_End\n" ); fprintf( outfile, "\t.globl " __ASM_NAME("Call16_End") "\n" );
if (use_stabs) if (use_stabs)
{ {
...@@ -1226,8 +1224,8 @@ void BuildRelays16( FILE *outfile ) ...@@ -1226,8 +1224,8 @@ void BuildRelays16( FILE *outfile )
/* The whole Call16_Ret segment must lie within the .data section */ /* The whole Call16_Ret segment must lie within the .data section */
fprintf( outfile, "\n\t.data\n" ); fprintf( outfile, "\n\t.data\n" );
fprintf( outfile, "\t.globl " PREFIX "Call16_Ret_Start\n" ); fprintf( outfile, "\t.globl " __ASM_NAME("Call16_Ret_Start") "\n" );
fprintf( outfile, PREFIX "Call16_Ret_Start:\n" ); fprintf( outfile, __ASM_NAME("Call16_Ret_Start") ":\n" );
/* Standard CallTo16 return stub */ /* Standard CallTo16 return stub */
BuildRet16Func( outfile ); BuildRet16Func( outfile );
...@@ -1239,8 +1237,8 @@ void BuildRelays16( FILE *outfile ) ...@@ -1239,8 +1237,8 @@ void BuildRelays16( FILE *outfile )
BuildCallTo32CBClientRet( outfile, TRUE ); BuildCallTo32CBClientRet( outfile, TRUE );
/* End of Call16_Ret segment */ /* End of Call16_Ret segment */
fprintf( outfile, "\n\t.globl " PREFIX "Call16_Ret_End\n" ); fprintf( outfile, "\n\t.globl " __ASM_NAME("Call16_Ret_End") "\n" );
fprintf( outfile, PREFIX "Call16_Ret_End:\n" ); fprintf( outfile, __ASM_NAME("Call16_Ret_End") ":\n" );
} }
/******************************************************************* /*******************************************************************
...@@ -1293,4 +1291,3 @@ void BuildRelays32( FILE *outfile ) ...@@ -1293,4 +1291,3 @@ void BuildRelays32( FILE *outfile )
} }
#endif /* __i386__ */ #endif /* __i386__ */
...@@ -134,14 +134,14 @@ static int output_exports( FILE *outfile, int nr_exports ) ...@@ -134,14 +134,14 @@ static int output_exports( FILE *outfile, int nr_exports )
fprintf( outfile, "asm(\".data\\n\"\n" ); fprintf( outfile, "asm(\".data\\n\"\n" );
fprintf( outfile, " \"\\t.align %d\\n\"\n", get_alignment(4) ); fprintf( outfile, " \"\\t.align %d\\n\"\n", get_alignment(4) );
fprintf( outfile, " \"" PREFIX "__wine_spec_exports:\\n\"\n" ); fprintf( outfile, " \"" __ASM_NAME("__wine_spec_exports") ":\\n\"\n" );
/* export directory header */ /* export directory header */
fprintf( outfile, " \"\\t.long 0\\n\"\n" ); /* Characteristics */ fprintf( outfile, " \"\\t.long 0\\n\"\n" ); /* Characteristics */
fprintf( outfile, " \"\\t.long 0\\n\"\n" ); /* TimeDateStamp */ fprintf( outfile, " \"\\t.long 0\\n\"\n" ); /* TimeDateStamp */
fprintf( outfile, " \"\\t.long 0\\n\"\n" ); /* MajorVersion/MinorVersion */ fprintf( outfile, " \"\\t.long 0\\n\"\n" ); /* MajorVersion/MinorVersion */
fprintf( outfile, " \"\\t.long " PREFIX "dllname\\n\"\n" ); /* Name */ fprintf( outfile, " \"\\t.long " __ASM_NAME("dllname") "\\n\"\n" ); /* Name */
fprintf( outfile, " \"\\t.long %d\\n\"\n", Base ); /* Base */ fprintf( outfile, " \"\\t.long %d\\n\"\n", Base ); /* Base */
fprintf( outfile, " \"\\t.long %d\\n\"\n", nr_exports ); /* NumberOfFunctions */ fprintf( outfile, " \"\\t.long %d\\n\"\n", nr_exports ); /* NumberOfFunctions */
fprintf( outfile, " \"\\t.long %d\\n\"\n", nb_names ); /* NumberOfNames */ fprintf( outfile, " \"\\t.long %d\\n\"\n", nb_names ); /* NumberOfNames */
...@@ -168,19 +168,19 @@ static int output_exports( FILE *outfile, int nr_exports ) ...@@ -168,19 +168,19 @@ static int output_exports( FILE *outfile, int nr_exports )
else switch(odp->type) else switch(odp->type)
{ {
case TYPE_EXTERN: case TYPE_EXTERN:
fprintf( outfile, " \"\\t.long " PREFIX "%s\\n\"\n", odp->link_name ); fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") "\\n\"\n", odp->link_name );
break; break;
case TYPE_STDCALL: case TYPE_STDCALL:
case TYPE_VARARGS: case TYPE_VARARGS:
case TYPE_CDECL: case TYPE_CDECL:
fprintf( outfile, " \"\\t.long " PREFIX "%s\\n\"\n", fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") "\\n\"\n",
(odp->flags & FLAG_REGISTER) ? make_internal_name(odp,"regs") : odp->link_name ); (odp->flags & FLAG_REGISTER) ? make_internal_name(odp,"regs") : odp->link_name );
break; break;
case TYPE_STUB: case TYPE_STUB:
fprintf( outfile, " \"\\t.long " PREFIX "%s\\n\"\n", make_internal_name( odp, "stub" ) ); fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") "\\n\"\n", make_internal_name( odp, "stub" ) );
break; break;
case TYPE_VARIABLE: case TYPE_VARIABLE:
fprintf( outfile, " \"\\t.long " PREFIX "%s\\n\"\n", make_internal_name( odp, "var" ) ); fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") "\\n\"\n", make_internal_name( odp, "var" ) );
break; break;
case TYPE_FORWARD: case TYPE_FORWARD:
fprintf( outfile, " \"\\t.long __wine_spec_forwards+%d\\n\"\n", fwd_size ); fprintf( outfile, " \"\\t.long __wine_spec_forwards+%d\\n\"\n", fwd_size );
...@@ -279,15 +279,15 @@ static int output_exports( FILE *outfile, int nr_exports ) ...@@ -279,15 +279,15 @@ static int output_exports( FILE *outfile, int nr_exports )
switch(odp->type) switch(odp->type)
{ {
case TYPE_STDCALL: case TYPE_STDCALL:
fprintf( outfile, " \"\\tjmp " PREFIX "%s\\n\"\n", name ); fprintf( outfile, " \"\\tjmp " __ASM_NAME("%s") "\\n\"\n", name );
fprintf( outfile, " \"\\tret $0x%04x\\n\"\n", args ); fprintf( outfile, " \"\\tret $0x%04x\\n\"\n", args );
fprintf( outfile, " \"\\t.long " PREFIX "%s,0x%08x\\n\"\n", name, mask ); fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") ",0x%08x\\n\"\n", name, mask );
break; break;
case TYPE_CDECL: case TYPE_CDECL:
fprintf( outfile, " \"\\tjmp " PREFIX "%s\\n\"\n", name ); fprintf( outfile, " \"\\tjmp " __ASM_NAME("%s") "\\n\"\n", name );
fprintf( outfile, " \"\\tret\\n\"\n" ); fprintf( outfile, " \"\\tret\\n\"\n" );
fprintf( outfile, " \"\\t.short 0x%04x\\n\"\n", args ); fprintf( outfile, " \"\\t.short 0x%04x\\n\"\n", args );
fprintf( outfile, " \"\\t.long " PREFIX "%s,0x%08x\\n\"\n", name, mask ); fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") ",0x%08x\\n\"\n", name, mask );
break; break;
default: default:
assert(0); assert(0);
...@@ -309,9 +309,9 @@ static int output_exports( FILE *outfile, int nr_exports ) ...@@ -309,9 +309,9 @@ static int output_exports( FILE *outfile, int nr_exports )
for (p = Names[i]->name; *p; p++) for (p = Names[i]->name; *p; p++)
if (!isalnum(*p) && *p != '_' && *p != '.') break; if (!isalnum(*p) && *p != '_' && *p != '.') break;
if (*p) continue; if (*p) continue;
fprintf( outfile, " \"\\t.globl " PREFIX "__wine_dllexport_%s_%s\\n\"\n", fprintf( outfile, " \"\\t.globl " __ASM_NAME("__wine_dllexport_%s_%s") "\\n\"\n",
make_c_identifier(DLLFileName), Names[i]->name ); make_c_identifier(DLLFileName), Names[i]->name );
fprintf( outfile, " \"" PREFIX "__wine_dllexport_%s_%s:\\n\"\n", fprintf( outfile, " \"" __ASM_NAME("__wine_dllexport_%s_%s") ":\\n\"\n",
make_c_identifier(DLLFileName), Names[i]->name ); make_c_identifier(DLLFileName), Names[i]->name );
} }
fprintf( outfile, " \"\\t.long 0xffffffff\\n\"\n" ); fprintf( outfile, " \"\\t.long 0xffffffff\\n\"\n" );
...@@ -415,9 +415,9 @@ static void output_register_funcs( FILE *outfile ) ...@@ -415,9 +415,9 @@ static void output_register_funcs( FILE *outfile )
fprintf( outfile, fprintf( outfile,
"asm(\".align %d\\n\\t\"\n" "asm(\".align %d\\n\\t\"\n"
" \"" __ASM_FUNC("%s") "\\n\\t\"\n" " \"" __ASM_FUNC("%s") "\\n\\t\"\n"
" \"" PREFIX "%s:\\n\\t\"\n" " \"" __ASM_NAME("%s") ":\\n\\t\"\n"
" \"call " PREFIX "__wine_call_from_32_regs\\n\\t\"\n" " \"call " __ASM_NAME("__wine_call_from_32_regs") "\\n\\t\"\n"
" \".long " PREFIX "%s\\n\\t\"\n" " \".long " __ASM_NAME("%s") "\\n\\t\"\n"
" \".byte %d,%d\");\n", " \".byte %d,%d\");\n",
get_alignment(4), get_alignment(4),
name, name, odp->link_name, name, name, odp->link_name,
...@@ -442,27 +442,27 @@ void output_dll_init( FILE *outfile, const char *constructor, const char *destru ...@@ -442,27 +442,27 @@ void output_dll_init( FILE *outfile, const char *constructor, const char *destru
if (constructor) if (constructor)
{ {
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "%s\\n\"\n", constructor ); fprintf( outfile, " \"\\tcall " __ASM_NAME("%s") "\\n\"\n", constructor );
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
} }
if (destructor) if (destructor)
{ {
fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "%s\\n\"\n", destructor ); fprintf( outfile, " \"\\tcall " __ASM_NAME("%s") "\\n\"\n", destructor );
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
} }
#elif defined(__sparc__) #elif defined(__sparc__)
if (constructor) if (constructor)
{ {
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "%s\\n\"\n", constructor ); fprintf( outfile, " \"\\tcall " __ASM_NAME("%s") "\\n\"\n", constructor );
fprintf( outfile, " \"\\tnop\\n\"\n" ); fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
} }
if (destructor) if (destructor)
{ {
fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "%s\\n\"\n", destructor ); fprintf( outfile, " \"\\tcall " __ASM_NAME("%s") "\\n\"\n", destructor );
fprintf( outfile, " \"\\tnop\\n\"\n" ); fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
} }
...@@ -470,13 +470,13 @@ void output_dll_init( FILE *outfile, const char *constructor, const char *destru ...@@ -470,13 +470,13 @@ void output_dll_init( FILE *outfile, const char *constructor, const char *destru
if (constructor) if (constructor)
{ {
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "%s\\n\"\n", constructor ); fprintf( outfile, " \"\\tbl " __ASM_NAME("%s") "\\n\"\n", constructor );
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
} }
if (destructor) if (destructor)
{ {
fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "%s\\n\"\n", destructor ); fprintf( outfile, " \"\\tbl " __ASM_NAME("%s") "\\n\"\n", destructor );
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
} }
#else #else
...@@ -529,7 +529,7 @@ void BuildSpec32File( FILE *outfile ) ...@@ -529,7 +529,7 @@ void BuildSpec32File( FILE *outfile )
fprintf( outfile, "#endif\n" ); fprintf( outfile, "#endif\n" );
fprintf( outfile, "asm(\".section \\\".text\\\"\\n\\t\"\n" ); fprintf( outfile, "asm(\".section \\\".text\\\"\\n\\t\"\n" );
fprintf( outfile, " \".align %d\\n\"\n", get_alignment(page_size) ); fprintf( outfile, " \".align %d\\n\"\n", get_alignment(page_size) );
fprintf( outfile, " \"" PREFIX "pe_header:\\t.skip %ld\\n\\t\");\n", page_size ); fprintf( outfile, " \"" __ASM_NAME("pe_header") ":\\t.skip %ld\\n\\t\");\n", page_size );
fprintf( outfile, "#ifndef __GNUC__\n" ); fprintf( outfile, "#ifndef __GNUC__\n" );
fprintf( outfile, "}\n" ); fprintf( outfile, "}\n" );
fprintf( outfile, "#endif\n" ); fprintf( outfile, "#endif\n" );
...@@ -900,23 +900,23 @@ void BuildDebugFile( FILE *outfile ) ...@@ -900,23 +900,23 @@ void BuildDebugFile( FILE *outfile )
#if defined(__i386__) #if defined(__i386__)
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_dbg_%s_init\\n\"\n", prefix ); fprintf( outfile, " \"\\tcall " __ASM_NAME("__wine_dbg_%s_init") "\\n\"\n", prefix );
fprintf( outfile, " \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, " \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_dbg_%s_fini\\n\"\n", prefix ); fprintf( outfile, " \"\\tcall " __ASM_NAME("__wine_dbg_%s_fini") "\\n\"\n", prefix );
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
#elif defined(__sparc__) #elif defined(__sparc__)
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_dbg_%s_init\\n\"\n", prefix ); fprintf( outfile, " \"\\tcall " __ASM_NAME("__wine_dbg_%s_init") "\\n\"\n", prefix );
fprintf( outfile, " \"\\tnop\\n\"\n" ); fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, " \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tcall " PREFIX "__wine_dbg_%s_fini\\n\"\n", prefix ); fprintf( outfile, " \"\\tcall " __ASM_NAME("__wine_dbg_%s_fini") "\\n\"\n", prefix );
fprintf( outfile, " \"\\tnop\\n\"\n" ); fprintf( outfile, " \"\\tnop\\n\"\n" );
fprintf( outfile, " \"\\t.section\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\t\\\".text\\\"\\n\");\n" );
#elif defined(__PPC__) #elif defined(__PPC__)
fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, "asm(\"\\t.section\\t\\\".init\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "__wine_dbg_%s_init\\n\"\n", prefix ); fprintf( outfile, " \"\\tbl " __ASM_NAME("__wine_dbg_%s_init") "\\n\"\n", prefix );
fprintf( outfile, " \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" ); fprintf( outfile, " \"\\t.section\\t\\\".fini\\\" ,\\\"ax\\\"\\n\"\n" );
fprintf( outfile, " \"\\tbl " PREFIX "__wine_dbg_%s_fini\\n\"\n", prefix ); fprintf( outfile, " \"\\tbl " __ASM_NAME("__wine_dbg_%s_fini") "\\n\"\n", prefix );
fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" ); fprintf( outfile, " \"\\t.section\\t\\\".text\\\"\\n\");\n" );
#else #else
#error You need to define the DLL constructor for your architecture #error You need to define the DLL constructor for your architecture
......
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
*/ */
#include "config.h" #include "config.h"
#include "wine/port.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -127,11 +128,7 @@ char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n" ...@@ -127,11 +128,7 @@ char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n"
* Default prefix for resource names used in the C array. * Default prefix for resource names used in the C array.
* Option '-p name' sets it to 'name' * Option '-p name' sets it to 'name'
*/ */
#ifdef NEED_UNDERSCORE_PREFIX char *prefix = __ASM_NAME("_Resource");
char *prefix = "__Resource";
#else
char *prefix = "_Resource";
#endif
/* /*
* Set if compiling in 32bit mode (default). * Set if compiling in 32bit mode (default).
...@@ -385,13 +382,7 @@ int main(int argc,char *argv[]) ...@@ -385,13 +382,7 @@ int main(int argc,char *argv[])
output_name = strdup(optarg); output_name = strdup(optarg);
break; break;
case 'p': case 'p':
#ifdef NEED_UNDERSCORE_PREFIX
prefix = (char *)xmalloc(strlen(optarg)+2);
prefix[0] = '_';
strcpy(prefix+1, optarg);
#else
prefix = xstrdup(optarg); prefix = xstrdup(optarg);
#endif
break; break;
case 'r': case 'r':
create_res = 1; create_res = 1;
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
*/ */
#include "config.h" #include "config.h"
#include "wine/port.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -32,12 +33,6 @@ ...@@ -32,12 +33,6 @@
#include "newstruc.h" #include "newstruc.h"
#include "utils.h" #include "utils.h"
#ifdef NEED_UNDERSCORE_PREFIX
char Underscore[] = "_";
#else
char Underscore[] = "";
#endif
static char s_file_head_str[] = static char s_file_head_str[] =
"/* This file is generated with wrc version " WRC_FULLVERSION ". Do not edit! */\n" "/* This file is generated with wrc version " WRC_FULLVERSION ". Do not edit! */\n"
"/* Source : %s */\n" "/* Source : %s */\n"
...@@ -56,12 +51,8 @@ static char s_file_tail_str[] = ...@@ -56,12 +51,8 @@ static char s_file_tail_str[] =
static char s_file_autoreg_str[] = static char s_file_autoreg_str[] =
"\t.text\n" "\t.text\n"
".LAuto_Register:\n" ".LAuto_Register:\n"
"\tpushl\t$%s%s\n" "\tpushl\t$" __ASM_NAME("%s%s") "\n"
#ifdef NEED_UNDERSCORE_PREFIX "\tcall\t" __ASM_NAME("LIBRES_RegisterResources") "\n"
"\tcall\t_LIBRES_RegisterResources\n"
#else
"\tcall\tLIBRES_RegisterResources\n"
#endif
"\taddl\t$4,%%esp\n" "\taddl\t$4,%%esp\n"
"\tret\n\n" "\tret\n\n"
#ifdef __NetBSD__ #ifdef __NetBSD__
...@@ -536,8 +527,8 @@ static void write_pe_segment(FILE *fp) ...@@ -536,8 +527,8 @@ static void write_pe_segment(FILE *fp)
int i; int i;
fprintf(fp, "\t.align\t4\n"); fprintf(fp, "\t.align\t4\n");
fprintf(fp, "%s%s:\n", prefix, _PEResTab); fprintf(fp, __ASM_NAME("%s%s") ":\n", prefix, _PEResTab);
fprintf(fp, "\t.globl\t%s%s\n", prefix, _PEResTab); fprintf(fp, "\t.globl\t" __ASM_NAME("%s%s") "\n", prefix, _PEResTab);
/* Flags */ /* Flags */
fprintf(fp, "\t.long\t0\n"); fprintf(fp, "\t.long\t0\n");
/* Time/Date stamp */ /* Time/Date stamp */
...@@ -561,7 +552,7 @@ static void write_pe_segment(FILE *fp) ...@@ -561,7 +552,7 @@ static void write_pe_segment(FILE *fp)
else else
{ {
char *name = prep_nid_for_label(&(rcp->type)); char *name = prep_nid_for_label(&(rcp->type));
fprintf(fp, "\t.long\t(%s_%s_typename - %s%s) | 0x80000000\n", fprintf(fp, "\t.long\t(" __ASM_NAME("%s_%s_typename") " - " __ASM_NAME("%s%s") ") | 0x80000000\n",
prefix, prefix,
name, name,
prefix, prefix,
...@@ -569,7 +560,7 @@ static void write_pe_segment(FILE *fp) ...@@ -569,7 +560,7 @@ static void write_pe_segment(FILE *fp)
} }
/* Offset */ /* Offset */
label = prep_nid_for_label(&(rcp->type)); label = prep_nid_for_label(&(rcp->type));
fprintf(fp, "\t.long\t(.L%s - %s%s) | 0x80000000\n", fprintf(fp, "\t.long\t(.L%s - " __ASM_NAME("%s%s") ") | 0x80000000\n",
label, label,
prefix, prefix,
_PEResTab); _PEResTab);
...@@ -601,7 +592,7 @@ static void write_pe_segment(FILE *fp) ...@@ -601,7 +592,7 @@ static void write_pe_segment(FILE *fp)
fprintf(fp, "\t.long\t%d\n", rsc->name->name.i_name); fprintf(fp, "\t.long\t%d\n", rsc->name->name.i_name);
else else
{ {
fprintf(fp, "\t.long\t(%s%s_name - %s%s) | 0x80000000\n", fprintf(fp, "\t.long\t(" __ASM_NAME("%s%s_name") " - " __ASM_NAME("%s%s") ") | 0x80000000\n",
prefix, prefix,
rsc->c_name, rsc->c_name,
prefix, prefix,
...@@ -613,7 +604,7 @@ static void write_pe_segment(FILE *fp) ...@@ -613,7 +604,7 @@ static void write_pe_segment(FILE *fp)
*/ */
/* Offset */ /* Offset */
namelabel = prep_nid_for_label(rsc->name); namelabel = prep_nid_for_label(rsc->name);
fprintf(fp, "\t.long\t(.L%s_%s - %s%s) | 0x80000000\n", fprintf(fp, "\t.long\t(.L%s_%s - " __ASM_NAME("%s%s") ") | 0x80000000\n",
typelabel, typelabel,
namelabel, namelabel,
prefix, prefix,
...@@ -654,7 +645,7 @@ static void write_pe_segment(FILE *fp) ...@@ -654,7 +645,7 @@ static void write_pe_segment(FILE *fp)
/* LanguageId */ /* LanguageId */
fprintf(fp, "\t.long\t0x%08x\n", rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0); fprintf(fp, "\t.long\t0x%08x\n", rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0);
/* Offset */ /* Offset */
fprintf(fp, "\t.long\t.L%s_%s_%d - %s%s\n", fprintf(fp, "\t.long\t.L%s_%s_%d - " __ASM_NAME("%s%s") "\n",
typelabel, typelabel,
namelabel, namelabel,
rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0, rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0,
...@@ -667,8 +658,8 @@ static void write_pe_segment(FILE *fp) ...@@ -667,8 +658,8 @@ static void write_pe_segment(FILE *fp)
} }
/* Write the resource table itself */ /* Write the resource table itself */
fprintf(fp, "%s_ResourceDirectory:\n", prefix); fprintf(fp, __ASM_NAME("%s_ResourceDirectory") ":\n", prefix);
fprintf(fp, "\t.globl\t%s_ResourceDirectory\n", prefix); fprintf(fp, "\t.globl\t" __ASM_NAME("%s_ResourceDirectory") "\n", prefix);
direntries = 0; direntries = 0;
for(i = 0; i < rccount; i++) for(i = 0; i < rccount; i++)
...@@ -700,7 +691,7 @@ static void write_pe_segment(FILE *fp) ...@@ -700,7 +691,7 @@ static void write_pe_segment(FILE *fp)
rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0); rsc->lan ? MAKELANGID(rsc->lan->id, rsc->lan->sub) : 0);
/* Data RVA */ /* Data RVA */
fprintf(fp, "\t.long\t%s%s_data - %s%s\n", fprintf(fp, "\t.long\t" __ASM_NAME("%s%s_data") " - " __ASM_NAME("%s%s") "\n",
prefix, prefix,
rsc->c_name, rsc->c_name,
prefix, prefix,
...@@ -736,8 +727,8 @@ static void write_ne_segment(FILE *fp) ...@@ -736,8 +727,8 @@ static void write_ne_segment(FILE *fp)
int i, j; int i, j;
fprintf(fp, "\t.align\t4\n"); fprintf(fp, "\t.align\t4\n");
fprintf(fp, "%s%s:\n", prefix, _NEResTab); fprintf(fp, __ASM_NAME("%s%s") ":\n", prefix, _NEResTab);
fprintf(fp, "\t.globl\t%s%s\n", prefix, _NEResTab); fprintf(fp, "\t.globl\t" __ASM_NAME("%s%s") "\n", prefix, _NEResTab);
/* AlignmentShift */ /* AlignmentShift */
fprintf(fp, "\t.short\t%d\n", alignment_pwr); fprintf(fp, "\t.short\t%d\n", alignment_pwr);
...@@ -751,7 +742,7 @@ static void write_ne_segment(FILE *fp) ...@@ -751,7 +742,7 @@ static void write_ne_segment(FILE *fp)
if(rcp->type.type == name_ord) if(rcp->type.type == name_ord)
fprintf(fp, "\t.short\t0x%04x\n", rcp->type.name.i_name | 0x8000); fprintf(fp, "\t.short\t0x%04x\n", rcp->type.name.i_name | 0x8000);
else else
fprintf(fp, "\t.short\t%s_%s_typename - %s%s\n", fprintf(fp, "\t.short\t" __ASM_NAME("%s_%s_typename") " - " __ASM_NAME("%s%s") "\n",
prefix, prefix,
rcp->type.name.s_name->str.cstr, rcp->type.name.s_name->str.cstr,
prefix, prefix,
...@@ -772,7 +763,7 @@ static void write_ne_segment(FILE *fp) ...@@ -772,7 +763,7 @@ static void write_ne_segment(FILE *fp)
* All other things are as the MS doc describes (alignment etc.) * All other things are as the MS doc describes (alignment etc.)
*/ */
/* Offset */ /* Offset */
fprintf(fp, "\t.short\t(%s%s_data - %s%s) >> %d\n", fprintf(fp, "\t.short\t(" __ASM_NAME("%s%s_data") " - " __ASM_NAME("%s%s") ") >> %d\n",
prefix, prefix,
rcp->rscarray[j]->c_name, rcp->rscarray[j]->c_name,
prefix, prefix,
...@@ -787,7 +778,7 @@ static void write_ne_segment(FILE *fp) ...@@ -787,7 +778,7 @@ static void write_ne_segment(FILE *fp)
if(rcp->rscarray[j]->name->type == name_ord) if(rcp->rscarray[j]->name->type == name_ord)
fprintf(fp, "\t.short\t0x%04x\n", rcp->rscarray[j]->name->name.i_name | 0x8000); fprintf(fp, "\t.short\t0x%04x\n", rcp->rscarray[j]->name->name.i_name | 0x8000);
else else
fprintf(fp, "\t.short\t%s%s_name - %s%s\n", fprintf(fp, "\t.short\t" __ASM_NAME("%s%s_name") " - " __ASM_NAME("%s%s") "\n",
prefix, prefix,
rcp->rscarray[j]->c_name, rcp->rscarray[j]->c_name,
prefix, prefix,
...@@ -827,7 +818,7 @@ static void write_rsc_names(FILE *fp) ...@@ -827,7 +818,7 @@ static void write_rsc_names(FILE *fp)
if(rcp->type.type == name_str) if(rcp->type.type == name_str)
{ {
char *name = prep_nid_for_label(&(rcp->type)); char *name = prep_nid_for_label(&(rcp->type));
fprintf(fp, "%s_%s_typename:\n", fprintf(fp, __ASM_NAME("%s_%s_typename") ":\n",
prefix, prefix,
name); name);
write_name_str(fp, &(rcp->type)); write_name_str(fp, &(rcp->type));
...@@ -839,7 +830,7 @@ static void write_rsc_names(FILE *fp) ...@@ -839,7 +830,7 @@ static void write_rsc_names(FILE *fp)
if(rsc->name->type == name_str) if(rsc->name->type == name_str)
{ {
fprintf(fp, "%s%s_name:\n", fprintf(fp, __ASM_NAME("%s%s_name") ":\n",
prefix, prefix,
rsc->c_name); rsc->c_name);
write_name_str(fp, rsc->name); write_name_str(fp, rsc->name);
...@@ -856,7 +847,7 @@ static void write_rsc_names(FILE *fp) ...@@ -856,7 +847,7 @@ static void write_rsc_names(FILE *fp)
if(rcp->type.type == name_str) if(rcp->type.type == name_str)
{ {
fprintf(fp, "%s_%s_typename:\n", fprintf(fp, __ASM_NAME("%s_%s_typename") ":\n",
prefix, prefix,
rcp->type.name.s_name->str.cstr); rcp->type.name.s_name->str.cstr);
write_name_str(fp, &(rcp->type)); write_name_str(fp, &(rcp->type));
...@@ -865,7 +856,7 @@ static void write_rsc_names(FILE *fp) ...@@ -865,7 +856,7 @@ static void write_rsc_names(FILE *fp)
{ {
if(rcp->rscarray[j]->name->type == name_str) if(rcp->rscarray[j]->name->type == name_str)
{ {
fprintf(fp, "%s%s_name:\n", fprintf(fp, __ASM_NAME("%s%s_name") ":\n",
prefix, prefix,
rcp->rscarray[j]->c_name); rcp->rscarray[j]->c_name);
write_name_str(fp, rcp->rscarray[j]->name); write_name_str(fp, rcp->rscarray[j]->name);
...@@ -943,9 +934,9 @@ void write_s_file(char *outname, resource_t *top) ...@@ -943,9 +934,9 @@ void write_s_file(char *outname, resource_t *top)
continue; continue;
fprintf(fo, "\t.align\t%d\n", win32 ? 4 : alignment); fprintf(fo, "\t.align\t%d\n", win32 ? 4 : alignment);
fprintf(fo, "%s%s_data:\n", prefix, rsc->c_name); fprintf(fo, __ASM_NAME("%s%s_data") ":\n", prefix, rsc->c_name);
if(global) if(global)
fprintf(fo, "\t.globl\t%s%s_data\n", prefix, rsc->c_name); fprintf(fo, "\t.globl\t" __ASM_NAME("%s%s_data") "\n", prefix, rsc->c_name);
write_s_res(fo, rsc->binres); write_s_res(fo, rsc->binres);
...@@ -956,26 +947,26 @@ void write_s_file(char *outname, resource_t *top) ...@@ -956,26 +947,26 @@ void write_s_file(char *outname, resource_t *top)
{ {
/* Add a resource descriptor for built-in and elf-dlls */ /* Add a resource descriptor for built-in and elf-dlls */
fprintf(fo, "\t.align\t4\n"); fprintf(fo, "\t.align\t4\n");
fprintf(fo, "%s_ResourceDescriptor:\n", prefix); fprintf(fo, __ASM_NAME("%s_ResourceDescriptor") ":\n", prefix);
fprintf(fo, "\t.globl\t%s_ResourceDescriptor\n", prefix); fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceDescriptor") "\n", prefix);
fprintf(fo, "%s_ResourceTable:\n", prefix); fprintf(fo, __ASM_NAME("%s_ResourceTable") ":\n", prefix);
if(global) if(global)
fprintf(fo, "\t.globl\t%s_ResourceTable\n", prefix); fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceTable") "\n", prefix);
fprintf(fo, "\t.long\t%s%s\n", prefix, win32 ? _PEResTab : _NEResTab); fprintf(fo, "\t.long\t" __ASM_NAME("%s%s") "\n", prefix, win32 ? _PEResTab : _NEResTab);
fprintf(fo, "%s_NumberOfResources:\n", prefix); fprintf(fo, __ASM_NAME("%s_NumberOfResources") ":\n", prefix);
if(global) if(global)
fprintf(fo, "\t.globl\t%s_NumberOfResources\n", prefix); fprintf(fo, "\t.globl\t" __ASM_NAME("%s_NumberOfResources") "\n", prefix);
fprintf(fo, "\t.long\t%d\n", direntries); fprintf(fo, "\t.long\t%d\n", direntries);
fprintf(fo, "%s_ResourceSectionSize:\n", prefix); fprintf(fo, __ASM_NAME("%s_ResourceSectionSize") ":\n", prefix);
if(global) if(global)
fprintf(fo, "\t.globl\t%s_ResourceSectionSize\n", prefix); fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourceSectionSize") "\n", prefix);
fprintf(fo, "\t.long\t.LResTabEnd - %s%s\n", prefix, win32 ? _PEResTab : _NEResTab); fprintf(fo, "\t.long\t.LResTabEnd - " __ASM_NAME("%s%s") "\n", prefix, win32 ? _PEResTab : _NEResTab);
if(win32) if(win32)
{ {
fprintf(fo, "%s_ResourcesEntries:\n", prefix); fprintf(fo, __ASM_NAME("%s_ResourcesEntries") ":\n", prefix);
if(global) if(global)
fprintf(fo, "\t.globl\t%s_ResourcesEntries\n", prefix); fprintf(fo, "\t.globl\t" __ASM_NAME("%s_ResourcesEntries") "\n", prefix);
fprintf(fo, "\t.long\t%s_ResourceDirectory\n", prefix); fprintf(fo, "\t.long\t" __ASM_NAME("%s_ResourceDirectory") "\n", prefix);
} }
} }
} }
...@@ -1024,19 +1015,21 @@ void write_s_file(char *outname, resource_t *top) ...@@ -1024,19 +1015,21 @@ void write_s_file(char *outname, resource_t *top)
* first byte/word denotes the size and the rest the string * first byte/word denotes the size and the rest the string
* itself. * itself.
*/ */
fprintf(fo, "%s%s:\n", prefix, rsc->c_name); fprintf(fo, __ASM_NAME("%s%s") ":\n", prefix, rsc->c_name);
if(global) if(global)
fprintf(fo, "\t.globl\t%s%s\n", prefix, rsc->c_name); fprintf(fo, "\t.globl\t" __ASM_NAME("%s%s") "\n", prefix, rsc->c_name);
fprintf(fo, "\t.long\t%d, %s%s%s, %d, %s%s%s%s, %s%s_data, %d\n", if (rsc->name->type == name_ord)
rsc->name->type == name_ord ? rsc->name->name.i_name : 0, fprintf(fo, "\t.long\t%d, 0, ", rsc->name->name.i_name );
rsc->name->type == name_ord ? "0" : prefix, else
rsc->name->type == name_ord ? "" : rsc->c_name, fprintf(fo, "\t.long\t0, " __ASM_NAME("%s%s_name") ", ",
rsc->name->type == name_ord ? "" : "_name", prefix, rsc->c_name );
type, if (type)
type ? "0" : prefix, fprintf(fo, "%d, 0, ", type);
type ? "" : "_", else
type ? "" : type_name, fprintf(fo, "0, " __ASM_NAME("%s_%s_typename") ", ",
type ? "" : "_typename", prefix, type_name );
fprintf(fo, __ASM_NAME("%s%s_data") ", %d\n",
prefix, prefix,
rsc->c_name, rsc->c_name,
rsc->binres->size - rsc->binres->dataidx); rsc->binres->size - rsc->binres->dataidx);
...@@ -1047,11 +1040,11 @@ void write_s_file(char *outname, resource_t *top) ...@@ -1047,11 +1040,11 @@ void write_s_file(char *outname, resource_t *top)
/* Write the indirection table */ /* Write the indirection table */
fprintf(fo, "/* Resource indirection table */\n\n"); fprintf(fo, "/* Resource indirection table */\n\n");
fprintf(fo, "\t.align\t4\n"); fprintf(fo, "\t.align\t4\n");
fprintf(fo, "%s%s:\n", prefix, _ResTable); fprintf(fo, __ASM_NAME("%s%s") ":\n", prefix, _ResTable);
fprintf(fo, "\t.globl\t%s%s\n", prefix, _ResTable); fprintf(fo, "\t.globl\t" __ASM_NAME("%s%s") "\n", prefix, _ResTable);
for(rsc = top; rsc; rsc = rsc->next) for(rsc = top; rsc; rsc = rsc->next)
{ {
fprintf(fo, "\t.long\t%s%s\n", prefix, rsc->c_name); fprintf(fo, "\t.long\t" __ASM_NAME("%s%s") "\n", prefix, rsc->c_name);
} }
fprintf(fo, "\t.long\t0\n"); fprintf(fo, "\t.long\t0\n");
fprintf(fo, "\n"); fprintf(fo, "\n");
...@@ -1080,13 +1073,6 @@ void write_h_file(char *outname, resource_t *top) ...@@ -1080,13 +1073,6 @@ void write_h_file(char *outname, resource_t *top)
{ {
FILE *fo; FILE *fo;
resource_t *rsc; resource_t *rsc;
char *h_prefix;
#ifdef NEED_UNDERSCORE_PREFIX
h_prefix = prefix + 1;
#else
h_prefix = prefix;
#endif
fo = fopen(outname, "wt"); fo = fopen(outname, "wt");
if(!fo) if(!fo)
...@@ -1102,7 +1088,7 @@ void write_h_file(char *outname, resource_t *top) ...@@ -1102,7 +1088,7 @@ void write_h_file(char *outname, resource_t *top)
{ {
fprintf(fo, "extern %schar %s%s[];\n\n", fprintf(fo, "extern %schar %s%s[];\n\n",
constant ? "const " : "", constant ? "const " : "",
h_prefix, prefix,
win32 ? _PEResTab : _NEResTab); win32 ? _PEResTab : _NEResTab);
} }
...@@ -1114,7 +1100,7 @@ void write_h_file(char *outname, resource_t *top) ...@@ -1114,7 +1100,7 @@ void write_h_file(char *outname, resource_t *top)
fprintf(fo, "extern %schar %s%s_data[];\n", fprintf(fo, "extern %schar %s%s_data[];\n",
constant ? "const " : "", constant ? "const " : "",
h_prefix, prefix,
rsc->c_name); rsc->c_name);
} }
...@@ -1129,7 +1115,7 @@ void write_h_file(char *outname, resource_t *top) ...@@ -1129,7 +1115,7 @@ void write_h_file(char *outname, resource_t *top)
fprintf(fo, "extern %swrc_resource%d_t %s%s;\n", fprintf(fo, "extern %swrc_resource%d_t %s%s;\n",
constant ? "const " : "", constant ? "const " : "",
win32 ? 32 : 16, win32 ? 32 : 16,
h_prefix, prefix,
rsc->c_name); rsc->c_name);
} }
...@@ -1140,11 +1126,10 @@ void write_h_file(char *outname, resource_t *top) ...@@ -1140,11 +1126,10 @@ void write_h_file(char *outname, resource_t *top)
fprintf(fo, "extern %swrc_resource%d_t %s%s[];\n\n", fprintf(fo, "extern %swrc_resource%d_t %s%s[];\n\n",
constant ? "const " : "", constant ? "const " : "",
win32 ? 32 : 16, win32 ? 32 : 16,
h_prefix, prefix,
_ResTable); _ResTable);
} }
fprintf(fo, h_file_tail_str); fprintf(fo, h_file_tail_str);
fclose(fo); fclose(fo);
} }
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