[Freeciv-Dev] Re: (PR#2461) bool type already exists
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Tue, 2002-12-03 at 03:25, Jason Short via RT wrote:
> On Tue, 2002-12-03 at 02:47, Raimar Falke via RT wrote:
> > On Mon, Dec 02, 2002 at 10:37:47PM -0800, Jason Short via RT wrote:
> > >
> > > [rfalke - Mon Dec 2 18:37:07 2002]:
> > >
> > > > Changes of the new patch are listed above.
> > >
> > > Raimar's most recent patch looks good, except configure.ac support is
> > > also needed.
> >
> > Mhhh last time I changed it was broken. I just can't test the
> > configure.ac change here.
>
> The configure.ac change should be the same. The attached patch works
> for me.
Erm, yeah.
jason
Index: configure.ac
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.ac,v
retrieving revision 1.27
diff -u -r1.27 configure.ac
--- configure.ac 2002/11/30 20:42:01 1.27
+++ configure.ac 2002/12/03 08:15:36
@@ -553,7 +553,8 @@
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h)
+AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h \
+ stdbool.h)
dnl Avoid including the unix emulation layer if we build mingw executables
dnl There would be type conflicts between winsock and bsd/unix includes
if test "x$MINGW32" != "xyes"; then
Index: configure.in
===================================================================
RCS file: /home/freeciv/CVS/freeciv/configure.in,v
retrieving revision 1.205
diff -u -r1.205 configure.in
--- configure.in 2002/11/30 20:42:01 1.205
+++ configure.in 2002/12/03 08:15:36
@@ -547,7 +547,8 @@
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h)
+AC_CHECK_HEADERS(fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h \
+ stdbool.h)
dnl Avoid including the unix emulation layer if we build mingw executables
dnl There would be type conflicts between winsock and bsd/unix includes
if test "x$MINGW32" != "xyes"; then
Index: common/shared.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/shared.h,v
retrieving revision 1.106
diff -u -r1.106 shared.h
--- common/shared.h 2002/11/21 13:35:31 1.106
+++ common/shared.h 2002/12/03 08:15:37
@@ -15,6 +15,24 @@
#include <stdlib.h> /* size_t */
+#if __BEOS__
+# include <posix/be_prim.h>
+# define __bool_true_false_are_defined 1
+#else
+# ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+# else /* Implement <stdbool.h> ourselves */
+# undef bool
+# undef true
+# undef false
+# undef __bool_true_false_are_defined
+# define bool fc_bool
+# define true 1
+# define false 0
+# define __bool_true_false_are_defined 1
+typedef unsigned int fc_bool;
+# endif /* ! HAVE_STDBOOL_H */
+#endif /* ! __BEOS__ */
/* Want to use GCC's __attribute__ keyword to check variadic
* parameters to printf-like functions, without upsetting other
@@ -47,14 +65,16 @@
another unreachable condition. */
#define FC_INFINITY (1000 * 1000 * 1000)
-#ifndef TRUE
-#define TRUE (1)
+#ifdef TRUE
+# undef TRUE
#endif
-#ifndef FALSE
-#define FALSE (0)
+
+#ifdef FALSE
+# undef FALSE
#endif
-typedef int bool;
+#define TRUE true
+#define FALSE false
#ifndef MAX
#define MAX(x,y) (((x)>(y))?(x):(y))
[Freeciv-Dev] (PR#2461) bool type already exists, Jason Short via RT, 2002/12/09
|
|