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.
- Iulia Tamas
- Andrew Twyman
## Contributors
- Google Inc.
## Contacts
- Andrew Twyman - `atwyman@dropbox.com`
- Jacob Potter - `djinni@j4cbo.com`
......@@ -156,11 +156,11 @@ void jniThrowAssertionError(JNIEnv * env, const char * file, int line, const cha
#define DJINNI_ASSERT_MSG(check, env, message) \
do { \
djinni::jniExceptionCheck(env); \
::djinni::jniExceptionCheck(env); \
const bool check__res = bool(check); \
djinni::jniExceptionCheck(env); \
::djinni::jniExceptionCheck(env); \
if (!check__res) { \
djinni::jniThrowAssertionError(env, __FILE__, __LINE__, message); \
::djinni::jniThrowAssertionError(env, __FILE__, __LINE__, message); \
} \
} while(false)
#define DJINNI_ASSERT(check, env) DJINNI_ASSERT_MSG(check, env, #check)
......@@ -340,7 +340,8 @@ template <class T>
static const std::shared_ptr<T> & objectFromHandleAddress(jlong handle) {
assert(handle);
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);
return ret;
}
......
......@@ -16,6 +16,7 @@
#pragma once
#include <memory>
#include <functional>
#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