diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-22 13:45:23 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-10-22 13:45:23 +0000 |
| commit | 3939b6cde594089636fa7e33120d65f47f9096f0 (patch) | |
| tree | 43478f4e597cfa386fc9f9b9e0eac4f290f8ee7f | |
| parent | 2ba819c6e72beead3fc34858a360bb460751f163 (diff) | |
Dammit, the NEdit code update before 1.1.0 introduced "bool" back into
Fl_Text_*. Rather than breaking binary compatibility, add the necessary
configure check and code in config.h.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2682 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | CHANGES | 3 | ||||
| -rw-r--r-- | configh.in | 20 | ||||
| -rw-r--r-- | configure.in | 21 |
3 files changed, 40 insertions, 4 deletions
@@ -1,5 +1,8 @@ CHANGES IN FLTK 1.1.1 + - The Fl_Text_* widgets use the C++ bool type, which is + not supported by older C++ compilers. Added a + configure check and workaround code for this. - Fl_X::set_xid() didn't initialize the backbuffer_bad element that was used with XDBE. - Fl_Shared_Image::uncache() was not implemented. diff --git a/configh.in b/configh.in index a97666438..0abefa4a0 100644 --- a/configh.in +++ b/configh.in @@ -1,5 +1,5 @@ /* - * "$Id: configh.in,v 1.11.2.11.2.13 2002/08/05 17:50:21 easysw Exp $" + * "$Id: configh.in,v 1.11.2.11.2.14 2002/10/22 13:45:23 easysw Exp $" * * Configuration file for the Fast Light Tool Kit (FLTK). * @configure_input@ @@ -32,6 +32,22 @@ #define FLTK_DOCDIR "" /* + * Old C++ compilers don't support the bool type; unfortunately, it crept + * into FLTK 1.1.0 (Fl_Text_*) when we updated to the latest NEdit code, + * but we didn't notice it before 1.1.0 went out the door. Rather than + * break binary compatibility or do a 1.2.0 release for the sake of the + * few old C++ compilers that can't handle it, the following definitions + * allow older compilers to compile code using the bool type... + */ + +#undef HAVE_BOOL + +#if !defined(HAVE_BOOL) && defined(__cplusplus) +typedef char bool; +enum { false, true }; +#endif /* !HAVE_BOOL */ + +/* * BORDER_WIDTH: * * Thickness of FL_UP_BOX and FL_DOWN_BOX. Current 1,2, and 3 are @@ -220,5 +236,5 @@ /* - * End of "$Id: configh.in,v 1.11.2.11.2.13 2002/08/05 17:50:21 easysw Exp $". + * End of "$Id: configh.in,v 1.11.2.11.2.14 2002/10/22 13:45:23 easysw Exp $". */ diff --git a/configure.in b/configure.in index f5fa0e265..af66c7552 100644 --- a/configure.in +++ b/configure.in @@ -1,7 +1,7 @@ dnl -*- sh -*- dnl the "configure" script is made from this by running GNU "autoconf" dnl -dnl "$Id: configure.in,v 1.33.2.31.2.88 2002/10/07 13:19:21 easysw Exp $" +dnl "$Id: configure.in,v 1.33.2.31.2.89 2002/10/22 13:45:23 easysw Exp $" dnl dnl Configuration script for the Fast Light Tool Kit (FLTK). dnl @@ -278,6 +278,23 @@ else fi fi +dnl Does the C++ compiler support the bool type? +AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type, +ac_cv_cxx_bool, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([ +int f(int x){return 1;} +int f(char x){return 1;} +int f(bool x){return 1;} +],[bool b = true; return f(b);], + ac_cv_cxx_bool=yes, ac_cv_cxx_bool=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_bool" = yes; then + AC_DEFINE(HAVE_BOOL) +fi + dnl Standard headers and functions... AC_HEADER_DIRENT AC_CHECK_HEADER(sys/select.h,AC_DEFINE(HAVE_SYS_SELECT_H)) @@ -785,5 +802,5 @@ dnl Make sure the fltk-config script is executable... chmod +x fltk-config dnl -dnl End of "$Id: configure.in,v 1.33.2.31.2.88 2002/10/07 13:19:21 easysw Exp $". +dnl End of "$Id: configure.in,v 1.33.2.31.2.89 2002/10/22 13:45:23 easysw Exp $". dnl |
