Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ValveSoftware/Proton.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Eikum <aeikum@codeweavers.com>2018-06-07 18:09:17 +0300
committerAndrew Eikum <aeikum@codeweavers.com>2018-06-07 18:16:52 +0300
commit97cb5639d78d893edae4a7aa730ea529eb128ff2 (patch)
tree597d0e062602cd6104456bd1109023a7c8486332
parent7afb1d5a4a730415e49e1822832f20e6eb1c0de1 (diff)
vrclient: Fix building on macosproton-3.7-20180607
-rw-r--r--vrclient_x64/cxx.h17
-rw-r--r--vrclient_x64/vrclient_main.c13
2 files changed, 11 insertions, 19 deletions
diff --git a/vrclient_x64/cxx.h b/vrclient_x64/cxx.h
index 5ee17132..322cdec4 100644
--- a/vrclient_x64/cxx.h
+++ b/vrclient_x64/cxx.h
@@ -21,23 +21,22 @@
#ifdef __APPLE__
# define __ASM_NAME(name) "_" name
-#else
-# define __ASM_NAME(name) name
-#endif
-
-#ifdef __i386__ /* thiscall functions are i386-specific */
-
-#ifdef __APPLE__
+# define FORCE_ALIGN
# define __ASM_DEFINE_FUNC(name,suffix,code) asm(".text\n\t.align 4\n\t.globl _" #name suffix "\n\t\n_" #name suffix ":\n\t.cfi_startproc\n\t" code "\n\t.cfi_endproc\n\t.previous");
#else
+# define __ASM_NAME(name) name
+# define FORCE_ALIGN __attribute__((__force_align_arg_pointer__))
# define __ASM_DEFINE_FUNC(name,suffix,code) asm(".text\n\t.align 4\n\t.globl " #name suffix "\n\t.type " #name suffix ",@function\n" #name suffix ":\n\t.cfi_startproc\n\t" code "\n\t.cfi_endproc\n\t.previous");
#endif
+
#define __ASM_GLOBAL_FUNC(name,code) __ASM_DEFINE_FUNC(name,"",code)
#define __ASM_STDCALL(args) ""
+#ifdef __i386__ /* thiscall functions are i386-specific */
+
#define THISCALL(func) __thiscall_ ## func
#define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func)
-#define __thiscall __stdcall __attribute__((__force_align_arg_pointer__))
+#define __thiscall __stdcall FORCE_ALIGN
#define DEFINE_THISCALL_WRAPPER(func,args) \
extern void THISCALL(func)(void); \
__ASM_GLOBAL_FUNC(__thiscall_ ## func, \
@@ -49,7 +48,7 @@
#define THISCALL(func) func
#define THISCALL_NAME(func) __ASM_NAME(#func)
-#define __thiscall __cdecl __attribute__((__force_align_arg_pointer__))
+#define __thiscall __cdecl FORCE_ALIGN
#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */
#endif /* __i386__ */
diff --git a/vrclient_x64/vrclient_main.c b/vrclient_x64/vrclient_main.c
index 3bc25258..afa50fb4 100644
--- a/vrclient_x64/vrclient_main.c
+++ b/vrclient_x64/vrclient_main.c
@@ -23,6 +23,7 @@
#include "wined3d-interop.h"
+#include "cxx.h"
#include "flatapi.h"
#include "cppIVRClientCore_IVRClientCore_003.h"
@@ -912,21 +913,13 @@ void destroy_compositor_data(struct compositor_data *data)
/* call_flat_method() definition */
#ifdef __i386__
-asm(".text\n\t"
- ".align 4\n\t"
- ".globl call_flat_method\n\t"
- ".type call_flat_method, @function\n"
- "call_flat_method:\n\t"
+__ASM_GLOBAL_FUNC(call_flat_method,
"popl %eax\n\t"
"pushl %ecx\n\t"
"pushl %eax\n\t"
"jmp *%edx");
#else
-asm(".text\n\t"
- ".align 4\n\t"
- ".globl call_flat_method\n\t"
- ".type call_flat_method, @function\n"
- "call_flat_method:\n\t"
+__ASM_GLOBAL_FUNC(call_flat_method,
"popq %rax\n\t" // return address
"pushq %r9\n\t"
"pushq %rax\n\t"