diff --git a/CHANGES b/CHANGES index 27c1f8d..f65203e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,4 @@ - security: (CVE Id pending) Fixed problems with signal handling caused by use of not async signal @@ -104,6 +103,10 @@ porting: Joachim Fenkes provided an new adapted spec file. + Type bool and macros Min and Max are defined by socat which led to + compile errors when they were already provided by build framework. + Thanks to Liyu Liu for providing a patch. + testing: Do not distribute testcert.conf with socat source but generate it (and new testcert6.conf) during test.sh run. diff --git a/config.h.in b/config.h.in index 47a408e..3ed5bff 100644 --- a/config.h.in +++ b/config.h.in @@ -452,6 +452,9 @@ /* is sig_atomic_t declared */ #undef HAVE_TYPE_SIG_ATOMIC_T +/* is bool already typedef'd? */ +#undef HAVE_TYPE_BOOL + /* is socklen_t already typedef'd? */ #undef HAVE_TYPE_SOCKLEN diff --git a/configure.in b/configure.in index 76ee9fb..52d0293 100644 --- a/configure.in +++ b/configure.in @@ -766,6 +766,16 @@ AC_MSG_RESULT($sc_cv_type_longlong) AC_CHECK_TYPE(sig_atomic_t,AC_DEFINE(HAVE_TYPE_SIG_ATOMIC_T),,[#include "sysincludes.h"]) +AC_MSG_CHECKING(for bool) +AC_CACHE_VAL(sc_cv_type_bool, +[AC_TRY_COMPILE([],[bool b;], +[sc_cv_type_bool=yes], +[sc_cv_type_bool=no])]) +if test $sc_cv_type_bool = yes; then + AC_DEFINE(HAVE_TYPE_BOOL) +fi +AC_MSG_RESULT($sc_cv_type_bool) + # following builtin macro does not check unistd.h and sys/socket.h where # socklen_t might be defined #AC_CHECK_TYPE(socklen_t, int) diff --git a/mytypes.h b/mytypes.h index f625314..23193d5 100644 --- a/mytypes.h +++ b/mytypes.h @@ -1,5 +1,5 @@ /* source: mytypes.h */ -/* Copyright Gerhard Rieger 2001-2006 */ +/* Copyright Gerhard Rieger */ /* Published under the GNU General Public License V.2, see file COPYING */ #ifndef __mytypes_h_included @@ -7,10 +7,18 @@ /* some types and macros I miss in C89 */ +#ifndef HAVE_TYPE_BOOL +# undef bool typedef enum { false, true } bool; +#endif +#ifndef Min #define Min(x,y) ((x)<=(y)?(x):(y)) +#endif + +#ifndef Max #define Max(x,y) ((x)>=(y)?(x):(y)) +#endif #define SOCKADDR_MAX UNIX_PATH_MAX