summaryrefslogtreecommitdiffstats
path: root/src/coin-1-fixes.patch
diff options
context:
space:
mode:
authorChristoph Weiss <weiss@wsoptics.de>2015-11-03 13:16:31 (GMT)
committerTony Theodore <tonyt@logyst.com>2015-11-18 08:27:10 (GMT)
commit1118024f45c5e274bc1a82d0b14f25293302b809 (patch)
tree9a92e2e80b20c345b77d5b3c0c9e7068ea5d2f67 /src/coin-1-fixes.patch
parentc62bcdbee56e87c81f1faa105b8777a5879d4e2e (diff)
downloadmxe-1118024f45c5e274bc1a82d0b14f25293302b809.zip
mxe-1118024f45c5e274bc1a82d0b14f25293302b809.tar.gz
mxe-1118024f45c5e274bc1a82d0b14f25293302b809.tar.bz2
Add Coin3D 3.1.3 (https://bitbucket.org/Coin3D/coin/wiki/Home)
Diffstat (limited to 'src/coin-1-fixes.patch')
-rw-r--r--src/coin-1-fixes.patch153
1 files changed, 153 insertions, 0 deletions
diff --git a/src/coin-1-fixes.patch b/src/coin-1-fixes.patch
new file mode 100644
index 0000000..cb5ced1
--- /dev/null
+++ b/src/coin-1-fixes.patch
@@ -0,0 +1,153 @@
+This file is part of MXE.
+See index.html for further information.
+
+This patch has been taken from: https://bitbucket.org/msys2/coin/commits/69e9990b05cee506f5fa16c6edad02a7808bc610/raw/
+
+It was modified to work with Coin 3.1.3.
+(The order of the template arguments of SbHash was switched.)
+
+diff --git a/include/Inventor/C/glue/spidermonkey.h b/include/Inventor/C/glue/spidermonkey.h
+--- a/include/Inventor/C/glue/spidermonkey.h
++++ b/include/Inventor/C/glue/spidermonkey.h
+@@ -56,7 +56,7 @@
+ Structs and defines.
+ */
+ typedef int JSBool;
+-typedef long jsword;
++typedef intmax_t jsword;
+ typedef jsword jsval;
+ typedef jsword jsid;
+ typedef int intN;
+diff --git a/src/foreignfiles/SoSTLFileKit.cpp b/src/foreignfiles/SoSTLFileKit.cpp
+--- a/src/foreignfiles/SoSTLFileKit.cpp
++++ b/src/foreignfiles/SoSTLFileKit.cpp
+@@ -566,14 +566,14 @@
+ SO_GET_ANY_PART(this, "facets", SoIndexedFaceSet);
+
+ // find existing indexes if any
+- long v1idx = PRIVATE(this)->points->findPoint(v1), v1new = (v1idx == -1);
+- long v2idx = PRIVATE(this)->points->findPoint(v2), v2new = (v2idx == -1);
+- long v3idx = PRIVATE(this)->points->findPoint(v3), v3new = (v3idx == -1);
+- if (!v1new) { v1idx = (long) PRIVATE(this)->points->getUserData(v1idx); }
+- if (!v2new) { v2idx = (long) PRIVATE(this)->points->getUserData(v2idx); }
+- if (!v3new) { v3idx = (long) PRIVATE(this)->points->getUserData(v3idx); }
+- long nidx = PRIVATE(this)->normals->findPoint(n);
+- if (nidx != -1) { nidx = (long) PRIVATE(this)->normals->getUserData(nidx); }
++ intmax_t v1idx = PRIVATE(this)->points->findPoint(v1), v1new = (v1idx == -1);
++ intmax_t v2idx = PRIVATE(this)->points->findPoint(v2), v2new = (v2idx == -1);
++ intmax_t v3idx = PRIVATE(this)->points->findPoint(v3), v3new = (v3idx == -1);
++ if (!v1new) { v1idx = (intmax_t) PRIVATE(this)->points->getUserData(v1idx); }
++ if (!v2new) { v2idx = (intmax_t) PRIVATE(this)->points->getUserData(v2idx); }
++ if (!v3new) { v3idx = (intmax_t) PRIVATE(this)->points->getUserData(v3idx); }
++ intmax_t nidx = PRIVATE(this)->normals->findPoint(n);
++ if (nidx != -1) { nidx = (intmax_t) PRIVATE(this)->normals->getUserData(nidx); }
+
+ // toss out invalid facets - facets where two or more points are in
+ // the same location. what are these - are they lines and points or
+diff --git a/src/threads/thread.cpp b/src/threads/thread.cpp
+--- a/src/threads/thread.cpp
++++ b/src/threads/thread.cpp
+@@ -130,7 +130,7 @@
+ void
+ cc_sleep(float seconds)
+ {
+-#ifndef _WIN32
++#if !defined(_WIN32) || defined(__MINGW32__)
+ /* FIXME: 20011107, thammer: create a configure macro to detect
+ * which sleep function is available */
+ sleep(floor(seconds));
+@@ -164,7 +164,7 @@
+ assert(0 && "unexpected failure");
+ }
+ }
+- return (unsigned long) val;
++ return static_cast<unsigned long>(reinterpret_cast<intptr_t>(val));
+ }
+
+ static void
+diff --git a/src/threads/thread_win32.icc b/src/threads/thread_win32.icc
+--- a/src/threads/thread_win32.icc
++++ b/src/threads/thread_win32.icc
+@@ -38,7 +38,7 @@
+ cc_w32thread_thread_proc(LPVOID lpParameter)
+ {
+ cc_thread *thread = (cc_thread *)lpParameter;
+- return (DWORD) thread->func(thread->closure);
++ return static_cast<DWORD>(reinterpret_cast<intptr_t>(thread->func(thread->closure)));
+ }
+
+ static int
+diff --git a/src/vrml97/JS_VRMLClasses.cpp b/src/vrml97/JS_VRMLClasses.cpp
+--- a/src/vrml97/JS_VRMLClasses.cpp
++++ b/src/vrml97/JS_VRMLClasses.cpp
+@@ -110,8 +110,11 @@
+ struct CoinVrmlJs_SensorInfo {
+ SbList <JSObject *> objects;
+ };
++#if defined(_WIN64)
++SbHash <void *, unsigned long long> * CoinVrmlJs_sensorinfohash = NULL;
++#else
+ SbHash <void *, unsigned long> * CoinVrmlJs_sensorinfohash = NULL;
+-
++#endif
+
+ const char * CoinVrmlJs_SFColorAliases[] = {"r", "g", "b"};
+ const char * CoinVrmlJs_SFRotationAliases[] = {"x", "y", "z", "angle"};
+@@ -674,7 +677,11 @@
+ {
+ SoNode * node = ((SoNodeSensor *) sensor)->getAttachedNode();
+ void * tmp;
++#if defined(_WIN64)
++ if(!CoinVrmlJs_sensorinfohash->get((unsigned long long) node, tmp)) {
++#else
+ if(!CoinVrmlJs_sensorinfohash->get((unsigned long) node, tmp)) {
++#endif
+ assert(FALSE && "Trying to delete an unregistered SoNodeSensor. Internal error.");
+ return;
+ }
+@@ -690,7 +697,11 @@
+
+ // Store the sensor-pointer so that it can be properly deleted later
+ nodesensorstobedeleted->append((SoNodeSensor *) sensor);
++#if defined(_WIN64)
++ CoinVrmlJs_sensorinfohash->remove((unsigned long long) node);
++#else
+ CoinVrmlJs_sensorinfohash->remove((unsigned long) node);
++#endif
+ delete si;
+ }
+
+@@ -1428,13 +1439,21 @@
+ {
+ // Has the hash-table been initialized?
+ if (!CoinVrmlJs_sensorinfohash) {
++#if defined(_WIN64)
++ CoinVrmlJs_sensorinfohash = new SbHash <void *, unsigned long long>;
++#else
+ CoinVrmlJs_sensorinfohash = new SbHash <void *, unsigned long>;
++#endif
+ coin_atexit(deleteSensorInfoHash, CC_ATEXIT_NORMAL);
+ }
+
+ // Is a sensor already attached to this SoNode?
+ void * tmp;
++#if defined(_WIN64)
++ if (CoinVrmlJs_sensorinfohash->get((unsigned long long) node, tmp)) {
++#else
+ if (CoinVrmlJs_sensorinfohash->get((unsigned long) node, tmp)) {
++#endif
+ CoinVrmlJs_SensorInfo * si = (CoinVrmlJs_SensorInfo *) tmp;
+ si->objects.append(obj);
+ }
+@@ -1444,7 +1463,11 @@
+ ns->attach(node);
+ CoinVrmlJs_SensorInfo * si = new CoinVrmlJs_SensorInfo;
+ si->objects.append(obj);
++#if defined(_WIN64)
++ CoinVrmlJs_sensorinfohash->put((unsigned long long) node, si);
++#else
+ CoinVrmlJs_sensorinfohash->put((unsigned long) node, si);
++#endif
+ }
+ }
+