--- a/hotspot/test/native/unittest.hpp Mon Jun 13 13:48:37 2016 +0200
+++ b/hotspot/test/native/unittest.hpp Mon Jun 13 13:54:46 2016 +0200
@@ -27,8 +27,17 @@
#define GTEST_DONT_DEFINE_TEST 1
#include "gtest/gtest.h"
+
+// gtest/gtest.h includes assert.h which will define the assert macro, but hotspot has its
+// own standards incompatible assert macro that takes two parameters.
+// The workaround is to undef assert and then re-define it. The re-definition
+// must unfortunately be copied since debug.hpp might already have been
+// included and a second include wouldn't work due to the header guards in debug.hpp.
#ifdef assert
#undef assert
+ #ifdef vmassert
+ #define assert(p, ...) vmassert(p, __VA_ARGS__)
+ #endif
#endif
#define CONCAT(a, b) a ## b