# # add_file "m4/typeof.m4" # # patch "ChangeLog" # from [fba138269296f377255814d47fb34988be3b0876] # to [233887d0a5c095f89bf692f7ac4ae9eac11ee31f] # # patch "configure.ac" # from [4cd637ba337c35746c0e0ff4716cf00d5e669dbd] # to [25dbc7b10cf740f084a4c1e5b29b4cf3ae11e3e6] # # patch "m4/typeof.m4" # from [] # to [c5cdfe761ac76df6989d142f21ebc6bd300850eb] # # patch "sanity.hh" # from [d20631b056fb0bb0005451bcc4fdd775a9d17388] # to [cb85ef0c3537ccd48478de3c93975cfeb8ebe518] # ======================================================================== --- ChangeLog fba138269296f377255814d47fb34988be3b0876 +++ ChangeLog 233887d0a5c095f89bf692f7ac4ae9eac11ee31f @@ -1,5 +1,13 @@ 2005-08-15 Patrick Mauritz + * m4/typeof.m4: new test, looks if compiler knows the typeof() + extension + * configure.ac: use it + * sanity.hh: use the test, and boost's abstraction over + __PRETTY_FUNCTION__ and similar pseudo-macros + +2005-08-15 Patrick Mauritz + * configure.ac (BOOST_FIX_VERSION): only apply that fix on gcc. 2005-08-14 Nathaniel Smith ======================================================================== --- configure.ac 4cd637ba337c35746c0e0ff4716cf00d5e669dbd +++ configure.ac 25dbc7b10cf740f084a4c1e5b29b4cf3ae11e3e6 @@ -28,6 +28,7 @@ AC_LANG(C++) AC_PROG_CXX_WARNINGS +AC_CXX_TYPEOF AC_CXX_GNUCXX_HASHMAP AC_CXX_STLPORT_HASHMAP ======================================================================== --- m4/typeof.m4 +++ m4/typeof.m4 c5cdfe761ac76df6989d142f21ebc6bd300850eb @@ -0,0 +1,23 @@ +dnl @synopsis AC_CXX_GNUCXX_HASHMAP +dnl +dnl tests for the presence of the gcc hashmap stl extension +dnl +dnl @author Patrick Mauritz +dnl @version 2005-08-15 +dnl @license AllPermissive + +AC_DEFUN([AC_CXX_TYPEOF],[ +AC_CACHE_CHECK(whether the compiler supports typeof, +ac_cv_cxx_typeof, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([int x; typeof (x) y[6];], + [], + ac_cv_cxx_typeof=yes, ac_cv_cxx_typeof=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_cxx_typeof" = yes; then + AC_DEFINE(HAVE_TYPEOF,,[define if the compiler supports typeof]) +fi +]) + ======================================================================== --- sanity.hh d20631b056fb0bb0005451bcc4fdd775a9d17388 +++ sanity.hh cb85ef0c3537ccd48478de3c93975cfeb8ebe518 @@ -13,6 +13,7 @@ #include "boost/format.hpp" #include "boost/circular_buffer.hpp" +#include "boost/current_function.hpp" #include // Required for ENABLE_NLS #include "gettext.h" @@ -243,9 +244,9 @@ // them.) However, while fake_M does nothing directly, it doesn't pass its // line argument to ##; therefore, its line argument is fully expanded before // being passed to real_M. -#ifdef __GNUC__ +#ifdef HAVE_TYPEOF // even worse, this is g++ only! -#define real_M(obj, line) Musing this_is_a_musing_fnord_object_ ## line (obj, #obj, __FILE__, __LINE__, __PRETTY_FUNCTION__) +#define real_M(obj, line) Musing this_is_a_musing_fnord_object_ ## line (obj, #obj, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION) #define fake_M(obj, line) real_M(obj, line) #define MM(obj) fake_M(obj, __LINE__) #else