diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-04-04 22:45:40 +0700 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-12 14:27:35 +0300 |
commit | 01c2ac873fdd7c219bea0dfa8cf3ba9580d8a933 (patch) | |
tree | 4a4084e045f7efa8da8de08fb4b086bd35a05aad | |
parent | 8ee0c6a12d1488c2fa131da25db91de0d2d44203 (diff) |
Stop using cxa_demangle in embind.
With an updated libcxx, we no longer have libcxxabi in the
include path, so we can't have the demangling code in the
build.
-rwxr-xr-x | system/lib/embind/bind.cpp | 6 | ||||
-rwxr-xr-x | tests/embind/embind.test.js | 18 |
2 files changed, 15 insertions, 9 deletions
diff --git a/system/lib/embind/bind.cpp b/system/lib/embind/bind.cpp index 417d9ffd..1619eddc 100755 --- a/system/lib/embind/bind.cpp +++ b/system/lib/embind/bind.cpp @@ -1,5 +1,7 @@ #include <emscripten/bind.h>
+#ifdef USE_CXA_DEMANGLE
#include <../lib/libcxxabi/include/cxxabi.h>
+#endif
#include <list>
#include <vector>
#include <typeinfo>
@@ -11,6 +13,7 @@ using namespace emscripten; extern "C" {
const char* EMSCRIPTEN_KEEPALIVE __getTypeName(const std::type_info* ti) {
+#ifdef USE_CXA_DEMANGLE
int stat;
char* demangled = abi::__cxa_demangle(ti->name(), NULL, NULL, &stat);
if (stat == 0 && demangled) {
@@ -27,6 +30,9 @@ extern "C" { default:
return strdup("<unknown error>");
}
+#else
+ return strdup(ti->name());
+#endif
}
}
diff --git a/tests/embind/embind.test.js b/tests/embind/embind.test.js index f365c1b8..290fed72 100755 --- a/tests/embind/embind.test.js +++ b/tests/embind/embind.test.js @@ -1487,7 +1487,7 @@ module({ function() { cm.getUnboundClass(); }, - 'Cannot call getUnboundClass due to unbound types: UnboundClass'); + 'Cannot call getUnboundClass due to unbound types: 12UnboundClass'); }); test("unbound base class produces error", function() { @@ -1495,14 +1495,14 @@ module({ function() { cm.getHasUnboundBase(); }, - 'Cannot call getHasUnboundBase due to unbound types: UnboundClass'); + 'Cannot call getHasUnboundBase due to unbound types: 12UnboundClass'); }); test("construct of class with unbound base", function() { assertMessage( function() { new cm.HasUnboundBase; - }, 'Cannot construct HasUnboundBase due to unbound types: UnboundClass'); + }, 'Cannot construct HasUnboundBase due to unbound types: 12UnboundClass'); }); test("unbound constructor argument", function() { @@ -1510,7 +1510,7 @@ module({ function() { new cm.HasConstructorUsingUnboundArgument(1); }, - 'Cannot construct HasConstructorUsingUnboundArgument due to unbound types: UnboundClass'); + 'Cannot construct HasConstructorUsingUnboundArgument due to unbound types: 12UnboundClass'); }); test("unbound constructor argument of class with unbound base", function() { @@ -1518,7 +1518,7 @@ module({ function() { new cm.HasConstructorUsingUnboundArgumentAndUnboundBase; }, - 'Cannot construct HasConstructorUsingUnboundArgumentAndUnboundBase due to unbound types: SecondUnboundClass'); + 'Cannot construct HasConstructorUsingUnboundArgumentAndUnboundBase due to unbound types: 18SecondUnboundClass'); }); test('class function with unbound argument', function() { @@ -1526,7 +1526,7 @@ module({ assertMessage( function() { x.method(); - }, 'Cannot call BoundClass.method due to unbound types: UnboundClass'); + }, 'Cannot call BoundClass.method due to unbound types: 12UnboundClass'); x.delete(); }); @@ -1534,7 +1534,7 @@ module({ assertMessage( function() { cm.BoundClass.classfunction(); - }, 'Cannot call BoundClass.classfunction due to unbound types: UnboundClass'); + }, 'Cannot call BoundClass.classfunction due to unbound types: 12UnboundClass'); }); test('class property of unbound type', function() { @@ -1543,11 +1543,11 @@ module({ assertMessage( function() { y = x.property; - }, 'Cannot access BoundClass.property due to unbound types: UnboundClass'); + }, 'Cannot access BoundClass.property due to unbound types: 12UnboundClass'); assertMessage( function() { x.property = 10; - }, 'Cannot access BoundClass.property due to unbound types: UnboundClass'); + }, 'Cannot access BoundClass.property due to unbound types: 12UnboundClass'); x.delete(); }); |