ruby-changes:54524
From: k0kubun <ko1@a...>
Date: Sun, 6 Jan 2019 23:53:48 +0900 (JST)
Subject: [ruby-changes:54524] k0kubun:r66739 (trunk): internal.h: unify our own stdtbool.h implementation
k0kubun 2019-01-06 23:53:43 +0900 (Sun, 06 Jan 2019) New Revision: 66739 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66739 Log: internal.h: unify our own stdtbool.h implementation because we had another one in missing/stdbool.h as well. Assuming that _Bool does not exist when stdbool.h is absent, I'm in favor of r57462 implementation rather than r61326. Note that Visual Studio 2013 has stdbool.h and thus r57462's commit message is somewhat misleading. This missing/stdbool.h is for Visual Studio 2012 or older, and for Oracle Solaris Studio 12.2 or older because it's added in 12.3 https://docs.oracle.com/cd/E24457_01/html/E21987/gkeza.html. missing/stdbool.h: ditto. Modified files: trunk/internal.h trunk/missing/stdbool.h Index: missing/stdbool.h =================================================================== --- missing/stdbool.h (revision 66738) +++ missing/stdbool.h (revision 66739) @@ -5,16 +5,16 @@ https://github.com/ruby/ruby/blob/trunk/missing/stdbool.h#L5 #ifndef _MISSING_STDBOOL_H_ #define _MISSING_STDBOOL_H_ -#ifndef __cplusplus - -#define bool _Bool -#define true 1 -#define false 0 - -#ifndef HAVE__BOOL /* AC_HEADER_STDBOOL in configure.ac */ -typedef int _Bool; -#endif /* HAVE__BOOL */ - -#endif /* __cplusplus */ +#ifndef __bool_true_false_are_defined +# ifndef __cplusplus +# undef bool +# undef false +# undef true +# define bool signed char +# define false 0 +# define true 1 +# define __bool_true_false_are_defined 1 +# endif +#endif #endif /* _MISSING_STDBOOL_H_ */ Index: internal.h =================================================================== --- internal.h (revision 66738) +++ internal.h (revision 66739) @@ -23,18 +23,8 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/internal.h#L23 #ifdef HAVE_STDBOOL_H # include <stdbool.h> -#endif - -#ifndef __bool_true_false_are_defined -# ifndef __cplusplus -# undef bool -# undef false -# undef true -# define bool signed char -# define false 0 -# define true 1 -# define __bool_true_false_are_defined 1 -# endif +#else +# include "missing/stdbool.h" #endif /* The most significant bit of the lower part of half-long integer. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/