Alexandre Julliard : configure: Add a macro to define an stdcall function in assembly.

Alexandre Julliard julliard at winehq.org
Mon Jun 15 07:59:04 CDT 2009


Module: wine
Branch: master
Commit: ea9cf9e49d394cd661adb0207555f36105185f13
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ea9cf9e49d394cd661adb0207555f36105185f13

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sun Jun 14 16:03:46 2009 +0200

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

---

 configure           |   22 ++++++++++++++++------
 configure.ac        |   18 +++++++++++-------
 include/config.h.in |   10 +++++++++-
 3 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/configure b/configure
index 1536001..dcc43b6 100755
--- a/configure
+++ b/configure
@@ -17867,19 +17867,19 @@ case "$ac_cv_asm_func_def" in
 #define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
 _ACEOF
 
-     asm_func_header=".def $asm_name_prefix\" #name \"; .scl 2; .type 32; .endef" ;;
+     asm_func_header=".def $asm_name_prefix\" #name suffix \"; .scl 2; .type 32; .endef" ;;
   ".type @function")
      cat >>confdefs.h <<\_ACEOF
 #define __ASM_FUNC(name) ".type " __ASM_NAME(name) ", at function"
 _ACEOF
 
-     asm_func_header=".type $asm_name_prefix\" #name \", at function" ;;
+     asm_func_header=".type $asm_name_prefix\" #name suffix \", at function" ;;
   ".type 2")
      cat >>confdefs.h <<\_ACEOF
 #define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",2"
 _ACEOF
 
-     asm_func_header=".type $asm_name_prefix\" #name \",2" ;;
+     asm_func_header=".type $asm_name_prefix\" #name suffix \",2" ;;
   *)
      cat >>confdefs.h <<\_ACEOF
 #define __ASM_FUNC(name) ""
@@ -18046,7 +18046,7 @@ fi
 { $as_echo "$as_me:$LINENO: result: $ac_cv_c_cfi_support" >&5
 $as_echo "$ac_cv_c_cfi_support" >&6; }
 
-asm_func_header=".globl $asm_name_prefix\" #name \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name \":\\n\\t"
+asm_func_header=".globl $asm_name_prefix\" #name suffix \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name suffix \":\\n\\t"
 asm_func_trailer=""
 if test "$ac_cv_c_dot_previous" = "yes"
 then
@@ -18065,16 +18065,26 @@ asm_func_code="$asm_func_header\" code \"$asm_func_trailer"
 if test "$ac_cv_c_asm_outside_funcs" = "yes"
 then
     cat >>confdefs.h <<_ACEOF
-#define __ASM_GLOBAL_FUNC(name,code) asm(".text\n\t.align 4\n\t$asm_func_code");
+#define __ASM_DEFINE_FUNC(name,suffix,code) asm(".text\n\t.align 4\n\t$asm_func_code");
 _ACEOF
 
 else
     cat >>confdefs.h <<_ACEOF
-#define __ASM_GLOBAL_FUNC(name,code) void __asm_dummy_##name(void) { asm(".text\n\t.align 4\n\t$asm_func_code"); }
+#define __ASM_DEFINE_FUNC(name,suffix,code) void __asm_dummy_##name(void) { asm(".text\n\t.align 4\n\t$asm_func_code"); }
 _ACEOF
 
 fi
 
+cat >>confdefs.h <<\_ACEOF
+#define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(name,"",code)
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define __ASM_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(name,__ASM_STDCALL(args),code)
+_ACEOF
+
+
 
 LDPATH=""
 
diff --git a/configure.ac b/configure.ac
index aa3b892..5fc708e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1447,13 +1447,13 @@ AH_TEMPLATE(__ASM_FUNC,[Define to a macro to generate an assembly function direc
 case "$ac_cv_asm_func_def" in
   ".def")
      AC_DEFINE([__ASM_FUNC(name)], [".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"])
-     asm_func_header=".def $asm_name_prefix\" #name \"; .scl 2; .type 32; .endef" ;;
+     asm_func_header=".def $asm_name_prefix\" #name suffix \"; .scl 2; .type 32; .endef" ;;
   ".type @function")
      AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ", at function"])
-     asm_func_header=".type $asm_name_prefix\" #name \", at function" ;;
+     asm_func_header=".type $asm_name_prefix\" #name suffix \", at function" ;;
   ".type 2")
      AC_DEFINE([__ASM_FUNC(name)], [".type " __ASM_NAME(name) ",2"])
-     asm_func_header=".type $asm_name_prefix\" #name \",2" ;;
+     asm_func_header=".type $asm_name_prefix\" #name suffix \",2" ;;
   *)
      AC_DEFINE([__ASM_FUNC(name)], [""])
      asm_func_header="" ;;
@@ -1471,7 +1471,7 @@ AC_CACHE_CHECK([whether CFI directives are supported in assembly code], ac_cv_c_
     AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[asm(".text\nac_test:\t.cfi_startproc\n\t.long 0\n\t.cfi_endproc");]])],
                       ac_cv_c_cfi_support="yes",ac_cv_c_cfi_support="no"))
 
-asm_func_header=".globl $asm_name_prefix\" #name \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name \":\\n\\t"
+asm_func_header=".globl $asm_name_prefix\" #name suffix \"\\n\\t$asm_func_header\\n$asm_name_prefix\" #name suffix \":\\n\\t"
 asm_func_trailer=""
 if test "$ac_cv_c_dot_previous" = "yes"
 then
@@ -1485,13 +1485,17 @@ fi
 
 asm_func_code="$asm_func_header\" code \"$asm_func_trailer"
 
-AH_TEMPLATE(__ASM_GLOBAL_FUNC,[Define to a macro to generate an assembly function])
+AH_TEMPLATE(__ASM_DEFINE_FUNC,[Define to a macro to define an assembly function])
 if test "$ac_cv_c_asm_outside_funcs" = "yes"
 then
-    AC_DEFINE_UNQUOTED([__ASM_GLOBAL_FUNC(name,code)],[asm(".text\n\t.align 4\n\t$asm_func_code");])
+    AC_DEFINE_UNQUOTED([__ASM_DEFINE_FUNC(name,suffix,code)],[asm(".text\n\t.align 4\n\t$asm_func_code");])
 else
-    AC_DEFINE_UNQUOTED([__ASM_GLOBAL_FUNC(name,code)],[void __asm_dummy_##name(void) { asm(".text\n\t.align 4\n\t$asm_func_code"); }])
+    AC_DEFINE_UNQUOTED([__ASM_DEFINE_FUNC(name,suffix,code)],[void __asm_dummy_##name(void) { asm(".text\n\t.align 4\n\t$asm_func_code"); }])
 fi
+AC_DEFINE([__ASM_GLOBAL_FUNC(name,code)],[__ASM_DEFINE_FUNC(name,"",code)],
+          [Define to a macro to generate an assembly function with C calling convention])
+AC_DEFINE([__ASM_STDCALL_FUNC(name,args,code)],[__ASM_DEFINE_FUNC(name,__ASM_STDCALL(args),code)],
+          [Define to a macro to generate an assembly function with stdcall calling convention])
 
 dnl **** Platform-specific checks ****
 
diff --git a/include/config.h.in b/include/config.h.in
index 5b5f7c8..aab0591 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -1188,10 +1188,14 @@
 /* Define to 1 if the X Window System is missing or not being used. */
 #undef X_DISPLAY_MISSING
 
+/* Define to a macro to define an assembly function */
+#undef __ASM_DEFINE_FUNC
+
 /* Define to a macro to generate an assembly function directive */
 #undef __ASM_FUNC
 
-/* Define to a macro to generate an assembly function */
+/* Define to a macro to generate an assembly function with C calling
+   convention */
 #undef __ASM_GLOBAL_FUNC
 
 /* Define to a macro to generate an assembly name from a C symbol */
@@ -1200,6 +1204,10 @@
 /* Define to a macro to generate an stdcall suffix */
 #undef __ASM_STDCALL
 
+/* Define to a macro to generate an assembly function with stdcall calling
+   convention */
+#undef __ASM_STDCALL_FUNC
+
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 




More information about the wine-cvs mailing list