Replace configure macros by explicit platform checks (probably not
correct on all platforms yet).
This commit is contained in:
parent
545aefa18f
commit
706a0a9e59
@ -184,6 +184,8 @@ extern unsigned int get_page_size(void);
|
|||||||
extern const char *asm_name( const char *func );
|
extern const char *asm_name( const char *func );
|
||||||
extern const char *func_declaration( const char *func );
|
extern const char *func_declaration( const char *func );
|
||||||
extern const char *func_size( const char *func );
|
extern const char *func_size( const char *func );
|
||||||
|
extern const char *get_asm_string_keyword(void);
|
||||||
|
extern const char *get_asm_short_keyword(void);
|
||||||
|
|
||||||
extern void add_import_dll( const char *name, const char *filename );
|
extern void add_import_dll( const char *name, const char *filename );
|
||||||
extern void add_delayed_import( const char *name );
|
extern void add_delayed_import( const char *name );
|
||||||
|
@ -266,12 +266,12 @@ static void output_exports( FILE *outfile, DLLSPEC *spec )
|
|||||||
fprintf( outfile, " \"__wine_spec_exp_ordinals:\\n\"\n" );
|
fprintf( outfile, " \"__wine_spec_exp_ordinals:\\n\"\n" );
|
||||||
for (i = 0; i < spec->nb_names; i++)
|
for (i = 0; i < spec->nb_names; i++)
|
||||||
{
|
{
|
||||||
fprintf( outfile, " \"\\t" __ASM_SHORT " %d\\n\"\n",
|
fprintf( outfile, " \"\\t%s %d\\n\"\n",
|
||||||
spec->names[i]->ordinal - spec->base );
|
get_asm_short_keyword(), spec->names[i]->ordinal - spec->base );
|
||||||
}
|
}
|
||||||
if (spec->nb_names % 2)
|
if (spec->nb_names % 2)
|
||||||
{
|
{
|
||||||
fprintf( outfile, " \"\\t" __ASM_SHORT " 0\\n\"\n" );
|
fprintf( outfile, " \"\\t%s 0\\n\"\n", get_asm_short_keyword() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -284,7 +284,7 @@ static void output_exports( FILE *outfile, DLLSPEC *spec )
|
|||||||
{
|
{
|
||||||
ORDDEF *odp = spec->ordinals[i];
|
ORDDEF *odp = spec->ordinals[i];
|
||||||
if (odp && (odp->flags & FLAG_FORWARD))
|
if (odp && (odp->flags & FLAG_FORWARD))
|
||||||
fprintf( outfile, " \"\\t" __ASM_STRING " \\\"%s\\\"\\n\"\n", odp->link_name );
|
fprintf( outfile, " \"\\t%s \\\"%s\\\"\\n\"\n", get_asm_string_keyword(), odp->link_name );
|
||||||
}
|
}
|
||||||
fprintf( outfile, " \"\\t.align %d\\n\"\n", get_alignment(4) );
|
fprintf( outfile, " \"\\t.align %d\\n\"\n", get_alignment(4) );
|
||||||
}
|
}
|
||||||
@ -324,7 +324,7 @@ static void output_exports( FILE *outfile, DLLSPEC *spec )
|
|||||||
case TYPE_CDECL:
|
case TYPE_CDECL:
|
||||||
fprintf( outfile, " \"\\tjmp %s\\n\"\n", asm_name(odp->link_name) );
|
fprintf( outfile, " \"\\tjmp %s\\n\"\n", asm_name(odp->link_name) );
|
||||||
fprintf( outfile, " \"\\tret\\n\"\n" );
|
fprintf( outfile, " \"\\tret\\n\"\n" );
|
||||||
fprintf( outfile, " \"\\t" __ASM_SHORT " %d\\n\"\n", args );
|
fprintf( outfile, " \"\\t%s %d\\n\"\n", get_asm_short_keyword(), args );
|
||||||
fprintf( outfile, " \"\\t.long %s,0x%08x\\n\"\n", asm_name(odp->link_name), mask );
|
fprintf( outfile, " \"\\t.long %s,0x%08x\\n\"\n", asm_name(odp->link_name), mask );
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -384,26 +384,72 @@ unsigned int get_page_size(void)
|
|||||||
const char *asm_name( const char *sym )
|
const char *asm_name( const char *sym )
|
||||||
{
|
{
|
||||||
static char buffer[256];
|
static char buffer[256];
|
||||||
sprintf( buffer, __ASM_NAME("%s"), sym );
|
|
||||||
|
switch (target_platform)
|
||||||
|
{
|
||||||
|
case PLATFORM_APPLE:
|
||||||
|
case PLATFORM_WINDOWS:
|
||||||
|
buffer[0] = '_';
|
||||||
|
strcpy( buffer + 1, sym );
|
||||||
return buffer;
|
return buffer;
|
||||||
|
default:
|
||||||
|
return sym;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return an assembly function declaration for a C function name */
|
/* return an assembly function declaration for a C function name */
|
||||||
const char *func_declaration( const char *func )
|
const char *func_declaration( const char *func )
|
||||||
{
|
{
|
||||||
static char buffer[256];
|
static char buffer[256];
|
||||||
sprintf( buffer, __ASM_FUNC("%s"), func );
|
|
||||||
|
switch (target_platform)
|
||||||
|
{
|
||||||
|
case PLATFORM_WINDOWS:
|
||||||
|
sprintf( buffer, ".def _%s; .scl 2; .type 32; .endef", func );
|
||||||
|
break;
|
||||||
|
case PLATFORM_APPLE:
|
||||||
|
sprintf( buffer, ".type _%s,@function", func );
|
||||||
|
break;
|
||||||
|
case PLATFORM_SVR4:
|
||||||
|
sprintf( buffer, ".type %s,2", func );
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
sprintf( buffer, ".type %s,@function", func );
|
||||||
|
break;
|
||||||
|
}
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return a size declaration for an assembly function */
|
/* return a size declaration for an assembly function */
|
||||||
const char *func_size( const char *func )
|
const char *func_size( const char *func )
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ASM_DOT_SIZE
|
|
||||||
static char buffer[256];
|
static char buffer[256];
|
||||||
sprintf( buffer, ".size " __ASM_NAME("%s") ", .-" __ASM_NAME("%s"), func, func );
|
|
||||||
return buffer;
|
switch (target_platform)
|
||||||
#else
|
{
|
||||||
|
case PLATFORM_APPLE:
|
||||||
|
case PLATFORM_WINDOWS:
|
||||||
return "";
|
return "";
|
||||||
#endif
|
default:
|
||||||
|
sprintf( buffer, ".size %s, .-%s", func, func );
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *get_asm_string_keyword(void)
|
||||||
|
{
|
||||||
|
switch (target_platform)
|
||||||
|
{
|
||||||
|
case PLATFORM_SVR4: return ".asciz";
|
||||||
|
default: return ".string";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *get_asm_short_keyword(void)
|
||||||
|
{
|
||||||
|
switch (target_platform)
|
||||||
|
{
|
||||||
|
case PLATFORM_SVR4: return ".half";
|
||||||
|
default: return ".short";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user