Commit f814cf87 authored by Christian Costa's avatar Christian Costa Committed by Alexandre Julliard

Make use of .half and/or .asciiz assembler keywords when necessary.

parent 992d1b99
......@@ -11141,7 +11141,125 @@ if test "$ac_cv_c_asm_string" = "yes"
then
cat >>confdefs.h <<\_ACEOF
#define HAVE_ASM_STRING 1
#define __ASM_STRING ".string"
_ACEOF
else
echo "$as_me:$LINENO: checking whether assembler accepts .asciz" >&5
echo $ECHO_N "checking whether assembler accepts .asciz... $ECHO_C" >&6
if test "${ac_cv_c_asm_asciz+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
void ac_asm(void) { asm(".data\n\t.asciz \"test\"\n\t.text"); }
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_asm_asciz="yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_asm_asciz="no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_c_asm_asciz" >&5
echo "${ECHO_T}$ac_cv_c_asm_asciz" >&6
if test "$ac_cv_c_asm_asciz" = "yes"
then
cat >>confdefs.h <<\_ACEOF
#define __ASM_STRING ".asciz"
_ACEOF
else
cat >>confdefs.h <<\_ACEOF
#define __ASM_STRING ".ascii"
_ACEOF
fi
fi
echo "$as_me:$LINENO: checking whether assembler accepts .short" >&5
echo $ECHO_N "checking whether assembler accepts .short... $ECHO_C" >&6
if test "${ac_cv_c_asm_short+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
void ac_asm(void) { asm(".data\n\t.short 1\n\t.text"); }
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_c_asm_short="yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_asm_short="no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_c_asm_short" >&5
echo "${ECHO_T}$ac_cv_c_asm_short" >&6
if test "$ac_cv_c_asm_short" = "yes"
then
cat >>confdefs.h <<\_ACEOF
#define __ASM_SHORT ".short"
_ACEOF
else
cat >>confdefs.h <<\_ACEOF
#define __ASM_SHORT ".half"
_ACEOF
fi
......
......@@ -732,14 +732,36 @@ else
AC_DEFINE([__ASM_NAME(name)], [name])
fi
dnl **** Check for .string in assembler ****
dnl **** Check how to do strings in assembler ****
AC_CACHE_CHECK([whether assembler accepts .string], ac_cv_c_asm_string,
WINE_TRY_ASM_LINK([".data\n\t.string \"test\"\n\t.text"],,,
ac_cv_c_asm_string="yes",ac_cv_c_asm_string="no"))
if test "$ac_cv_c_asm_string" = "yes"
then
AC_DEFINE(HAVE_ASM_STRING, 1, [Define to use .string instead of .ascii])
AC_DEFINE(__ASM_STRING, [".string"], [Define to the assembler keyword used to specify an ASCII string])
else
AC_CACHE_CHECK([whether assembler accepts .asciz], ac_cv_c_asm_asciz,
WINE_TRY_ASM_LINK([".data\n\t.asciz \"test\"\n\t.text"],,,
ac_cv_c_asm_asciz="yes",ac_cv_c_asm_asciz="no"))
if test "$ac_cv_c_asm_asciz" = "yes"
then
AC_DEFINE(__ASM_STRING, [".asciz"])
else
AC_DEFINE(__ASM_STRING, [".ascii"])
fi
fi
dnl **** Check for .short in assembler ****
AC_CACHE_CHECK([whether assembler accepts .short], ac_cv_c_asm_short,
WINE_TRY_ASM_LINK([".data\n\t.short 1\n\t.text"],,,
ac_cv_c_asm_short="yes",ac_cv_c_asm_short="no"))
if test "$ac_cv_c_asm_short" = "yes"
then
AC_DEFINE(__ASM_SHORT, [".short"], [Define to the assembler keyword used to specify a word value])
else
AC_DEFINE(__ASM_SHORT, [".half"])
fi
dnl **** Check for working dll ****
......
......@@ -35,9 +35,6 @@
/* Define if you have ARTS sound server */
#undef HAVE_ARTS
/* Define to use .string instead of .ascii */
#undef HAVE_ASM_STRING
/* Define to 1 if you have the <audio/audiolib.h> header file. */
#undef HAVE_AUDIO_AUDIOLIB_H
......@@ -779,6 +776,12 @@
/* Define to a macro to generate an assembly name from a C symbol */
#undef __ASM_NAME
/* Define to the assembler keyword used to specify a word value */
#undef __ASM_SHORT
/* Define to the assembler keyword used to specify an ASCII string */
#undef __ASM_STRING
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
......
......@@ -210,7 +210,7 @@ static int output_exports( FILE *outfile, int nr_exports )
fprintf( outfile, " \"\\t.text\\n\"\n" );
fprintf( outfile, " \"__wine_spec_exp_names:\\n\"\n" );
for (i = 0; i < nb_names; i++)
fprintf( outfile, " \"\\t" STRING " \\\"%s\\\"\\n\"\n", Names[i]->name );
fprintf( outfile, " \"\\t" __ASM_STRING " \\\"%s\\\"\\n\"\n", Names[i]->name );
fprintf( outfile, " \"\\t.data\\n\"\n" );
/* output the function ordinals */
......@@ -218,12 +218,12 @@ static int output_exports( FILE *outfile, int nr_exports )
fprintf( outfile, " \"__wine_spec_exp_ordinals:\\n\"\n" );
for (i = 0; i < nb_names; i++)
{
fprintf( outfile, " \"\\t.short %d\\n\"\n", Names[i]->ordinal - Base );
fprintf( outfile, " \"\\t" __ASM_SHORT " %d\\n\"\n", Names[i]->ordinal - Base );
}
total_size += nb_names * sizeof(short);
if (nb_names % 2)
{
fprintf( outfile, " \"\\t.short 0\\n\"\n" );
fprintf( outfile, " \"\\t" __ASM_SHORT " 0\\n\"\n" );
total_size += sizeof(short);
}
}
......@@ -237,7 +237,7 @@ static int output_exports( FILE *outfile, int nr_exports )
{
ORDDEF *odp = Ordinals[i];
if (odp && (odp->flags & FLAG_FORWARD))
fprintf( outfile, " \"\\t" STRING " \\\"%s\\\"\\n\"\n", odp->link_name );
fprintf( outfile, " \"\\t" __ASM_STRING " \\\"%s\\\"\\n\"\n", odp->link_name );
}
fprintf( outfile, " \"\\t.align %d\\n\"\n", get_alignment(4) );
total_size += (fwd_size + 3) & ~3;
......@@ -281,7 +281,7 @@ static int output_exports( FILE *outfile, int nr_exports )
case TYPE_CDECL:
fprintf( outfile, " \"\\tjmp " __ASM_NAME("%s") "\\n\"\n", name );
fprintf( outfile, " \"\\tret\\n\"\n" );
fprintf( outfile, " \"\\t.short %d\\n\"\n", args );
fprintf( outfile, " \"\\t" __ASM_SHORT " %d\\n\"\n", args );
fprintf( outfile, " \"\\t.long " __ASM_NAME("%s") ",0x%08x\\n\"\n", name, mask );
break;
default:
......
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