diff options
author | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-08-06 15:52:11 +0000 |
---|---|---|
committer | jtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2004-08-06 15:52:11 +0000 |
commit | 307f31c35f8f921cee6cae6aa5c3d0c8e9d9902f (patch) | |
tree | 4454506c819eec4311b5d502095c978a2c5c4079 | |
parent | 29ed7a3a44ce2ccd04250fc1097f11fb80ba46c9 (diff) | |
download | ATCD-307f31c35f8f921cee6cae6aa5c3d0c8e9d9902f.tar.gz |
ChangeLogTag: Fri Aug 6 08:17:23 2004 J.T. Conklin <jtc@acorntoolworks.com>
32 files changed, 309 insertions, 203 deletions
diff --git a/ChangeLog b/ChangeLog index 9e29ad6f684..9b54f7488f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,69 @@ +Fri Aug 6 08:17:23 2004 J.T. Conklin <jtc@acorntoolworks.com> + + * m4/ace.m4: + Split new ACE_WITH_RMCAST, ACE_WITH_QOS, and ACE_WITH_SSL macros + out of ACE_CONFIGURATION_OPTIONS so they can be used with other + packages. + + * ace/OS_NS_sys_uio.cpp: + * ace/OS_NS_sys_uio.h: + * ace/OS_NS_sys_uio.inl: + Changed ACE_OS::readv_emulation() and ACE_OS::writev_emulation() + to use const iovec * instead of type of system iovec parameter. + Changed ACE_OS::readv() to cast const qualification of iovec + parameter away if ACE_HAS_NONCONST_READV. + Changed ACE_OS::writev() to cast const qualifiaction of iovec + parameter away if ACE_HAS_NONCONST_WRITEV. + * ace/os_include/os_uio.h: + Removed ACE_READV_TYPE type definition. + Removed ACE_WRITEV_TYPE type definition. + Changed readv_timedwait and writev_timedwait definitions to + use const iovec *'s for iovec parameter. + + * ace/OS_sys_socket.inl: + Cast const qualifiaction away if ACE_HAS_NONCONST_SENDMSG. + * ace/os_include/sys/os_socket.h: + Removed ACE_SENDMSG_TYPE type definition. + + * ace/OS_sys_resource.h: + * ace/OS_sys_resource.inl: + Changed ACE_OS::setrlimit() to use const struct rlimit* + instead of type of system rlimit parameter. Cast const + qualification away if ACE_HAS_NONCONST_SETRLIMIT. + * ace/os_include/sys/os_resource.h: + Removed ACE_SETRLIMIT_TYPE type definition. + + * ace/config-chorus.h: + * ace/config-linux-common.h: + * ace/config-lynxos.h: + * ace/config-m88k.h: + * ace/config-osf1-3.2.h: + * ace/config-osf1-4.0.h: + * ace/config-psos-diab-mips.h: + * ace/config-psos-diab-ppc.h: + * ace/config-psos-diab.h: + * ace/config-psos-tm.h: + * ace/config-psosim-g++.h + * ace/config-rtems.h: + * ace/config-sunos5.4-centerline-2.x.h: + * ace/config-sunos5.4-g++.h: + * ace/config-sunos5.4-sunc++-4.x.h: + * ace/config-tandem-nsk-mips-v2.h: + * ace/config-tandem.h: + * ace/config-vxworks5.x.h: + * configure.ac: + * m4/config_h.m4: + Rename ACE_HAS_BROKEN_SETRLIMIT, ACE_HAS_BROKEN_SENDMSG, + ACE_HAS_BROKEN_READV, and ACE_HAS_BROKEN_WRITEV to + ACE_HAS_NONCONST_SETRLIMIT, ACE_HAS_NONCONST_SENDMSG, + ACE_HAS_NONCONST_READV, and ACE_HAS_NONCONST_WRITEV to + be more descriptive of what's really broken. + + * bin/MakeProjectCreator/config/ec_used_typed_events.mpb: + Changed to inherit from dynamicinterface and ifr_client instead + of providing libs and after statements so that dependency chain + is complete. + Fri Aug 6 10:26:20 2004 Jeff Parsons <j.parsons@vanderbilt.edu> * ace/OS_NS_string.h: diff --git a/ace/OS_NS_sys_resource.h b/ace/OS_NS_sys_resource.h index 7841f7d9c52..7486dd2a1c7 100644 --- a/ace/OS_NS_sys_resource.h +++ b/ace/OS_NS_sys_resource.h @@ -46,7 +46,7 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION int setrlimit (int resource, - ACE_SETRLIMIT_TYPE *rl); + const struct rlimit *rl); } /* namespace ACE_OS */ diff --git a/ace/OS_NS_sys_resource.inl b/ace/OS_NS_sys_resource.inl index fbc5ce8e3a0..393673848b7 100644 --- a/ace/OS_NS_sys_resource.inl +++ b/ace/OS_NS_sys_resource.inl @@ -59,7 +59,7 @@ ACE_OS::getrusage (int who, struct rusage *ru) } ACE_INLINE int -ACE_OS::setrlimit (int resource, ACE_SETRLIMIT_TYPE *rl) +ACE_OS::setrlimit (int resource, const struct rlimit *rl) { ACE_OS_TRACE ("ACE_OS::setrlimit"); @@ -69,11 +69,18 @@ ACE_OS::setrlimit (int resource, ACE_SETRLIMIT_TYPE *rl) ACE_NOTSUP_RETURN (-1); #else + ACE_OSCALL_RETURN (::setrlimit ( # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM) - ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, rl), int, -1); + (ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, # else - ACE_OSCALL_RETURN (::setrlimit (resource, rl), int, -1); + resource, # endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ +# if defined (ACE_HAS_NONCONST_SETRLIMIT) + const_cast<struct rlimit *>(rl) +# else + rl +# endif /* ACE_HAS_NONCONST_SETRLIMIT */ + ), int, -1); #endif /* ACE_LACKS_RLIMIT */ } diff --git a/ace/OS_NS_sys_socket.inl b/ace/OS_NS_sys_socket.inl index 59930fb6319..3d3f9fbd199 100644 --- a/ace/OS_NS_sys_socket.inl +++ b/ace/OS_NS_sys_socket.inl @@ -531,11 +531,13 @@ ACE_OS::sendmsg (ACE_HANDLE handle, } else return (ssize_t) bytes_sent; -# elif defined (ACE_PSOS) - ACE_SOCKCALL_RETURN (::sendmsg (handle, (struct msghdr *) msg, flags), int, -1); +# elif defined (ACE_HAS_NONCONST_SENDMSG) + ACE_SOCKCALL_RETURN (::sendmsg (handle, + const_cast<struct msghdr *>(msg), + flags), int, -1); # else - ACE_SOCKCALL_RETURN (::sendmsg (handle, (ACE_SENDMSG_TYPE *) msg, flags), int, -1); -# endif /* ACE_PSOS */ + ACE_SOCKCALL_RETURN (::sendmsg (handle, msg, flags), int, -1); +# endif #else ACE_UNUSED_ARG (flags); ACE_UNUSED_ARG (msg); diff --git a/ace/OS_NS_sys_uio.cpp b/ace/OS_NS_sys_uio.cpp index 5936e84eaec..7c52d91bab7 100644 --- a/ace/OS_NS_sys_uio.cpp +++ b/ace/OS_NS_sys_uio.cpp @@ -20,7 +20,7 @@ ACE_RCSID(ace, OS_NS_sys_uio, "$Id$") ssize_t ACE_OS::readv_emulation (ACE_HANDLE handle, - ACE_READV_TYPE *iov, + const iovec *iov, int n) { ACE_OS_TRACE ("ACE_OS::readv_emulation"); @@ -81,7 +81,7 @@ ACE_OS::readv_emulation (ACE_HANDLE handle, // thread-safe. ssize_t -ACE_OS::writev_emulation (ACE_HANDLE handle, ACE_WRITEV_TYPE iov[], int n) +ACE_OS::writev_emulation (ACE_HANDLE handle, const iovec *iov, int n) { ACE_OS_TRACE ("ACE_OS::writev_emulation"); diff --git a/ace/OS_NS_sys_uio.h b/ace/OS_NS_sys_uio.h index 0450563f5f1..2978b95501f 100644 --- a/ace/OS_NS_sys_uio.h +++ b/ace/OS_NS_sys_uio.h @@ -37,13 +37,13 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION ssize_t readv (ACE_HANDLE handle, - iovec *iov, + const iovec *iov, int iovlen); #if defined (ACE_LACKS_READV) extern ACE_Export ssize_t readv_emulation (ACE_HANDLE handle, - ACE_READV_TYPE *iov, + const iovec *iov, int iovcnt); #endif /* ACE_LACKS_READV */ @@ -57,7 +57,7 @@ namespace ACE_OS { #if defined (ACE_LACKS_WRITEV) extern ACE_Export ssize_t writev_emulation (ACE_HANDLE handle, - ACE_WRITEV_TYPE *iov, + const iovec *iov, int iovcnt); #endif /* ACE_LACKS_WRITEV */ diff --git a/ace/OS_NS_sys_uio.inl b/ace/OS_NS_sys_uio.inl index 2b944d4684b..c216e9d0a8f 100644 --- a/ace/OS_NS_sys_uio.inl +++ b/ace/OS_NS_sys_uio.inl @@ -6,7 +6,7 @@ ACE_INLINE ssize_t ACE_OS::readv (ACE_HANDLE handle, - iovec *iov, + const iovec *iov, int iovlen) { ACE_OS_TRACE ("ACE_OS::readv"); @@ -15,7 +15,15 @@ ACE_OS::readv (ACE_HANDLE handle, ssize_t, -1); #else /* ACE_LACKS_READV */ - ACE_OSCALL_RETURN (::readv (handle, iov, iovlen), ssize_t, -1); +#if defined (ACE_HAS_NONCONST_READV) + ACE_OSCALL_RETURN (::readv (handle, + const_cast<iovec *>(iov), + iovlen), ssize_t, -1); +#else + ACE_OSCALL_RETURN (::readv (handle, + iov, + iovlen), ssize_t, -1); +#endif /* ACE_HAS_NONCONST_READV */ #endif /* ACE_LACKS_READV */ } @@ -27,11 +35,17 @@ ACE_OS::writev (ACE_HANDLE handle, ACE_OS_TRACE ("ACE_OS::writev"); #if defined (ACE_LACKS_WRITEV) ACE_OSCALL_RETURN (ACE_OS::writev_emulation (handle, - (ACE_WRITEV_TYPE *) iov, + iov, iovcnt), ssize_t, -1); #else /* ACE_LACKS_WRITEV */ +#if defined (ACE_HAS_NONCONST_WRITEV) ACE_OSCALL_RETURN (::writev (handle, - (ACE_WRITEV_TYPE *) iov, + const_cast<iovec *>(iov), iovcnt), ssize_t, -1); +#else + ACE_OSCALL_RETURN (::writev (handle, + iov, + iovcnt), ssize_t, -1); +#endif /* ACE_HAS_NONCONST_WRITEV */ #endif /* ACE_LACKS_WRITEV */ } diff --git a/ace/README b/ace/README index 28b08493a1b..9435bce3068 100644 --- a/ace/README +++ b/ace/README @@ -243,14 +243,6 @@ ACE_HAS_BROKEN_POSIX_TIME Platform defines struct ACE_HAS_BROKEN_RANDR OS/compiler's header files are inconsistent with libC definition of rand_r(). -ACE_HAS_BROKEN_READV() OS/Compiler's header files are - not consistent with readv() - definition. -ACE_HAS_BROKEN_SENDMSG OS/compiler omits the const - from the sendmsg() prototype. -ACE_HAS_BROKEN_SETRLIMIT OS/compiler omits the const - from the rlimit parameter in - the setrlimit() prototype. ACE_HAS_BROKEN_T_ERROR Compiler/platform has the wrong prototype for t_error(), i.e., t_error(char *) rather than @@ -261,9 +253,6 @@ ACE_HAS_BROKEN_TIMESPEC_MEMBERS platform define struct tv_nsec. This is highly non-portable. Currently only FreeBSD 2.1.x uses it. -ACE_HAS_BROKEN_WRITEV OS/compiler omits the const - from the iovec parameter in - the writev() prototype. ACE_HAS_BSTRING Platform has <bstring.h> (which contains bzero() prototype) @@ -404,11 +393,21 @@ ACE_HAS_NONCONST_GETBY Platform uses non-const char * ACE_HAS_NONCONST_MSGSND Platform has a non-const parameter to msgsend() (e.g., SCO). +ACE_HAS_NONCONST_READV Platform omits const qualifier from + iovec parameter in readv() prototype. ACE_HAS_NONCONST_SELECT_TIMEVAL Platform's select() uses non-const timeval* (only found on Linux right now) +ACE_HAS_NONCONST_SENDMSG Platform omits const qualifier + from msghdr parameter in sendmsg() + prototype. +ACE_HAS_NONCONST_SETRLIMIT Platform omits const qualifier + from rlimit parameter in setrlimit() + prototype. ACE_HAS_NONCONST_SWAB Platform's swab function has non const src argument +ACE_HAS_NONCONST_WRITEV Platform omits const qualifier from + iovec parameter in writev() prototype. ACE_HAS_OLD_MALLOC Compiler/platform uses old malloc()/free() prototypes (ugh) @@ -1641,20 +1640,20 @@ ACE_QTREACTOR_CLEAR_PENDING_EVENTS: ---------------------------- Used in: ace/QtReactor.cpp: - QtReactor by default does not clear qt events pending for - activated socket. Clearing costs much, at least 2 hash accesses - in ACE, and 2 another in Qt. It is also better to not clear - pending events as some side effects are unknown. However, - when events are not clear, then some user applications may be - confused by handle_input/output/exception called without any - data eg. in ACE_Acceptor::make_svc_handler. This swithc is - intended to quickly fix user application which does not + QtReactor by default does not clear qt events pending for + activated socket. Clearing costs much, at least 2 hash accesses + in ACE, and 2 another in Qt. It is also better to not clear + pending events as some side effects are unknown. However, + when events are not clear, then some user applications may be + confused by handle_input/output/exception called without any + data eg. in ACE_Acceptor::make_svc_handler. This swithc is + intended to quickly fix user application which does not follow some reactor rules. Linux: - It seems linux::qt does not queue pending events. Do not define + It seems linux::qt does not queue pending events. Do not define this switch. Windows: - Windows::qt queues pending events. If user application has handle_* - methods which cannot be called without data, then turn on this switch - to quickly fix the bug. However, one should seriously fix the + Windows::qt queues pending events. If user application has handle_* + methods which cannot be called without data, then turn on this switch + to quickly fix the bug. However, one should seriously fix the application then. diff --git a/ace/config-chorus.h b/ace/config-chorus.h index 99a2e580869..1f0b43974bb 100644 --- a/ace/config-chorus.h +++ b/ace/config-chorus.h @@ -71,7 +71,7 @@ # define ACE_LACKS_LONGLONG_T #endif -#define ACE_HAS_BROKEN_READV +#define ACE_HAS_NONCONST_READV #define ACE_HAS_CLOCK_GETTIME #define ACE_HAS_CPLUSPLUS_HEADERS #define ACE_HAS_DIRENT diff --git a/ace/config-linux-common.h b/ace/config-linux-common.h index 915b26d60ef..dca17fcdf2a 100644 --- a/ace/config-linux-common.h +++ b/ace/config-linux-common.h @@ -49,7 +49,7 @@ // Then glibc/libc5 specific parts #if defined(__GLIBC__) -# define ACE_HAS_BROKEN_SETRLIMIT +# define ACE_HAS_NONCONST_SETRLIMIT # define ACE_HAS_RUSAGE_WHO_ENUM enum __rusage_who # define ACE_HAS_RLIMIT_RESOURCE_ENUM enum __rlimit_resource # define ACE_HAS_SOCKLEN_T diff --git a/ace/config-lynxos.h b/ace/config-lynxos.h index 1e2f6f34a10..710ab6521fc 100644 --- a/ace/config-lynxos.h +++ b/ace/config-lynxos.h @@ -67,9 +67,9 @@ #define ACE_HAS_ALLOCA #define ACE_HAS_ALLOCA_H #define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_BROKEN_READV -#define ACE_HAS_BROKEN_SETRLIMIT -#define ACE_HAS_BROKEN_WRITEV +#define ACE_HAS_NONCONST_READV +#define ACE_HAS_NONCONST_SETRLIMIT +#define ACE_HAS_NONCONST_WRITEV #define ACE_HAS_CLOCK_GETTIME #define ACE_HAS_CPLUSPLUS_HEADERS #define ACE_HAS_DIRENT diff --git a/ace/config-m88k.h b/ace/config-m88k.h index 699e9e3f4d6..d089331a253 100644 --- a/ace/config-m88k.h +++ b/ace/config-m88k.h @@ -69,7 +69,7 @@ struct ip_mreq #define ACE_HAS_SYSV_IPC // Sun has the wrong prototype for sendmsg. -#define ACE_HAS_BROKEN_SENDMSG +#define ACE_HAS_NONCONST_SENDMSG // The SunOS 5.x version of rand_r is inconsistent with the header files... #define ACE_HAS_BROKEN_RANDR diff --git a/ace/config-osf1-3.2.h b/ace/config-osf1-3.2.h index 4fe6d10fb79..83edfa0f9af 100644 --- a/ace/config-osf1-3.2.h +++ b/ace/config-osf1-3.2.h @@ -61,13 +61,13 @@ extern "C" pid_t getpgid (pid_t); #define ACE_HAS_LONG_MAP_FAILED // Platform's implementation of sendmsg() has a non-const msgheader parameter. -#define ACE_HAS_BROKEN_SENDMSG +#define ACE_HAS_NONCONST_SENDMSG // Platform's implementation of writev() has a non-const iovec parameter. -#define ACE_HAS_BROKEN_WRITEV +#define ACE_HAS_NONCONST_WRITEV // Platform's implementation of setlrmit() has a non-const rlimit parameter. -#define ACE_HAS_BROKEN_SETRLIMIT +#define ACE_HAS_NONCONST_SETRLIMIT // Platform supports System V IPC (most versions of UNIX, but not Win32) #define ACE_HAS_SYSV_IPC diff --git a/ace/config-osf1-4.0.h b/ace/config-osf1-4.0.h index a070449e84c..c08fd3943a7 100644 --- a/ace/config-osf1-4.0.h +++ b/ace/config-osf1-4.0.h @@ -123,9 +123,9 @@ #define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) #define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_BROKEN_SETRLIMIT +#define ACE_HAS_NONCONST_SETRLIMIT #define ACE_HAS_BROKEN_T_ERROR -#define ACE_HAS_BROKEN_WRITEV +#define ACE_HAS_NONCONST_WRITEV #define ACE_HAS_CLOCK_GETTIME #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES #define ACE_HAS_CPLUSPLUS_HEADERS @@ -178,7 +178,7 @@ // approporiate ordering of the include files. The Platinum release // now temporarily supports both forms. Platform's implementation of // sendmsg() has a non-const msgheader parameter. -#define ACE_HAS_BROKEN_SENDMSG +#define ACE_HAS_NONCONST_SENDMSG #define ACE_HAS_IDTYPE_T #include /**/ "ace/post.h" diff --git a/ace/config-psos-diab-mips.h b/ace/config-psos-diab-mips.h index cf9a689f2e5..515fa25701f 100644 --- a/ace/config-psos-diab-mips.h +++ b/ace/config-psos-diab-mips.h @@ -119,9 +119,9 @@ #define ACE_LACKS_PTHREAD_THR_SIGSETMASK -/* #define ACE_HAS_BROKEN_SENDMSG */ +/* #define ACE_HAS_NONCONST_SENDMSG */ -/* #define ACE_HAS_BROKEN_WRITEV */ +/* #define ACE_HAS_NONCONST_WRITEV */ #define ACE_HAS_BROKEN_CONVERSIONS diff --git a/ace/config-psos-diab-ppc.h b/ace/config-psos-diab-ppc.h index 98dd63db07e..277927ae69a 100644 --- a/ace/config-psos-diab-ppc.h +++ b/ace/config-psos-diab-ppc.h @@ -132,9 +132,9 @@ #define ACE_LACKS_PTHREAD_THR_SIGSETMASK -/* #define ACE_HAS_BROKEN_SENDMSG */ +/* #define ACE_HAS_NONCONST_SENDMSG */ -/* #define ACE_HAS_BROKEN_WRITEV */ +/* #define ACE_HAS_NONCONST_WRITEV */ #define ACE_HAS_BROKEN_CONVERSIONS diff --git a/ace/config-psos-diab.h b/ace/config-psos-diab.h index 857647ebd2b..c1cef9c6418 100644 --- a/ace/config-psos-diab.h +++ b/ace/config-psos-diab.h @@ -117,9 +117,9 @@ #define ACE_LACKS_PTHREAD_THR_SIGSETMASK -/* #define ACE_HAS_BROKEN_SENDMSG */ +/* #define ACE_HAS_NONCONST_SENDMSG */ -/* #define ACE_HAS_BROKEN_WRITEV */ +/* #define ACE_HAS_NONCONST_WRITEV */ #define ACE_HAS_BROKEN_CONVERSIONS diff --git a/ace/config-psos-tm.h b/ace/config-psos-tm.h index 50696703dbe..a82310cdbcf 100644 --- a/ace/config-psos-tm.h +++ b/ace/config-psos-tm.h @@ -85,9 +85,9 @@ #define ACE_LACKS_PTHREAD_THR_SIGSETMASK -/* #define ACE_HAS_BROKEN_SENDMSG */ +/* #define ACE_HAS_NONCONST_SENDMSG */ -/* #define ACE_HAS_BROKEN_WRITEV */ +/* #define ACE_HAS_NONCONST_WRITEV */ #define ACE_HAS_BROKEN_CONVERSIONS diff --git a/ace/config-psosim-g++.h b/ace/config-psosim-g++.h index 3e0ecb11b70..28abfc99f5d 100644 --- a/ace/config-psosim-g++.h +++ b/ace/config-psosim-g++.h @@ -131,9 +131,9 @@ #define ACE_LACKS_PTHREAD_THR_SIGSETMASK -/* #define ACE_HAS_BROKEN_SENDMSG */ +/* #define ACE_HAS_NONCONST_SENDMSG */ -/* #define ACE_HAS_BROKEN_WRITEV */ +/* #define ACE_HAS_NONCONST_WRITEV */ #define ACE_HAS_CHARPTR_SOCKOPT diff --git a/ace/config-rtems.h b/ace/config-rtems.h index 51abb8be168..f053266fbcf 100644 --- a/ace/config-rtems.h +++ b/ace/config-rtems.h @@ -99,7 +99,7 @@ #define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_LACKS_READDIR_R #define ACE_LACKS_READLINK -#define ACE_HAS_BROKEN_READV +#define ACE_HAS_NONCONST_READV #define ACE_LACKS_READV #define ACE_LACKS_RLIMIT #define ACE_LACKS_RLIMIT_PROTOTYPE @@ -120,7 +120,7 @@ #define ACE_LACKS_SYS_NERR #define ACE_LACKS_UALARM_PROTOTYPE #define ACE_LACKS_UCONTEXT_H -#define ACE_HAS_BROKEN_WRITEV +#define ACE_HAS_NONCONST_WRITEV #define ACE_LACKS_WRITEV #define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 #define ACE_NEEDS_SCHED_H diff --git a/ace/config-sunos5.4-centerline-2.x.h b/ace/config-sunos5.4-centerline-2.x.h index 3e078451f10..c5b140237be 100644 --- a/ace/config-sunos5.4-centerline-2.x.h +++ b/ace/config-sunos5.4-centerline-2.x.h @@ -21,7 +21,7 @@ #define ACE_HAS_SYSV_IPC // Sun has the wrong prototype for sendmsg. -#define ACE_HAS_BROKEN_SENDMSG +#define ACE_HAS_NONCONST_SENDMSG // The SunOS 5.x version of rand_r is inconsistent with the header files... #define ACE_HAS_BROKEN_RANDR diff --git a/ace/config-sunos5.4-g++.h b/ace/config-sunos5.4-g++.h index 4d0217cdc40..a3a223ea341 100644 --- a/ace/config-sunos5.4-g++.h +++ b/ace/config-sunos5.4-g++.h @@ -32,7 +32,7 @@ #define ACE_HAS_SYSV_IPC // Sun has the wrong prototype for sendmsg. -#define ACE_HAS_BROKEN_SENDMSG +#define ACE_HAS_NONCONST_SENDMSG // The SunOS 5.x version of rand_r is inconsistent with the header files... #define ACE_HAS_BROKEN_RANDR diff --git a/ace/config-sunos5.4-sunc++-4.x.h b/ace/config-sunos5.4-sunc++-4.x.h index b52eae3f9e6..0738d54de60 100644 --- a/ace/config-sunos5.4-sunc++-4.x.h +++ b/ace/config-sunos5.4-sunc++-4.x.h @@ -26,7 +26,7 @@ #define ACE_HAS_SYSV_IPC // Sun has the wrong prototype for sendmsg. -#define ACE_HAS_BROKEN_SENDMSG +#define ACE_HAS_NONCONST_SENDMSG // The SunOS 5.x version of rand_r is inconsistent with the header files... #define ACE_HAS_BROKEN_RANDR diff --git a/ace/config-tandem-nsk-mips-v2.h b/ace/config-tandem-nsk-mips-v2.h index 5996dad3f32..bea60cd56c6 100644 --- a/ace/config-tandem-nsk-mips-v2.h +++ b/ace/config-tandem-nsk-mips-v2.h @@ -306,7 +306,7 @@ extern int cma_sigwait (sigset_t *); // OS/compiler omits the const from the iovec parameter in the // writev() prototype. -#define ACE_HAS_BROKEN_WRITEV +#define ACE_HAS_NONCONST_WRITEV // Platform lacks <stdint.h> #define ACE_LACKS_STDINT_H diff --git a/ace/config-tandem.h b/ace/config-tandem.h index dac4b85a623..89d45ddbb5c 100644 --- a/ace/config-tandem.h +++ b/ace/config-tandem.h @@ -37,7 +37,7 @@ #define ACE_HAS_SYSV_IPC // OS/compiler omits the const from the sendmsg() prototype. -#define ACE_HAS_BROKEN_SENDMSG +#define ACE_HAS_NONCONST_SENDMSG //OS/compiler's header files are inconsistent with libC definition of rand_r(). //#define ACE_HAS_BROKEN_RANDR // Defines it the same way as sunos5.4 @@ -272,9 +272,9 @@ // files with extern "C". //ACE_HAS_BROKEN_POSIX_TIME Platform defines struct timespec in // <sys/timers.h> -//ACE_HAS_BROKEN_SETRLIMIT OS/compiler omits the const from the +//ACE_HAS_NONCONST_SETRLIMIT OS/compiler omits the const from the // rlimit parameter in the setrlimit() prototype. -//ACE_HAS_BROKEN_WRITEV OS/compiler omits the const from the +//ACE_HAS_NONCONST_WRITEV OS/compiler omits the const from the // iovec parameter in the writev() prototype. // There is a bstring in the Tandem but where man bstring OK, find bstring NOK // ? ACE_HAS_BSTRING Platform has <bstring.h> (which contains bzero() prototype) diff --git a/ace/config-vxworks5.x.h b/ace/config-vxworks5.x.h index 43e6e6cc60f..4a2dce61056 100644 --- a/ace/config-vxworks5.x.h +++ b/ace/config-vxworks5.x.h @@ -104,8 +104,8 @@ #define ACE_DEFAULT_MAX_SOCKET_BUFSIZ 32768 #define ACE_DEFAULT_THREAD_KEYS 16 #define ACE_HAS_BROKEN_ACCEPT_ADDR -#define ACE_HAS_BROKEN_SENDMSG -#define ACE_HAS_BROKEN_WRITEV +#define ACE_HAS_NONCONST_SENDMSG +#define ACE_HAS_NONCONST_WRITEV #define ACE_HAS_CHARPTR_DL #define ACE_HAS_CHARPTR_SOCKOPT #define ACE_HAS_CLOCK_GETTIME diff --git a/ace/os_include/sys/os_resource.h b/ace/os_include/sys/os_resource.h index 8845e544782..15058b22c63 100644 --- a/ace/os_include/sys/os_resource.h +++ b/ace/os_include/sys/os_resource.h @@ -61,12 +61,6 @@ extern "C" # endif /* defined (linux) || defined (AIX) || defined (SCO) */ #endif /* RLIMIT_NOFILE */ -#if defined (ACE_HAS_BROKEN_SETRLIMIT) - typedef struct rlimit ACE_SETRLIMIT_TYPE; -#else - typedef const struct rlimit ACE_SETRLIMIT_TYPE; -#endif /* ACE_HAS_BROKEN_SETRLIMIT */ - #if defined (ACE_WIN32) # define RUSAGE_SELF 1 /// Fake the UNIX rusage structure. Perhaps we can add more to this diff --git a/ace/os_include/sys/os_socket.h b/ace/os_include/sys/os_socket.h index 8f232a67b81..db06e73d3a9 100644 --- a/ace/os_include/sys/os_socket.h +++ b/ace/os_include/sys/os_socket.h @@ -50,12 +50,6 @@ extern "C" struct msghdr {}; #endif /* ACE_HAS_MSG */ -#if defined (ACE_HAS_BROKEN_SENDMSG) - typedef struct msghdr ACE_SENDMSG_TYPE; -#else - typedef const struct msghdr ACE_SENDMSG_TYPE; -#endif /* ACE_HAS_BROKEN_SENDMSG */ - #if defined (ACE_HAS_MSG) && defined (ACE_LACKS_MSG_ACCRIGHTS) # if !defined (msg_accrights) # undef msg_control @@ -202,7 +196,7 @@ extern "C" struct timespec *timeout); ssize_t sendmsg_timedwait (ACE_HANDLE handle, - ACE_SENDMSG_TYPE *msg, + const struct msghdr *msg, int flags, struct timespec *timeout); diff --git a/ace/os_include/sys/os_uio.h b/ace/os_include/sys/os_uio.h index 6c39c1e15b8..21abbd34a6b 100644 --- a/ace/os_include/sys/os_uio.h +++ b/ace/os_include/sys/os_uio.h @@ -63,27 +63,15 @@ extern "C" #endif /* __rtems__ */ -#if defined (ACE_HAS_BROKEN_WRITEV) - typedef struct iovec ACE_WRITEV_TYPE; -#else - typedef const struct iovec ACE_WRITEV_TYPE; -#endif /* ACE_HAS_BROKEN_WRITEV */ - -#if defined (ACE_HAS_BROKEN_READV) - typedef const struct iovec ACE_READV_TYPE; -#else - typedef struct iovec ACE_READV_TYPE; -#endif /* ACE_HAS_BROKEN_READV */ - # if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES) ssize_t readv_timedwait (ACE_HANDLE handle, - iovec *iov, + const iovec *iov, int iovcnt, struct timespec* timeout); ssize_t writev_timedwait (ACE_HANDLE handle, - ACE_WRITEV_TYPE *iov, + const iovec *iov, int iovcnt, struct timespec *timeout); diff --git a/configure.ac b/configure.ac index 4cb93c3bcad..d891cabe29e 100644 --- a/configure.ac +++ b/configure.ac @@ -4649,25 +4649,6 @@ dnl converts all warnings to errors, whenever we are compiling with dnl G++. dnl -Ossama -ACE_CONVERT_WARNINGS_TO_ERRORS( -[ -dnl Check if setrlimit() takes a const pointer as 2nd argument -ACE_CACHE_CHECK([if setrlimit() takes a const pointer as 2nd argument], - [ace_cv_lib_posix_setrlimit_const_2],[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include <sys/time.h> -#include <sys/resource.h> - ]], [[ - const struct rlimit* rlp = 0; - setrlimit(RLIMIT_CPU, rlp); - ]])],[ - ace_cv_lib_posix_setrlimit_const_2=yes - ],[ - ace_cv_lib_posix_setrlimit_const_2=no - ]) - ],, [AC_DEFINE([ACE_HAS_BROKEN_SETRLIMIT])]) -]) dnl ACE_CONVERT_WARNINGS_TO_ERRORS - dnl Check if getrusage() takes an enum as 1st argument ACE_CHECK_GETRUSAGE_ENUM @@ -4707,14 +4688,15 @@ ACE_CACHE_CHECK([if select takes a const fifth argument], ], , [AC_DEFINE([ACE_HAS_NONCONST_SELECT_TIMEVAL])]) ]) dnl ACE_CONVERT_WARNINGS_TO_ERRORS + dnl Only run the following tests if the msghdr structure exists. if test "$ace_cv_struct_msghdr" = yes && test "$ac_cv_func_sendmsg" = yes; then ACE_CONVERT_WARNINGS_TO_ERRORS( [ dnl Check if sendmsg takes a const 2nd argument - ACE_CACHE_CHECK([if sendmsg omits the const from the second argument], - [ace_cv_lib_broken_sendmsg],[ + ACE_CACHE_CHECK([if sendmsg omits const qualifier from the msghdr argument], + [ace_cv_lib_nonconst_sendmsg],[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifndef ACE_LACKS_SYS_TYPES_H # include <sys/types.h> @@ -4729,13 +4711,69 @@ dnl Check if sendmsg takes a const 2nd argument result = (int) sendmsg(s, msg, flags); ]])],[ - ace_cv_lib_broken_sendmsg=no + ace_cv_lib_nonconst_sendmsg=no + ],[ + ace_cv_lib_nonconst_sendmsg=yes + ]) + ], [AC_DEFINE([ACE_HAS_NONCONST_SENDMSG])],) + ]) dnl ACE_CONVERT_WARNINGS_TO_ERRORS +fi dnl "$ace_cv_struct_msghdr" = yes && $ac_cv_func_sendmsg = yes + + +dnl Only run the following tests if the setrlimit function exists +if test "$ac_cv_func_setrlimit" = yes; then + ACE_CONVERT_WARNINGS_TO_ERRORS( + [ +dnl Check if setrlimit() takes a const pointer as 2nd argument + ACE_CACHE_CHECK([if setrlimit omits const qualifier from the rlimit argument], + [ace_cv_lib_nonconst_setrlimit],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#include <sys/time.h> +#include <sys/resource.h> + ]], [[ + const struct rlimit* rlp = 0; + setrlimit(RLIMIT_CPU, rlp); + ]])],[ + ace_cv_lib_nonconst_setrlimit=no ],[ - ace_cv_lib_broken_sendmsg=yes + ace_cv_lib_nonconst_setrlimit=yes ]) - ], [AC_DEFINE([ACE_HAS_BROKEN_SENDMSG])],) + ], [AC_DEFINE([ACE_HAS_NONCONST_SETRLIMIT])]) ]) dnl ACE_CONVERT_WARNINGS_TO_ERRORS -fi dnl test "$ace_cv_struct_msghdr" = yes +fi dnl "$ac_cv_func_setrlimit" = yes; then + + +dnl Only run the following tests if the readv function exists +if test "$ac_cv_header_sys_uio_h" = yes && + test "$ac_cv_func_readv" = yes; then + ACE_CONVERT_WARNINGS_TO_ERRORS( + [ +dnl Check if readv omits the const from the iovec argument + ACE_CACHE_CHECK([if readv omits const qualifier from the iovec argument], + [ace_cv_lib_nonconst_readv],[ + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ +#ifndef ACE_LACKS_UNISTD_H +# include <unistd.h> +#endif + +#include <sys/uio.h> + ]], [[ + int filedes = 0; + const struct iovec *vector = 0; + size_t count = 0; + + int result = 0; + + result = (int) readv(filedes, vector, count); + ]])],[ + ace_cv_lib_nonconst_readv=no + ],[ + ace_cv_lib_nonconst_readv=yes + ]) + ], [AC_DEFINE([ACE_HAS_NONCONST_READV])],) + ]) dnl ACE_CONVERT_WARNINGS_TO_ERRORS +fi dnl $ac_cv_header_sys_uio_h = yes && $ac_cv_func_writev = yes + dnl Only run the following tests if the writev function exists if test "$ac_cv_header_sys_uio_h" = yes && @@ -4743,8 +4781,8 @@ if test "$ac_cv_header_sys_uio_h" = yes && ACE_CONVERT_WARNINGS_TO_ERRORS( [ dnl Check if writev omits the const from the iovec argument - ACE_CACHE_CHECK([if writev omits the const from the iovec argument], - [ace_cv_lib_broken_writev],[ + ACE_CACHE_CHECK([if writev omits const qualifier from the iovec argument], + [ace_cv_lib_nonconst_writev],[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifndef ACE_LACKS_UNISTD_H # include <unistd.h> @@ -4760,11 +4798,11 @@ dnl Check if writev omits the const from the iovec argument result = (int) writev(filedes, vector, count); ]])],[ - ace_cv_lib_broken_writev=no + ace_cv_lib_nonconst_writev=no ],[ - ace_cv_lib_broken_writev=yes + ace_cv_lib_nonconst_writev=yes ]) - ], [AC_DEFINE([ACE_HAS_BROKEN_WRITEV])],) + ], [AC_DEFINE([ACE_HAS_NONCONST_WRITEV])],) ]) dnl ACE_CONVERT_WARNINGS_TO_ERRORS fi dnl $ac_cv_header_sys_uio_h = yes && $ac_cv_func_writev = yes diff --git a/m4/ace.m4 b/m4/ace.m4 index c9e89b16656..e990794f90e 100644 --- a/m4/ace.m4 +++ b/m4/ace.m4 @@ -310,65 +310,9 @@ dnl line, then "no_x" is set to "yes." ]) AM_CONDITIONAL([COMPILE_GPERF], [test X$ace_user_with_gperf = Xyes]) - AC_ARG_WITH([rmcast], - AS_HELP_STRING(--with-rmcast,compile the ACE_RMCast library [[[yes]]]), - [ - case "${withval}" in - yes) - ace_user_with_rmcast=yes - ;; - no) - ace_user_with_rmcast=no - ;; - *) - AC_MSG_ERROR([bad value ${withval} for --with-rmcast]) - ;; - esac - ], - [ - ace_user_with_rmcast=yes - ]) - AM_CONDITIONAL([BUILD_RMCAST], [test X$ace_user_with_rmcast = Xyes]) - - AC_ARG_WITH([qos], - AS_HELP_STRING(--with-qos,compile the ACE_QoS library [[[no]]]), - [ - case "${withval}" in - yes) - ace_user_with_qos=yes - ;; - no) - ace_user_with_qos=no - ;; - *) - AC_MSG_ERROR([bad value ${withval} for --with-qos]) - ;; - esac - ], - [ - ace_user_with_qos=no - ]) - AM_CONDITIONAL([BUILD_QOS], [test X$ace_user_with_qos = Xyes]) - - AC_ARG_WITH([ssl], - AS_HELP_STRING(--with-ssl,compile the ACE_SSL library [[[yes]]]), - [ - case "${withval}" in - yes) - ace_user_with_ssl=yes - ;; - no) - ace_user_with_ssl=no - ;; - *) - AC_MSG_ERROR([bad value ${withval} for --with-ssl]) - ;; - esac - ], - [ - ace_user_with_ssl=yes - ]) -AM_CONDITIONAL([BUILD_SSL], [test X$ace_user_with_ssl = Xyes]) + ACE_WITH_RMCAST + ACE_WITH_QOS + ACE_WITH_SSL AC_ARG_WITH([tao], AS_HELP_STRING(--with-tao,build TAO (the ACE ORB) [[[yes]]]), @@ -711,3 +655,63 @@ dnl fi ]) ]) + +AC_DEFUN([ACE_WITH_RMCAST], +[AC_ARG_WITH([rmcast], + AS_HELP_STRING([--with-rmcast], + [compile/use the ACE_RMCast library [[yes]]]), + [case "${withval}" in + yes) + ace_user_with_rmcast=yes + ;; + no) + ace_user_with_rmcast=no + ;; + *) + AC_MSG_ERROR(bad value ${withval} for --with-rmcast) + ;; + esac]) +AC_CACHE_CHECK([whether to compile/use the ACE_RMCast library], + [ace_user_with_rmcast],[ace_user_with_rmcast=yes]) +AM_CONDITIONAL([BUILD_RMCAST], [test X$ace_user_with_rmcast = Xyes]) +]) + +AC_DEFUN([ACE_WITH_QOS], +[AC_ARG_WITH([qos], + AS_HELP_STRING([--with-qos], + [compile/use the ACE_QoS library [[no]]]), + [case "${withval}" in + yes) + ace_user_with_qos=yes + ;; + no) + ace_user_with_qos=no + ;; + *) + AC_MSG_ERROR(bad value ${withval} for --with-qos) + ;; + esac]) +AC_CACHE_CHECK([whether to compile/use the ACE_QoS library], + [ace_user_with_qos],[ace_user_with_qos=no]) +AM_CONDITIONAL([BUILD_QOS], [test X$ace_user_with_qos = Xyes]) +]) + +AC_DEFUN([ACE_WITH_SSL], +[AC_ARG_WITH([ssl], + AS_HELP_STRING([--with-ssl], + [compile/use the ACE_SSL library [[yes]]]), + [case "${withval}" in + yes) + ace_user_with_ssl=yes + ;; + no) + ace_user_with_ssl=no + ;; + *) + AC_MSG_ERROR(bad value ${withval} for --with-ssl) + ;; + esac]) +AC_CACHE_CHECK([whether to compile/use the ACE_SSL library], + [ace_user_with_ssl], [ace_user_with_ssl=yes]) +AM_CONDITIONAL([BUILD_SSL], [test X$ace_user_with_ssl = Xyes]) +]) diff --git a/m4/config_h.m4 b/m4/config_h.m4 index 8acf5a0b942..73a6ceae8d8 100644 --- a/m4/config_h.m4 +++ b/m4/config_h.m4 @@ -369,19 +369,9 @@ AH_TEMPLATE([ACE_HAS_BROKEN_RANDR], [OS/compiler's header files are inconsistent with libC definition of rand_r().]) -AH_TEMPLATE([ACE_HAS_BROKEN_READV], -[OS/Compiler's header files are not consistent with readv() definition.]) - AH_TEMPLATE([ACE_HAS_BROKEN_SAP_ANY], [Compiler can't handle the static ACE_Addr::sap_any construct.]) -AH_TEMPLATE([ACE_HAS_BROKEN_SENDMSG], -[OS/compiler omits the const from the sendmsg() prototype.]) - -AH_TEMPLATE([ACE_HAS_BROKEN_SETRLIMIT], -[OS/compiler omits the const from the rlimit parameter in the -setrlimit() prototype.]) - AH_TEMPLATE([ACE_HAS_BROKEN_T_ERROR], [Compiler/platform has the wrong prototype for t_error(), i.e., t_error(char *) rather than t_error(const char *).]) @@ -391,10 +381,6 @@ AH_TEMPLATE([ACE_HAS_BROKEN_TIMESPEC_MEMBERS], instead of tv_sec and tv_nsec. This is highly non-portable. Currently only FreeBSD 2.1.x uses it.]) -AH_TEMPLATE([ACE_HAS_BROKEN_WRITEV], -[OS/compiler omits the const from the iovec parameter in the -writev() prototype.]) - AH_TEMPLATE([ACE_HAS_BSTRING], [Platform has <bstring.h> (which contains bzero() prototype)]) @@ -524,10 +510,24 @@ AH_TEMPLATE([ACE_HAS_NONCONST_GETBY], AH_TEMPLATE([ACE_HAS_NONCONST_MSGSND], [Platform has a non-const parameter to msgsnd() (e.g., SCO).]) +AH_TEMPLATE([ACE_HAS_NONCONST_READV], +[Platform omits const qualifier from iovec parameter in readv() prototype.]) + AH_TEMPLATE([ACE_HAS_NONCONST_SELECT_TIMEVAL], [Platform's select() uses non-const timeval* (only found on Linux right now)]) +AH_TEMPLATE([ACE_HAS_NONCONST_SENDMSG], +[Platform omits const qualifier from msghdr parameter in sendmsg() + prototype.]) + +AH_TEMPLATE([ACE_HAS_NONCONST_SETRLIMIT], +[Platform omits const qualifier from rlimit parameter in setrlimit() + prototype.]) + +AH_TEMPLATE([ACE_HAS_NONCONST_WRITEV], +[Platform omits const qualifier from iovec parameter in writev() prototype.]) + AH_TEMPLATE([ACE_HAS_GNUG_PRE_2_8], [Platform has "old" GNU compiler, i.e. does not completely support standard C++. (compiling with g++ prior to version 2.8.0)]) |