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,
"pushl %fs\n\t"
"int $0x80\n"
".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"
"popl %fs\n\t"
"popl %ecx\n\t"
......@@ -162,7 +162,7 @@ __ASM_GLOBAL_FUNC(vm86_enter,
"movl 4(%esp),%ecx\n\t" /* vm86_ptr */
"movl $0,(%ecx)\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"
"ret" );
......
......@@ -50,12 +50,6 @@ extern const char **debug_snoop_includelist;
extern void WINAPI SNOOP_Entry();
extern void WINAPI SNOOP_Return();
#ifdef NEED_UNDERSCORE_PREFIX
# define PREFIX "_"
#else
# define PREFIX
#endif
#include "pshpack1.h"
typedef struct tagSNOOP_FUN {
......
......@@ -53,13 +53,7 @@ void PTHREAD_init_done(void)
#include <pthread.h>
#include <signal.h>
#ifdef NEED_UNDERSCORE_PREFIX
# define PREFIX "_"
#else
# define PREFIX
#endif
#define PSTR(str) PREFIX #str
#define PSTR(str) __ASM_NAME(#str)
/* adapt as necessary (a construct like this is used in glibc sources) */
#define strong_alias(orig, alias) \
......@@ -70,11 +64,7 @@ void PTHREAD_init_done(void)
* so for those, we need to use the pogo stick */
#if defined(__i386__) && !defined(__PIC__)
/* FIXME: PIC */
#define jump_alias(orig, alias) \
asm(".globl " PSTR(alias) "\n" \
"\t.type " PSTR(alias) ",@function\n" \
PSTR(alias) ":\n" \
"\tjmp " PSTR(orig))
#define jump_alias(orig, alias) __ASM_GLOBAL_FUNC( alias, "jmp " PSTR(orig))
#endif
/* get necessary libc symbols */
......
......@@ -31,12 +31,6 @@
#include <stdlib.h>
#include <string.h>
#ifdef NEED_UNDERSCORE_PREFIX
# define PREFIX "_"
#else
# define PREFIX
#endif
#ifdef HAVE_ASM_STRING
# define STRING ".string"
#else
......
......@@ -470,13 +470,9 @@ static int output_immediate_imports( FILE *outfile )
{
fprintf( outfile, " \"\\t" __ASM_FUNC("%s") "\\n\"\n",
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] );
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 (strstr( dll_imports[i]->imports[j], "__wine_call_from_16" ))
......@@ -651,7 +647,7 @@ static int output_delayed_imports( FILE *outfile )
fprintf( outfile, "asm(\".align %d\\n\"\n", get_alignment(8) );
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__)
fprintf( outfile, " \"\\tpushl %%ecx\\n\\tpushl %%edx\\n\\tpushl %%eax\\n\"\n" );
fprintf( outfile, " \"\\tcall __wine_delay_load\\n\"\n" );
......@@ -675,7 +671,7 @@ static int output_delayed_imports( FILE *outfile )
char buffer[128];
sprintf( buffer, "__wine_delay_imp_%d_%s", i, dll_imports[i]->imports[j]);
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__)
fprintf( outfile, " \"\\tmovl $%d, %%eax\\n\"\n", (idx << 16) | j );
fprintf( outfile, " \"\\tjmp __wine_delay_load_asm\\n\"\n" );
......@@ -700,9 +696,9 @@ static int output_delayed_imports( FILE *outfile )
{
fprintf( outfile, " \"\\t" __ASM_FUNC("%s") "\\n\"\n",
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] );
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 (strstr( dll_imports[i]->imports[j], "__wine_call_from_16" ))
fprintf( outfile, ".byte 0x2e\\n\\tjmp *(delay_imports+%d)\\n\\tnop\\n", pos );
......
......@@ -48,6 +48,7 @@
*/
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include <stdlib.h>
......@@ -127,11 +128,7 @@ char version_string[] = "Wine Resource Compiler Version " WRC_FULLVERSION "\n"
* Default prefix for resource names used in the C array.
* Option '-p name' sets it to 'name'
*/
#ifdef NEED_UNDERSCORE_PREFIX
char *prefix = "__Resource";
#else
char *prefix = "_Resource";
#endif
char *prefix = __ASM_NAME("_Resource");
/*
* Set if compiling in 32bit mode (default).
......@@ -385,13 +382,7 @@ int main(int argc,char *argv[])
output_name = strdup(optarg);
break;
case 'p':
#ifdef NEED_UNDERSCORE_PREFIX
prefix = (char *)xmalloc(strlen(optarg)+2);
prefix[0] = '_';
strcpy(prefix+1, optarg);
#else
prefix = xstrdup(optarg);
#endif
break;
case 'r':
create_res = 1;
......
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