summaryrefslogtreecommitdiffstats
path: root/src/openal-2-gcc-destructor-win32.patch
diff options
context:
space:
mode:
authorVolker Grabsch <vog@notjusthosting.com>2010-11-28 21:28:35 (GMT)
committerVolker Grabsch <vog@notjusthosting.com>2010-11-28 21:28:35 (GMT)
commit1f1ff5d8f1f473d2b39cc791734b5905f22e68bb (patch)
tree7c39e262442c91a1468658a90dc8340baa844c3e /src/openal-2-gcc-destructor-win32.patch
parent0c78444409b237dc700c8739c226509d47b8e496 (diff)
downloadmxe-1f1ff5d8f1f473d2b39cc791734b5905f22e68bb.zip
mxe-1f1ff5d8f1f473d2b39cc791734b5905f22e68bb.tar.gz
mxe-1f1ff5d8f1f473d2b39cc791734b5905f22e68bb.tar.bz2
replace the ugly hacks with clean patches for package openal
Diffstat (limited to 'src/openal-2-gcc-destructor-win32.patch')
-rw-r--r--src/openal-2-gcc-destructor-win32.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/openal-2-gcc-destructor-win32.patch b/src/openal-2-gcc-destructor-win32.patch
new file mode 100644
index 0000000..d2a51a2
--- /dev/null
+++ b/src/openal-2-gcc-destructor-win32.patch
@@ -0,0 +1,51 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+This patch has been taken from:
+http://opensource.creative.com/pipermail/openal-devel/2010-November/005759.html
+
+diff -r 37cec05f2c93 Alc/ALc.c
+--- a/Alc/ALc.c Sun Nov 28 20:53:45 2010 +0100
++++ b/Alc/ALc.c Sun Nov 28 21:19:52 2010 +0100
+@@ -239,7 +239,10 @@
+
+ ///////////////////////////////////////////////////////
+ // ALC Related helper functions
+-#ifdef _WIN32
++#if defined(HAVE_GCC_DESTRUCTOR)
++static void alc_init(void) __attribute__((constructor));
++static void alc_deinit(void) __attribute__((destructor));
++#elif defined(_WIN32)
+ static void alc_init(void);
+ static void alc_deinit(void);
+
+@@ -261,11 +264,6 @@
+ }
+ return TRUE;
+ }
+-#else
+-#ifdef HAVE_GCC_DESTRUCTOR
+-static void alc_init(void) __attribute__((constructor));
+-static void alc_deinit(void) __attribute__((destructor));
+-#endif
+ #endif
+
+ static void alc_init(void)
+diff -r 37cec05f2c93 CMakeLists.txt
+--- a/CMakeLists.txt Sun Nov 28 20:53:45 2010 +0100
++++ b/CMakeLists.txt Sun Nov 28 21:19:52 2010 +0100
+@@ -123,11 +123,11 @@
+ "Flags used by the compiler during debug builds."
+ FORCE)
+
++ CHECK_C_SOURCE_COMPILES("int foo() __attribute__((destructor));
++ int main() {return 0;}" HAVE_GCC_DESTRUCTOR)
++
+ # Set visibility options if available
+ IF(NOT WIN32)
+- CHECK_C_SOURCE_COMPILES("int foo() __attribute__((destructor));
+- int main() {return 0;}" HAVE_GCC_DESTRUCTOR)
+-
+ CHECK_C_COMPILER_FLAG(-fvisibility=hidden HAVE_VISIBILITY_SWITCH)
+ IF(HAVE_VISIBILITY_SWITCH)
+ CHECK_C_SOURCE_COMPILES("int foo() __attribute__((visibility(\"default\")));