changeset 22111:ef3e0408097b

allow stdbool.h to be included before mex.h (patch #8526) * mex.h: Also skip defining bool if __bool_true_false_are_defined is defined (this macro comes from stdbool.h). Also conditionally define true and false. From Sebastian Freundt.
author John W. Eaton <jwe@octave.org>
date Thu, 14 Jul 2016 19:54:16 -0400
parents d534a3014fd7
children 03764eef9f7c
files libinterp/corefcn/mex.h
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/mex.h	Thu Jul 14 09:36:50 2016 -0700
+++ b/libinterp/corefcn/mex.h	Thu Jul 14 19:54:16 2016 -0400
@@ -54,8 +54,16 @@
 
 typedef void mxArray;
 
-#if ! defined (__cplusplus) && ! defined (bool)
-typedef int bool;
+#if (! defined (__cplusplus) && ! defined (__bool_true_false_are_defined)
+#  if ! defined (bool)
+#    typedef int bool;
+#  endif
+#  if ! defined (true)
+#    define true 1
+#  endif
+#  if ! defined (false)
+#    define false 0
+#  endif
 #endif
 
 /* -V4 stuff */