# # patch "ChangeLog" # from [99f1fd4d460ecda9483aa96b27d223695adf3a11] # to [9ba7aad773842acad94aac42a42c214f60756423] # # patch "configure.ac" # from [22b889144948265a44054ed96ba229b8fcd81f11] # to [91aa8dc3693ec6a89a6fb6c0a3e9f987d493d1e4] # # patch "cryptopp/cryptlib.h" # from [c7e2f32a290e849763e76a31c0ae820209fc35ef] # to [b1ac5a1e75e3c5c6489ac767511180782dc20916] # # patch "netxx/osutil.h" # from [21397cd35453b20f7acbb8f1ba7a08b2678e641d] # to [410b3050e6da00aca1cbe528773bc33cb1465060] # --- ChangeLog +++ ChangeLog @@ -1,3 +1,13 @@ +2005-05-04 Matthew Gregan + + * configure.ac: Add TYPE_SOCKLEN_T function from the Autoconf + archive. + * cryptopp/cryptlib.h (NameValuePairs): Change GetVoidValue from a + pure virtual to an implemented (but never called) member function + to work around build problem with GCC 4 on OS X 10.4 + * netxx/osutil.h: Include config.h, use new HAVE_SOCKLEN_T define + to determine socklen_t type. + 2005-05-03 Nathaniel Smith * netsync.cc (load_epoch): Remove unused function. --- configure.ac +++ configure.ac @@ -365,6 +365,23 @@ AC_CHECK_MEMBERS([struct stat.st_ctimespec.tv_nsec, struct stat.st_mtimespec.tv_nsec]) AC_CHECK_MEMBERS([struct stat.st_ctimensec, struct stat.st_mtimensec]) +# Check type of socklen_t; int on Cygwin, OS X <= 10.3, Win32. TYPE_SOCKLEN_T +# function supplied by via http://autoconf-archive.cryp.to/ +AC_DEFUN([TYPE_SOCKLEN_T], +[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t, +[ + AC_TRY_COMPILE( + [#include + #include ], + [socklen_t len = 42; return 0;], + ac_cv_type_socklen_t=yes, + ac_cv_type_socklen_t=no) +]) + if test $ac_cv_type_socklen_t = yes; then + AC_DEFINE(HAVE_SOCKLEN_T, 1, [Define if platform has real socklen_t.]) + fi +]) +TYPE_SOCKLEN_T # Checks for library functions. AC_PROG_GCC_TRADITIONAL --- cryptopp/cryptlib.h +++ cryptopp/cryptlib.h @@ -300,7 +300,11 @@ } //! to be implemented by derived classes, users should use one of the above functions instead - CRYPTOPP_DLL virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const =0; + // nb: this used to be a pure virtual, but OS X 10.4's GCC 4 (4061) + // doesn't like it, so it has been changed to an always-fails + // implemented virtual as a workaround. + + CRYPTOPP_DLL virtual bool GetVoidValue(const char *name, const std::type_info &valueType, void *pValue) const { assert(false); return false; }; }; //! namespace containing value name definitions --- netxx/osutil.h +++ netxx/osutil.h @@ -76,20 +76,22 @@ # include #endif +#include "config.h" + namespace Netxx { typedef int error_type; error_type get_last_error (void); -#if defined(WIN32) || defined(__APPLE__) || defined (__CYGWIN__) - typedef int os_socklen_type; - typedef int* os_socklen_ptr_type; -# define get_socklen_ptr(x) reinterpret_cast(&x) -#else +#if defined(HAVE_SOCKLEN_T) typedef socklen_t os_socklen_type; typedef socklen_t* os_socklen_ptr_type; # define get_socklen_ptr(x) &x +#else + typedef int os_socklen_type; + typedef int* os_socklen_ptr_type; +# define get_socklen_ptr(x) reinterpret_cast(&x) #endif } // end Netxx namespace