remove tests for bool and {const,static,reinterpret}_cast in configure and wx/defs.h, all supported compilers have them
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
113
acinclude.m4
113
acinclude.m4
@@ -143,43 +143,6 @@ AC_DEFUN([WX_CPP_NEW_HEADERS],
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl WX_CPP_BOOL checks whether the C++ compiler has a built in bool type
|
||||
dnl
|
||||
dnl call WX_CPP_BOOL - will define HAVE_BOOL if the compiler supports bool
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([WX_CPP_BOOL],
|
||||
[
|
||||
AC_CACHE_CHECK([if C++ compiler supports bool], wx_cv_cpp_bool,
|
||||
[
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
|
||||
AC_TRY_COMPILE(
|
||||
[
|
||||
],
|
||||
[
|
||||
bool b = true;
|
||||
|
||||
return 0;
|
||||
],
|
||||
[
|
||||
wx_cv_cpp_bool=yes
|
||||
],
|
||||
[
|
||||
wx_cv_cpp_bool=no
|
||||
]
|
||||
)
|
||||
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
|
||||
if test "$wx_cv_cpp_bool" = "yes"; then
|
||||
AC_DEFINE(HAVE_BOOL)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl WX_CPP_EXPLICIT checks whether the C++ compiler support the explicit
|
||||
dnl keyword and defines HAVE_EXPLICIT if this is the case
|
||||
@@ -744,79 +707,3 @@ if test "$enable_largefile" != no; then
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl Available from the GNU Autoconf Macro Archive at:
|
||||
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_const_cast.html
|
||||
dnl
|
||||
AC_DEFUN([AC_CXX_CONST_CAST],
|
||||
[AC_CACHE_CHECK(whether the compiler supports const_cast<>,
|
||||
ac_cv_cxx_const_cast,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE(,[int x = 0;const int& y = x;int& z = const_cast<int&>(y);return z;],
|
||||
ac_cv_cxx_const_cast=yes, ac_cv_cxx_const_cast=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_const_cast" = yes; then
|
||||
AC_DEFINE(HAVE_CONST_CAST,,[define if the compiler supports const_cast<>])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_reinterpret_cast.html
|
||||
AC_DEFUN([AC_CXX_REINTERPRET_CAST],
|
||||
[AC_CACHE_CHECK(whether the compiler supports reinterpret_cast<>,
|
||||
ac_cv_cxx_reinterpret_cast,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([#include <typeinfo>
|
||||
class Base { public : Base () {} virtual void f () = 0;};
|
||||
class Derived : public Base { public : Derived () {} virtual void f () {} };
|
||||
class Unrelated { public : Unrelated () {} };
|
||||
int g (Unrelated&) { return 0; }],[
|
||||
Derived d;Base& b=d;Unrelated& e=reinterpret_cast<Unrelated&>(b);return g(e);],
|
||||
ac_cv_cxx_reinterpret_cast=yes, ac_cv_cxx_reinterpret_cast=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_reinterpret_cast" = yes; then
|
||||
AC_DEFINE(HAVE_REINTERPRET_CAST,,
|
||||
[define if the compiler supports reinterpret_cast<>])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl and http://www.gnu.org/software/ac-archive/htmldoc/ac_cxx_static_cast.html
|
||||
AC_DEFUN([AC_CXX_STATIC_CAST],
|
||||
[AC_CACHE_CHECK(whether the compiler supports static_cast<>,
|
||||
ac_cv_cxx_static_cast,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([#include <typeinfo>
|
||||
class Base { public : Base () {} virtual void f () = 0; };
|
||||
class Derived : public Base { public : Derived () {} virtual void f () {} };
|
||||
int g (Derived&) { return 0; }],[
|
||||
Derived d; Base& b = d; Derived& s = static_cast<Derived&> (b); return g (s);],
|
||||
ac_cv_cxx_static_cast=yes, ac_cv_cxx_static_cast=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_static_cast" = yes; then
|
||||
AC_DEFINE(HAVE_STATIC_CAST,, [define if the compiler supports static_cast<>])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl http://autoconf-archive.cryp.to/ac_cxx_dynamic_cast.html
|
||||
AC_DEFUN([AC_CXX_DYNAMIC_CAST],
|
||||
[AC_CACHE_CHECK(whether the compiler supports dynamic_cast<>,
|
||||
ac_cv_cxx_dynamic_cast,
|
||||
[AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
AC_TRY_COMPILE([#include <typeinfo>
|
||||
class Base { public : Base () {} virtual void f () = 0;};
|
||||
class Derived : public Base { public : Derived () {} virtual void f () {} };],[
|
||||
Derived d; Base& b=d; return dynamic_cast<Derived*>(&b) ? 0 : 1;],
|
||||
ac_cv_cxx_dynamic_cast=yes, ac_cv_cxx_dynamic_cast=no)
|
||||
AC_LANG_RESTORE
|
||||
])
|
||||
if test "$ac_cv_cxx_dynamic_cast" = yes; then
|
||||
AC_DEFINE(HAVE_DYNAMIC_CAST,,[define if the compiler supports dynamic_cast<>])
|
||||
fi
|
||||
])
|
||||
|
||||
|
309
configure
vendored
309
configure
vendored
@@ -23892,92 +23892,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
|
||||
{ echo "$as_me:$LINENO: checking if C++ compiler supports bool" >&5
|
||||
echo $ECHO_N "checking if C++ compiler supports bool... $ECHO_C" >&6; }
|
||||
if test "${wx_cv_cpp_bool+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
bool b = true;
|
||||
|
||||
return 0;
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_cxx_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; then
|
||||
|
||||
wx_cv_cpp_bool=yes
|
||||
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
|
||||
wx_cv_cpp_bool=no
|
||||
|
||||
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
fi
|
||||
{ echo "$as_me:$LINENO: result: $wx_cv_cpp_bool" >&5
|
||||
echo "${ECHO_T}$wx_cv_cpp_bool" >&6; }
|
||||
|
||||
if test "$wx_cv_cpp_bool" = "yes"; then
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_BOOL 1
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
{ echo "$as_me:$LINENO: checking if C++ compiler supports the explicit keyword" >&5
|
||||
echo $ECHO_N "checking if C++ compiler supports the explicit keyword... $ECHO_C" >&6; }
|
||||
if test "${wx_cv_explicit+set}" = set; then
|
||||
@@ -24107,229 +24021,6 @@ _ACEOF
|
||||
fi
|
||||
|
||||
|
||||
{ echo "$as_me:$LINENO: checking whether the compiler supports const_cast<>" >&5
|
||||
echo $ECHO_N "checking whether the compiler supports const_cast<>... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_cxx_const_cast+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int x = 0;const int& y = x;int& z = const_cast<int&>(y);return z;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_cxx_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; then
|
||||
ac_cv_cxx_const_cast=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_cxx_const_cast=no
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
fi
|
||||
{ echo "$as_me:$LINENO: result: $ac_cv_cxx_const_cast" >&5
|
||||
echo "${ECHO_T}$ac_cv_cxx_const_cast" >&6; }
|
||||
if test "$ac_cv_cxx_const_cast" = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_CONST_CAST
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
{ echo "$as_me:$LINENO: checking whether the compiler supports reinterpret_cast<>" >&5
|
||||
echo $ECHO_N "checking whether the compiler supports reinterpret_cast<>... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_cxx_reinterpret_cast+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <typeinfo>
|
||||
class Base { public : Base () {} virtual void f () = 0;};
|
||||
class Derived : public Base { public : Derived () {} virtual void f () {} };
|
||||
class Unrelated { public : Unrelated () {} };
|
||||
int g (Unrelated&) { return 0; }
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
Derived d;Base& b=d;Unrelated& e=reinterpret_cast<Unrelated&>(b);return g(e);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_cxx_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; then
|
||||
ac_cv_cxx_reinterpret_cast=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_cxx_reinterpret_cast=no
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
fi
|
||||
{ echo "$as_me:$LINENO: result: $ac_cv_cxx_reinterpret_cast" >&5
|
||||
echo "${ECHO_T}$ac_cv_cxx_reinterpret_cast" >&6; }
|
||||
if test "$ac_cv_cxx_reinterpret_cast" = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_REINTERPRET_CAST
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
{ echo "$as_me:$LINENO: checking whether the compiler supports static_cast<>" >&5
|
||||
echo $ECHO_N "checking whether the compiler supports static_cast<>... $ECHO_C" >&6; }
|
||||
if test "${ac_cv_cxx_static_cast+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
|
||||
ac_ext=cpp
|
||||
ac_cpp='$CXXCPP $CPPFLAGS'
|
||||
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
|
||||
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
#include <typeinfo>
|
||||
class Base { public : Base () {} virtual void f () = 0; };
|
||||
class Derived : public Base { public : Derived () {} virtual void f () {} };
|
||||
int g (Derived&) { return 0; }
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
Derived d; Base& b = d; Derived& s = static_cast<Derived&> (b); return g (s);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext
|
||||
if { (ac_try="$ac_compile"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
|
||||
(eval "$ac_compile") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_cxx_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest.$ac_objext; then
|
||||
ac_cv_cxx_static_cast=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_cxx_static_cast=no
|
||||
fi
|
||||
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
fi
|
||||
{ echo "$as_me:$LINENO: result: $ac_cv_cxx_static_cast" >&5
|
||||
echo "${ECHO_T}$ac_cv_cxx_static_cast" >&6; }
|
||||
if test "$ac_cv_cxx_static_cast" = yes; then
|
||||
|
||||
cat >>confdefs.h <<\_ACEOF
|
||||
#define HAVE_STATIC_CAST
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
|
||||
if test "x$SUNCXX" = xyes; then
|
||||
CXXFLAGS="-features=tmplife $CXXFLAGS"
|
||||
fi
|
||||
|
10
configure.in
10
configure.in
@@ -1742,19 +1742,9 @@ WX_C_BIGENDIAN
|
||||
dnl check for iostream (as opposed to iostream.h) standard header
|
||||
WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
|
||||
|
||||
dnl check whether C++ compiler supports bool built-in type
|
||||
WX_CPP_BOOL
|
||||
|
||||
dnl check whether C++ compiler supports explicit keyword
|
||||
WX_CPP_EXPLICIT
|
||||
|
||||
dnl check whether C++ compiler supports C++ casts
|
||||
AC_CXX_CONST_CAST
|
||||
AC_CXX_REINTERPRET_CAST
|
||||
AC_CXX_STATIC_CAST
|
||||
dnl we don't use HAVE_DYNAMIC_CAST anywhere right now...
|
||||
dnl AC_CXX_DYNAMIC_CAST
|
||||
|
||||
dnl With Sun CC, temporaries have block scope by default. This flag is needed
|
||||
dnl to get the expression scope behaviour that conforms to the standard.
|
||||
if test "x$SUNCXX" = xyes; then
|
||||
|
@@ -194,72 +194,6 @@
|
||||
/* check for native bool type and TRUE/FALSE constants */
|
||||
/* ---------------------------------------------------------------------------- */
|
||||
|
||||
/* Add more tests here for Windows compilers that already define bool */
|
||||
/* (under Unix, configure tests for this) */
|
||||
#ifndef HAVE_BOOL
|
||||
#if defined( __MWERKS__ )
|
||||
#if (__MWERKS__ >= 0x1000) && __option(bool)
|
||||
#define HAVE_BOOL
|
||||
#endif
|
||||
#elif defined(__APPLE__) && defined(__APPLE_CC__)
|
||||
/* Apple bundled gcc supports bool */
|
||||
#define HAVE_BOOL
|
||||
#elif defined(__VISUALC__) && (__VISUALC__ == 1020)
|
||||
/* in VC++ 4.2 the bool keyword is reserved (hence can't be typedefed) */
|
||||
/* but not implemented, so we must #define it */
|
||||
#define bool unsigned int
|
||||
#elif defined(__VISUALC__) && (__VISUALC__ == 1010)
|
||||
/* For VisualC++ 4.1, we need to define */
|
||||
/* bool as something between 4.0 & 5.0... */
|
||||
typedef unsigned int wxbool;
|
||||
#define bool wxbool
|
||||
#define HAVE_BOOL
|
||||
#elif defined(__VISUALC__) && (__VISUALC__ > 1020)
|
||||
/* VC++ supports bool since 4.2 */
|
||||
#define HAVE_BOOL
|
||||
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x500)
|
||||
/* Borland 5.0+ supports bool */
|
||||
#define HAVE_BOOL
|
||||
#elif wxCHECK_WATCOM_VERSION(1,0)
|
||||
/* Watcom 11+ supports bool */
|
||||
#define HAVE_BOOL
|
||||
#elif defined(__DIGITALMARS__)
|
||||
/* DigitalMars supports bool */
|
||||
#define HAVE_BOOL
|
||||
#elif defined(__GNUWIN32__) || defined(__MINGW32__) || defined(__CYGWIN__)
|
||||
/* Cygwin supports bool */
|
||||
#define HAVE_BOOL
|
||||
#elif defined(__VISAGECPP__)
|
||||
#if __IBMCPP__ < 400
|
||||
typedef unsigned long bool;
|
||||
#define true ((bool)1)
|
||||
#define false ((bool)0)
|
||||
#endif
|
||||
#define HAVE_BOOL
|
||||
#elif defined(__WXPALMOS__)
|
||||
/* Palm OS supports bool */
|
||||
#define HAVE_BOOL
|
||||
#endif /* compilers */
|
||||
#endif /* HAVE_BOOL */
|
||||
|
||||
#if !defined(__MWERKS__) || !defined(true)
|
||||
#if !defined(HAVE_BOOL) && !defined(bool) && !defined(VMS)
|
||||
/* NB: of course, this doesn't replace the standard type, because, for */
|
||||
/* example, overloading based on bool/int parameter doesn't work and */
|
||||
/* so should be avoided in portable programs */
|
||||
typedef unsigned int bool;
|
||||
#endif /* bool */
|
||||
|
||||
/* deal with TRUE/true stuff: we assume that if the compiler supports bool, it */
|
||||
/* supports true/false as well and that, OTOH, if it does _not_ support bool, */
|
||||
/* it doesn't support these keywords (this is less sure, in particular VC++ */
|
||||
/* 4.x could be a problem here) */
|
||||
#ifndef HAVE_BOOL
|
||||
#define true ((bool)1)
|
||||
#define false ((bool)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* for backwards compatibility, also define TRUE and FALSE */
|
||||
/* */
|
||||
/* note that these definitions should work both in C++ and C code, so don't */
|
||||
@@ -315,51 +249,10 @@ typedef short int WXTYPE;
|
||||
#define wxEXPLICIT
|
||||
#endif /* HAVE_EXPLICIT/!HAVE_EXPLICIT */
|
||||
|
||||
/* check for static/const_cast<>() (we don't use the other ones for now) */
|
||||
#ifndef HAVE_CXX_CASTS
|
||||
#if defined(__VISUALC__) && (__VISUALC__ >= 1100)
|
||||
/* VC++ 6.0 and 5.0 have C++ casts (what about earlier versions?) */
|
||||
#define HAVE_CXX_CASTS
|
||||
#elif defined(__MINGW32__) || defined(__CYGWIN32__)
|
||||
#if wxCHECK_GCC_VERSION(2, 95)
|
||||
/* GCC 2.95 has C++ casts, what about earlier versions? */
|
||||
#define HAVE_CXX_CASTS
|
||||
#endif
|
||||
#endif
|
||||
#endif /* !HAVE_CXX_CASTS */
|
||||
|
||||
#ifdef HAVE_CXX_CASTS
|
||||
#ifndef HAVE_CONST_CAST
|
||||
#define HAVE_CONST_CAST
|
||||
#endif
|
||||
#ifndef HAVE_REINTERPRET_CAST
|
||||
#define HAVE_REINTERPRET_CAST
|
||||
#endif
|
||||
#ifndef HAVE_STATIC_CAST
|
||||
#define HAVE_STATIC_CAST
|
||||
#endif
|
||||
#ifndef HAVE_DYNAMIC_CAST
|
||||
#define HAVE_DYNAMIC_CAST
|
||||
#endif
|
||||
#endif /* HAVE_CXX_CASTS */
|
||||
|
||||
#ifdef HAVE_STATIC_CAST
|
||||
/* these macros are obsolete, use the standard C++ casts directly now */
|
||||
#define wx_static_cast(t, x) static_cast<t>(x)
|
||||
#else
|
||||
#define wx_static_cast(t, x) ((t)(x))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONST_CAST
|
||||
#define wx_const_cast(t, x) const_cast<t>(x)
|
||||
#else
|
||||
#define wx_const_cast(t, x) ((t)(x))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_REINTERPRET_CAST
|
||||
#define wx_reinterpret_cast(t, x) reinterpret_cast<t>(x)
|
||||
#else
|
||||
#define wx_reinterpret_cast(t, x) ((t)(x))
|
||||
#endif
|
||||
|
||||
/*
|
||||
This one is a wx invention: like static cast but used when we intentionally
|
||||
|
@@ -23,11 +23,7 @@
|
||||
#define wx_USE_NANOX 0
|
||||
#define TARGET_CARBON 1
|
||||
|
||||
#define HAVE_BOOL 1
|
||||
#define HAVE_EXPLICIT 1
|
||||
#define HAVE_CONST_CAST
|
||||
#define HAVE_REINTERPRET_CAST
|
||||
#define HAVE_STATIC_CAST
|
||||
#define HAVE_VA_COPY 1
|
||||
#define HAVE_VARIADIC_MACROS 1
|
||||
#define HAVE_VISIBILITY 1
|
||||
|
@@ -609,11 +609,6 @@
|
||||
#define wxUSE_CRASHREPORT 1
|
||||
/* --- end MSW options --- */
|
||||
|
||||
/*
|
||||
* Supports bool type
|
||||
*/
|
||||
#define HAVE_BOOL 1
|
||||
|
||||
/*
|
||||
* Define if your compiler supports the explicit keyword
|
||||
*/
|
||||
|
@@ -186,14 +186,12 @@ public:
|
||||
long GetLong() const;
|
||||
|
||||
// bool
|
||||
#ifdef HAVE_BOOL
|
||||
wxVariant(bool val, const wxString& name = wxEmptyString);
|
||||
bool operator== (bool value) const;
|
||||
bool operator!= (bool value) const;
|
||||
void operator= (bool value) ;
|
||||
inline operator bool () const { return GetBool(); }
|
||||
bool GetBool() const ;
|
||||
#endif
|
||||
|
||||
// wxDateTime
|
||||
#if wxUSE_DATETIME
|
||||
|
@@ -517,8 +517,6 @@ double wxVariant::GetDouble() const
|
||||
// wxVariantBoolData
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
#ifdef HAVE_BOOL
|
||||
|
||||
class WXDLLIMPEXP_BASE wxVariantDataBool: public wxVariantData
|
||||
{
|
||||
public:
|
||||
@@ -654,8 +652,6 @@ bool wxVariant::GetBool() const
|
||||
}
|
||||
}
|
||||
|
||||
#endif // HAVE_BOOL
|
||||
|
||||
// -----------------------------------------------------------------
|
||||
// wxVariantDataChar
|
||||
// -----------------------------------------------------------------
|
||||
@@ -1728,10 +1724,8 @@ bool wxVariant::Convert(long* value) const
|
||||
*value = (long) (((wxVariantDoubleData*)GetData())->GetValue());
|
||||
else if (type == wxT("long"))
|
||||
*value = ((wxVariantDataLong*)GetData())->GetValue();
|
||||
#ifdef HAVE_BOOL
|
||||
else if (type == wxT("bool"))
|
||||
*value = (long) (((wxVariantDataBool*)GetData())->GetValue());
|
||||
#endif
|
||||
else if (type == wxT("string"))
|
||||
*value = wxAtol(((wxVariantDataString*)GetData())->GetValue());
|
||||
else
|
||||
@@ -1747,10 +1741,8 @@ bool wxVariant::Convert(bool* value) const
|
||||
*value = ((int) (((wxVariantDoubleData*)GetData())->GetValue()) != 0);
|
||||
else if (type == wxT("long"))
|
||||
*value = (((wxVariantDataLong*)GetData())->GetValue() != 0);
|
||||
#ifdef HAVE_BOOL
|
||||
else if (type == wxT("bool"))
|
||||
*value = ((wxVariantDataBool*)GetData())->GetValue();
|
||||
#endif
|
||||
else if (type == wxT("string"))
|
||||
{
|
||||
wxString val(((wxVariantDataString*)GetData())->GetValue());
|
||||
@@ -1775,10 +1767,8 @@ bool wxVariant::Convert(double* value) const
|
||||
*value = ((wxVariantDoubleData*)GetData())->GetValue();
|
||||
else if (type == wxT("long"))
|
||||
*value = (double) (((wxVariantDataLong*)GetData())->GetValue());
|
||||
#ifdef HAVE_BOOL
|
||||
else if (type == wxT("bool"))
|
||||
*value = (double) (((wxVariantDataBool*)GetData())->GetValue());
|
||||
#endif
|
||||
else if (type == wxT("string"))
|
||||
*value = (double) wxAtof(((wxVariantDataString*)GetData())->GetValue());
|
||||
else
|
||||
@@ -1794,10 +1784,8 @@ bool wxVariant::Convert(wxUniChar* value) const
|
||||
*value = ((wxVariantDataChar*)GetData())->GetValue();
|
||||
else if (type == wxT("long"))
|
||||
*value = (char) (((wxVariantDataLong*)GetData())->GetValue());
|
||||
#ifdef HAVE_BOOL
|
||||
else if (type == wxT("bool"))
|
||||
*value = (char) (((wxVariantDataBool*)GetData())->GetValue());
|
||||
#endif
|
||||
else
|
||||
return false;
|
||||
|
||||
|
Reference in New Issue
Block a user