Commit eb02361e authored by Michael Jarrett's avatar Michael Jarrett

Making three changes to fix compilation in our environment.

- Adding global namespace scope to DJINNI_ASSERT to prevent conflict
  with local namespaces.
- Add <memory> include to reference shared_ptr.
- Use temporary variable in djinni_support.hpp to avoid compiler
  segfault.
parent 697bde61
...@@ -437,6 +437,9 @@ Run `make test` to invoke the test suite, found in the test-suite subdirectory. ...@@ -437,6 +437,9 @@ Run `make test` to invoke the test suite, found in the test-suite subdirectory.
- Iulia Tamas - Iulia Tamas
- Andrew Twyman - Andrew Twyman
## Contributors
- Google Inc.
## Contacts ## Contacts
- Andrew Twyman - `atwyman@dropbox.com` - Andrew Twyman - `atwyman@dropbox.com`
- Jacob Potter - `djinni@j4cbo.com` - Jacob Potter - `djinni@j4cbo.com`
...@@ -156,11 +156,11 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha ...@@ -156,11 +156,11 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha
#define DJINNI_ASSERT_MSG(check, env, message) \ #define DJINNI_ASSERT_MSG(check, env, message) \
do { \ do { \
djinni::jniExceptionCheck(env); \ ::djinni::jniExceptionCheck(env); \
const bool check__res = bool(check); \ const bool check__res = bool(check); \
djinni::jniExceptionCheck(env); \ ::djinni::jniExceptionCheck(env); \
if (!check__res) { \ if (!check__res) { \
djinni::jniThrowAssertionError(env, __FILE__, __LINE__, message); \ ::djinni::jniThrowAssertionError(env, __FILE__, __LINE__, message); \
} \ } \
} while(false) } while(false)
#define DJINNI_ASSERT(check, env) DJINNI_ASSERT_MSG(check, env, #check) #define DJINNI_ASSERT(check, env) DJINNI_ASSERT_MSG(check, env, #check)
...@@ -340,7 +340,8 @@ template <class T> ...@@ -340,7 +340,8 @@ template <class T>
static const std::shared_ptr<T> & objectFromHandleAddress(jlong handle) { static const std::shared_ptr<T> & objectFromHandleAddress(jlong handle) {
assert(handle); assert(handle);
assert(handle > 4096); assert(handle > 4096);
const auto & ret = reinterpret_cast<const CppProxyHandle<T> *>(handle)->get(); const CppProxyHandle<T> *temp = reinterpret_cast<const CppProxyHandle<T> *>(handle);
const auto & ret = temp->get();
assert(ret); assert(ret);
return ret; return ret;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#pragma once #pragma once
#include <memory>
#include <functional> #include <functional>
#include <typeindex> #include <typeindex>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment