Modified winebuild to use the __ASM_FUNC macro for greater portability.

This commit is contained in:
Dimitrie O. Paun 2000-12-01 21:27:43 +00:00 committed by Alexandre Julliard
parent 7afce0e6d6
commit 31b6d090df
4 changed files with 11 additions and 9 deletions

View file

@ -722,16 +722,16 @@ typedef HANDLE *PHANDLE;
#endif #endif
#ifdef NEED_TYPE_IN_DEF #ifdef NEED_TYPE_IN_DEF
# define __ASM_TYPE(name) ".def " __ASM_NAME(#name) "; .scl 2; .type 32; .endef\n" # define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
#else #else
# define __ASM_TYPE(name) ".type " __ASM_NAME(#name) ",@function\n" # define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",@function"
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
# define __ASM_GLOBAL_FUNC(name,code) \ # define __ASM_GLOBAL_FUNC(name,code) \
__asm__( ".align 4\n\t" \ __asm__( ".align 4\n\t" \
".globl " __ASM_NAME(#name) "\n\t" \ ".globl " __ASM_NAME(#name) "\n\t" \
__ASM_TYPE(name) \ __ASM_FUNC(#name) "\n" \
__ASM_NAME(#name) ":\n\t" \ __ASM_NAME(#name) ":\n\t" \
code ); code );
#else /* __GNUC__ */ #else /* __GNUC__ */
@ -739,7 +739,7 @@ typedef HANDLE *PHANDLE;
void __asm_dummy_##name(void) { \ void __asm_dummy_##name(void) { \
asm( ".align 4\n\t" \ asm( ".align 4\n\t" \
".globl " __ASM_NAME(#name) "\n\t" \ ".globl " __ASM_NAME(#name) "\n\t" \
__ASM_TYPE(name) \ __ASM_FUNC(#name) "\n" \
__ASM_NAME(#name) ":\n\t" \ __ASM_NAME(#name) ":\n\t" \
code ); \ code ); \
} }

View file

@ -8,6 +8,7 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include "config.h"
#include "winnt.h" #include "winnt.h"
#include "build.h" #include "build.h"
@ -324,7 +325,7 @@ int output_imports( FILE *outfile )
{ {
for (j = 0; j < dll_imports[i]->nb_imports; j++, pos += 4) for (j = 0; j < dll_imports[i]->nb_imports; j++, pos += 4)
{ {
fprintf( outfile, " \"\\t.type " PREFIX "%s,@function\\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 " PREFIX "%s\\n\"\n",
dll_imports[i]->imports[j] ); dll_imports[i]->imports[j] );

View file

@ -11,6 +11,7 @@
#include <ctype.h> #include <ctype.h>
#include <unistd.h> #include <unistd.h>
#include "config.h"
#include "winnt.h" #include "winnt.h"
#include "thread.h" #include "thread.h"
#include "stackframe.h" #include "stackframe.h"
@ -94,7 +95,7 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
#ifdef USE_STABS #ifdef USE_STABS
fprintf( outfile, ".stabs \"__wine_call_from_16_%s:F1\",36,0,0," PREFIX "__wine_call_from_16_%s\n", name, name); fprintf( outfile, ".stabs \"__wine_call_from_16_%s:F1\",36,0,0," PREFIX "__wine_call_from_16_%s\n", name, name);
#endif #endif
fprintf( outfile, "\t.type " PREFIX "__wine_call_from_16_%s,@function\n", name ); fprintf( outfile, "\t" __ASM_FUNC("__wine_call_from_16_%s") "\n", name );
fprintf( outfile, "\t.globl " PREFIX "__wine_call_from_16_%s\n", name ); fprintf( outfile, "\t.globl " PREFIX "__wine_call_from_16_%s\n", name );
fprintf( outfile, PREFIX "__wine_call_from_16_%s:\n", name ); fprintf( outfile, PREFIX "__wine_call_from_16_%s:\n", name );
@ -452,7 +453,7 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
fprintf( outfile, ".stabs \"wine_call_to_16_%s:F1\",36,0,0," PREFIX "wine_call_to_16_%s\n", fprintf( outfile, ".stabs \"wine_call_to_16_%s:F1\",36,0,0," PREFIX "wine_call_to_16_%s\n",
name, name); name, name);
#endif #endif
fprintf( outfile, "\t.type " PREFIX "wine_call_to_16_%s,@function\n", name ); fprintf( outfile, "\t" __ASM_FUNC("wine_call_to_16_%s") "\n", name );
fprintf( outfile, "\t.globl " PREFIX "wine_call_to_16_%s\n", name ); fprintf( outfile, "\t.globl " PREFIX "wine_call_to_16_%s\n", name );
fprintf( outfile, PREFIX "wine_call_to_16_%s:\n", name ); fprintf( outfile, PREFIX "wine_call_to_16_%s:\n", name );
@ -688,7 +689,7 @@ static void BuildRet16Func( FILE *outfile )
* run-time relocation of the SYSLEVEL_Win16CurrentTeb symbol * run-time relocation of the SYSLEVEL_Win16CurrentTeb symbol
*/ */
fprintf( outfile, "\n\t.type " PREFIX "CallTo16_Ret,@function\n" ); fprintf( outfile, "\n\t" __ASM_FUNC("CallTo16_Ret") "\n" );
fprintf( outfile, "\t.globl " PREFIX "CallTo16_Ret\n" ); fprintf( outfile, "\t.globl " PREFIX "CallTo16_Ret\n" );
fprintf( outfile, PREFIX "CallTo16_Ret:\n" ); fprintf( outfile, PREFIX "CallTo16_Ret:\n" );

View file

@ -389,7 +389,7 @@ static void output_register_funcs( FILE *outfile )
name = make_internal_name( odp, "regs" ); name = make_internal_name( odp, "regs" );
fprintf( outfile, fprintf( outfile,
"asm(\".align 4\\n\\t\"\n" "asm(\".align 4\\n\\t\"\n"
" \".type " PREFIX "%s,@function\\n\\t\"\n" " \"" __ASM_FUNC("%s") "\\n\\t\"\n"
" \"" PREFIX "%s:\\n\\t\"\n" " \"" PREFIX "%s:\\n\\t\"\n"
" \"call " PREFIX "CALL32_Regs\\n\\t\"\n" " \"call " PREFIX "CALL32_Regs\\n\\t\"\n"
" \".long " PREFIX "%s\\n\\t\"\n" " \".long " PREFIX "%s\\n\\t\"\n"