configure: Add a macro to define an stdcall suffix in assembly code.

This commit is contained in:
Alexandre Julliard 2009-06-14 11:24:20 +02:00
parent 8812d241f0
commit 9cebf090af
3 changed files with 102 additions and 0 deletions

78
configure vendored
View File

@ -17615,6 +17615,69 @@ fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_extern_prefix" >&5 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_extern_prefix" >&5
$as_echo "$ac_cv_c_extern_prefix" >&6; } $as_echo "$ac_cv_c_extern_prefix" >&6; }
case $host_cpu in
*i[3456789]86*)
{ $as_echo "$as_me:$LINENO: checking whether external symbols need stdcall decoration" >&5
$as_echo_n "checking whether external symbols need stdcall decoration... " >&6; }
if test "${ac_cv_c_stdcall_suffix+set}" = set; then
$as_echo_n "(cached) " >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#ifndef _MSC_VER
#define __stdcall __attribute__((__stdcall__))
#endif
int __stdcall ac_test(int i) { return i; }
int
main ()
{
asm("jmp _ac_test@4"); if (ac_test(1)) return 1
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
$as_echo "$ac_try_echo") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
$as_test_x conftest$ac_exeext
}; then
ac_cv_c_stdcall_suffix="yes"
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_c_stdcall_suffix="no"
fi
rm -rf conftest.dSYM
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stdcall_suffix" >&5
$as_echo "$ac_cv_c_stdcall_suffix" >&6; } ;;
*) ac_cv_c_stdcall_suffix="no" ;;
esac
if test "$ac_cv_c_extern_prefix" = "yes" if test "$ac_cv_c_extern_prefix" = "yes"
@ -17633,6 +17696,21 @@ _ACEOF
fi fi
if test "$ac_cv_c_stdcall_suffix" = "yes"
then
cat >>confdefs.h <<\_ACEOF
#define __ASM_STDCALL(args) "@" #args
_ACEOF
else
cat >>confdefs.h <<\_ACEOF
#define __ASM_STDCALL(args) ""
_ACEOF
fi
{ $as_echo "$as_me:$LINENO: checking how to define a function in assembly code" >&5 { $as_echo "$as_me:$LINENO: checking how to define a function in assembly code" >&5
$as_echo_n "checking how to define a function in assembly code... " >&6; } $as_echo_n "checking how to define a function in assembly code... " >&6; }
if test "${ac_cv_asm_func_def+set}" = set; then if test "${ac_cv_asm_func_def+set}" = set; then

View File

@ -1400,6 +1400,19 @@ AC_CACHE_CHECK([whether external symbols need an underscore prefix], ac_cv_c_ext
[if (ac_test) return 1], [if (ac_test) return 1],
ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no")) ac_cv_c_extern_prefix="yes",ac_cv_c_extern_prefix="no"))
case $host_cpu in
*i[[3456789]]86*)
AC_CACHE_CHECK([whether external symbols need stdcall decoration], ac_cv_c_stdcall_suffix,
WINE_TRY_ASM_LINK(["jmp _ac_test@4"],
[#ifndef _MSC_VER
#define __stdcall __attribute__((__stdcall__))
#endif
int __stdcall ac_test(int i) { return i; }],
[if (ac_test(1)) return 1],
ac_cv_c_stdcall_suffix="yes",ac_cv_c_stdcall_suffix="no")) ;;
*) ac_cv_c_stdcall_suffix="no" ;;
esac
AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol]) AH_TEMPLATE(__ASM_NAME,[Define to a macro to generate an assembly name from a C symbol])
if test "$ac_cv_c_extern_prefix" = "yes" if test "$ac_cv_c_extern_prefix" = "yes"
then then
@ -1410,6 +1423,14 @@ else
asm_name_prefix="" asm_name_prefix=""
fi fi
AH_TEMPLATE(__ASM_STDCALL,[Define to a macro to generate an stdcall suffix])
if test "$ac_cv_c_stdcall_suffix" = "yes"
then
AC_DEFINE([__ASM_STDCALL(args)],["@" #args])
else
AC_DEFINE([__ASM_STDCALL(args)],[""])
fi
dnl **** Check how to define a function in assembly code **** dnl **** Check how to define a function in assembly code ****
AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def, AC_CACHE_CHECK([how to define a function in assembly code], ac_cv_asm_func_def,

View File

@ -1197,6 +1197,9 @@
/* Define to a macro to generate an assembly name from a C symbol */ /* Define to a macro to generate an assembly name from a C symbol */
#undef __ASM_NAME #undef __ASM_NAME
/* Define to a macro to generate an stdcall suffix */
#undef __ASM_STDCALL
/* Define to empty if `const' does not conform to ANSI C. */ /* Define to empty if `const' does not conform to ANSI C. */
#undef const #undef const