[x265] [PATCH 1 of 2] threading: fix 32bit multilib with GCC
Steve Borho
steve at borho.org
Wed Jun 24 17:40:59 CEST 2015
# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1435159862 18000
# Wed Jun 24 10:31:02 2015 -0500
# Node ID 95df7ec3c5e6e4ccd1f58c93d302cdfd94ecddd8
# Parent e16b8c5fa3aca0a799955a5f27404a1b020ea803
threading: fix 32bit multilib with GCC
diff -r e16b8c5fa3ac -r 95df7ec3c5e6 source/common/threading.cpp
--- a/source/common/threading.cpp Wed Jun 24 10:26:17 2015 -0500
+++ b/source/common/threading.cpp Wed Jun 24 10:31:02 2015 -0500
@@ -21,21 +21,24 @@
* For more information, contact us at license @ x265.com
*****************************************************************************/
+#include "common.h"
#include "threading.h"
+#include "cpu.h"
namespace X265_NS {
// x265 private namespace
#if X265_ARCH_X86 && !defined(X86_64) && ENABLE_ASSEMBLY && defined(__GNUC__)
-extern "C" intptr_t x265_stack_align(void (*func)(), ...);
-#define x265_stack_align(func, ...) x265_stack_align((void (*)())func, __VA_ARGS__)
+extern "C" intptr_t PFX(stack_align)(void (*func)(), ...);
+#define STACK_ALIGN(func, ...) PFX(stack_align)((void (*)())func, __VA_ARGS__)
#else
-#define x265_stack_align(func, ...) func(__VA_ARGS__)
+#define STACK_ALIGN(func, ...) func(__VA_ARGS__)
#endif
/* C shim for forced stack alignment */
static void stackAlignMain(Thread *instance)
{
+ // defer processing to the virtual function implemented in the derived class
instance->threadMain();
}
@@ -43,8 +46,7 @@
static DWORD WINAPI ThreadShim(Thread *instance)
{
- // defer processing to the virtual function implemented in the derived class
- x265_stack_align(stackAlignMain, instance);
+ STACK_ALIGN(stackAlignMain, instance);
return 0;
}
@@ -77,7 +79,7 @@
// defer processing to the virtual function implemented in the derived class
Thread *instance = reinterpret_cast<Thread *>(opaque);
- x265_stack_align(stackAlignMain, instance);
+ STACK_ALIGN(stackAlignMain, instance);
return NULL;
}
More information about the x265-devel
mailing list