[WINE]
authorAleksey Bragin <aleksey@reactos.org>
Sun, 21 Mar 2010 22:27:26 +0000 (22:27 +0000)
committerAleksey Bragin <aleksey@reactos.org>
Sun, 21 Mar 2010 22:27:26 +0000 (22:27 +0000)
- Move and update assembler functions definition macros from port.h (added by Steven around revision 7000) to config.h as it is now in Wine.
- Update related __ASM macros.

svn path=/trunk/; revision=46327

reactos/include/reactos/wine/config.h
reactos/include/reactos/wine/port.h

index b677544..406b5fb 100644 (file)
 #define YYTEXT_POINTER 1
 
 /* Define to a macro to output a .cfi assembly pseudo-op */
-#define __ASM_CFI(x)
+#define __ASM_CFI(str) str
+
+/* Define to a macro to define an assembly function */
+#define __ASM_DEFINE_FUNC(name,suffix,code) asm(".text\n\t.align 4\n\t.globl _" #name suffix "\n\t.def _" #name suffix "; .scl 2; .type 32; .endef\n_" #name suffix ":\n\t.cfi_startproc\n\t" code "\n\t.cfi_endproc");
 
 /* Define to a macro to generate an assembly function directive */
 #define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
 
+/* Define to a macro to generate an assembly function with C calling
+   convention */
+#define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(name,"",code)
+
 /* Define to a macro to generate an assembly name from a C symbol */
 #define __ASM_NAME(name) "_" name
 
 /* Define to a macro to generate an stdcall suffix */
 #define __ASM_STDCALL(args) "@" #args
 
+/* Define to a macro to generate an assembly function with stdcall calling
+   convention */
+#define __ASM_STDCALL_FUNC(name,args,code) __ASM_DEFINE_FUNC(name,__ASM_STDCALL(args),code)
+
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
 
index 3b1b1c0..6b29317 100644 (file)
@@ -148,29 +148,6 @@ struct statfs;
 #endif
 
 
-/* Macros to define assembler functions somewhat portably */
-
-#if defined(__GNUC__) && !defined(__INTERIX) && !defined(__MINGW32__) && !defined(__CYGWIN__) && !defined(__APPLE__)
-# define __ASM_GLOBAL_FUNC(name,code) \
-      __asm__( ".text\n\t" \
-               ".align 4\n\t" \
-               ".globl " __ASM_NAME(#name) "\n\t" \
-               __ASM_FUNC(#name) "\n" \
-               __ASM_NAME(#name) ":\n\t" \
-               code \
-               "\n\t.previous" );
-#else  /* defined(__GNUC__) && !defined(__MINGW32__) && !defined(__APPLE__)  */
-# define __ASM_GLOBAL_FUNC(name,code) \
-      void __asm_dummy_##name(void) { \
-          asm( ".align 4\n\t" \
-               ".globl " __ASM_NAME(#name) "\n\t" \
-               __ASM_FUNC(#name) "\n" \
-               __ASM_NAME(#name) ":\n\t" \
-               code ); \
-      }
-#endif  /* __GNUC__ */
-
-
 /* Constructor functions */
 
 #ifdef __GNUC__