Changes:
- Made sure that C++ compilers do not complain about the header files
include/pub_tool_libcassert.h and include/pub_tool_basics.h.
- Added the source file none/tests/valgrind_cpp_test.cpp. This source file
is compiled together with the regression tests in order to verify that
Valgrind's public header files compile cleanly with a C++ compiler.
These modifications are based on a patch provided by Konstantin Serebryany.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10970 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/include/pub_tool_libcassert.h b/include/pub_tool_libcassert.h
index 6e4f69a..c560938 100644
--- a/include/pub_tool_libcassert.h
+++ b/include/pub_tool_libcassert.h
@@ -33,15 +33,17 @@
#define tl_assert(expr) \
((void) ((expr) ? 0 : \
- (VG_(assert_fail) (/*isCore?*/False, #expr, \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, \
- ""), \
+ (VG_(assert_fail) (/*isCore?*/False, (const Char*)#expr, \
+ (const Char*)__FILE__, __LINE__, \
+ (const Char*)__PRETTY_FUNCTION__, \
+ (const HChar*)""), \
0)))
#define tl_assert2(expr, format, args...) \
((void) ((expr) ? 0 : \
- (VG_(assert_fail) (/*isCore?*/False, #expr, \
- __FILE__, __LINE__, __PRETTY_FUNCTION__, \
+ (VG_(assert_fail) (/*isCore?*/False, (const Char*)#expr, \
+ (const Char*)__FILE__, __LINE__, \
+ (const Char*)__PRETTY_FUNCTION__, \
format, ##args), \
0)))