Hi!

Probably intentionally assert.h shares its name with the system header. But this leads to compile problems on Mac as the LinkBack.m file is not C++ based (switching it to Objective-C++ is not trivial because cmake does not know the .mm extension, if I remember right. Tried it before...), but it includes headers from the OSX API which include assert.h. As this leads to our assert.h we get a compile error because "namespace" is not valid in C. No idea what the right solution is. Here is one that works:

diff --git a/src/support/assert.h b/src/support/assert.h
index cb1ac57..4322448 100644
--- a/src/support/assert.h
+++ b/src/support/assert.h
@@ -13,6 +13,7 @@
 #ifndef LASSERT_H
 #define LASSERT_H

+#ifdef __cplusplus
 namespace lyx {

 void doAssert(char const * expr, char const * file, long line);
@@ -21,6 +22,6 @@ void doAssert(char const * expr, char const * file, long line);

 #define LASSERT(expr, escape) \
if (expr) {} else { lyx::doAssert(#expr, __FILE__, __LINE__); escape; }
-
+#endif

 #endif // LASSERT


Stefan

Reply via email to