emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master d72e7c4fd4: Fix the Haiku port


From: Po Lu
Subject: master d72e7c4fd4: Fix the Haiku port
Date: Sat, 12 Feb 2022 19:51:40 -0500 (EST)

branch: master
commit d72e7c4fd41c0ab400d9eb748e3b4f8d545ea948
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Fix the Haiku port
    
    * src/haiku_support.h [__cplusplus]: Define `specpdl_ref' type
    on C++ since that code cannot include lisp.h.
---
 src/haiku_support.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/haiku_support.h b/src/haiku_support.h
index f20b2e766c..e6560f401a 100644
--- a/src/haiku_support.h
+++ b/src/haiku_support.h
@@ -348,6 +348,24 @@ struct haiku_menu_bar_state_event
 #define BE_RECT_WIDTH(rect) (ceil (((rect).right - (rect).left) + 1))
 #endif /* __cplusplus */
 
+/* C++ code cannot include lisp.h, but file dialogs need to be able
+   to bind to the specpdl and handle quitting correctly.  */
+
+#ifdef __cplusplus
+
+#if SIZE_MAX > 0xffffffff
+#define WRAP_SPECPDL_REF 1
+#endif
+#ifdef WRAP_SPECPDL_REF
+typedef struct { ptrdiff_t bytes; } specpdl_ref;
+#else
+typedef ptrdiff_t specpdl_ref;
+#endif
+
+#else
+#include "lisp.h"
+#endif
+
 #ifdef __cplusplus
 extern "C"
 {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]