diff options
Diffstat (limited to 'ace')
267 files changed, 2837 insertions, 3840 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 60a97d33f87..4db8c1ead1d 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -31,28 +31,21 @@ # include "ace/OS_NS_poll.h" #endif /* ACE_HAS_POLL && ACE_HAS_LIMITED_SELECT */ +ACE_RCSID(ace, ACE, "$Id$") -ACE_RCSID (ace, - ACE, - "$Id$") + // Static data members. +// Keeps track of whether we're in some global debug mode. +char ACE::debug_ = 0; -namespace ACE -{ - // private: - // Used internally so not exported. - - // Size of allocation granularity. - size_t allocation_granularity_ = 0; +// Hex characters. +const ACE_TCHAR ACE::hex_chars_[] = ACE_LIB_TEXT ("0123456789abcdef"); - // Size of a VM page. - size_t pagesize_ = 0; - - // Are we debugging ACE? - // Keeps track of whether we're in some global debug mode. - char debug_; -} +// Size of a VM page. +size_t ACE::pagesize_ = 0; +// Size of allocation granularity. +size_t ACE::allocation_granularity_ = 0; int ACE::out_of_handles (int error) @@ -154,18 +147,6 @@ ACE::compiler_beta_version (void) #endif } -char -ACE::debug (void) -{ - return ACE::debug_; -} - -void -ACE::debug (char c) -{ - ACE::debug_ = c; -} - int ACE::select (int width, ACE_Handle_Set *readfds, @@ -416,64 +397,60 @@ ACE::hash_pjw (const wchar_t *str) * SUCH DAMAGE. */ -namespace ACE -{ - u_long crc_table_[] = - { - 0x0, - 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, - 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, - 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, - 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, - 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, - 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, - 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, - 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, - 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, - 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe, - 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, - 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, - 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, - 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, - 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, - 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07, - 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, - 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, - 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, - 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, - 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, - 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, - 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, - 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f, - 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, - 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, - 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, - 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, - 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629, - 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, - 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, - 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, - 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, - 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8, - 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, - 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, - 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, - 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, - 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, - 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21, - 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, - 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087, - 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, - 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, - 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, - 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, - 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, - 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09, - 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, - 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, - 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 - }; -} +u_long ACE::crc_table_[] = +{ + 0x0, + 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, + 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, + 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, + 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, + 0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f, + 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, + 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, + 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, + 0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe, + 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, + 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, + 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, + 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, + 0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, + 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07, + 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, + 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, + 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, + 0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, + 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, + 0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, + 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f, + 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, + 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, + 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, + 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, + 0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629, + 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, + 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, + 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, + 0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8, + 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, + 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, + 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, + 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, + 0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, + 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21, + 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, + 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087, + 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, + 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, + 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, + 0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, + 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09, + 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, + 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, + 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4}; // Compute a POSIX 1003.2 checksum. The routine takes an string and // computes the CRC for it (it stops on the first '\0' character). @@ -2698,20 +2675,16 @@ ACE::timestamp (ACE_TCHAR date_and_time[], ACE_OS::strsncpy (date_and_time, timebuf, date_and_timelen); - ACE_TCHAR yeartmp[5]; + char yeartmp[5]; ACE_OS::strsncpy (yeartmp, &date_and_time[20], 5); - ACE_TCHAR timetmp[9]; + char timetmp[9]; ACE_OS::strsncpy (timetmp, &date_and_time[11], 9); ACE_OS::sprintf (&date_and_time[11], -# if defined (ACE_USES_WCHAR) - ACE_LIB_TEXT ("%ls %ls.%06ld"), -# else - ACE_LIB_TEXT ("%s %s.%06ld"), -# endif /* ACE_USES_WCHAR */ + "%s %s.%06ld", yeartmp, timetmp, cur_time.usec ()); @@ -3118,8 +3091,7 @@ ACE::max_handles (void) // Otherwise, set it to be the value of NEW_LIMIT. int -ACE::set_handle_limit (int new_limit, - int increase_limit_only) +ACE::set_handle_limit (int new_limit) { ACE_TRACE ("ACE::set_handle_limit"); int cur_limit = ACE::max_handles (); @@ -3147,7 +3119,6 @@ ACE::set_handle_limit (int new_limit, } else if (new_limit > cur_limit) { - // Increase the limit. #if !defined (ACE_LACKS_RLIMIT) && defined (RLIMIT_NOFILE) rl.rlim_cur = new_limit; return ACE_OS::setrlimit (RLIMIT_NOFILE, &rl); @@ -3156,9 +3127,8 @@ ACE::set_handle_limit (int new_limit, ACE_NOTSUP_RETURN (-1); #endif /* ACE_LACKS_RLIMIT */ } - else if (increase_limit_only == 0) + else { - // Decrease the limit. #if !defined (ACE_LACKS_RLIMIT) && defined (RLIMIT_NOFILE) rl.rlim_cur = new_limit; return ACE_OS::setrlimit (RLIMIT_NOFILE, &rl); @@ -3170,7 +3140,11 @@ ACE::set_handle_limit (int new_limit, #endif /* ACE_LACKS_RLIMIT */ } - return 0; + // Irix complains without this return statement. DEC cxx + // (correctly) says that it's not reachable. ACE_NOTREACHED won't + // work here, because it handles both platforms the same. + // IRIX does not complain anymore [7.2] + ACE_NOTREACHED (return 0); } int @@ -3371,52 +3345,6 @@ ACE::sock_error (int error) #endif /* ACE_WIN32 */ } -bool -ACE::is_sock_error (int error) -{ -#if defined (ACE_WIN32) - switch (error) - { - case WSAVERNOTSUPPORTED: - case WSASYSNOTREADY: - case WSAEINVAL: - case WSAHOST_NOT_FOUND: - case WSATRY_AGAIN: - case WSANO_RECOVERY: - case WSANO_DATA: - /* - case WSANO_ADDRESS: - */ - case WSANOTINITIALISED: - case WSAENETDOWN: - case WSAEINPROGRESS: - case WSAEINTR: - case WSAEAFNOSUPPORT: - case WSAEMFILE: - case WSAENOBUFS: - case WSAEPROTONOSUPPORT: - case WSAEPROTOTYPE: - case WSAESOCKTNOSUPPORT: - case WSAENOTSOCK: - case WSAEWOULDBLOCK: - case WSAEADDRINUSE: - case WSAECONNABORTED: - case WSAECONNRESET: - case WSAENOTCONN: - case WSAETIMEDOUT: - case WSAECONNREFUSED: - case WSAEHOSTDOWN: - case WSAEHOSTUNREACH: - case WSAEADDRNOTAVAIL: - case WSAEISCONN: - return true; - } -#else - ACE_UNUSED_ARG (error); -#endif /* ACE_WIN32 */ - return false; -} - char * ACE::strndup (const char *str, size_t n) { diff --git a/ace/ACE.h b/ace/ACE.h index 3a0e4063394..ac389a9e7f3 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -1,25 +1,17 @@ -// -*- C++ -*- +/* -*- C++ -*- */ //============================================================================= /** - * @file ACE.h + * @file ACE.h * - * $Id$ + * $Id$ * - * This file contains value added ACE functions that extend the - * behavior of the UNIX and Win32 OS calls. - * - * All these ACE static functions are consolidated in a single place - * in order to manage the namespace better. These functions are put - * here rather than in @c ACE_OS in order to separate concerns. - * - * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> + * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> */ //============================================================================= #ifndef ACE_ACE_H #define ACE_ACE_H - #include /**/ "ace/pre.h" #include "ace/config-all.h" @@ -54,76 +46,78 @@ class ACE_Handle_Set; # undef log2 #endif /* log2 */ -#if defined (ACE_EXPORT_MACRO) -# undef ACE_EXPORT_MACRO -#endif -#define ACE_EXPORT_MACRO ACE_Export - - /** - * @namespace ACE + * @class ACE * - * @brief The namespace containing the ACE framework itself. + * @brief Contains value added ACE methods that extend the behavior + * of the UNIX and Win32 OS calls. * - * The ACE namespace contains all types (classes, structures, - * typedefs, etc), and global functions and variables in the ACE - * framework. + * This class consolidates all these ACE static methods in a + * single place in order to manage the namespace better. These + * methods are put here rather than in ACE_OS in order to + * separate concerns. */ -namespace ACE +class ACE_Export ACE : public ACE_Flag_Manip, public ACE_Handle_Ops, + public ACE_Lib_Find, public ACE_Init_ACE, + public ACE_Sock_Connect { + + ACE_CLASS_IS_NAMESPACE (ACE); +public: + // = ACE version information. /// e.g., the "5" in ACE 5.1.12. - extern ACE_Export u_int major_version (void); + static u_int major_version (void); /// e.g., the "1" in ACE 5.1.12. - extern ACE_Export u_int minor_version (void); + static u_int minor_version (void); /// e.g., the "12" in ACE 5.1.12. /// Returns 0 for "stable" (non-beta) releases. - extern ACE_Export u_int beta_version (void); + static u_int beta_version (void); // = C++ compiler version information. /// E.g., the "SunPro C++" in SunPro C++ 4.32.0 - extern ACE_Export const ACE_TCHAR * compiler_name (void); + static const ACE_TCHAR * compiler_name (void); /// E.g., the "4" in SunPro C++ 4.32.0 - extern ACE_Export u_int compiler_major_version (void); + static u_int compiler_major_version (void); /// E.g., the "32" in SunPro C++ 4.32.0 - extern ACE_Export u_int compiler_minor_version (void); + static u_int compiler_minor_version (void); /// E.g., the "0" in SunPro C++ 4.32.0 - extern ACE_Export u_int compiler_beta_version (void); + static u_int compiler_beta_version (void); /// Check if error indicates the process being out of handles (file /// descriptors). - extern ACE_Export int out_of_handles (int error); + static int out_of_handles (int error); /** * @name I/O operations * * Notes on common parameters: * - * @a handle is the connected endpoint that will be used for I/O. + * <handle> is the connected endpoint that will be used for I/O. * - * @a buf is the buffer to write from or receive into. + * <buf> is the buffer to write from or receive into. * - * @a len is the number of bytes to transfer. + * <len> is the number of bytes to transfer. * - * The @a timeout parameter in the following methods indicates how - * long to blocking trying to transfer data. If @a timeout == 0, + * The <timeout> parameter in the following methods indicates how + * long to blocking trying to transfer data. If <timeout> == 0, * then the call behaves as a normal send/recv call, i.e., for * blocking sockets, the call will block until action is possible; - * for non-blocking sockets, @c EWOULDBLOCK will be returned if no + * for non-blocking sockets, EWOULDBLOCK will be returned if no * action is immediately possible. * - * If @a timeout != 0, the call will wait until the relative time - * specified in @a *timeout elapses. + * If <timeout> != 0, the call will wait until the relative time + * specified in *<timeout> elapses. * * The "_n()" I/O methods keep looping until all the data has been * transferred. These methods also work for sockets in non-blocking - * mode i.e., they keep looping on @c EWOULDBLOCK. @a timeout is - * used to make sure we keep making progress, i.e., the same timeout + * mode i.e., they keep looping on EWOULDBLOCK. <timeout> is used + * to make sure we keep making progress, i.e., the same timeout * value is used for every I/O operation in the loop and the timeout * is not counted down. * @@ -131,84 +125,80 @@ namespace ACE * from the non "_n()" methods and are specified as follows: * * - On complete transfer, the number of bytes transferred is returned. - * - On timeout, -1 is returned, @c errno == @c ETIME. - * - On error, -1 is returned, @c errno is set to appropriate error. - * - On @c EOF, 0 is returned, @c errno is irrelevant. + * - On timeout, -1 is returned, errno == ETIME. + * - On error, -1 is returned, errno is set to appropriate error. + * - On EOF, 0 is returned, errno is irrelevant. * * On partial transfers, i.e., if any data is transferred before - * timeout / error / @c EOF, @a bytes_transferred> will contain the - * number of bytes transferred. + * timeout/error/EOF, <bytes_transferred> will contain the number of + * bytes transferred. * - * Methods with @a iovec parameter are I/O vector variants of the - * I/O operations. + * Methods with <iovec> parameter are I/O vector variants of the I/O + * operations. * - * Methods with the extra @a flags argument will always result in - * @c send getting called. Methods without the extra @a flags - * argument will result in @c send getting called on Win32 - * platforms, and @c write getting called on non-Win32 platforms. + * Methods with the extra <flags> argument will always result in + * <send> getting called. Methods without the extra <flags> argument + * will result in <send> getting called on Win32 platforms, and + * <write> getting called on non-Win32 platforms. */ //@{ - extern ACE_Export ssize_t recv (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0); + static ssize_t recv (ACE_HANDLE handle, + void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout = 0); #if defined (ACE_HAS_TLI) - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t t_rcv (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout = 0); + static ssize_t t_rcv (ACE_HANDLE handle, + void *buf, + size_t len, + int *flags, + const ACE_Time_Value *timeout = 0); #endif /* ACE_HAS_TLI */ - extern ACE_Export ssize_t recv (ACE_HANDLE handle, - void *buf, - size_t len, - const ACE_Time_Value *timeout = 0); - - extern ACE_Export ssize_t recvmsg (ACE_HANDLE handle, - struct msghdr *msg, - int flags, - const ACE_Time_Value *timeout = 0); - - extern ACE_Export ssize_t recvfrom (ACE_HANDLE handle, - char *buf, - int len, - int flags, - struct sockaddr *addr, - int *addrlen, - const ACE_Time_Value *timeout = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t recv_n (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); + static ssize_t recv (ACE_HANDLE handle, + void *buf, + size_t len, + const ACE_Time_Value *timeout = 0); + + static ssize_t recvmsg (ACE_HANDLE handle, + struct msghdr *msg, + int flags, + const ACE_Time_Value *timeout = 0); + + static ssize_t recvfrom (ACE_HANDLE handle, + char *buf, + int len, + int flags, + struct sockaddr *addr, + int *addrlen, + const ACE_Time_Value *timeout = 0); + + static ssize_t recv_n (ACE_HANDLE handle, + void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); #if defined (ACE_HAS_TLI) - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t t_rcv_n (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); + static ssize_t t_rcv_n (ACE_HANDLE handle, + void *buf, + size_t len, + int *flags, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); #endif /* ACE_HAS_TLI */ - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t recv_n (ACE_HANDLE handle, - void *buf, - size_t len, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); + static ssize_t recv_n (ACE_HANDLE handle, + void *buf, + size_t len, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); /// Receive into a variable number of pieces. /** @@ -220,218 +210,208 @@ namespace ACE * * @return -1 on error, else total number of bytes received. */ - extern ACE_Export ssize_t recv (ACE_HANDLE handle, size_t n, ...); - - extern ACE_Export ssize_t recvv (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t recvv_n (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - extern ACE_Export ssize_t recv_n (ACE_HANDLE handle, - ACE_Message_Block *message_block, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - extern ACE_Export ssize_t send (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0); + static ssize_t recv (ACE_HANDLE handle, size_t n, ...); + + static ssize_t recvv (ACE_HANDLE handle, + iovec *iov, + int iovcnt, + const ACE_Time_Value *timeout = 0); + + static ssize_t recvv_n (ACE_HANDLE handle, + iovec *iov, + int iovcnt, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); + + static ssize_t recv_n (ACE_HANDLE handle, + ACE_Message_Block *message_block, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); + + static ssize_t send (ACE_HANDLE handle, + const void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout = 0); #if defined (ACE_HAS_TLI) - extern ACE_Export ssize_t t_snd (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0); + static ssize_t t_snd (ACE_HANDLE handle, + const void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout = 0); #endif /* ACE_HAS_TLI */ - extern ACE_Export ssize_t send (ACE_HANDLE handle, - const void *buf, - size_t len, - const ACE_Time_Value *timeout = 0); - - extern ACE_Export ssize_t sendmsg (ACE_HANDLE handle, - const struct msghdr *msg, - int flags, - const ACE_Time_Value *timeout = 0); - - extern ACE_Export ssize_t sendto (ACE_HANDLE handle, - const char *buf, - int len, - int flags, - const struct sockaddr *addr, - int addrlen, - const ACE_Time_Value *timeout = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t send_n (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); + static ssize_t send (ACE_HANDLE handle, + const void *buf, + size_t len, + const ACE_Time_Value *timeout = 0); + + static ssize_t sendmsg (ACE_HANDLE handle, + const struct msghdr *msg, + int flags, + const ACE_Time_Value *timeout = 0); + + static ssize_t sendto (ACE_HANDLE handle, + const char *buf, + int len, + int flags, + const struct sockaddr *addr, + int addrlen, + const ACE_Time_Value *timeout = 0); + + static ssize_t send_n (ACE_HANDLE handle, + const void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); #if defined (ACE_HAS_TLI) - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t t_snd_n (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); + static ssize_t t_snd_n (ACE_HANDLE handle, + const void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); #endif /* ACE_HAS_TLI */ - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t send_n (ACE_HANDLE handle, - const void *buf, - size_t len, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); + static ssize_t send_n (ACE_HANDLE handle, + const void *buf, + size_t len, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); /// Varargs variant. - extern ACE_Export ssize_t send (ACE_HANDLE handle, size_t n, ...); - - extern ACE_Export ssize_t sendv (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t sendv_n (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); - - /// Send all the @a message_blocks chained through their @c next and - /// @c cont pointers. This call uses the underlying OS gather-write + static ssize_t send (ACE_HANDLE handle, size_t n, ...); + + static ssize_t sendv (ACE_HANDLE handle, + const iovec *iov, + int iovcnt, + const ACE_Time_Value *timeout = 0); + + static ssize_t sendv_n (ACE_HANDLE handle, + const iovec *iov, + int iovcnt, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); + + /// Send all the <message_block>s chained through their <next> and + /// <cont> pointers. This call uses the underlying OS gather-write /// operation to reduce the domain-crossing penalty. - extern ACE_Export ssize_t send_n (ACE_HANDLE handle, - const ACE_Message_Block *message_block, - const ACE_Time_Value *timeout = 0, - size_t *bytes_transferred = 0); + static ssize_t send_n (ACE_HANDLE handle, + const ACE_Message_Block *message_block, + const ACE_Time_Value *timeout = 0, + size_t *bytes_transferred = 0); // = File system I/O functions (these don't support timeouts). - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t read_n (ACE_HANDLE handle, - void *buf, - size_t len, - size_t *bytes_transferred = 0); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t write_n (ACE_HANDLE handle, - const void *buf, - size_t len, - size_t *bytes_transferred = 0); - - /// Write all the @a message_blocks chained through their @c next - /// and @c cont pointers. This call uses the underlying OS - /// gather-write operation to reduce the domain-crossing penalty. - extern ACE_Export ssize_t write_n (ACE_HANDLE handle, - const ACE_Message_Block *message_block, - size_t *bytes_transferred = 0); - - extern ACE_Export ssize_t readv_n (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - size_t *bytes_transferred = 0); - - extern ACE_Export ssize_t writev_n (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - size_t *bytes_transferred = 0); + static ssize_t read_n (ACE_HANDLE handle, + void *buf, + size_t len, + size_t *bytes_transferred = 0); + + static ssize_t write_n (ACE_HANDLE handle, + const void *buf, + size_t len, + size_t *bytes_transferred = 0); + + /// Write all the <message_block>s chained through their <next> and + /// <cont> pointers. This call uses the underlying OS gather-write + /// operation to reduce the domain-crossing penalty. + static ssize_t write_n (ACE_HANDLE handle, + const ACE_Message_Block *message_block, + size_t *bytes_transferred = 0); + + static ssize_t readv_n (ACE_HANDLE handle, + iovec *iov, + int iovcnt, + size_t *bytes_transferred = 0); + + static ssize_t writev_n (ACE_HANDLE handle, + const iovec *iov, + int iovcnt, + size_t *bytes_transferred = 0); //@} /** - * Wait up to @a timeout amount of time to passively establish a - * connection. This method doesn't perform the @c accept, it just - * does the timed wait. + * Wait up to <timeout> amount of time to passively establish a + * connection. This method doesn't perform the <accept>, it just + * does the timed wait... */ - extern ACE_Export int handle_timed_accept (ACE_HANDLE listener, - ACE_Time_Value *timeout, - int restart); + static int handle_timed_accept (ACE_HANDLE listener, + ACE_Time_Value *timeout, + int restart); /** - * Wait up to @a timeout amount of time to complete an actively - * established non-blocking connection. If @a is_tli is non-0 then + * Wait up to <timeout> amount of time to complete an actively + * established non-blocking connection. If <is_tli> is non-0 then * we are being called by a TLI wrapper (which behaves slightly * differently from a socket wrapper). */ - extern ACE_Export ACE_HANDLE handle_timed_complete ( - ACE_HANDLE listener, - const ACE_Time_Value *timeout, - int is_tli = 0); + static ACE_HANDLE handle_timed_complete (ACE_HANDLE listener, + const ACE_Time_Value *timeout, + int is_tli = 0); /** - * Reset the limit on the number of open handles. If @a new_limit - * == -1 set the limit to the maximum allowable. Otherwise, set - * the limit value to @a new_limit. If @a increase_limit_only is - * non-0 then only allow increases to the limit. + * Reset the limit on the number of open handles. If <new_limit> == + * -1 set the limit to the maximum allowable. Otherwise, set it to + * be the value of <new_limit>. */ - extern ACE_Export int set_handle_limit (int new_limit = -1, - int increase_limit_only = 0); + static int set_handle_limit (int new_limit = -1); /** * Returns the maximum number of open handles currently permitted in * this process. This maximum may be extended using - * @c ACE::set_handle_limit. + * <ACE::set_handle_limit>. */ - extern ACE_Export int max_handles (void); + static int max_handles (void); // = String functions #if !defined (ACE_HAS_WINCE) /** - * Return a dynamically allocated duplicate of @a str, substituting - * the environment variable if @c str[0] @c == @c '$'. Note that - * the pointer is allocated with @c ACE_OS::malloc and must be freed - * by @c ACE_OS::free. + * Return a dynamically allocated duplicate of <str>, substituting + * the environment variable if <str[0] == '$'>. Note that the + * pointer is allocated with <ACE_OS::malloc> and must be freed by + * <ACE_OS::free>. */ - extern ACE_Export ACE_TCHAR *strenvdup (const ACE_TCHAR *str); + static ACE_TCHAR *strenvdup (const ACE_TCHAR *str); #endif /* ACE_HAS_WINCE */ /// Returns a pointer to the "end" of the string, i.e., the character - /// past the @c '\0'. - extern ACE_Export const char *strend (const char *s); + /// past the '\0'. + static const char *strend (const char *s); - /// This method is just like @c strdup, except that it uses - /// @c operator @c new rather than @c malloc. If @a s is NULL - /// returns NULL rather than segfaulting. - extern ACE_Export char *strnew (const char *s); + /// This method is just like <strdup>, except that it uses <operator + /// new> rather than <malloc>. If <s> is NULL returns NULL rather than + /// segfaulting... + static char *strnew (const char *s); - /// Delete the memory allocated by @c strnew. - extern ACE_Export void strdelete (char *s); + /// Delete the memory allocated by <strnew>. + static void strdelete (char *s); - /// Create a fresh new copy of @a str, up to @a n chars long. Uses - /// @c ACE_OS::malloc to allocate the new string. - extern ACE_Export char *strndup (const char *str, size_t n); + /// Create a fresh new copy of <str>, up to <n> chars long. Uses + /// <ACE_OS::malloc> to allocate the new string. + static char *strndup (const char *str, size_t n); - /// Create a fresh new copy of @a str, up to @a n chars long. Uses - /// @c ACE_OS::malloc to allocate the new string. - extern ACE_Export char *strnnew (const char *str, size_t n); + /// Create a fresh new copy of <str>, up to <n> chars long. Uses + /// <ACE_OS::malloc> to allocate the new string. + static char *strnnew (const char *str, size_t n); #if defined (ACE_HAS_WCHAR) - extern ACE_Export const wchar_t *strend (const wchar_t *s); + static const wchar_t *strend (const wchar_t *s); - extern ACE_Export wchar_t *strnew (const wchar_t *s); + static wchar_t *strnew (const wchar_t *s); - extern ACE_Export void strdelete (wchar_t *s); + static void strdelete (wchar_t *s); - extern ACE_Export wchar_t *strndup (const wchar_t *str, size_t n); + static wchar_t *strndup (const wchar_t *str, size_t n); - extern ACE_Export wchar_t *strnnew (const wchar_t *str, size_t n); + static wchar_t *strnnew (const wchar_t *str, size_t n); #endif /* ACE_HAS_WCHAR */ @@ -451,141 +431,130 @@ namespace ACE * a ".exe" suffix. The caller is responsible for freeing the * memory using delete []. */ - extern ACE_Export const ACE_TCHAR *execname (const ACE_TCHAR *pathname); + static const ACE_TCHAR *execname (const ACE_TCHAR *pathname); /** - * Returns the "basename" of a @a pathname separated by @a delim. - * For instance, the basename of "/tmp/foo.cpp" is "foo.cpp" when - * @a delim is @a '/'. + * Returns the "basename" of a <pathname> separated by <delim>. For + * instance, the basename of "/tmp/foo.cpp" is "foo.cpp" when + * <delim> is '/'. */ - extern ACE_Export const ACE_TCHAR *basename (const ACE_TCHAR *pathname, - ACE_TCHAR delim = - ACE_DIRECTORY_SEPARATOR_CHAR); + static const ACE_TCHAR *basename (const ACE_TCHAR *pathname, + ACE_TCHAR delim = + ACE_DIRECTORY_SEPARATOR_CHAR); /** - * Returns the "dirname" of a @a pathname. For instance, the - * dirname of "/tmp/foo.cpp" is "/tmp" when @a delim is @a '/'. If - * @a pathname has no @a delim ".\0" is returned. This method does - * not modify @a pathname and is not reentrant. + * Returns the "dirname" of a <pathname>. For instance, the dirname + * of "/tmp/foo.cpp" is "/tmp" when <delim> is '/'. If <pathname> + * has no <delim> ".\0" is returned. This method does not modify + * <pathname> and is not reentrant. */ - extern ACE_Export const ACE_TCHAR *dirname (const ACE_TCHAR *pathname, - ACE_TCHAR delim = - ACE_DIRECTORY_SEPARATOR_CHAR); + static const ACE_TCHAR *dirname (const ACE_TCHAR *pathname, + ACE_TCHAR delim = ACE_DIRECTORY_SEPARATOR_CHAR); /** * Returns the current timestamp in the form * "hour:minute:second:microsecond." The month, day, and year are - * also stored in the beginning of the @a date_and_time array, which - * is a user-supplied array of size @a time_len> @c ACE_TCHARs. - * Returns 0 if unsuccessful, else returns pointer to beginning of the - * "time" portion of @a date_and_time. If @a - * return_pointer_to_first_digit is 0 then return a pointer to the + * also stored in the beginning of the <date_and_time> array, which + * is a user-supplied array of size <time_len> <ACE_TCHAR>s. Returns + * 0 if unsuccessful, else returns pointer to beginning of the + * "time" portion of <date_and_time>. If + * <return_pointer_to_first_digit> is 0 then return a pointer to the * space before the time, else return a pointer to the beginning of * the time portion. */ - extern ACE_Export ACE_TCHAR *timestamp (ACE_TCHAR date_and_time[], - int time_len, - int return_pointer_to_first_digit = - 0); + static ACE_TCHAR *timestamp (ACE_TCHAR date_and_time[], + int time_len, + int return_pointer_to_first_digit = 0); /** - * if @a avoid_zombies == 0 call @c ACE_OS::fork directly, else - * create an orphan process that's inherited by the init process; - * init cleans up when the orphan process terminates so we don't - * create zombies. + * if <avoid_zombies> == 0 call <ACE_OS::fork> directly, else create + * an orphan process that's inherited by the init process; init + * cleans up when the orphan process terminates so we don't create + * zombies. */ - extern ACE_Export pid_t fork ( - const ACE_TCHAR *program_name = ACE_LIB_TEXT ("<unknown>"), - int avoid_zombies = 0); + static pid_t fork (const ACE_TCHAR *program_name = ACE_LIB_TEXT ("<unknown>"), + int avoid_zombies = 0); /** * Become a daemon process using the algorithm in Richard Stevens * "Advanced Programming in the UNIX Environment." If - * @a close_all_handles is non-zero then all open file handles are + * <close_all_handles> is non-zero then all open file handles are * closed. */ - extern ACE_Export int daemonize ( - const ACE_TCHAR pathname[] = ACE_LIB_TEXT ("/"), - int close_all_handles = ACE_DEFAULT_CLOSE_ALL_HANDLES, - const ACE_TCHAR program_name[] = ACE_LIB_TEXT ("<unknown>")); + static int daemonize (const ACE_TCHAR pathname[] = ACE_LIB_TEXT ("/"), + int close_all_handles = ACE_DEFAULT_CLOSE_ALL_HANDLES, + const ACE_TCHAR program_name[] = ACE_LIB_TEXT ("<unknown>")); - // = Miscellaneous functions. + // = Miscelleous functions. /// Rounds the request to a multiple of the page size. - extern ACE_Export size_t round_to_pagesize (off_t length); + static size_t round_to_pagesize (off_t length); /// Rounds the request to a multiple of the allocation granularity. - extern ACE_Export size_t round_to_allocation_granularity (off_t len); + static size_t round_to_allocation_granularity (off_t len); // @@ UNICODE what about buffer? /// Format buffer into printable format. This is useful for /// debugging. - extern ACE_Export size_t format_hexdump (const char *buffer, size_t size, - ACE_TCHAR *obuf, size_t obuf_sz); + static size_t format_hexdump (const char *buffer, size_t size, + ACE_TCHAR *obuf, size_t obuf_sz); /// Computes the hash value of <str> using the "Hash PJW" routine. - extern ACE_Export u_long hash_pjw (const char *str); + static u_long hash_pjw (const char *str); /// Computes the hash value of <str> using the "Hash PJW" routine. - extern ACE_Export u_long hash_pjw (const char *str, size_t len); + static u_long hash_pjw (const char *str, size_t len); #if defined (ACE_HAS_WCHAR) /// Computes the hash value of <str> using the "Hash PJW" routine. - extern ACE_Export u_long hash_pjw (const wchar_t *str); + static u_long hash_pjw (const wchar_t *str); /// Computes the hash value of <str> using the "Hash PJW" routine. - extern ACE_Export u_long hash_pjw (const wchar_t *str, size_t len); + static u_long hash_pjw (const wchar_t *str, size_t len); #endif /* ACE_HAS_WCHAR */ /// Computes the ISO 8802-3 standard 32 bits CRC for the string /// (not for a file). - extern ACE_Export u_long crc32 (const char *str); + static u_long crc32 (const char *str); /// Computes the ISO 8802-3 standard 32 bits CRC for the given /// buffer (the length is included in the CRC). - extern ACE_Export u_long crc32 (const char *buf, ACE_UINT32 len); + static u_long crc32 (const char *buf, ACE_UINT32 len); /// Computes the ISO 8802-3 standard 32 bits CRC for the /// @ len iovec buffers. - extern ACE_Export u_long crc32 (iovec *iov, int len); + static u_long crc32 (iovec *iov, int len); /// Euclid's greatest common divisor algorithm. - extern ACE_Export u_long gcd (u_long x, u_long y); + static u_long gcd (u_long x, u_long y); /// Calculates the minimum enclosing frame size for the given values. - extern ACE_Export u_long minimum_frame_size (u_long period1, u_long period2); + static u_long minimum_frame_size (u_long period1, u_long period2); /** * Function that can burn up noticeable CPU time: brute-force - * determination of whether number @a n is prime. Returns 0 if - * it is prime, or the smallest factor if it is not prime. - * @a min_factor and @a max_factor can be used to partition the work - * among threads. For just one thread, typical values are 2 and - * n/2. + * determination of whether number "n" is prime. Returns 0 if + * it is prime, or the smallest factor if it is not prime. min_factor + * and max_factor can be used to partition the work among threads. + * For just one thread, typical values are 2 and n/2. */ - extern ACE_Export u_long is_prime (const u_long n, - const u_long min_factor, - const u_long max_factor); + static u_long is_prime (const u_long n, + const u_long min_factor, + const u_long max_factor); /// Map troublesome win32 errno values to values that standard C /// strerr function understands. Thank you Microsoft. - extern ACE_Export int map_errno (int error); + static int map_errno (int error); /// Returns a string containing the error message corresponding to a - /// WinSock error. This works around an omission in the Win32 API. - /// @internal - extern ACE_Export const ACE_TCHAR * sock_error (int error); - - /// Determins whether the given error code corresponds to to a - /// WinSock error. If so returns true, false otherwise. - /// @internal - extern ACE_Export bool is_sock_error (int error); + /// WinSock error. This works around an omission in the Win32 API... + static const ACE_TCHAR *sock_error (int error); /** * Checks if process with <pid> is still alive. Returns 1 if it is * still alive, 0 if it isn't alive, and -1 if something weird * happened. */ - extern ACE_Export int process_active (pid_t pid); + static int process_active (pid_t pid); /** * Terminate the process abruptly with id <pid>. On Win32 platforms @@ -595,7 +564,7 @@ namespace ACE * since the process being terminated may not have a chance to * cleanup before it shuts down. */ - extern ACE_Export int terminate_process (pid_t pid); + static int terminate_process (pid_t pid); /** * This method uses process id and object pointer to come up with a @@ -605,209 +574,214 @@ namespace ACE * the same process. The uniqueness of this name is therefore only * valid for the life of <object>. */ - ACE_NAMESPACE_INLINE_FUNCTION void unique_name (const void *object, - ACE_TCHAR *name, - size_t length); + static void unique_name (const void *object, + ACE_TCHAR *name, + size_t length); /// Computes the base 2 logarithm of <num>. - ACE_NAMESPACE_INLINE_FUNCTION u_long log2 (u_long num); + static u_long log2 (u_long num); /// Hex conversion utility. - ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR nibble2hex (u_int n); + static ACE_TCHAR nibble2hex (u_int n); /// Convert a hex character to its byte representation. - ACE_NAMESPACE_INLINE_FUNCTION u_char hex2byte (ACE_TCHAR c); + static u_char hex2byte (ACE_TCHAR c); // = Set/get the debug level. - extern ACE_Export char debug (void); - extern ACE_Export void debug (char d); - - /// Wrapper facade for @c select that uses @c ACE_Handle_Sets. - extern ACE_Export int select (int width, - ACE_Handle_Set *readfds, - ACE_Handle_Set *writefds = 0, - ACE_Handle_Set *exceptfds = 0, - const ACE_Time_Value *timeout = 0); - - /// Wrapper facade for the most common use of @c select that uses - /// @c ACE_Handle_Sets. - extern ACE_Export int select (int width, - ACE_Handle_Set &readfds, - const ACE_Time_Value *timeout = 0); + static char debug (void); + static void debug (char d); + + /// Wrapper facade for <select> that uses <ACE_Handle_Set>s. + static int select (int width, + ACE_Handle_Set *readfds, + ACE_Handle_Set *writefds = 0, + ACE_Handle_Set *exceptfds = 0, + const ACE_Time_Value *timeout = 0); + + /// Wrapper facade for the most common use of <select> that uses + /// <ACE_Handle_Set>s. + static int select (int width, + ACE_Handle_Set &readfds, + const ACE_Time_Value *timeout = 0); /// Timed wait for handle to get read ready. - ACE_NAMESPACE_INLINE_FUNCTION - int handle_read_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout); + static int handle_read_ready (ACE_HANDLE handle, + const ACE_Time_Value *timeout); /// Timed wait for handle to get write ready. - ACE_NAMESPACE_INLINE_FUNCTION - int handle_write_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout); + static int handle_write_ready (ACE_HANDLE handle, + const ACE_Time_Value *timeout); /// Timed wait for handle to get exception ready. - ACE_NAMESPACE_INLINE_FUNCTION - int handle_exception_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout); + static int handle_exception_ready (ACE_HANDLE handle, + const ACE_Time_Value *timeout); /// Timed wait for handle to get read, write, or exception ready. - extern ACE_Export int handle_ready (ACE_HANDLE handle, - const ACE_Time_Value *timeout, - int read_ready, - int write_ready, - int exception_ready); - - /// Wait for @a timeout before proceeding to a @c recv operation. - /// @a val keeps track of whether we're in non-blocking mode or - /// not. - extern ACE_Export int enter_recv_timedwait (ACE_HANDLE handle, - const ACE_Time_Value *timeout, - int &val); - - /// Wait for @a timeout before proceeding to a @c send operation. - /// @a val keeps track of whether we're in non-blocking mode or - /// not. - extern ACE_Export int enter_send_timedwait (ACE_HANDLE handle, - const ACE_Time_Value* timeout, - int &val); - - /// This makes sure that @a handle is set into non-blocking mode. - /// @a val keeps track of whether were in non-blocking mode or not. - extern ACE_Export void record_and_set_non_blocking_mode (ACE_HANDLE handle, - int &val); + static int handle_ready (ACE_HANDLE handle, + const ACE_Time_Value *timeout, + int read_ready, + int write_ready, + int exception_ready); + + /// Wait for <timeout> before proceeding to a <recv> operation. + /// <val> keeps track of whether we're in non-blocking mode or not. + static int enter_recv_timedwait (ACE_HANDLE handle, + const ACE_Time_Value *timeout, + int &val); + + /// Wait for <timeout> before proceeding to a <send> operation. + /// <val> keeps track of whether we're in non-blocking mode or not. + static int enter_send_timedwait (ACE_HANDLE handle, + const ACE_Time_Value* timeout, + int &val); + + /// This makes sure that <handle> is set into non-blocking mode. + /// <val> keeps track of whether were in non-blocking mode or not. + static void record_and_set_non_blocking_mode (ACE_HANDLE handle, + int &val); /// Cleanup after a timed operation, restore the appropriate - /// non-blocking status of @a handle. - extern ACE_Export void restore_non_blocking_mode (ACE_HANDLE handle, - int val); + /// non-blocking status of <handle>. + static void restore_non_blocking_mode (ACE_HANDLE handle, + int val); - // private: - // These functions aren't meant to be used internally, so they are - // not exported. +private: // // = Recv_n helpers // - ACE_NAMESPACE_INLINE_FUNCTION ssize_t recv_i (ACE_HANDLE handle, - void *buf, - size_t len); + static ssize_t recv_i (ACE_HANDLE handle, + void *buf, + size_t len); - extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - size_t *bytes_transferred); + static ssize_t recv_n_i (ACE_HANDLE handle, + void *buf, + size_t len, + int flags, + size_t *bytes_transferred); - extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); + static ssize_t recv_n_i (ACE_HANDLE handle, + void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout, + size_t *bytes_transferred); #if defined (ACE_HAS_TLI) - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t t_rcv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - size_t *bytes_transferred); - - ACE_NAMESPACE_INLINE_FUNCTION - ssize_t t_rcv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - int *flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); + static ssize_t t_rcv_n_i (ACE_HANDLE handle, + void *buf, + size_t len, + int *flags, + size_t *bytes_transferred); + + static ssize_t t_rcv_n_i (ACE_HANDLE handle, + void *buf, + size_t len, + int *flags, + const ACE_Time_Value *timeout, + size_t *bytes_transferred); #endif /* ACE_HAS_TLI */ - extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - size_t *bytes_transferred); + static ssize_t recv_n_i (ACE_HANDLE handle, + void *buf, + size_t len, + size_t *bytes_transferred); - extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle, - void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); + static ssize_t recv_n_i (ACE_HANDLE handle, + void *buf, + size_t len, + const ACE_Time_Value *timeout, + size_t *bytes_transferred); - extern ACE_Export ssize_t recvv_n_i (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - size_t *bytes_transferred); + static ssize_t recvv_n_i (ACE_HANDLE handle, + iovec *iov, + int iovcnt, + size_t *bytes_transferred); - extern ACE_Export ssize_t recvv_n_i (ACE_HANDLE handle, - iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); + static ssize_t recvv_n_i (ACE_HANDLE handle, + iovec *iov, + int iovcnt, + const ACE_Time_Value *timeout, + size_t *bytes_transferred); // // = Send_n helpers // - ACE_NAMESPACE_INLINE_FUNCTION ssize_t send_i (ACE_HANDLE handle, - const void *buf, - size_t len); + static ssize_t send_i (ACE_HANDLE handle, + const void *buf, + size_t len); - extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - size_t *bytes_transferred); + static ssize_t send_n_i (ACE_HANDLE handle, + const void *buf, + size_t len, + int flags, + size_t *bytes_transferred); - extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); + static ssize_t send_n_i (ACE_HANDLE handle, + const void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout, + size_t *bytes_transferred); #if defined (ACE_HAS_TLI) - extern ACE_Export ssize_t t_snd_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - size_t *bytes_transferred); + static ssize_t t_snd_n_i (ACE_HANDLE handle, + const void *buf, + size_t len, + int flags, + size_t *bytes_transferred); - extern ACE_Export ssize_t t_snd_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - int flags, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); + static ssize_t t_snd_n_i (ACE_HANDLE handle, + const void *buf, + size_t len, + int flags, + const ACE_Time_Value *timeout, + size_t *bytes_transferred); #endif /* ACE_HAS_TLI */ - extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - size_t *bytes_transferred); + static ssize_t send_n_i (ACE_HANDLE handle, + const void *buf, + size_t len, + size_t *bytes_transferred); - extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle, - const void *buf, - size_t len, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); + static ssize_t send_n_i (ACE_HANDLE handle, + const void *buf, + size_t len, + const ACE_Time_Value *timeout, + size_t *bytes_transferred); - extern ACE_Export ssize_t sendv_n_i (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - size_t *bytes_transferred); + static ssize_t sendv_n_i (ACE_HANDLE handle, + const iovec *iov, + int iovcnt, + size_t *bytes_transferred); - extern ACE_Export ssize_t sendv_n_i (ACE_HANDLE handle, - const iovec *iov, - int iovcnt, - const ACE_Time_Value *timeout, - size_t *bytes_transferred); + static ssize_t sendv_n_i (ACE_HANDLE handle, + const iovec *iov, + int iovcnt, + const ACE_Time_Value *timeout, + size_t *bytes_transferred); -} + /// Size of a VM page. + static size_t pagesize_; + + /// Size of allocation granularity. + static size_t allocation_granularity_; + + /// CRC table. + static u_long crc_table_[]; + + /// Hex characters. + static const ACE_TCHAR hex_chars_[]; + + /// Are we debugging ACE? + static char debug_; +}; #if defined (__ACE_INLINE__) #include "ace/ACE.inl" @@ -818,5 +792,4 @@ namespace ACE #endif /* acelog2 */ #include /**/ "ace/post.h" - #endif /* ACE_ACE_H */ diff --git a/ace/ACE.inl b/ace/ACE.inl index fcd4e9b407b..9e28d4ea321 100644 --- a/ace/ACE.inl +++ b/ace/ACE.inl @@ -278,7 +278,9 @@ ACE::log2 (u_long num) { u_long log = 0; - for (; num > 0; ++log) + for (; + num > 0; + log++) num >>= 1; return log; @@ -287,11 +289,8 @@ ACE::log2 (u_long num) ACE_INLINE ACE_TCHAR ACE::nibble2hex (u_int n) { - // Hexadecimal characters. - static const ACE_TCHAR hex_chars[] = ACE_LIB_TEXT ("0123456789abcdef"); - // @@ UNICODE does this work? - return hex_chars[n & 0x0f]; + return ACE::hex_chars_[n & 0x0f]; } ACE_INLINE u_char @@ -304,3 +303,15 @@ ACE::hex2byte (ACE_TCHAR c) else return (u_char) (10 + c - ACE_LIB_TEXT ('A')); } + +ACE_INLINE char +ACE::debug (void) +{ + return ACE::debug_; +} + +ACE_INLINE void +ACE::debug (char c) +{ + ACE::debug_ = c; +} diff --git a/ace/ARGV.cpp b/ace/ARGV.cpp index 7e7b323fbdc..16f8ee14dc2 100644 --- a/ace/ARGV.cpp +++ b/ace/ARGV.cpp @@ -105,7 +105,61 @@ ACE_ARGV::ACE_ARGV (ACE_TCHAR *argv[], if (argv == 0 || argv[0] == 0) return; - this->argc_ = ACE_OS::argv_to_string (argv, this->buf_, substitute_env_args); + size_t buf_len = 0; + + // Determine the length of the buffer. + + for (int i = 0; argv[i] != 0; i++) + { +#if !defined (ACE_LACKS_ENV) + ACE_TCHAR *temp = 0; + + // Account for environment variables. + if (this->substitute_env_args_ + && (argv[i][0] == '$' + && (temp = ACE_OS::getenv (&argv[i][1])) != 0)) + buf_len += ACE_OS::strlen (temp); + else +#endif /* !ACE_LACKS_ENV */ + buf_len += ACE_OS::strlen (argv[i]); + + // Add one for the extra space between each string. + buf_len++; + } + + // Step through all argv params and copy each one into buf; separate + // each param with white space. + + ACE_NEW (this->buf_, + ACE_TCHAR[buf_len + 1]); + + ACE_TCHAR *end = this->buf_; + int j; + + for (j = 0; argv[j] != 0; j++) + { +#if !defined (ACE_LACKS_ENV) + ACE_TCHAR *temp = 0; + + // Account for environment variables. + if (this->substitute_env_args_ + && (argv[j][0] == '$' + && (temp = ACE_OS::getenv (&argv[j][1])) != 0)) + end = ACE_OS::strecpy (end, temp); + else +#endif /* ACE_LACKS_ENV */ + end = ACE_OS::strecpy (end, argv[j]); + + // Replace the null char that strecpy copies with white space as + // a separator. + *(end - 1) = ACE_LIB_TEXT (' '); + } + + // Remember how many arguments there are + this->argc_ = j; + + // Null terminate the string. + *end = '\0'; } ACE_ARGV::ACE_ARGV (ACE_TCHAR *first_argv[], @@ -128,10 +182,10 @@ ACE_ARGV::ACE_ARGV (ACE_TCHAR *first_argv[], ACE_TCHAR *second_buf; // convert the first argv to a string - first_argc = this->argv_to_string (first_argv, first_buf); + first_argc = this->argv_to_string (first_argv,first_buf); // convert the second argv to a string - second_argc = this->argv_to_string (second_argv, second_buf); + second_argc = this->argv_to_string (second_argv,second_buf); // Add the number of arguments in both the argvs. this->argc_ = first_argc + second_argc; diff --git a/ace/Asynch_Acceptor.cpp b/ace/Asynch_Acceptor.cpp index 6303f00f869..719af603aa1 100644 --- a/ace/Asynch_Acceptor.cpp +++ b/ace/Asynch_Acceptor.cpp @@ -78,8 +78,8 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, { ACE_Errno_Guard g (errno); ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE_Asynch_Accept::open"))); + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("ACE_Asynch_Accept::open"))); ACE_OS::closesocket (this->listen_handle_); this->listen_handle_ = ACE_INVALID_HANDLE; return -1; @@ -94,29 +94,29 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, SO_REUSEADDR, (const char*) &one, sizeof one) == -1) - { - ACE_Errno_Guard g (errno); - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE_OS::setsockopt"))); - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - return -1; - } + { + ACE_Errno_Guard g (errno); + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("ACE_OS::setsockopt"))); + ACE_OS::closesocket (this->listen_handle_); + this->listen_handle_ = ACE_INVALID_HANDLE; + return -1; + } } // If port is not specified, bind to any port. static ACE_INET_Addr sa (ACE_sap_any_cast (const ACE_INET_Addr &)); if (address == sa && - ACE::bind_port (this->listen_handle_, - INADDR_ANY, - address.get_type()) == -1) + ACE_Sock_Connect::bind_port (this->listen_handle_, + INADDR_ANY, + address.get_type()) == -1) { ACE_Errno_Guard g (errno); ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::bind_port"))); + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("ACE::bind_port"))); ACE_OS::closesocket (this->listen_handle_); this->listen_handle_ = ACE_INVALID_HANDLE; return -1; @@ -129,8 +129,8 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, { ACE_Errno_Guard g (errno); ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE_OS::bind"))); + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("ACE_OS::bind"))); ACE_OS::closesocket (this->listen_handle_); this->listen_handle_ = ACE_INVALID_HANDLE; return -1; @@ -141,8 +141,8 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, { ACE_Errno_Guard g (errno); ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE_OS::listen"))); + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("ACE_OS::listen"))); ACE_OS::closesocket (this->listen_handle_); this->listen_handle_ = ACE_INVALID_HANDLE; return -1; @@ -156,15 +156,15 @@ ACE_Asynch_Acceptor<HANDLER>::open (const ACE_INET_Addr &address, { // Initiate accepts. if (this->accept (bytes_to_read) == -1) - { - ACE_Errno_Guard g (errno); - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE_Asynch_Acceptor::accept"))); - ACE_OS::closesocket (this->listen_handle_); - this->listen_handle_ = ACE_INVALID_HANDLE; - return -1; - } + { + ACE_Errno_Guard g (errno); + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("%p\n"), + ACE_LIB_TEXT ("ACE_Asynch_Acceptor::accept"))); + ACE_OS::closesocket (this->listen_handle_); + this->listen_handle_ = ACE_INVALID_HANDLE; + return -1; + } } return 0; diff --git a/ace/Asynch_Connector.cpp b/ace/Asynch_Connector.cpp index d8cc7b03fd0..927a70e6aa8 100644 --- a/ace/Asynch_Connector.cpp +++ b/ace/Asynch_Connector.cpp @@ -22,8 +22,6 @@ ACE_RCSID(ace, Asynch_Connector, "$Id$") #include "ace/Message_Block.h" #include "ace/INET_Addr.h" -template <class HANDLER> -const ACE_INET_Addr ACE_Asynch_Connector<HANDLER>::local_default = (u_short) 0; template <class HANDLER> ACE_Asynch_Connector<HANDLER>::ACE_Asynch_Connector (void) @@ -98,7 +96,7 @@ ACE_Asynch_Connector<HANDLER>::handle_connect (const ACE_Asynch_Connect::Result // set blocking mode if (!error && - ACE::clr_flags + ACE_Flag_Manip::clr_flags (result.connect_handle (), ACE_NONBLOCK) != 0) { error = 1; diff --git a/ace/Asynch_Connector.h b/ace/Asynch_Connector.h index c1e9a34fb70..8b00b9544af 100644 --- a/ace/Asynch_Connector.h +++ b/ace/Asynch_Connector.h @@ -44,7 +44,6 @@ template <class HANDLER> class ACE_Asynch_Connector : public ACE_Handler { public: - static const ACE_INET_Addr local_default; /// A do nothing constructor. ACE_Asynch_Connector (void); @@ -61,7 +60,8 @@ public: /// This initiates a new asynchronous connect virtual int connect (const ACE_INET_Addr &remote_sap, - const ACE_INET_Addr &local_sap = local_default, + const ACE_INET_Addr &local_sap = + ACE_INET_Addr ((u_short)0), int reuse_addr = 1, const void *act = 0); diff --git a/ace/Auto_Ptr.h b/ace/Auto_Ptr.h index 7565e66cad0..ab56839c2c3 100644 --- a/ace/Auto_Ptr.h +++ b/ace/Auto_Ptr.h @@ -92,23 +92,6 @@ public: #endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ - -/** - * @brief Implements the draft C++ standard auto_ptr abstraction. - * This version can be used instead of auto_ptr<T>, and obviates - * the need for the ACE_AUTO_PTR_RESET macro on platforms like - * VC6 where the auto_ptr<T> is broken. - */ -template <class X> -class ACE_Auto_Ptr : public ACE_Auto_Basic_Ptr <X> -{ -public: - // = Initialization and termination methods - explicit ACE_Auto_Ptr (X *p = 0) : ACE_Auto_Basic_Ptr<X> (p) {} - - X *operator-> () const; -}; - /** * @class ACE_Auto_Basic_Array_Ptr * @@ -167,18 +150,18 @@ public: // easily. Portability to these platforms requires // use of the following ACE_AUTO_PTR_RESET macro. # if defined (ACE_AUTO_PTR_LACKS_RESET) -# define ACE_AUTO_PTR_RESET(AUTOPTR,NEWPTR,TYPE) \ +# define ACE_AUTO_PTR_RESET(X,Y,Z) \ do { \ - if (NEWPTR != AUTOPTR.get ()) \ + if (Y != X.get ()) \ { \ - AUTOPTR.release (); \ - AUTOPTR = auto_ptr<TYPE> (NEWPTR); \ + X.release (); \ + X = auto_ptr<Z> (Y); \ } \ } while (0) # else /* ! ACE_AUTO_PTR_LACKS_RESET */ -# define ACE_AUTO_PTR_RESET(AUTOPTR,NEWPTR,TYPE) \ +# define ACE_AUTO_PTR_RESET(X,Y,Z) \ do { \ - AUTOPTR.reset (NEWPTR); \ + X.reset (Y); \ } while (0) # endif /* ACE_AUTO_PTR_LACKS_RESET */ diff --git a/ace/Auto_Ptr.inl b/ace/Auto_Ptr.inl index ce4d53a490c..d891930000e 100644 --- a/ace/Auto_Ptr.inl +++ b/ace/Auto_Ptr.inl @@ -92,13 +92,6 @@ auto_ptr<X>::operator-> () const #endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ template<class X> ACE_INLINE X * -ACE_Auto_Ptr<X>::operator-> () const -{ - ACE_TRACE ("ACE_Auto_Ptr<X>::operator->"); - return this->get (); -} - -template<class X> ACE_INLINE X * ACE_Auto_Basic_Array_Ptr<X>::get (void) const { ACE_TRACE ("ACE_Auto_Basic_Array_Ptr<X>::get"); diff --git a/ace/Basic_Types.h b/ace/Basic_Types.h index 3273f6eaccb..4f3e0231d89 100644 --- a/ace/Basic_Types.h +++ b/ace/Basic_Types.h @@ -41,7 +41,7 @@ */ //============================================================================= -#include "ace/config-lite.h" +#include "ace/config-all.h" #ifndef ACE_BASIC_TYPES_H # define ACE_BASIC_TYPES_H @@ -65,9 +65,9 @@ # include "ace/os_include/sys/os_types.h" -# if !defined (ACE_LACKS_SYS_PARAM_H) +# if !defined (ACE_LACKS_PARAM_H) # include /**/ <sys/param.h> -# endif /* ACE_LACKS_SYS_PARAM_H */ +# endif /* ACE_LACKS_PARAM_H */ # include "ace/ACE_export.h" @@ -75,15 +75,11 @@ # define ACE_SIZEOF_CHAR 1 // Unfortunately, there isn't a portable way to determine the size of a wchar. -// So we just define them on a platform basis. If the platform doesn't -// define it and it's an XPG4 system, assume wchar_t is 4 bytes. Some code -// uses ACE_SIZEOF_WCHAR in preprocessor statements, so sizeof() isn't valid. -// If the platform config doesn't set this, and this guess is wrong, -// Basic_Types_Test should catch the inconsistency. +// So we just define them on a platform basis. # if defined (ACE_HAS_WCHAR) # if !defined (ACE_SIZEOF_WCHAR) # if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) -# define ACE_SIZEOF_WCHAR 4 +# define ACE_SIZEOF_WCHAR sizeof (wchar_t) # else // 0 so the Basic_Types test will catch this. # define ACE_SIZEOF_WCHAR 0 @@ -563,17 +559,17 @@ typedef ptrdiff_t ptr_arith_t; # endif /* ! ACE_WIN32 && ! ACE_LACKS_LONGLONG_T */ #if !defined (ACE_UINT64_FORMAT_SPECIFIER) -# if ACE_SIZEOF_LONG == 8 -# define ACE_UINT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%lu") -# else +# if ACE_SIZEOF_LONG == 8 +# define ACE_UINT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%lu") +# else # define ACE_UINT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%llu") # endif /* ACE_SIZEOF_LONG == 8*/ #endif /* ACE_UINT64_FORMAT_SPECIFIER */ #if !defined (ACE_INT64_FORMAT_SPECIFIER) -# if ACE_SIZEOF_LONG == 8 -# define ACE_INT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%ld") -# else +# if ACE_SIZEOF_LONG == 8 +# define ACE_INT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%ld") +# else # define ACE_INT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%lld") # endif /* ACE_SIZEOF_LONG == 8 */ #endif /* ACE_INT64_FORMAT_SPECIFIER */ @@ -636,7 +632,7 @@ typedef ptrdiff_t ptr_arith_t; # define ACE_SIZEOF_LONG_DOUBLE 8 # elif LDBL_MAX_EXP == 16384 # if defined (LDBL_DIG) && LDBL_DIG == 18 -# if defined (__ia64) || defined (__x86_64) +# if defined (__ia64) # define ACE_SIZEOF_LONG_DOUBLE 16 # else /* ! __ia64 */ # define ACE_SIZEOF_LONG_DOUBLE 12 diff --git a/ace/CDR_Base.h b/ace/CDR_Base.h index 0503b9cae84..764e7bdcc1b 100644 --- a/ace/CDR_Base.h +++ b/ace/CDR_Base.h @@ -39,12 +39,6 @@ #include "ace/Basic_Types.h" #include "ace/Default_Constants.h" -#if !defined (_MSC_VER) || (_MSC_VER >= 1300) - // MSVC++ 6 can't handle partial template specializations so fall - // back on an unsigned char typedef. -# include "ace/If_Then_Else.h" -#endif /* _MSC_VER < 1300 */ - class ACE_Message_Block; @@ -167,19 +161,21 @@ public: /** * @name Basic OMG IDL Types * - * These types are for use in the CDR classes. The cleanest way to + * These types are for use in the CDRclasses. The cleanest way to * avoid complaints from all compilers is to define them all. */ //@{ -# if (defined (_MSC_VER) && (_MSC_VER < 1300)) - // MSVC++ 6 can't handle partial template specializations so fall - // back on an unsigned char typedef. + + // Versions of GNU G++ less than version 3.0 defined a pre-C99 + // bool type that was an enumeration. In some cases the enumeration + // could be promoted to an int, causing a potential problem where a + // 4 byte integer (for example) could be selected when attempting to + // send a boolean over a CDR stream. +#if defined (__GNUC__) && __GNUC__ < 3 typedef unsigned char Boolean; -# else - typedef ACE::If_Then_Else<(sizeof (bool) == 1), - bool, - unsigned char>::result_type Boolean; -# endif /* _MSC_VER <= 1300 */ +#else + typedef bool Boolean; +#endif /* bool || __GNUC__ < 3 */ typedef unsigned char Octet; typedef char Char; typedef ACE_WCHAR_T WChar; diff --git a/ace/Cleanup.h b/ace/Cleanup.h index 4cf7629ac4a..117c65f60e3 100644 --- a/ace/Cleanup.h +++ b/ace/Cleanup.h @@ -19,7 +19,7 @@ # include /**/ "ace/pre.h" -# include "ace/config-lite.h" +# include "ace/config-all.h" # if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/DEV_Connector.cpp b/ace/DEV_Connector.cpp index 5c577754481..3bb63a3aae1 100644 --- a/ace/DEV_Connector.cpp +++ b/ace/DEV_Connector.cpp @@ -9,11 +9,7 @@ #include "ace/DEV_Connector.inl" #endif /* __ACE_INLINE__ */ - -ACE_RCSID (ace, - DEV_Connector, - "$Id$") - +ACE_RCSID(ace, DEV_Connector, "$Id$") ACE_ALLOC_HOOK_DEFINE(ACE_DEV_Connector) @@ -32,19 +28,20 @@ ACE_DEV_Connector::ACE_DEV_Connector (void) int ACE_DEV_Connector::connect (ACE_DEV_IO &new_io, - const ACE_DEV_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &, - int, - int flags, - int perms) + const ACE_DEV_Addr &remote_sap, + ACE_Time_Value *timeout, + const ACE_Addr &, + int, + int flags, + int perms) { ACE_TRACE ("ACE_DEV_Connector::connect"); - ACE_HANDLE handle = ACE::handle_timed_open (timeout, - remote_sap.get_path_name (), - flags, perms); + ACE_HANDLE handle = ACE_Handle_Ops::handle_timed_open (timeout, + remote_sap.get_path_name (), + flags, perms); new_io.set_handle (handle); new_io.addr_ = remote_sap; // class copy. return handle == ACE_INVALID_HANDLE ? -1 : 0; } + diff --git a/ace/DEV_IO.h b/ace/DEV_IO.h index bdb5bee9f16..6050db06050 100644 --- a/ace/DEV_IO.h +++ b/ace/DEV_IO.h @@ -22,10 +22,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#if defined (ACE_HAS_STREAM_PIPES) -# include "ace/OS_NS_stropts.h" -#endif /* ACE_HAS_STREAM_PIPES */ - #include "ace/os_include/os_stdio.h" #include "ace/os_include/sys/os_uio.h" diff --git a/ace/DLL_Manager.cpp b/ace/DLL_Manager.cpp index 8d1e75c6660..204d1f5ebb9 100644 --- a/ace/DLL_Manager.cpp +++ b/ace/DLL_Manager.cpp @@ -86,72 +86,33 @@ ACE_DLL_Handle::open (const ACE_TCHAR *dll_name, if (ACE::debug ()) ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("ACE_DLL_Handle::open: calling dlopen on ") ACE_LIB_TEXT ("\"%s\"\n"), dll_name)); - - /* - ** Get the set of names to try loading. We need to do this to - ** properly support the ability for a user to specify a simple, - ** unadorned name (for example, "ACE") that will work across - ** platforms. We apply platform specifics to get a name that will - ** work (e.g. libACE, ACEd.dll, ACE.dll, etc.) We rely on the - ** underlying dlopen() implementation to "Do The Right Thing" in - ** terms of using relative paths, LD_LIBRARY_PATH, system security - ** rules, etc. except when ACE_MUST_HELP_DLOPEN_SEARCH_PATH is set. - ** If it is set, then ACE::ldfind() scans the configured path - ** looking for a match on the name and prefix/suffix applications. - ** NOTE: having ACE scan for a file and then pass a fully-qualified - ** pathname to dlopen() is a potential security hole; therefore, - ** do not use ACE_MUST_HELP_DLOPEN_SEARCH_PATH unless necessary - ** and only after considering the risks. - */ - ACE_Array<ACE_TString> dll_names; - dll_names.max_size (10); // Decent guess to avoid realloc later - -#if defined (ACE_MUST_HELP_DLOPEN_SEARCH_PATH) // Find out where the library is ACE_TCHAR dll_pathname[MAXPATHLEN + 1]; // Transform the pathname into the appropriate dynamic link library // by searching the ACE_LD_SEARCH_PATH. - ACE::ldfind (dll_name, - dll_pathname, - (sizeof dll_pathname / sizeof (ACE_TCHAR))); - ACE_TString dll_str (dll_pathname); - dll_names.size (1); - dll_names.set (dll_str, 0); -#else - this->get_dll_names (dll_name, dll_names); -#endif - - ACE_Array_Iterator<ACE_TString> name_iter (dll_names); - ACE_TString *name = 0; - while (name_iter.next (name)) - { - // The ACE_SHLIB_HANDLE object is obtained. - this->handle_ = ACE_OS::dlopen (name->c_str (), - open_mode); - if (this->handle_ != ACE_SHLIB_INVALID_HANDLE) // Good one - break; + ACE_Lib_Find::ldfind (dll_name, + dll_pathname, + (sizeof dll_pathname / sizeof (ACE_TCHAR))); + + // The ACE_SHLIB_HANDLE object is obtained. + this->handle_ = ACE_OS::dlopen (dll_pathname, + open_mode); #if defined (AIX) - // AIX often puts the shared library file (most often named - // shr.o) inside an archive library. If this is an archive - // library name, then try appending [shr.o] and retry. - if (ACE_TString::npos != name->strstr (ACE_LIB_TEXT (".a"))) + if (this->handle_ == ACE_SHLIB_INVALID_HANDLE) + { + // AIX often puts the shared library file (most often named shr.o) + // inside an archive library. If this is an archive library + // name, then try appending [shr.o] and retry. + if (0 != ACE_OS::strstr (dll_pathname, ACE_LIB_TEXT (".a"))) { - ACE_TCHAR aix_pathname[MAXPATHLEN + 1]; - ACE_OS::strncpy (aix_pathname, - name->c_str (), - name->length ()); - aix_pathname[name->length ()] = '\0'; - ACE_OS::strcat (aix_pathname, ACE_LIB_TEXT ("(shr.o)")); + ACE_OS::strcat (dll_pathname, ACE_LIB_TEXT ("(shr.o)")); open_mode |= RTLD_MEMBER; - this->handle_ = ACE_OS::dlopen (aix_pathname, open_mode); - if (this->handle_ != ACE_SHLIB_INVALID_HANDLE) - break; + this->handle_ = ACE_OS::dlopen (dll_pathname, open_mode); } -#endif /* AIX */ - name_iter.advance (); } +#endif /* AIX */ if (this->handle_ == ACE_SHLIB_INVALID_HANDLE) { @@ -232,7 +193,7 @@ ACE_DLL_Handle::symbol (const ACE_TCHAR *sym_name, int ignore_errors) ACE_TRACE ("ACE_DLL_Handle::symbol"); ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, this->lock_, 0)); - ACE_Auto_Array_Ptr <ACE_TCHAR> auto_name (ACE::ldname (sym_name)); + ACE_Auto_Array_Ptr <ACE_TCHAR> auto_name (ACE_Lib_Find::ldname (sym_name)); // handle_ can be invalid especially when ACE_DLL_Handle resigned ownership // BTW. Handle lifecycle management is a little crazy in ACE if ( this->handle_ != ACE_SHLIB_INVALID_HANDLE ) @@ -305,97 +266,6 @@ ACE_DLL_Handle::error (void) return str; } -void -ACE_DLL_Handle::get_dll_names (const ACE_TCHAR *dll_name, - ACE_Array<ACE_TString> &try_names) -{ - // Build the array of DLL names to try on this platform by applying the - // proper prefixes and/or suffixes to the specified dll_name. - ACE_TString base (dll_name); - ACE_TString base_dir, base_file, base_suffix; - - // 1. Separate the dll_name into the dir part and the file part. We - // only decorate the file part to determine the names to try loading. - int pos = base.rfind (ACE_DIRECTORY_SEPARATOR_CHAR); - if (pos != ACE_TString::npos) - { - base_dir = base.substr (0, static_cast<ssize_t>(pos) + 1); - base_file = base.substr (static_cast<size_t>(pos) + 1); - } - else - base_file = base; - - // 2. Locate the file suffix, if there is one. Move the '.' and the - // suffix to base_suffix. - if ((pos = base_file.rfind (ACE_TEXT ('.'))) != ACE_TString::npos) - { - base_suffix = base_file.substr (static_cast<size_t>(pos)); - base_file = base_file.substr (0, static_cast<ssize_t>(pos)); - } - - // 3. Build the combinations to try for this platform. - // Try these combinations: - // - name as originally given - // - name with decorator and platform's suffix appended (if not supplied) - // - name with platform's suffix appended (if not supplied) - // - name with platform's dll prefix (if it has one) and suffix - // - name with platform's dll prefix, decorator, and suffix. - // So we need room for 5 entries in try_names. - try_names.size (0); - if ((try_names.max_size () - try_names.size ()) < 5) - try_names.max_size (try_names.max_size () + 5); -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - ACE_TString decorator (ACE_LD_DECORATOR_STR); -#endif - ACE_TString suffix (ACE_DLL_SUFFIX); - ACE_TString prefix (ACE_DLL_PREFIX); - - for (size_t i = 0; i < 5 && try_names.size () < try_names.max_size (); ++i) - { - ACE_TString try_this; - size_t j = try_names.size (); - switch (i) - { - case 0: - try_this = dll_name; - break; - - case 1: // Name + decorator + suffix - case 2: // Name + suffix - case 3: // Prefix + name + decorator + suffix - case 4: // Prefix + name + suffix - if ( - base_suffix.length () > 0 -#if !(defined(ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK)) - || (i == 2 || i == 4) // No decorator desired; skip -#endif - ) - break; - try_this = base_dir; - if (i > 2) - try_this += prefix; - try_this += base_file; - if (base_suffix.length () > 0) - try_this += base_suffix; - else - { -#if defined (ACE_WIN32) && defined (ACE_LD_DECORATOR_STR) && !defined (ACE_DISABLE_DEBUG_DLL_CHECK) - try_this += decorator; -#endif - try_this += suffix; - } - break; - } - - if (try_this.length ()) - { - try_names.size (j + 1); - try_names.set (try_this, j); - } - } - return; -} - /******************************************************************/ // Pointer to the Singleton instance. @@ -672,8 +542,6 @@ ACE_DLL_Manager::unload_dll (ACE_DLL_Handle *dll_handle, int force_unload) } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) -template class ACE_Array_Base<ACE_TString>; -template class ACE_Array_Iterator<ACE_TString>; template class auto_ptr<ACE_TString>; # if defined (ACE_LACKS_AUTO_PTR) \ || !(defined (ACE_HAS_STANDARD_CPP_LIBRARY) \ @@ -681,9 +549,7 @@ template class auto_ptr<ACE_TString>; template class ACE_Auto_Basic_Ptr<ACE_TString>; # endif /* ACE_LACKS_AUTO_PTR */ #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) -# pragma instantiate ACE_Array_Base<ACE_TString> -# pragma instantiate ACE_Array_Iterator<ACE_TString> -# pragma instantiate auto_ptr<ACE_TString> +#pragma instantiate auto_ptr<ACE_TString> # if defined (ACE_LACKS_AUTO_PTR) \ || !(defined (ACE_HAS_STANDARD_CPP_LIBRARY) \ && (ACE_HAS_STANDARD_CPP_LIBRARY != 0)) diff --git a/ace/DLL_Manager.h b/ace/DLL_Manager.h index 856fbe4e861..0203155bd94 100644 --- a/ace/DLL_Manager.h +++ b/ace/DLL_Manager.h @@ -22,7 +22,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Auto_Ptr.h" -#include "ace/Containers_T.h" #include "ace/SStringfwd.h" #include "ace/os_include/os_dlfcn.h" @@ -108,12 +107,6 @@ private: /// to the caller. auto_ptr <ACE_TString> error (void); - // Builds array of DLL names to try to dlopen, based on platform - // and configured DLL prefixes/suffixes. - // Returns the array of names to try in try_names. - void get_dll_names (const ACE_TCHAR *dll_name, - ACE_Array<ACE_TString> &try_names); - // Keep track of how many ACE_DLL objects have a reference to this // dll. sig_atomic_t refcount_; diff --git a/ace/Default_Constants.h b/ace/Default_Constants.h index b483d4152c2..f1d99a59b9b 100644 --- a/ace/Default_Constants.h +++ b/ace/Default_Constants.h @@ -500,9 +500,9 @@ const unsigned int ACE_CONNECTOR_HANDLER_MAP_SIZE = 16; // Used for dynamic linking. #if !defined (ACE_DEFAULT_SVC_CONF) # if (ACE_USES_CLASSIC_SVC_CONF == 1) -# define ACE_DEFAULT_SVC_CONF ACE_LIB_TEXT ("./svc.conf") +# define ACE_DEFAULT_SVC_CONF "./svc.conf" # else -# define ACE_DEFAULT_SVC_CONF ACE_LIB_TEXT ("./svc.conf.xml") +# define ACE_DEFAULT_SVC_CONF "./svc.conf.xml" # endif /* ACE_USES_CLASSIC_SVC_CONF ==1 */ #endif /* ACE_DEFAULT_SVC_CONF */ diff --git a/ace/Dev_Poll_Reactor.cpp b/ace/Dev_Poll_Reactor.cpp index f0bf6b15a1b..90dc7ac525a 100644 --- a/ace/Dev_Poll_Reactor.cpp +++ b/ace/Dev_Poll_Reactor.cpp @@ -14,7 +14,7 @@ ACE_RCSID (ace, # include "ace/OS_NS_unistd.h" # include "ace/OS_NS_fcntl.h" -# include /**/ <sys/epoll.h> +# include <sys/epoll.h> # elif defined (ACE_HAS_DEV_POLL) diff --git a/ace/Dev_Poll_Reactor.h b/ace/Dev_Poll_Reactor.h index a35a087d6a1..77efe756d21 100644 --- a/ace/Dev_Poll_Reactor.h +++ b/ace/Dev_Poll_Reactor.h @@ -29,7 +29,7 @@ // The sys_epoll interface was introduced in Linux kernel 2.5.45. // Don't support backported versions since they appear to be buggy. // The obsolete ioctl()-based interface is no longer supported. -# include /**/ <linux/version.h> +# include <linux/version.h> # if LINUX_VERSION_CODE < KERNEL_VERSION (2,5,45) # undef ACE_HAS_EVENT_POLL # error Disabling Linux epoll support. Kernel used in C library is too old. diff --git a/ace/Dump_T.cpp b/ace/Dump_T.cpp index fe83085ee1a..806ccd2f443 100644 --- a/ace/Dump_T.cpp +++ b/ace/Dump_T.cpp @@ -6,7 +6,6 @@ #include "ace/Dump_T.h" #include "ace/Global_Macros.h" -#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/Dynamic_Service.h b/ace/Dynamic_Service.h index e7cddce6ad8..85d1a2f7730 100644 --- a/ace/Dynamic_Service.h +++ b/ace/Dynamic_Service.h @@ -39,11 +39,10 @@ template <class TYPE> class ACE_Dynamic_Service : public ACE_Dynamic_Service_Base { public: - /// Return instance using @a name to search the Service_Repository. - static TYPE* instance (const ACE_TCHAR *name); + /// Return instance using <name> to search the Service_Repository. + static TYPE*instance (const ACE_TCHAR *name); #if defined (ACE_USES_WCHAR) - /// Return instance using @a name to search the Service_Repository. static TYPE* instance (const ACE_ANTI_TCHAR *name); #endif // ACE_USES_WCHAR }; diff --git a/ace/Env_Value_T.inl b/ace/Env_Value_T.inl index 2a58036c2f3..9f98f0fdb45 100644 --- a/ace/Env_Value_T.inl +++ b/ace/Env_Value_T.inl @@ -33,15 +33,10 @@ ACE_Env_Value<T>::open (const ACE_TCHAR *varname, template <class T> ACE_INLINE void ACE_Env_Value<T>::fetch_value (void) { -#if defined (ACE_WIN32) - const ACE_TCHAR *env = ACE_OS::getenv (this->varname_); + const ACE_TCHAR *env = ACE_OS::getenv (varname_); + if (env != 0) ACE_Convert (env, value_); -#else - char *nenv = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (this->varname_)); - if (nenv != 0) - ACE_Convert (ACE_TEXT_CHAR_TO_TCHAR (nenv), value_); -#endif } template <class T> ACE_INLINE const ACE_TCHAR* diff --git a/ace/Event_Handler_T.h b/ace/Event_Handler_T.h index 1352a65d486..4f2d10f3df8 100644 --- a/ace/Event_Handler_T.h +++ b/ace/Event_Handler_T.h @@ -100,9 +100,9 @@ public: // These methods all delegate down to the <T> operations handler. virtual ACE_HANDLE get_handle (void) const; virtual void set_handle (ACE_HANDLE); - virtual int handle_input (ACE_HANDLE fd = ACE_INVALID_HANDLE); - virtual int handle_output (ACE_HANDLE fd = ACE_INVALID_HANDLE); - virtual int handle_exception (ACE_HANDLE fd = ACE_INVALID_HANDLE); + virtual int handle_input (ACE_HANDLE fd = -1); + virtual int handle_output (ACE_HANDLE fd = -1); + virtual int handle_exception (ACE_HANDLE fd = -1); virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg = 0); virtual int handle_close (ACE_HANDLE fd, ACE_Reactor_Mask close_mask); virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); diff --git a/ace/FIFO_Send_Msg.h b/ace/FIFO_Send_Msg.h index b7f0e104177..b4efb1607cf 100644 --- a/ace/FIFO_Send_Msg.h +++ b/ace/FIFO_Send_Msg.h @@ -21,10 +21,6 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#if defined (ACE_HAS_STREAM_PIPES) -# include "ace/OS_NS_stropts.h" -#endif /* ACE_HAS_STREAM_PIPES */ - // Forward Decls class ACE_Str_Buf; diff --git a/ace/FILE_Addr.cpp b/ace/FILE_Addr.cpp index 8a44c0757c5..5109e375253 100644 --- a/ace/FILE_Addr.cpp +++ b/ace/FILE_Addr.cpp @@ -31,7 +31,7 @@ ACE_FILE_Addr::set (const ACE_FILE_Addr &sa) ACE_OS::strcpy (this->filename_, ACE_DEFAULT_TEMP_FILE); #else /* ACE_DEFAULT_TEMP_FILE */ - if (ACE::get_temp_dir (this->filename_, + if (ACE_Lib_Find::get_temp_dir (this->filename_, MAXPATHLEN - 15) == -1) // -15 for ace-file-XXXXXX { diff --git a/ace/FILE_Connector.cpp b/ace/FILE_Connector.cpp index 446be74fdf5..665deb3c077 100644 --- a/ace/FILE_Connector.cpp +++ b/ace/FILE_Connector.cpp @@ -32,12 +32,12 @@ ACE_FILE_Connector::ACE_FILE_Connector (void) int ACE_FILE_Connector::connect (ACE_FILE_IO &new_io, - const ACE_FILE_Addr &remote_sap, - ACE_Time_Value *timeout, - const ACE_Addr &, - int, - int flags, - int perms) + const ACE_FILE_Addr &remote_sap, + ACE_Time_Value *timeout, + const ACE_Addr &, + int, + int flags, + int perms) { ACE_TRACE ("ACE_FILE_Connector::connect"); ACE_ASSERT (new_io.get_handle () == ACE_INVALID_HANDLE); @@ -65,7 +65,7 @@ ACE_FILE_Connector::connect (ACE_FILE_IO &new_io, handle = ACE_OS::mkstemp (filename); // mkstemp() replaces "XXXXXX" if (handle == ACE_INVALID_HANDLE - || new_io.addr_.set (ACE_TEXT_CHAR_TO_TCHAR (filename)) != 0) + || new_io.addr_.set (filename) != 0) return -1; new_io.set_handle (handle); @@ -76,7 +76,7 @@ ACE_FILE_Connector::connect (ACE_FILE_IO &new_io, else new_io.addr_ = remote_sap; // class copy. - handle = ACE::handle_timed_open (timeout, + handle = ACE_Handle_Ops::handle_timed_open (timeout, new_io.addr_.get_path_name (), flags, perms); diff --git a/ace/FILE_IO.h b/ace/FILE_IO.h index 0bc7c98e187..ee44973a083 100644 --- a/ace/FILE_IO.h +++ b/ace/FILE_IO.h @@ -26,10 +26,6 @@ #include "ace/os_include/os_stdio.h" #include "ace/os_include/sys/os_uio.h" -#if defined (ACE_HAS_STREAM_PIPES) -# include "ace/OS_NS_stropts.h" -#endif /* ACE_HAS_STREAM_PIPES */ - // Forward decl. class ACE_Message_Block; class ACE_Time_Value; diff --git a/ace/Flag_Manip.cpp b/ace/Flag_Manip.cpp index 50df345d56a..fcd7fa450a5 100644 --- a/ace/Flag_Manip.cpp +++ b/ace/Flag_Manip.cpp @@ -15,16 +15,14 @@ # include "ace/os_include/os_termios.h" #endif /* CYGWIN32 */ -ACE_RCSID (ace, - Flag_Manip, - "$Id$") +ACE_RCSID(ace, Flag_Manip, "$Id$") // Flags are file status flags to turn on. int -ACE::set_flags (ACE_HANDLE handle, int flags) +ACE_Flag_Manip::set_flags (ACE_HANDLE handle, int flags) { - ACE_TRACE ("ACE::set_flags"); + ACE_TRACE ("ACE_Flag_Manip::set_flags"); #if defined (ACE_WIN32) || defined (VXWORKS) || defined (ACE_LACKS_FCNTL) switch (flags) { @@ -57,9 +55,9 @@ ACE::set_flags (ACE_HANDLE handle, int flags) // Flags are the file status flags to turn off. int -ACE::clr_flags (ACE_HANDLE handle, int flags) +ACE_Flag_Manip::clr_flags (ACE_HANDLE handle, int flags) { - ACE_TRACE ("ACE::clr_flags"); + ACE_TRACE ("ACE_Flag_Manip::clr_flags"); #if defined (ACE_WIN32) || defined (VXWORKS) || defined (ACE_LACKS_FCNTL) switch (flags) diff --git a/ace/Flag_Manip.h b/ace/Flag_Manip.h index 28646f98350..5357a798a5f 100644 --- a/ace/Flag_Manip.h +++ b/ace/Flag_Manip.h @@ -26,26 +26,22 @@ #include "ace/Global_Macros.h" #include "ace/os_include/os_fcntl.h" /* For values passed to these methods */ -#if defined (ACE_EXPORT_MACRO) -# undef ACE_EXPORT_MACRO -#endif -#define ACE_EXPORT_MACRO ACE_Export - - -namespace ACE +class ACE_Export ACE_Flag_Manip { + public: + // = Set/get/clear various flags related to I/O HANDLE. - /// Set flags associated with @a handle. - extern ACE_Export int set_flags (ACE_HANDLE handle, - int flags); + /// Set flags associated with <handle>. + static int set_flags (ACE_HANDLE handle, + int flags); - /// Clear flags associated with @a handle. - extern ACE_Export int clr_flags (ACE_HANDLE handle, - int flags); + /// Clear flags associated with <handle>. + static int clr_flags (ACE_HANDLE handle, + int flags); - /// Return the current setting of flags associated with @a handle. - ACE_NAMESPACE_INLINE_FUNCTION int get_flags (ACE_HANDLE handle); -} + /// Return the current setting of flags associated with <handle>. + static int get_flags (ACE_HANDLE handle); +}; #if defined (__ACE_INLINE__) #include "ace/Flag_Manip.inl" diff --git a/ace/Flag_Manip.inl b/ace/Flag_Manip.inl index 0009be56695..3eb4b236023 100644 --- a/ace/Flag_Manip.inl +++ b/ace/Flag_Manip.inl @@ -6,9 +6,9 @@ #include "ace/OS_NS_fcntl.h" ACE_INLINE int -ACE::get_flags (ACE_HANDLE handle) +ACE_Flag_Manip::get_flags (ACE_HANDLE handle) { - ACE_TRACE ("ACE::get_flags"); + ACE_TRACE ("ACE_Flag_Manip::get_flags"); #if defined (ACE_LACKS_FCNTL) // ACE_OS::fcntl is not supported, e.g., on VxWorks. It diff --git a/ace/Get_Opt.cpp b/ace/Get_Opt.cpp index 3492b31c263..e95ef4701ad 100644 --- a/ace/Get_Opt.cpp +++ b/ace/Get_Opt.cpp @@ -118,13 +118,7 @@ ACE_Get_Opt::ACE_Get_Opt (int argc, ACE_NEW (this->last_option_, ACE_TString (ACE_LIB_TEXT (""))); // First check to see if POSIXLY_CORRECT was set. - // Win32 is the only platform capable of wide-char env var. -#if defined (ACE_WIN32) - const ACE_TCHAR *env_check = ACE_LIB_TEXT ("POSIXLY_CORRECT"); -#else - const char *env_check = "POSIXLY_CORRECT"; -#endif - if (ACE_OS::getenv (env_check) != 0) + if (ACE_OS::getenv (ACE_LIB_TEXT ("POSIXLY_CORRECT")) != 0) this->ordering_ = REQUIRE_ORDER; // Now, check to see if any or the following were passed at diff --git a/ace/Global_Macros.h b/ace/Global_Macros.h index d4dc3dae628..9304ac28501 100644 --- a/ace/Global_Macros.h +++ b/ace/Global_Macros.h @@ -358,6 +358,15 @@ friend class ace_dewarn_gplusplus } \ } \ while (0) +# if defined (__Lynx__) && __LYNXOS_SDK_VERSION == 199701L + // LynxOS 3.0.0's g++ has trouble with the real versions of these. +# define ACE_DES_FREE_TEMPLATE(POINTER,DEALLOCATOR,T_CLASS,T_PARAMETER) +# define ACE_DES_ARRAY_FREE_TEMPLATE(POINTER,DEALLOCATOR,T_CLASS,T_PARAMETER) +# define ACE_DES_FREE_TEMPLATE2(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) +# define ACE_DES_FREE_TEMPLATE3(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) +# define ACE_DES_FREE_TEMPLATE4(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) +# define ACE_DES_ARRAY_FREE_TEMPLATE2(POINTER,DEALLOCATOR,T_CLASS,T_PARAM1,T_PARAM2) +# else # define ACE_DES_FREE_TEMPLATE(POINTER,DEALLOCATOR,T_CLASS,T_PARAMETER) \ do { \ if (POINTER) \ @@ -422,6 +431,7 @@ friend class ace_dewarn_gplusplus } \ } \ while (0) +# endif /* defined (__Lynx__) && __LYNXOS_SDK_VERSION == 199701L */ # endif /* defined ! ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR */ diff --git a/ace/Handle_Ops.cpp b/ace/Handle_Ops.cpp index eb373af8020..e58ebfb6f26 100644 --- a/ace/Handle_Ops.cpp +++ b/ace/Handle_Ops.cpp @@ -6,18 +6,16 @@ #include "ace/OS_NS_fcntl.h" #include "ace/Time_Value.h" -ACE_RCSID (ace, - Handle_Ops, - "$Id$") +ACE_RCSID(ace, Handle_Ops, "$Id$") ACE_HANDLE -ACE::handle_timed_open (ACE_Time_Value *timeout, - const ACE_TCHAR *name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa) +ACE_Handle_Ops::handle_timed_open (ACE_Time_Value *timeout, + const ACE_TCHAR *name, + int flags, + int perms, + LPSECURITY_ATTRIBUTES sa) { - ACE_TRACE ("ACE::handle_timed_open"); + ACE_TRACE ("ACE_Handle_Ops::handle_timed_open"); if (timeout != 0) { diff --git a/ace/Handle_Ops.h b/ace/Handle_Ops.h index 7f50eba8270..66bdf4dfa34 100644 --- a/ace/Handle_Ops.h +++ b/ace/Handle_Ops.h @@ -6,7 +6,8 @@ * * $Id$ * - * This class consolidates the operations on the Handles. + * This class consolidates the operations on the Handles. + * * * @author Priyanka Gontla <pgontla@ece.uci.edu> */ @@ -27,21 +28,22 @@ class ACE_Time_Value; -// = Operations on HANDLEs. -namespace ACE +class ACE_Export ACE_Handle_Ops { +public: + // = Operations on HANDLEs. + /** - * Wait up to @a timeout> amount of time to actively open a device. - * This method doesn't perform the @c connect, it just does the - * timed wait. + * Wait up to <timeout> amount of time to actively open a device. + * This method doesn't perform the <connect>, it just does the timed + * wait... */ - extern ACE_Export ACE_HANDLE handle_timed_open ( - ACE_Time_Value *timeout, - const ACE_TCHAR *name, - int flags, - int perms, - LPSECURITY_ATTRIBUTES sa = 0); -} + static ACE_HANDLE handle_timed_open (ACE_Time_Value *timeout, + const ACE_TCHAR *name, + int flags, + int perms, + LPSECURITY_ATTRIBUTES sa = 0); +}; #include /**/ "ace/post.h" diff --git a/ace/High_Res_Timer.cpp b/ace/High_Res_Timer.cpp index f2ba4c05687..57ece6e2f05 100644 --- a/ace/High_Res_Timer.cpp +++ b/ace/High_Res_Timer.cpp @@ -75,12 +75,11 @@ ACE_High_Res_Timer::get_cpuinfo (void) int supported = 0; #endif /* __alpha__ */ - FILE *cpuinfo = ACE_OS::fopen (ACE_LIB_TEXT ("/proc/cpuinfo"), - ACE_LIB_TEXT ("r")); + FILE *cpuinfo = ACE_OS::fopen ("/proc/cpuinfo", "r"); if (cpuinfo != 0) { - char buf[128]; + ACE_TCHAR buf[128]; // ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nReading /proc/cpuinfo..."))); @@ -104,7 +103,7 @@ ACE_High_Res_Timer::get_cpuinfo (void) #else double mhertz = 1; double bmips = 1; - char arg[128]; + ACE_TCHAR arg[128]; // CPU type? if (::sscanf (buf, "cpu : %s\n", arg) == 1) @@ -334,17 +333,16 @@ ACE_High_Res_Timer::reset (void) { ACE_TRACE ("ACE_High_Res_Timer::reset"); - this->start_ = 0; - this->end_ = 0; - this->total_ = 0; - this->start_incr_ = 0; + start_ = 0; + end_ = 0; + total_ = 0; + start_incr_ = 0; } void ACE_High_Res_Timer::elapsed_time (ACE_Time_Value &tv) const { - hrtime_to_tv (tv, - ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_)); + hrtime_to_tv (tv, end_ - start_); } #if defined (ACE_HAS_POSIX_TIME) @@ -362,14 +360,12 @@ ACE_High_Res_Timer::elapsed_time (struct timespec &elapsed_time) const // Then it converts that to nanoseconds by dividing by the scale // factor to convert to usec, and multiplying by 1000.) The cast // avoids a MSVC 4.1 compiler warning about narrowing. - ACE_hrtime_t elapsed = - ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_); - u_long nseconds = static_cast<u_long> (elapsed % + u_long nseconds = static_cast<u_long> ((this->end_ - this->start_) % global_scale_factor () * 1000u / global_scale_factor ()); // Get just the microseconds (dropping any left over nanoseconds). - ACE_UINT32 useconds = (ACE_UINT32) (elapsed / global_scale_factor ()); + ACE_UINT32 useconds = (ACE_UINT32) ((this->end_ - this->start_) / global_scale_factor ()); #if ! defined(ACE_HAS_BROKEN_TIMESPEC_MEMBERS) elapsed_time.tv_sec = (time_t) (useconds / ACE_ONE_SECOND_IN_USECS); @@ -397,10 +393,10 @@ ACE_High_Res_Timer::elapsed_time (ACE_hrtime_t &nanoseconds) const // native 64-bit ints. In particular, division can be a problem. // For more background on this, please see bugzilla #1024. #if defined (ACE_WIN32) - nanoseconds = ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_) + nanoseconds = (this->end_ - this->start_) * (1024000000u / ACE_High_Res_Timer::global_scale_factor()); #else - nanoseconds = ACE_High_Res_Timer::elapsed_hrtime (this->end_, this->start_) + nanoseconds = (this->end_ - this->start_) * (1024000u / ACE_High_Res_Timer::global_scale_factor ()); #endif /* ACE_WIN32 */ // Caution - Borland has a problem with >>=, so resist the temptation. @@ -517,7 +513,7 @@ ACE_High_Res_Timer::get_env_global_scale_factor (const ACE_TCHAR *env) #if !defined (ACE_HAS_WINCE) if (env != 0) { - const char *env_value = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (env)); + const ACE_TCHAR *env_value = ACE_OS::getenv (env); if (env_value != 0) { int value = ACE_OS::atoi (env_value); diff --git a/ace/High_Res_Timer.h b/ace/High_Res_Timer.h index 194143b097b..cf9ae847693 100644 --- a/ace/High_Res_Timer.h +++ b/ace/High_Res_Timer.h @@ -279,12 +279,6 @@ private: static ACE_hrtime_t gettime (const ACE_OS::ACE_HRTimer_Op = ACE_OS::ACE_HRTIMER_GETTIME); - /// Calculate the difference between two ACE_hrtime_t values. It is assumed - /// that the end time is later than start time, so if end is a smaller - /// value, the time counter has wrapped around. - static ACE_hrtime_t elapsed_hrtime (const ACE_hrtime_t end, - const ACE_hrtime_t start); - /// Starting time. ACE_hrtime_t start_; diff --git a/ace/High_Res_Timer.inl b/ace/High_Res_Timer.inl index 49fff1aabe4..8b9e72b828e 100644 --- a/ace/High_Res_Timer.inl +++ b/ace/High_Res_Timer.inl @@ -105,15 +105,6 @@ ACE_High_Res_Timer::gettime (const ACE_OS::ACE_HRTimer_Op op) return ACE_OS::gethrtime (op); } -ACE_INLINE ACE_hrtime_t -ACE_High_Res_Timer::elapsed_hrtime (const ACE_hrtime_t end, - const ACE_hrtime_t start) -{ - if (end > start) - return end - start; - return (~start + 1 + end); // Wrapped-around counter diff -} - ACE_INLINE ACE_High_Res_Timer::~ACE_High_Res_Timer (void) { @@ -144,25 +135,26 @@ ACE_INLINE void ACE_High_Res_Timer::stop_incr (const ACE_OS::ACE_HRTimer_Op op) { ACE_TRACE ("ACE_High_Res_Timer::stop_incr"); - this->total_ += - ACE_High_Res_Timer::elapsed_hrtime (ACE_High_Res_Timer::gettime (op), - this->start_incr_); + this->total_ += ACE_High_Res_Timer::gettime (op) - this->start_incr_; } ACE_INLINE void ACE_High_Res_Timer::elapsed_microseconds (ACE_hrtime_t &usecs) const { - ACE_hrtime_t elapsed = ACE_High_Res_Timer::elapsed_hrtime (this->end_, - this->start_); #if defined (ACE_WIN32) // Win32 scale factor is in msec // This could give overflow when measuring a long time with a // big global_scale_factor() (> 48 days with a 4Ghz tick freq.) // To be looked after in the future. - usecs = (ACE_hrtime_t) ((elapsed * 1000) / global_scale_factor ()); + usecs = (ACE_hrtime_t) (((this->end_ - this->start_) * 1000) / + global_scale_factor ()); #else - usecs = (ACE_hrtime_t) (elapsed / global_scale_factor ()); + usecs = + (ACE_hrtime_t) ((this->end_ - this->start_) / global_scale_factor ()); #endif + + + } ACE_INLINE void diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp index a80a2fd06a9..ac100d46117 100644 --- a/ace/INET_Addr.cpp +++ b/ace/INET_Addr.cpp @@ -40,6 +40,9 @@ ACE_INET_Addr::addr_to_string (ACE_TCHAR s[], ACE_OS::strlen (this->get_host_addr ())) + ACE_OS::strlen ("65536") // Assume the max port number. + sizeof (':') +#if defined ACE_HAS_IPV6 + + ACE_OS::strlen ("[]") +#endif + sizeof ('\0'); // For trailing '\0'. if (size < total_len) @@ -47,7 +50,11 @@ ACE_INET_Addr::addr_to_string (ACE_TCHAR s[], else { ACE_OS::sprintf (s, +#if defined ACE_HAS_IPV6 + ACE_LIB_TEXT ("[%s]:%d"), +#else ACE_LIB_TEXT ("%s:%d"), +#endif ACE_TEXT_CHAR_TO_TCHAR (ipaddr_format == 0 ? this->get_host_name () : this->get_host_addr ()), diff --git a/ace/INET_Addr.inl b/ace/INET_Addr.inl index 41743b5ae7f..2f1b4f6c968 100644 --- a/ace/INET_Addr.inl +++ b/ace/INET_Addr.inl @@ -30,7 +30,7 @@ ACE_INET_Addr::determine_type (void) const { #if defined (ACE_HAS_IPV6) # if defined (ACE_USES_IPV4_IPV6_MIGRATION) - return ACE::ipv6_enabled () ? AF_INET6 : AF_INET; + return ACE_Sock_Connect::ipv6_enabled () ? AF_INET6 : AF_INET; # else return AF_INET6; # endif /* ACE_USES_IPV4_IPV6_MIGRATION */ diff --git a/ace/IOStream.h b/ace/IOStream.h index 66aa738227a..e4df98db3d9 100644 --- a/ace/IOStream.h +++ b/ace/IOStream.h @@ -158,7 +158,7 @@ public: virtual ~ACE_Streambuf (void); /// Get the current Time_Value pointer and provide a new one. - ACE_Time_Value *recv_timeout (ACE_Time_Value *tv = 0); + ACE_Time_Value *recv_timeout (ACE_Time_Value *tv = NULL); /** * Use this to allocate a new/different buffer for put operations. @@ -169,7 +169,7 @@ public: * It is your responsibility to delete this memory when you are done * with it. */ - char *reset_put_buffer (char *newBuffer = 0, + char *reset_put_buffer (char *newBuffer = NULL, u_int _streambuf_size = 0, u_int _pptr = 0 ); @@ -186,7 +186,7 @@ public: * It is your responsibility to delete this memory when you are done * with it. */ - char *reset_get_buffer (char *newBuffer = 0, + char *reset_get_buffer (char *newBuffer = NULL, u_int _streambuf_size = 0, u_int _gptr = 0, u_int _egptr = 0); @@ -219,7 +219,7 @@ protected: /// The overflow function receives the character which caused the /// overflow. - virtual int overflow (int c = EOF); + virtual int overflow (int = EOF); /// Resets the <base> pointer and streambuf mode. This is used /// internally when get/put buffers are allocatd. @@ -301,15 +301,15 @@ protected: ssize_t len) = 0; virtual ssize_t recv (char *buf, ssize_t len, - ACE_Time_Value *tv = 0) = 0; + ACE_Time_Value *tv = NULL) = 0; virtual ssize_t recv (char *buf, ssize_t len, int flags, - ACE_Time_Value *tv = 0) = 0; + ACE_Time_Value *tv = NULL) = 0; virtual ssize_t recv_n (char *buf, ssize_t len, int flags = 0, - ACE_Time_Value *tv = 0) = 0; + ACE_Time_Value *tv = NULL) = 0; virtual ACE_HANDLE get_handle (void); diff --git a/ace/IOStream_T.h b/ace/IOStream_T.h index dfcc5689f09..9569ba15888 100644 --- a/ace/IOStream_T.h +++ b/ace/IOStream_T.h @@ -31,10 +31,6 @@ # include "ace/Handle_Set.h" # include "ace/Global_Macros.h" -# if defined (ACE_LACKS_IOSTREAM_FX) -# include "ace/os_include/os_ctype.h" -# endif /**/ - # if defined (ACE_HAS_STRING_CLASS) template <class STREAM> STREAM & operator>> (STREAM &stream, ACE_Quoted_String &str); template <class STREAM> STREAM & operator<< (STREAM &stream, ACE_Quoted_String &str); diff --git a/ace/IO_SAP.cpp b/ace/IO_SAP.cpp index 295b88c9698..1a92cb8ad66 100644 --- a/ace/IO_SAP.cpp +++ b/ace/IO_SAP.cpp @@ -72,7 +72,7 @@ ACE_IO_SAP::enable (int value) const if (ACE_OS::fcntl (this->handle_, F_SETOWN, ACE_IO_SAP::pid_) == -1 - || ACE::set_flags (this->handle_, + || ACE_Flag_Manip::set_flags (this->handle_, FASYNC) == -1) return -1; break; @@ -83,7 +83,7 @@ ACE_IO_SAP::enable (int value) const ACE_NOTSUP_RETURN (-1); #endif /* SIGIO <== */ case ACE_NONBLOCK: - if (ACE::set_flags (this->handle_, + if (ACE_Flag_Manip::set_flags (this->handle_, ACE_NONBLOCK) == -1) return -1; break; @@ -124,7 +124,7 @@ ACE_IO_SAP::disable (int value) const if (ACE_OS::fcntl (this->handle_, F_SETOWN, 0) == -1 - || ACE::clr_flags (this->handle_, FASYNC) == -1) + || ACE_Flag_Manip::clr_flags (this->handle_, FASYNC) == -1) return -1; break; #else @@ -134,7 +134,7 @@ ACE_IO_SAP::disable (int value) const ACE_NOTSUP_RETURN (-1); #endif /* SIGIO <== */ case ACE_NONBLOCK: - if (ACE::clr_flags (this->handle_, + if (ACE_Flag_Manip::clr_flags (this->handle_, ACE_NONBLOCK) == -1) return -1; break; diff --git a/ace/IPC_SAP.cpp b/ace/IPC_SAP.cpp index a67e8a2bd95..7bf4b6f0110 100644 --- a/ace/IPC_SAP.cpp +++ b/ace/IPC_SAP.cpp @@ -86,7 +86,7 @@ ACE_IPC_SAP::enable (int value) const if (ACE_OS::fcntl (this->handle_, F_SETOWN, ACE_IPC_SAP::pid_) == -1 - || ACE::set_flags (this->handle_, + || ACE_Flag_Manip::set_flags (this->handle_, FASYNC) == -1) return -1; break; @@ -104,7 +104,7 @@ ACE_IPC_SAP::enable (int value) const break; #endif /* F_SETFD */ case ACE_NONBLOCK: - if (ACE::set_flags (this->handle_, + if (ACE_Flag_Manip::set_flags (this->handle_, ACE_NONBLOCK) == ACE_INVALID_HANDLE) return -1; break; @@ -158,7 +158,7 @@ ACE_IPC_SAP::disable (int value) const if (ACE_OS::fcntl (this->handle_, F_SETOWN, 0) == -1 - || ACE::clr_flags (this->handle_, + || ACE_Flag_Manip::clr_flags (this->handle_, FASYNC) == -1) return -1; break; @@ -176,7 +176,7 @@ ACE_IPC_SAP::disable (int value) const break; #endif /* F_SETFD */ case ACE_NONBLOCK: - if (ACE::clr_flags (this->handle_, + if (ACE_Flag_Manip::clr_flags (this->handle_, ACE_NONBLOCK) == -1) return -1; break; diff --git a/ace/Init_ACE.cpp b/ace/Init_ACE.cpp index d1f098438bc..d58574d07c3 100644 --- a/ace/Init_ACE.cpp +++ b/ace/Init_ACE.cpp @@ -6,36 +6,36 @@ ACE_RCSID (ace, Init_ACE, "$Id$") - -unsigned int ACE::init_fini_count_ = 0; +// Static data members. +unsigned int ACE_Init_ACE::init_fini_count_ = 0; int -ACE::init (void) +ACE_Init_ACE::init (void) { // Don't use ACE_TRACE, because Object_Manager might not have been // instantiated yet. - // ACE_TRACE ("ACE::init"); + // ACE_TRACE ("ACE_Init_ACE::init"); - ++ACE::init_fini_count_; + ++init_fini_count_; return ACE_Object_Manager::instance ()->init (); } int -ACE::fini (void) +ACE_Init_ACE::fini (void) { - ACE_TRACE ("ACE::fini"); + ACE_TRACE ("ACE_Init_ACE::fini"); - if (ACE::init_fini_count_ > 0) + if (init_fini_count_ > 0) { - if (--ACE::init_fini_count_ == 0) + if (--init_fini_count_ == 0) return ACE_Object_Manager::instance ()->fini (); else // Wait for remaining fini () calls. return 1; } else - // More ACE::fini () calls than ACE::init () calls. Bad + // More ACE_Init_ACE::fini () calls than ACE_Init_ACE::init () calls. Bad // application! return -1; } diff --git a/ace/Init_ACE.h b/ace/Init_ACE.h index 4d9d14da998..487fe4da176 100644 --- a/ace/Init_ACE.h +++ b/ace/Init_ACE.h @@ -6,8 +6,7 @@ * * $Id$ * - * Initialize ACE library services. Can be called only once per - * program invocation. + * This class consolidates the operations on the Handles. * * @author Priyanka Gontla <pgontla@ece.uci.edu> */ @@ -28,11 +27,13 @@ /** * @class ACE_Init_ACE * - * @brief + * @brief Initialize ACE library services. Can be called only once + * per program invocation. * */ -namespace ACE +class ACE_Export ACE_Init_ACE { +public: /** * This class implements the functions for the initialization and * shutting down ACE. These functions are called only once per ACE @@ -40,7 +41,7 @@ namespace ACE * @return Returns 0 on success, -1 on failure, and 1 if it had already been * called. */ - extern ACE_Export int init (void); + static int init (void); /** * Shut down ACE library services. Can be called only once per @@ -48,18 +49,16 @@ namespace ACE * @return Returns 0 on success, -1 on failure, and 1 if it had already been * called. */ - extern ACE_Export int fini (void); - - // private: - // Used internally, so not exported. + static int fini (void); +private: /** * Counter to match <init()>/<fini()> calls. <init()> must increment it; * <fini()> must decrement it. <fini()> then does nothing until it * reaches 0. */ - extern unsigned int init_fini_count_; -} + static unsigned int init_fini_count_; +}; #include /**/ "ace/post.h" diff --git a/ace/Lib_Find.cpp b/ace/Lib_Find.cpp index 2a78e8cc94c..8b634773273 100644 --- a/ace/Lib_Find.cpp +++ b/ace/Lib_Find.cpp @@ -27,11 +27,11 @@ ACE_RCSID(ace, Lib_Find, "$Id$") #if ! defined (ACE_PSOS_DIAB_MIPS) int -ACE::ldfind (const ACE_TCHAR* filename, - ACE_TCHAR pathname[], - size_t maxpathnamelen) +ACE_Lib_Find::ldfind (const ACE_TCHAR* filename, + ACE_TCHAR pathname[], + size_t maxpathnamelen) { - ACE_TRACE ("ACE::ldfind"); + ACE_TRACE ("ACE_Lib_Find::ldfind"); #if defined (ACE_OPENVMS) if (strlen(filename) >= maxpathnamelen) { @@ -138,7 +138,7 @@ ACE::ldfind (const ACE_TCHAR* filename, #if (ACE_DIRECTORY_SEPARATOR_CHAR != '/') // Make all the directory separators "canonical" to simplify // subsequent code. - ACE::strrepl (tempcopy, ACE_DIRECTORY_SEPARATOR_CHAR, '/'); + ACE_Lib_Find::strrepl (tempcopy, ACE_DIRECTORY_SEPARATOR_CHAR, '/'); #endif /* ACE_DIRECTORY_SEPARATOR_CHAR */ // Separate filename from pathname. @@ -222,9 +222,9 @@ ACE::ldfind (const ACE_TCHAR* filename, { #if (ACE_DIRECTORY_SEPARATOR_CHAR != '/') // Revert to native path name separators. - ACE::strrepl (searchpathname, - '/', - ACE_DIRECTORY_SEPARATOR_CHAR); + ACE_Lib_Find::strrepl (searchpathname, + '/', + ACE_DIRECTORY_SEPARATOR_CHAR); #endif /* ACE_DIRECTORY_SEPARATOR_CHAR */ // First, try matching the filename *without* adding a // prefix. @@ -309,20 +309,12 @@ ACE::ldfind (const ACE_TCHAR* filename, else if (pathlen > 0) return 0; #else - ACE_TCHAR *ld_path; -# if defined ACE_DEFAULT_LD_SEARCH_PATH - ld_path = ACE_DEFAULT_LD_SEARCH_PATH; -# else -# if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - ld_path = ACE_OS::getenv (ACE_LD_SEARCH_PATH); -# else - // Wide-char, non-Windows only offers char * getenv. So capture - // it, translate to wide-char, and continue. - ACE_Ascii_To_Wide wide_ldpath - (ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (ACE_LD_SEARCH_PATH))); - ld_path = wide_ldpath.wchar_rep (); -# endif /* ACE_WIN32 || !ACE_USES_WCHAR */ -# endif /* ACE_DEFAULT_LD_SEARCH_PATH */ + ACE_TCHAR *ld_path = +#if defined ACE_DEFAULT_LD_SEARCH_PATH + ACE_DEFAULT_LD_SEARCH_PATH; +#else + ACE_OS::getenv (ACE_LD_SEARCH_PATH); +#endif /* ACE_DEFAULT_LD_SEARCH_PATH */ #if defined (ACE_HAS_WINCE) ACE_TCHAR *ld_path_temp = 0; @@ -367,9 +359,9 @@ ACE::ldfind (const ACE_TCHAR* filename, ACE_TCHAR *nextholder = 0; const ACE_TCHAR *path_entry = - ACE::strsplit_r (ld_path, - ACE_LD_SEARCH_PATH_SEPARATOR_STR, - nextholder); + ACE_Lib_Find::strsplit_r (ld_path, + ACE_LD_SEARCH_PATH_SEPARATOR_STR, + nextholder); int result = 0; for (;;) @@ -444,10 +436,9 @@ ACE::ldfind (const ACE_TCHAR* filename, break; // Fetch the next item in the path - path_entry = - ACE::strsplit_r (0, - ACE_LD_SEARCH_PATH_SEPARATOR_STR, - nextholder); + path_entry = ACE_Lib_Find::strsplit_r (0, + ACE_LD_SEARCH_PATH_SEPARATOR_STR, + nextholder); } #if defined (ACE_HAS_WINCE) @@ -472,13 +463,13 @@ ACE::ldfind (const ACE_TCHAR* filename, } FILE * -ACE::ldopen (const ACE_TCHAR *filename, +ACE_Lib_Find::ldopen (const ACE_TCHAR *filename, const ACE_TCHAR *type) { - ACE_TRACE ("ACE::ldopen"); + ACE_TRACE ("ACE_Lib_Find::ldopen"); ACE_TCHAR buf[MAXPATHLEN + 1]; - if (ACE::ldfind (filename, + if (ACE_Lib_Find::ldfind (filename, buf, sizeof (buf) /sizeof (ACE_TCHAR)) == -1) return 0; @@ -487,9 +478,9 @@ ACE::ldopen (const ACE_TCHAR *filename, } ACE_TCHAR * -ACE::ldname (const ACE_TCHAR *entry_point) +ACE_Lib_Find::ldname (const ACE_TCHAR *entry_point) { - ACE_TRACE ("ACE::ldname"); + ACE_TRACE ("ACE_Lib_Find::ldname"); #if defined(ACE_NEEDS_DL_UNDERSCORE) size_t size = @@ -526,7 +517,7 @@ ACE::ldname (const ACE_TCHAR *entry_point) } int -ACE::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len) +ACE_Lib_Find::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len) { int result; #if defined (ACE_WIN32) @@ -540,16 +531,12 @@ ACE::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len) #else /* ACE_WIN32 */ - // NOTE! Non-Windows platforms don't deal with wide chars for env. - // variables, so do this narrow-char and convert to wide for the - // caller if necessary. - // On non-win32 platforms, check to see what the TMPDIR environment // variable is defined to be. If it doesn't exist, just use /tmp - const char *tmpdir = ACE_OS::getenv ("TMPDIR"); + const ACE_TCHAR *tmpdir = ACE_OS::getenv (ACE_LIB_TEXT ("TMPDIR")); if (tmpdir == 0) - tmpdir = "/tmp"; + tmpdir = ACE_LIB_TEXT ("/tmp"); size_t len = ACE_OS::strlen (tmpdir); @@ -561,11 +548,11 @@ ACE::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len) } else { - ACE_OS::strcpy (buffer, ACE_TEXT_CHAR_TO_TCHAR (tmpdir)); + ACE_OS::strcpy (buffer, tmpdir); // Add a trailing slash because we cannot assume there is already one // at the end. And having an extra one should not cause problems. - buffer[len] = ACE_LIB_TEXT ('/'); + buffer[len] = '/'; buffer[len + 1] = 0; result = 0; } @@ -574,7 +561,7 @@ ACE::get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len) } ACE_HANDLE -ACE::open_temp_file (const ACE_TCHAR *name, int mode, int perm) +ACE_Lib_Find::open_temp_file (const ACE_TCHAR *name, int mode, int perm) { #if defined (ACE_WIN32) ACE_UNUSED_ARG(perm); @@ -599,9 +586,9 @@ ACE::open_temp_file (const ACE_TCHAR *name, int mode, int perm) #endif /* ! ACE_PSOS_DIAB_MIPS */ size_t -ACE::strrepl (char *s, char search, char replace) +ACE_Lib_Find::strrepl (char *s, char search, char replace) { - ACE_TRACE ("ACE::strrepl"); + ACE_TRACE ("ACE_Lib_Find::strrepl"); size_t replaced = 0; @@ -620,9 +607,9 @@ ACE::strrepl (char *s, char search, char replace) // "split". char * -ACE::strsplit_r (char *str, - const char *token, - char *&next_start) +ACE_Lib_Find::strsplit_r (char *str, + const char *token, + char *&next_start) { char *result = 0; @@ -654,9 +641,9 @@ ACE::strsplit_r (char *str, #if defined (ACE_HAS_WCHAR) wchar_t * -ACE::strsplit_r (wchar_t *str, - const wchar_t *token, - wchar_t *&next_start) +ACE_Lib_Find::strsplit_r (wchar_t *str, + const wchar_t *token, + wchar_t *&next_start) { wchar_t *result = 0; @@ -687,9 +674,9 @@ ACE::strsplit_r (wchar_t *str, } size_t -ACE::strrepl (wchar_t *s, wchar_t search, wchar_t replace) +ACE_Lib_Find::strrepl (wchar_t *s, wchar_t search, wchar_t replace) { - ACE_TRACE ("ACE::strrepl"); + ACE_TRACE ("ACE_Lib_Find::strrepl"); size_t replaced = 0; diff --git a/ace/Lib_Find.h b/ace/Lib_Find.h index bfaf6a98003..fefcce6439b 100644 --- a/ace/Lib_Find.h +++ b/ace/Lib_Find.h @@ -1,12 +1,7 @@ -// -*- C++ -*- - //============================================================================= /** * @file Lib_Find.h * - * All the static function calls needed to search and open shared - * libraries. - * * $Id$ * * @author Priyanka Gontla <pgontla@ece.uci.edu> @@ -21,32 +16,39 @@ #include "ace/ACE_export.h" #include "ace/os_include/os_stdio.h" - -namespace ACE +/** + * @class ACE_Lib_Find + * + * This class includes all the static function calls needed to search + * and open shared libraries. + */ +class ACE_Export ACE_Lib_Find { + public: + // = Methods for searching and opening shared libraries. /** - * Finds the file @a filename either using an absolute path or using + * Finds the file <filename> either using an absolute path or using * a relative path in conjunction with ACE_LD_SEARCH_PATH (e.g., * $LD_LIBRARY_PATH on UNIX or the directories scaned by Win32 API * SearchPath on Win32). This function will add appropriate suffix * (e.g., .dll on Win32 or .so on UNIX) according to the OS * platform. In addition, this function will apply the appropriate - * prefix (e.g., "lib" on UNIX and "" on Win32) if the @a filename + * prefix (e.g., "lib" on UNIX and "" on Win32) if the <filename> * doesn't match directly. */ - extern ACE_Export int ldfind (const ACE_TCHAR* filename, - ACE_TCHAR pathname[], - size_t maxpathnamelen); + static int ldfind (const ACE_TCHAR* filename, + ACE_TCHAR pathname[], + size_t maxpathnamelen); /** - * Uses @c ldfind to locate and open the appropriate @a filename and + * Uses <ldfind> to locate and open the appropriate <filename> and * returns a pointer to the file, else it returns a NULL - * pointer. @a type specifies how the file should be open. + * pointer. <type> specifies how the file should be open. */ - extern ACE_Export FILE *ldopen (const ACE_TCHAR *filename, - const ACE_TCHAR *type); + static FILE *ldopen (const ACE_TCHAR *filename, + const ACE_TCHAR *type); /** * Transforms <entry_point> into a form that can be located in a @@ -55,20 +57,20 @@ namespace ACE * have a '_' prepended. Always returns a buffer that has been * dynamically allocated using <operator new>. */ - extern ACE_Export ACE_TCHAR *ldname (const ACE_TCHAR *entry_point); + static ACE_TCHAR *ldname (const ACE_TCHAR *entry_point); /** * Returns the temporary directory including the trailing slash in * <buffer>. Returns -1 for an error or if the buffer_len is not * long enough. */ - extern ACE_Export int get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len); + static int get_temp_dir (ACE_TCHAR *buffer, size_t buffer_len); /// Opening the temp file. File is automagically unlinked when it is /// closed. This is useful for have temp files. - extern ACE_Export ACE_HANDLE open_temp_file (const ACE_TCHAR *name, - int mode, - int perm = 0); + static ACE_HANDLE open_temp_file (const ACE_TCHAR *name, + int mode, + int perm = 0); // @@ Though the following functions dont come under the same category as // above, these are used only in the functions in this class. So it makes @@ -76,7 +78,7 @@ namespace ACE // /// Replace all instances of <search> in <s> with <replace>. Returns /// the number of replacements made. - extern ACE_Export size_t strrepl (char *s, char search, char replace); + static size_t strrepl (char *s, char search, char replace); /** * Splits string <s> into pieces separated by the string <token>. @@ -85,22 +87,17 @@ namespace ACE * This operates very similar to Perl's <split> function except that * it returns pieces one at a time instead of into an array. */ - extern ACE_Export char *strsplit_r (char *s, - const char *token, - char *&next_start); + static char *strsplit_r (char *s, const char *token, char *&next_start); #if defined (ACE_HAS_WCHAR) /// As strrepl, but for wide characters. - extern ACE_Export size_t strrepl (wchar_t *s, - wchar_t search, - wchar_t replace); + static size_t strrepl (wchar_t *s, wchar_t search, wchar_t replace); /// As strsplit_r, but for wide characters. - extern ACE_Export wchar_t *strsplit_r (wchar_t *s, - const wchar_t *token, - wchar_t *&next_start); + static wchar_t *strsplit_r (wchar_t *s, const wchar_t *token, + wchar_t *&next_start); #endif /* ACE_HAS_WCHAR */ -} +}; #include /**/ "ace/post.h" #endif /* ACE_LIB_FIND_H */ diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp index 0b0e7ee6041..23bd504a178 100644 --- a/ace/Log_Msg.cpp +++ b/ace/Log_Msg.cpp @@ -56,7 +56,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Log_Msg) ACE_thread_key_t *log_msg_tss_key (void) { - static ACE_thread_key_t key = 0; + static ACE_thread_key_t key; return &key; } @@ -948,8 +948,8 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, ACE_TRACE ("ACE_Log_Msg::log"); // External decls. -// sys_nerr is deprecated on some platforms, and is declared by -// system header files on others. +// sys_nerr is deprecated on some platforms, and is declared by +// system header files on others. #if ! (defined(__BORLANDC__) && __BORLANDC__ >= 0x0530) \ && !defined(__MINGW32__) && !defined(__GLIBC__) \ && !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__) \ @@ -1174,11 +1174,8 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, break; case 'N': // Source file name -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_LIB_TEXT ("ls")); -#else + // @@ UNICODE ACE_OS::strcpy (fp, ACE_LIB_TEXT ("s")); -#endif if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, this->file () ? @@ -1193,11 +1190,8 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, break; case 'n': // Program name -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_LIB_TEXT ("ls")); -#else /* ACE_WIN32 && ACE_USES_WCHAR */ + // @@ UNICODE ACE_OS::strcpy (fp, ACE_LIB_TEXT ("s")); -#endif if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, ACE_Log_Msg::program_name_ ? @@ -1234,11 +1228,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, # endif /* !__GLIBC__ */ ) { -# if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_LIB_TEXT ("ls: %ls")); -# else ACE_OS::strcpy (fp, ACE_LIB_TEXT ("s: %s")); -# endif if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, va_arg (argp, ACE_TCHAR *), @@ -1331,11 +1321,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, } case 'M': // Print the name of the priority of the message. -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_LIB_TEXT ("ls")); -#else ACE_OS::strcpy (fp, ACE_LIB_TEXT ("s")); -#endif if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, @@ -1358,11 +1344,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, # endif /* !__GLIBC__ */ ) { -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_LIB_TEXT ("ls")); -#else /* ACE_WIN32 && ACE_USES_WCHAR */ ACE_OS::strcpy (fp, ACE_LIB_TEXT ("s")); -#endif if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, @@ -1561,11 +1543,7 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, ACE_TCHAR day_and_time[35]; ACE::timestamp (day_and_time, sizeof day_and_time); -#if !defined (ACE_WIN32) && defined (ACE_USES_WCHAR) - ACE_OS::strcpy (fp, ACE_LIB_TEXT ("ls")); -#else ACE_OS::strcpy (fp, ACE_LIB_TEXT ("s")); -#endif if (can_check) this_len = ACE_OS::snprintf (bp, bspace, format, day_and_time); @@ -1820,7 +1798,10 @@ ACE_Log_Msg::log (const ACE_TCHAR *format_str, if (sizeof (ACE_OS::WChar) != sizeof (wchar_t)) { size_t len = ACE_OS::wslen (wchar_str) + 1; - ACE_NEW_NORETURN(wchar_t_str, wchar_t[len]); + //@@ Bad, but there is no such ugly thing as + // ACE_NEW_BREAK and ACE_NEW has a return + // statement inside. + ACE_NEW_RETURN(wchar_t_str, wchar_t[len], 0); if (wchar_t_str == 0) break; @@ -2240,11 +2221,11 @@ ACE_Log_Msg::dump (void) const ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("status_ = %d\n"), this->status_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nerrnum_ = %d\n"), this->errnum_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nlinenum_ = %d\n"), this->linenum_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nfile_ = %C\n"), this->file_)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nfile_ = %s\n"), this->file_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nmsg_ = %s\n"), this->msg_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nrestart_ = %d\n"), this->restart_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nostream_ = %@\n"), this->ostream_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nmsg_callback_ = %@\n"), + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nostream_ = %x\n"), this->ostream_)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nmsg_callback_ = %x\n"), this->msg_callback_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nprogram_name_ = %s\n"), this->program_name_ ? this->program_name_ @@ -2253,14 +2234,14 @@ ACE_Log_Msg::dump (void) const this->local_host_ ? this->local_host_ : ACE_LIB_TEXT ("<unknown>"))); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\npid_ = %d\n"), this->getpid ())); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nflags_ = 0x%x\n"), this->flags_)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nflags_ = %x\n"), this->flags_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\ntrace_depth_ = %d\n"), this->trace_depth_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\ntrace_active_ = %d\n"), this->trace_active_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\ntracing_enabled_ = %d\n"), this->tracing_enabled_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\npriority_mask_ = 0x%x\n"), + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\npriority_mask_ = %x\n"), this->priority_mask_)); if (this->thr_desc_ != 0 && this->thr_desc_->state () != 0) ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("\nthr_state_ = %d\n"), @@ -2623,14 +2604,14 @@ ACE_Log_Msg::inherit_hook (ACE_OS_Thread_Descriptor *thr_desc, # else /* Don't inherit Log Msg */ # if defined (ACE_PSOS) - // Create a special name for each thread... + //Create a special name for each thread... char new_name[MAXPATHLEN]={"Ace_thread-"}; char new_id[2]={0,0}; //Now it's pre-terminated! new_id[0] = '0' + (ACE_PSOS_unique_file_id++); //Unique identifier ACE_OS::strcat(new_name, new_id); - // Initialize the task specific logger + //Initialize the task specific logger ACE_LOG_MSG->open(new_name); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("(%P|%t) starting %s thread at %D\n"),new_name)); # endif /* ACE_PSOS */ diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h index 14be11341e9..258612c27fc 100644 --- a/ace/Log_Msg.h +++ b/ace/Log_Msg.h @@ -36,7 +36,7 @@ ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \ ace___->set (__FILE__, __LINE__, -1, __ace_error, ace___->restart (), \ ace___->msg_ostream (), ace___->msg_callback ()); \ - ace___->log (LM_ERROR, ACE_LIB_TEXT ("ACE_ASSERT: file %N, line %l assertion failed for '%s'.%a\n"), ACE_TEXT_CHAR_TO_TCHAR (#X), -1); \ + ace___->log (LM_ERROR, ACE_LIB_TEXT ("ACE_ASSERT: file %N, line %l assertion failed for '%s'.%a\n"), #X, -1); \ } } while (0) #endif /* ACE_NDEBUG */ @@ -100,17 +100,15 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -// These workarounds are necessary for nasty libraries or platforms -// that #define STDERR or THREAD (e.g. LynxOS). We simply #undef -// these macros as there is no way to save the macro definition using -// the pre-processor. See Bugzilla Bug #299 for more info. - -#if defined (STDERR) +#if defined (__Lynx__) || defined (INTEGRITY) # undef STDERR -#endif /* STDERR */ +#endif /* __Lynx__ */ #if defined (THREAD) -# undef THREAD +// This workaround is necessary for nasty libraries that #define +// THREAD 1. +#define ACE_THREAD_HACK THREAD +#undef THREAD #endif /* THREAD */ class ACE_Log_Msg_Callback; @@ -711,6 +709,11 @@ ACE_TSS_cleanup (void *ptr); # endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ #endif /* ACE_MT_SAFE */ +#if defined (ACE_THREAD_HACK) +#define THREAD ACE_THREAD_HACK +#undef ACE_THREAD_HACK +#endif /* ACE_THREAD_HACK */ + #if defined(ACE_LEGACY_MODE) #include "ace/Log_Msg_Callback.h" #endif /* ACE_LEGACY_MODE */ diff --git a/ace/Log_Msg_UNIX_Syslog.cpp b/ace/Log_Msg_UNIX_Syslog.cpp index b502d1dd185..9957ae90575 100644 --- a/ace/Log_Msg_UNIX_Syslog.cpp +++ b/ace/Log_Msg_UNIX_Syslog.cpp @@ -41,15 +41,9 @@ ACE_Log_Msg_UNIX_Syslog::open (const ACE_TCHAR * logger_key) // options LOG_CONS and LOG_PID to be set. There really should be a // logging strategy option to control the syslog log options, // however, we'll take the easy way out for now. -#if defined (ACE_USES_WCHAR) - openlog (ACE_TEXT_ALWAYS_CHAR (logger_key), - LOG_CONS|LOG_PID, - ACE_DEFAULT_SYSLOG_FACILITY); -#else openlog (const_cast<char *> (logger_key), LOG_CONS|LOG_PID, ACE_DEFAULT_SYSLOG_FACILITY); -#endif /* ACE_USES_WCHAR */ // Enable logging of all syslog priorities. If logging of all // priorities is not desired, use the ACE_Log_Msg::priority_mask() @@ -109,18 +103,14 @@ ACE_Log_Msg_UNIX_Syslog::log (ACE_Log_Record &log_record) || ACE_BIT_ENABLED (flags, ACE_Log_Msg::VERBOSE_LITE)) { ACE_TCHAR date_and_time[35]; - if (0 == ACE::timestamp (date_and_time, sizeof (date_and_time), 1)) - ACE_OS::strcpy (date_and_time, ACE_LIB_TEXT ("<time error>")); - const ACE_TCHAR *prio_name = - ACE_Log_Record::priority_name(ACE_Log_Priority(log_record.type())); syslog (syslog_priority, - "%s: %s: %s", - ACE_TEXT_ALWAYS_CHAR (date_and_time), - ACE_TEXT_ALWAYS_CHAR (prio_name), - ACE_TEXT_ALWAYS_CHAR (line)); + ACE_LIB_TEXT ("%s: %s: %s"), + ACE::timestamp (date_and_time, sizeof (date_and_time), 1), + ACE_Log_Record::priority_name (ACE_Log_Priority(log_record.type ())), + line); } else // No formatting required. - syslog (syslog_priority, "%s", ACE_TEXT_ALWAYS_CHAR (line)); + syslog (syslog_priority, ACE_LIB_TEXT ("%s"), line); } return 0; diff --git a/ace/Log_Record.cpp b/ace/Log_Record.cpp index 326628ae6a1..d5ca1493b4a 100644 --- a/ace/Log_Record.cpp +++ b/ace/Log_Record.cpp @@ -174,18 +174,6 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[], /* Oct 18 14:25:36.000 1989<nul> */ ACE_TCHAR timestamp[26]; // Only used by VERBOSE and VERBOSE_LITE. - // The sprintf format needs to be different for Windows and POSIX - // in the wide-char case. -#if defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) - const ACE_TCHAR *time_fmt = ACE_LIB_TEXT ("%s.%03ld %s"); - const ACE_TCHAR *verbose_fmt = ACE_LIB_TEXT ("%s@%s@%u@%s@%s"); - const ACE_TCHAR *verbose_lite_fmt = ACE_LIB_TEXT ("%s@%s@%s"); -#else - const ACE_TCHAR *time_fmt = ACE_LIB_TEXT ("%ls.%03ld %ls"); - const ACE_TCHAR *verbose_fmt = ACE_LIB_TEXT ("%ls@%ls@%u@%ls@%ls"); - const ACE_TCHAR *verbose_lite_fmt = ACE_LIB_TEXT ("%ls@%ls@%ls"); -#endif - if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE) || ACE_BIT_ENABLED (verbose_flag, @@ -204,7 +192,7 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[], ctp[24] = '\0'; // NUL-terminate after the date. ACE_OS::sprintf (timestamp, - time_fmt, + ACE_LIB_TEXT ("%s.%03ld %s"), ctp + 4, ((long) this->usecs_) / 1000, ctp + 20); @@ -223,7 +211,7 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[], : host_name); # endif /* ! defined (ACE_HAS_BROKEN_CONDITIONAL_STRING_CASTS) */ ACE_OS::sprintf (verbose_msg, - verbose_fmt, + ACE_LIB_TEXT ("%s@%s@%u@%s@%s"), timestamp, lhost_name, this->pid_, @@ -232,12 +220,14 @@ ACE_Log_Record::format_msg (const ACE_TCHAR host_name[], } else if (ACE_BIT_ENABLED (verbose_flag, ACE_Log_Msg::VERBOSE_LITE)) ACE_OS::sprintf (verbose_msg, - verbose_lite_fmt, + ACE_LIB_TEXT ("%s@%s@%s"), timestamp, ACE_Log_Record::priority_name (ACE_Log_Priority (this->type_)), this->msg_data_); else - ACE_OS::strcpy (verbose_msg, this->msg_data_); + ACE_OS::sprintf (verbose_msg, + ACE_LIB_TEXT ("%s"), + this->msg_data_); return 0; } diff --git a/ace/Logging_Strategy.cpp b/ace/Logging_Strategy.cpp index 73acccd0e0e..e6082f71397 100644 --- a/ace/Logging_Strategy.cpp +++ b/ace/Logging_Strategy.cpp @@ -232,7 +232,7 @@ ACE_Logging_Strategy::ACE_Logging_Strategy (void) ACE_TCHAR[MAXPATHLEN + 1]); // Get the temporary directory - if (ACE::get_temp_dir + if (ACE_Lib_Find::get_temp_dir (this->filename_, MAXPATHLEN - 7) == -1) // 7 for "logfile" { diff --git a/ace/MEM_Acceptor.cpp b/ace/MEM_Acceptor.cpp index adfb7e84945..e2e7de19f38 100644 --- a/ace/MEM_Acceptor.cpp +++ b/ace/MEM_Acceptor.cpp @@ -148,7 +148,7 @@ ACE_MEM_Acceptor::accept (ACE_MEM_Stream &new_stream, { ACE_TCHAR name[25]; // - 24 is so we can append name to the end. - if (ACE::get_temp_dir (buf, MAXPATHLEN - 24) == -1) + if (ACE_Lib_Find::get_temp_dir (buf, MAXPATHLEN - 24) == -1) { ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("Temporary path too long, ") @@ -237,9 +237,9 @@ ACE_MEM_Acceptor::shared_accept_finish (ACE_MEM_Stream new_stream, // Only disable ACE_NONBLOCK if we weren't in non-blocking mode // originally. - ACE::clr_flags (this->get_handle (), + ACE_Flag_Manip::clr_flags (this->get_handle (), ACE_NONBLOCK); - ACE::clr_flags (new_handle, + ACE_Flag_Manip::clr_flags (new_handle, ACE_NONBLOCK); } diff --git a/ace/Makefile.am b/ace/Makefile.am index 0beb8b6a5c8..6dd3daa35f4 100644 --- a/ace/Makefile.am +++ b/ace/Makefile.am @@ -785,7 +785,6 @@ HEADER_FILES = \ Hash_Map_Manager_T.h \ Hash_Map_With_Allocator_T.h \ High_Res_Timer.h \ - If_Then_Else.h \ INET_Addr.h \ Init_ACE.h \ Intrusive_List.h \ @@ -1367,7 +1366,7 @@ ACE_EXTRA_DIST = os_include dist-hook: (cd $(srcdir); tar cf - $(ACE_EXTRA_DIST)) | (cd $(distdir); \ tar xfBp -) - list=`find $(distdir) -type d -a \( -name CVS -o -name .svn \) -a -print`; for p in $$list; do \ + list=`find $(distdir) -type d -name CVS -print`; for p in $$list; do \ rm -rf $$p; \ done @@ -1382,7 +1381,7 @@ clean-local: ## os_include subdirectory just for installation purposes seemed like ## overkill. install-data-local: - list=`(cd $(srcdir); find os_include -type d -a \! \( \( -name CVS -o -name .svn \) -prune \) )`; for p in $$list; do \ + list=`(cd $(srcdir); find os_include -type d | $(EGREP) -v CVS)`; for p in $$list; do \ $(mkdir_p) $(DESTDIR)$(pkgincludedir)/$$p; \ files=`(cd $(srcdir)/$$p; $(ECHO) *.h)`; \ test "$$files" != "*.h" && \ diff --git a/ace/Malloc.cpp b/ace/Malloc.cpp index 9985ec74849..b0ff605f368 100644 --- a/ace/Malloc.cpp +++ b/ace/Malloc.cpp @@ -138,7 +138,7 @@ void ACE_Control_Block::ACE_Name_Node::name (const char *) { #if !defined (ACE_PSOS) - ACE_ASSERT (!"not implemented!"); + ACE_ASSERT (0 == "not implemented!"); #endif /* ! ACE_PSOS */ } diff --git a/ace/Malloc_T.h b/ace/Malloc_T.h index db31b148fa3..ada5fc23236 100644 --- a/ace/Malloc_T.h +++ b/ace/Malloc_T.h @@ -115,9 +115,6 @@ public: /// Return a chunk of memory back to free list cache. void free (void *); - /// Return the number of chunks available in the cache. - size_t pool_depth (void); - private: /// Remember how we allocate the memory in the first place so /// we can clear things up later. @@ -180,9 +177,6 @@ public: /// Return a chunk of memory back to free list cache. void free (void *); - /// Return the number of chunks available in the cache. - size_t pool_depth (void); - private: /// Remember how we allocate the memory in the first place so /// we can clear things up later. diff --git a/ace/Malloc_T.inl b/ace/Malloc_T.inl index 109d1153336..b24436fb868 100644 --- a/ace/Malloc_T.inl +++ b/ace/Malloc_T.inl @@ -67,12 +67,6 @@ ACE_Cached_Allocator<T, ACE_LOCK>::free (void * ptr) this->free_list_.add ((ACE_Cached_Mem_Pool_Node<T> *) ptr) ; } -template <class T, class ACE_LOCK> ACE_INLINE size_t -ACE_Cached_Allocator<T, ACE_LOCK>::pool_depth (void) -{ - return this->free_list_.size (); -} - template <class ACE_LOCK> ACE_INLINE void * ACE_Dynamic_Cached_Allocator<ACE_LOCK>::malloc (size_t nbytes) { @@ -113,12 +107,6 @@ ACE_Dynamic_Cached_Allocator<ACE_LOCK>::free (void * ptr) this->free_list_.add ((ACE_Cached_Mem_Pool_Node<char> *) ptr); } -template <class ACE_LOCK> ACE_INLINE size_t -ACE_Dynamic_Cached_Allocator<ACE_LOCK>::pool_depth (void) -{ - return this->free_list_.size (); -} - template <class MALLOC> ACE_INLINE void * ACE_Allocator_Adapter<MALLOC>::malloc (size_t nbytes) { diff --git a/ace/Memory_Pool.cpp b/ace/Memory_Pool.cpp index e5de1f19fdf..053fa58749f 100644 --- a/ace/Memory_Pool.cpp +++ b/ace/Memory_Pool.cpp @@ -216,7 +216,7 @@ ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool (const ACE_TCHAR *backing_store_name, ACE_OS::strcpy (this->backing_store_name_, ACE_DEFAULT_BACKING_STORE); #else /* ACE_DEFAULT_BACKING_STORE */ - if (ACE::get_temp_dir (this->backing_store_name_, + if (ACE_Lib_Find::get_temp_dir (this->backing_store_name_, MAXPATHLEN - 17) == -1) // -17 for ace-malloc-XXXXXX { @@ -485,6 +485,12 @@ ACE_MMAP_Memory_Pool_Options::ACE_MMAP_Memory_Pool_Options (const void *base_add // for backwards compatability if (base_addr_ == 0 && use_fixed_addr_ == ALWAYS_FIXED) use_fixed_addr_ = FIRSTCALL_FIXED; + + // HP-UX 11, 64-bit bug workaround. +#if defined (__hpux) && defined (__LP64__) + long temp = ACE_DEFAULT_BASE_ADDRL; + base_addr_ = (void *) temp; +#endif /* defined (__hpux) && defined (__LP64__) */ } // Handle SIGSEGV and SIGBUS signals to remap memory properly. When a @@ -628,6 +634,11 @@ ACE_Shared_Memory_Pool_Options::ACE_Shared_Memory_Pool_Options (const char *base segment_size_ (segment_size) { ACE_TRACE ("ACE_Shared_Memory_Pool_Options::ACE_Shared_Memory_Pool_Options"); + // HP-UX 11, 64-bit bug workaround +#if defined (__hpux) && defined (__LP64__) + long temp = ACE_DEFAULT_BASE_ADDRL; + base_addr_ = (char *) temp; +#endif /* defined (__hpux) && defined (__LP64__) */ } void @@ -851,15 +862,14 @@ ACE_Shared_Memory_Pool::ACE_Shared_Memory_Pool (const ACE_TCHAR *backing_store_n // key. int segment_key; - int result = ::sscanf (ACE_TEXT_ALWAYS_CHAR (backing_store_name), + int result = ::sscanf (backing_store_name, "%d", &segment_key); if (result == 0 || result == EOF) // The conversion to a number failed so hash with crc32 // ACE::crc32 is also used in <SV_Semaphore_Simple>. - this->base_shm_key_ = - (key_t) ACE::crc32 (ACE_TEXT_ALWAYS_CHAR (backing_store_name)); + this->base_shm_key_ = (key_t) ACE::crc32 (backing_store_name); else this->base_shm_key_ = segment_key; diff --git a/ace/Message_Block.cpp b/ace/Message_Block.cpp index 05659a712c5..97925966fc0 100644 --- a/ace/Message_Block.cpp +++ b/ace/Message_Block.cpp @@ -116,14 +116,11 @@ ACE_Message_Block::copy (const char *buf) } } -int +void ACE_Message_Block::crunch (void) { - if (this->rd_ptr_ != 0) + if (this->rd_ptr () > this->base ()) { - if (this->rd_ptr_ > this->wr_ptr_) - return -1; - size_t len = this->length (); (void) ACE_OS::memmove (this->base (), this->rd_ptr (), @@ -131,7 +128,6 @@ ACE_Message_Block::crunch (void) this->rd_ptr (this->base ()); this->wr_ptr (this->base () + len); } - return 0; } void diff --git a/ace/Message_Block.h b/ace/Message_Block.h index 9379f61a35b..8ea08caf316 100644 --- a/ace/Message_Block.h +++ b/ace/Message_Block.h @@ -395,9 +395,8 @@ public: /// Normalizes data in the top-level <Message_Block> to align with the base, /// i.e., it "shifts" the data pointed to by <rd_ptr> down to the <base> and /// then readjusts <rt_ptr> to point to <base> and <wr_ptr> to point - /// to <base> + the length of the moved data. Returns -1 and does - /// nothing if the <rd_ptr> is > <wr_ptr>, else 0 on success. - int crunch (void); + /// to <base> + the length of the moved data. + void crunch (void); /// Resets the Message Block data to contain nothing, i.e., sets the /// read and write pointers to align with the base. diff --git a/ace/Message_Queue_T.inl b/ace/Message_Queue_T.inl index dc3c06f7ede..3cd1e3cd719 100644 --- a/ace/Message_Queue_T.inl +++ b/ace/Message_Queue_T.inl @@ -40,7 +40,7 @@ template <ACE_SYNCH_DECL> ACE_INLINE int ACE_Message_Queue<ACE_SYNCH_USE>::is_full_i (void) { ACE_TRACE ("ACE_Message_Queue<ACE_SYNCH_USE>::is_full_i"); - return this->cur_bytes_ >= this->high_water_mark_; + return this->cur_bytes_ > this->high_water_mark_; } // Check if queue is empty (holds locks). diff --git a/ace/Module.h b/ace/Module.h index a3e6f4126b8..8f9c78e8228 100644 --- a/ace/Module.h +++ b/ace/Module.h @@ -90,7 +90,7 @@ public: int flags = M_DELETE); /** - * Initialize the module with <module_name> as its identity + * Create an initialized module with <module_name> as its identity * and <reader> and <writer> as its tasks. Previously register * reader or writers or closed down and deleted according to the * value of flags_. Should not be called from within @@ -103,7 +103,7 @@ public: int flags = M_DELETE); /** - * Close down the module and its tasks. The flags argument can be + * Close down the Module and its Tasks. The flags argument can be * used to override the default behaviour, which depends on previous * <flags> values in calls to c'tor, <open>, <reader>, and <writer>. * A previous value M_DELETE[_XXX] can not be overridden. Should diff --git a/ace/Naming_Context.cpp b/ace/Naming_Context.cpp index d700b592158..a490e919ed4 100644 --- a/ace/Naming_Context.cpp +++ b/ace/Naming_Context.cpp @@ -436,7 +436,7 @@ ACE_Name_Options::ACE_Name_Options (void) size_t pathsize = (MAXPATHLEN + 1) * sizeof (ACE_TCHAR); this->namespace_dir_ = ACE_static_cast (ACE_TCHAR *, ACE_OS::malloc (pathsize)); - if (ACE::get_temp_dir (this->namespace_dir_, MAXPATHLEN) == -1) + if (ACE_Lib_Find::get_temp_dir (this->namespace_dir_, MAXPATHLEN) == -1) { ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("Temporary path too long, ") @@ -297,6 +297,9 @@ class ACE_Timeout_Manager; # if defined (ACE_HAS_TERM_IOCTLS) # include "ace/os_include/os_termios.h" +# if defined (HPUX) +# include /**/ <sys/modem.h> +# endif /* HPUX */ # endif /* ACE_HAS_TERM_IOCTLS */ # if defined (ACE_HAS_AIO_CALLS) @@ -305,6 +308,14 @@ class ACE_Timeout_Manager; # include "ace/os_include/os_limits.h" // <sys/param.h> +// This is here for ACE_OS::num_processors_online(). On HP-UX, it +// needs sys/param.h (above) and sys/pstat.h. The implementation of the +// num_processors_online() method also uses 'defined (__hpux)' to decide +// whether or not to try the syscall. +# if defined (__hpux) +# include /**/ <sys/pstat.h> +# endif /* __hpux **/ + # if !defined (ACE_LACKS_UNIX_DOMAIN_SOCKETS) && !defined (VXWORKS) # include "ace/os_include/sys/os_un.h" # endif /* ACE_LACKS_UNIX_DOMAIN_SOCKETS */ diff --git a/ace/OS.inl b/ace/OS.inl index bd725c941e5..39dad0b3df4 100644 --- a/ace/OS.inl +++ b/ace/OS.inl @@ -68,9 +68,9 @@ using std::strftime; # include /**/ <sys/systeminfo.h> # endif /* ACE_HAS_SYS_INFO */ -# if defined (ACE_HAS_SYS_SYSCALL_H) +# if defined (ACE_HAS_SYSCALL_H) # include /**/ <sys/syscall.h> -# endif /* ACE_HAS_SYS_SYSCALL_H */ +# endif /* ACE_HAS_SYSCALL_H */ # if defined (UNIXWARE) /* See strcasecmp, below */ # include /**/ <ctype.h> diff --git a/ace/OS_Errno.h b/ace/OS_Errno.h index 7318147ae37..5ab0d2f2492 100644 --- a/ace/OS_Errno.h +++ b/ace/OS_Errno.h @@ -20,7 +20,42 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/OS_NS_errno.h" +#include "ace/os_include/os_errno.h" + +#if defined (ACE_HAS_WINCE_BROKEN_ERRNO) +/** + * @class ACE_CE_Errno + * + * Some versions of CE don't support <errno> and some versions' + * implementations are busted. So we implement our own. + * Our implementation takes up one Tls key, however, it does not + * allocate memory fromt the heap so there's no problem with cleanin + * up the errno when a thread exit. + */ +class ACE_Export ACE_CE_Errno +{ +public: + ACE_CE_Errno () {} + static void init (); + static void fini (); + static ACE_CE_Errno *instance (); + + operator int (void) const; + int operator= (int); + +private: + static ACE_CE_Errno *instance_; + static DWORD errno_key_; +}; + +# define errno (* (ACE_CE_Errno::instance ())) +#endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ + +#if defined (ACE_HAS_WINCE_BROKEN_ERRNO) +# define ACE_ERRNO_TYPE ACE_CE_Errno +#else +# define ACE_ERRNO_TYPE int +#endif /* ACE_HAS_WINCE */ /** * @class ACE_Errno_Guard diff --git a/ace/OS_Errno.inl b/ace/OS_Errno.inl index 9330c37deb4..67ef64f3d5c 100644 --- a/ace/OS_Errno.inl +++ b/ace/OS_Errno.inl @@ -1,6 +1,31 @@ // -*- C++ -*- // $Id$ +#if defined (ACE_HAS_WINCE_BROKEN_ERRNO) + +ACE_INLINE ACE_CE_Errno * +ACE_CE_Errno::instance () +{ + // This should be inlined. + return ACE_CE_Errno::instance_; +} + +ACE_INLINE +ACE_CE_Errno::operator int (void) const +{ + return (int) TlsGetValue (ACE_CE_Errno::errno_key_); +} + +ACE_INLINE int +ACE_CE_Errno::operator= (int x) +{ + // error checking? + TlsSetValue (ACE_CE_Errno::errno_key_, (void *) x); + return x; +} + +#endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ + ACE_INLINE ACE_Errno_Guard::ACE_Errno_Guard (ACE_ERRNO_TYPE &errno_ref, int error) diff --git a/ace/OS_NS_Thread.cpp b/ace/OS_NS_Thread.cpp index abf9c5bbe7b..c992554753a 100644 --- a/ace/OS_NS_Thread.cpp +++ b/ace/OS_NS_Thread.cpp @@ -16,7 +16,7 @@ ACE_RCSID (ace, #include "ace/Object_Manager_Base.h" #include "ace/OS_NS_errno.h" #include "ace/OS_NS_ctype.h" -#include "ace/Log_Msg.h" // for ACE_ASSERT + // This is necessary to work around nasty problems with MVS C++. extern "C" void @@ -502,11 +502,11 @@ ACE_TSS_Ref::operator != (const ACE_TSS_Ref &tss_ref) const // single file of template instantiations ACE_TSS_Info::ACE_TSS_Info (ACE_thread_key_t key, - ACE_TSS_Info::Destructor dest, + void (*dest)(void *), void *tss_inst) : key_ (key), destructor_ (dest), - tss_inst_ (tss_inst), + tss_obj_ (tss_inst), thread_count_ (-1) { ACE_OS_TRACE ("ACE_TSS_Info::ACE_TSS_Info"); @@ -515,7 +515,7 @@ ACE_TSS_Info::ACE_TSS_Info (ACE_thread_key_t key, ACE_TSS_Info::ACE_TSS_Info (void) : key_ (ACE_OS::NULL_key), destructor_ (0), - tss_inst_ (0), + tss_obj_ (0), thread_count_ (-1) { ACE_OS_TRACE ("ACE_TSS_Info::ACE_TSS_Info"); @@ -563,7 +563,7 @@ ACE_TSS_Info::dump (void) ACE_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("key_ = %u\n"), this->key_)); ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("destructor_ = %u\n"), this->destructor_)); - ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("tss_inst_ = %u\n"), this->tss_inst_)); + ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("tss_obj_ = %u\n"), this->tss_obj_)); ACE_DEBUG ((LM_DEBUG, ACE_END_DUMP)); # endif /* 0 */ # endif /* ACE_HAS_DUMP */ @@ -639,30 +639,12 @@ ACE_TSS_Keys::is_set (const ACE_thread_key_t key) const /** * @class ACE_TSS_Cleanup * - * @brief Singleton that helps to manage the lifetime of TSS objects and keys. + * @brief Singleton that knows how to clean up all the thread-specific + * resources for Win32. * - *********************************************************************** - * Behavior of TSS_Cleanup was changed to eliminate leaks: - * +------OLD------------+--------NEW--------- - * Action | exit| detach | exit : detach : remove - * -------------------------- | Always: Last | : : (if...) - * --key_info->thread_count_ X | X : | X : : - * destructor(tss_obj) X | [4] : | X : : - * tss_keys ()->test_and_clear X | X[2] : X[2] | X : : - * key_info->inst = 0 | X[2] : X[1] | : X : - * | | remove : remove : - * key_info->in_use (0) | : X[1] | : : X - * key_info->key_ = NULL [6] | : X[1] | : : - * key_info->destructor=0 | : X[1] | : : X - * release tss key [4] | : X | : : X - * clear key in_use_ | : [5] | : : X - *---------------------------------------------------------------------- - * [1] delegated to remove - * [2] done twice; - * [3] this is a bug. It should not be done here - * [4] Resource leak--should be done, but it's not. - * [5] Should be done here, but it's not. - * [6] Unnecessary and problematic. + * All this nonsense is required since Win32 doesn't + * automatically cleanup thread-specific storage on thread exit, + * unlike real operating systems... ;-) */ class ACE_TSS_Cleanup { @@ -681,44 +663,22 @@ public: int remove (ACE_thread_key_t key); /// Detaches a tss_instance from its key. - int detach (ACE_thread_key_t key, void * inst); + int detach (void *inst); /// Mark a key as being used by this thread. void key_used (ACE_thread_key_t key); + /// Free all keys left in the table before destruction. + int free_all_keys_left (void); + /// Indication of whether the ACE_TSS_CLEANUP_LOCK is usable, and /// therefore whether we are in static constructor/destructor phase /// or not. - static int lockable () - { - return instance_ != 0; - } + static int lockable () { return instance_ != 0; } protected: void dump (void); - /// remove key if it's unused - /// @param info reference to the info for this key - void remove_key (ACE_TSS_Info &info); - - /// Release a key used by this thread - /// @param info reference to the info for this key - /// @param destructor out arg to receive destructor function ptr - /// @param tss_obj out arg to receive pointer to deletable object - void thread_release ( - ACE_TSS_Info &info, - ACE_TSS_Info::Destructor & destructor, - void *& tss_obj); - - /// Find the TSS keys (if any) for this thread. - /// @param thread_keys reference to pointer to be filled in by this function. - /// @return false if keys don't exist. - bool find_tss_keys (ACE_TSS_Keys *& thread_keys) const; - - /// Accessor for this threads ACE_TSS_Keys instance. - /// Creates the keys if necessary. - ACE_TSS_Keys *tss_keys (); - /// Ensure singleton. ACE_TSS_Cleanup (void); @@ -730,12 +690,18 @@ private: /// Table of <ACE_TSS_Info>'s. ACE_TSS_TABLE table_; - /// Key for the thread-specific ACE_TSS_Keys - /// Used by find_tss_keys() or tss_keys() to find the - /// bit array that records whether each TSS key is in - /// use by this thread. + /// Key for the thread-specific array of whether each TSS key is in use. ACE_thread_key_t in_use_; + /// Accessor for this threads ACE_TSS_Keys instance. + ACE_TSS_Keys *tss_keys (); + +# if defined (ACE_HAS_TSS_EMULATION) + /// Key that is used by in_use_. We save this key so that we know + /// not to call its destructor in free_all_keys_left (). + ACE_thread_key_t in_use_key_; +# endif /* ACE_HAS_TSS_EMULATION */ + // = Static data. /// Pointer to the singleton instance. static ACE_TSS_Cleanup *instance_; @@ -756,74 +722,134 @@ void ACE_TSS_Cleanup::exit (void * /* status */) { ACE_OS_TRACE ("ACE_TSS_Cleanup::exit"); - // variables to hold the destructors - // and pointers to the object to be destructed - // the actual destruction is deferred until the guard is released - ACE_TSS_Info::Destructor destructor[ACE_DEFAULT_THREAD_KEYS]; - void * tss_obj[ACE_DEFAULT_THREAD_KEYS]; - // count of items to be destroyed - unsigned int d_count = 0; - - // scope the guard + + ACE_TSS_TABLE_ITERATOR key_info = table_; + ACE_TSS_Info info_arr[ACE_DEFAULT_THREAD_KEYS]; + int info_ix = 0; + + // While holding the lock, we only collect the ACE_TSS_Info objects + // in an array without invoking the according destructors. { ACE_TSS_CLEANUP_GUARD - // if not initialized or already cleaned up - ACE_TSS_Keys *this_thread_keys = 0; - if (! find_tss_keys (this_thread_keys) ) - { - return; - } + // Iterate through all the thread-specific items and free them all + // up. - // Minor hack: Iterating in reverse order means the LOG buffer which is - // accidentally allocated first will be accidentally deallocated (almost) - // last -- in case someone logs something from the other destructors. - // applications should not count on this behavior because platforms which - // do not use ACE_TSS_Cleanup may delete objects in other orders. - unsigned int key_index = ACE_DEFAULT_THREAD_KEYS; - while( key_index > 0) + for (unsigned int i = 0; + i < ACE_DEFAULT_THREAD_KEYS; + ++key_info, ++i) { - --key_index; - ACE_TSS_Info & info = this->table_[key_index]; - // if this key is in use by this thread - if (this_thread_keys->is_set(info.key_)) + if (key_info->key_ == ACE_OS::NULL_key || + ! key_info->key_in_use ()) continue; + + // If the key's ACE_TSS_Info in-use bit for this thread was set, + // unset it and decrement the key's thread_count_. + if (! tss_keys ()->test_and_clear (key_info->key_)) { - // defer deleting the in-use key until all others have been deleted - if(info.key_ != this->in_use_) - { - destructor[d_count] = 0; - tss_obj[d_count] = 0; - this->thread_release (info, destructor[d_count], tss_obj[d_count]); - if (destructor[d_count] != 0 && tss_obj[d_count] != 0) - { - ++d_count; - } - this->remove_key (info); - } + --key_info->thread_count_; } - } - // remove the in_use bit vector last - ACE_KEY_INDEX (use_index, this->in_use_); - ACE_TSS_Info & info = this->table_[use_index]; - destructor[d_count] = 0; - tss_obj[d_count] = 0; - this->thread_release (info, destructor[d_count], tss_obj[d_count]); - if (destructor[d_count] != 0 && tss_obj[d_count] != 0) - { - ++d_count; + void *tss_info = 0; + + if (key_info->destructor_ + && ACE_OS::thr_getspecific (key_info->key_, &tss_info) == 0 + && tss_info) + { + info_arr[info_ix].key_ = key_info->key_; + info_arr[info_ix].destructor_ = key_info->destructor_; + info_arr[info_ix++].tss_obj_ = key_info->tss_obj_; + } } - this->remove_key (info); - } // end of guard scope - // WARNING: - // Once the guard is released this ACE_TSS_Cleanup may be deleted -- especially - // because we are about to delete a Thread_Exit object. - // Do not attempt to use any data members for the rest of this method. + } - for (unsigned int d_index = 0; d_index < d_count; ++d_index) + // Now we have given up the ACE_TSS_Cleanup::lock_ and we start + // invoking destructors, in the reverse order of creation. + for (int i = info_ix - 1; i >= 0; --i) { - (*destructor[d_index])(tss_obj[d_index]); + void *tss_info = 0; + + ACE_OS::thr_getspecific (info_arr[i].key_, &tss_info); + + if (tss_info != 0) + { + // Only call the destructor if the value is non-zero for this + // thread. + (*info_arr[i].destructor_)(tss_info); + } } + + // Acquire the ACE_TSS_CLEANUP_LOCK, then free TLS keys and remove + // entries from ACE_TSS_Info table. + { + ACE_TSS_CLEANUP_GUARD + +# if 0 + // We shouldn't free the key and remove it from the table here + // because if we do and some thread ends before other threads + // even get started (or their TSS object haven't been created yet,) + // it's entry will be removed from the table and we are in big chaos. + // For TSS object, these have been done in ACE_TSS_Cleanup::detach. + // Two other use cases will be user managed TSS'es and system wide + // TSS, ones are users responsibilities and the others should be + // persistant system wide. + for (int i = 0; i < index; i++) + { +# if defined (ACE_WIN32) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) + // Calling thr_keyfree here ensure the key + // gets removed appropriately. Notice that + // a key should be removed before freeing it. + ACE_OS::thr_keyfree (key_info->key_); +# else + // don't bother to free the key + this->remove (key_info->key_); +# endif /* ACE_WIN32 */ + } +# endif /* 0 */ + } +} + +int +ACE_TSS_Cleanup::free_all_keys_left (void) + // This is called from ACE_OS::cleanup_tss (). When this gets + // called, all threads should have exited except the main thread. + // No key should be freed from this routine. It there's any, + // something might be wrong. +{ + ACE_thread_key_t key_arr[ACE_DEFAULT_THREAD_KEYS]; + ACE_TSS_TABLE_ITERATOR key_info = table_; + unsigned int idx = 0; + unsigned int i; + + for (i = 0; + i < ACE_DEFAULT_THREAD_KEYS; + ++key_info, ++i) +# if defined (ACE_HAS_TSS_EMULATION) + if (key_info->key_ != in_use_key_) +# endif /* ACE_HAS_TSS_EMULATION */ + // Don't call ACE_OS::thr_keyfree () on ACE_TSS_Cleanup's own + // key. See the comments in ACE_OS::thr_key_detach (): the key + // doesn't get detached, so it will be in the table here. + // However, there's no resource associated with it, so we don't + // need to keyfree it. The dynamic memory associated with it + // was already deleted by ACE_TSS_Cleanup::exit (), so we don't + // want to access it again. + key_arr [idx++] = key_info->key_; + + for (i = 0; i < idx; i++) + if (key_arr[i] != ACE_OS::NULL_key) +# if defined (ACE_HAS_TSS_EMULATION) + ACE_OS::thr_keyfree (key_arr[i]); +# elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) + // Don't call ACE_OS::thr_keyfree here. It will try to use + // <in_use_> which has already been cleaned up here. + ::tsd_delete (key_arr[i]); +# else /* ACE_WIN32 */ + // Don't call ACE_OS::thr_keyfree here. It will try to use + // <in_use_> which has already been cleaned up here. + TlsFree (key_arr[i]); +# endif /* ACE_HAS_TSS_EMULATION */ + + return 0; } extern "C" void @@ -834,6 +860,11 @@ ACE_TSS_Cleanup_keys_destroyer (void *tss_keys) ACE_TSS_Cleanup::ACE_TSS_Cleanup (void) : in_use_ (ACE_OS::NULL_key) +# if defined (ACE_HAS_TSS_EMULATION) + // ACE_TSS_Emulation::total_keys () provides the value of the next + // key to be created. + , in_use_key_ (ACE_TSS_Emulation::total_keys ()) +# endif /* ACE_HAS_TSS_EMULATION */ { ACE_OS_TRACE ("ACE_TSS_Cleanup::ACE_TSS_Cleanup"); } @@ -885,118 +916,77 @@ ACE_TSS_Cleanup::remove (ACE_thread_key_t key) { ACE_OS_TRACE ("ACE_TSS_Cleanup::remove"); ACE_TSS_CLEANUP_GUARD + ACE_KEY_INDEX (key_index, key); if (key_index < ACE_DEFAULT_THREAD_KEYS) { - remove_key (this->table_ [key_index]); + // "Remove" the TSS_Info table entry by zeroing out its key_ and + // destructor_ fields. Also, keep track of the number threads + // using the key. + ACE_TSS_Info &info = this->table_ [key_index]; + + // Don't bother to test/clear the in "use bit" if the program is + // shutting down. Doing so will cause a new ACE_TSS object to be + // created again. + if (!ACE_OS_Object_Manager::shutting_down ()) + tss_keys ()->test_and_clear (info.key_); + info.key_in_use (0); + info.key_ = ACE_OS::NULL_key; + info.destructor_ = 0; return 0; } - return -1; + else + return -1; } -void -ACE_TSS_Cleanup::remove_key (ACE_TSS_Info &info) +int +ACE_TSS_Cleanup::detach (void *inst) { - // assume CLEANUP_GUARD is held by caller - ACE_OS_TRACE ("ACE_TSS_Cleanup::remove_key"); + ACE_TSS_CLEANUP_GUARD - // only remove it if all threads are done with it - // and there is no ACE_TSS holding on to it. - if (info.thread_count_ == 0 && info.tss_inst_ == 0) + ACE_TSS_TABLE_ITERATOR key_info = table_; + int success = 0; + int ref_cnt = 0; + + // Mark the key as detached in the TSS_Info table. + // It only works for the first key that "inst" owns. + // I don't know why. + for (unsigned int i = 0; + i < ACE_DEFAULT_THREAD_KEYS; + ++key_info, ++i) { + if (key_info->tss_obj_ == inst) + { + key_info->tss_obj_ = 0; + ref_cnt = --key_info->thread_count_; + success = 1; + break; + } + } + + if (success == 0) + return -1; + else if (ref_cnt == 0) + { + // Mark the key as no longer being used. + key_info->key_in_use (0); +# if defined (ACE_WIN32) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) + ACE_thread_key_t temp_key = key_info->key_; +# endif /* ACE_WIN32 */ + int retv = this->remove (key_info->key_); + # if defined (ACE_WIN32) - ACE_thread_key_t temp_key = info.key_; ::TlsFree (temp_key); # elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) - ACE_thread_key_t temp_key = info.key_; ::tsd_delete (temp_key); # endif /* ACE_WIN32 */ - if (info.key_ == this->in_use_) - { - this->in_use_ = ACE_OS::NULL_key; - } - info.key_in_use (0); - info.destructor_ = 0; + return retv; } -} - -int -ACE_TSS_Cleanup::detach (ACE_thread_key_t key, void *inst) -{ - // variables to hold the destructor and the object to be destructed - // the actual call is deferred until the guard is released - ACE_TSS_Info::Destructor destructor = 0; - void * tss_obj = 0; - - // scope the guard - { - ACE_TSS_CLEANUP_GUARD - - ACE_KEY_INDEX (key_index, key); - ACE_ASSERT (key_index < sizeof(this->table_)/sizeof(this->table_[0]) - && this->table_[key_index].key_ == key); - ACE_TSS_Info &info = this->table_ [key_index]; - - - // sanity check - if (!info.key_in_use ()) - { - return -1; - } - // if we are detaching from a TSS<x> - // clear the inst info so we'll actually release the key - if (inst != 0) - { - ACE_ASSERT (info.tss_inst_ == inst); - info.tss_inst_ = 0; - } - this->thread_release (info, destructor, tss_obj); - - // try to remove this key - this->remove_key (info); - - } // end of scope for the Guard - // if there's a destructor and an object to be destroyed - if (destructor != 0 && tss_obj != 0) - { - (*destructor) (tss_obj); - } return 0; } void -ACE_TSS_Cleanup::thread_release ( - ACE_TSS_Info &info, - ACE_TSS_Info::Destructor & destructor, - void *& tss_obj) -{ - // assume guard is held by caller - // Find the TSS keys (if any) for this thread - // do not create them if they don't exist - ACE_TSS_Keys * thread_keys = 0; - if (find_tss_keys (thread_keys)) - { - // if this key is in use by this thread - if (thread_keys->test_and_clear(info.key_) == 0) - { - // save destructor & pointer to tss object - // until after the guard is released - destructor = info.destructor_; - ACE_OS::thr_getspecific (info.key_, &tss_obj); - ACE_ASSERT (info.thread_count_ > 0); - --info.thread_count_; -#ifdef ACE_DEBUGGING_TSS_CLEANUP - ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) ACE_TSS_Cleanup::thread_release[%d] decrement %d\n"), - key,info.thread_count_)); -#endif //ACE_DEBUGGING_TSS_CLEANUP - } - } -} - - -void ACE_TSS_Cleanup::key_used (ACE_thread_key_t key) { // If the key's ACE_TSS_Info in-use bit for this thread is not set, @@ -1029,24 +1019,10 @@ ACE_TSS_Cleanup::dump (void) # endif /* ACE_HAS_DUMP */ } -bool -ACE_TSS_Cleanup::find_tss_keys (ACE_TSS_Keys *& tss_keys) const -{ - if (this->in_use_ == ACE_OS::NULL_key) - return false; - if (ACE_OS::thr_getspecific (in_use_, - reinterpret_cast<void **> (&tss_keys)) == -1) - { - ACE_ASSERT (false); - return false; // This should not happen! - } - return tss_keys != 0; -} - ACE_TSS_Keys * ACE_TSS_Cleanup::tss_keys () { - if (this->in_use_ == ACE_OS::NULL_key) + if (in_use_ == ACE_OS::NULL_key) { ACE_TSS_CLEANUP_GUARD // Double-check; @@ -1055,20 +1031,14 @@ ACE_TSS_Cleanup::tss_keys () // Initialize in_use_ with a new key. if (ACE_OS::thr_keycreate (&in_use_, &ACE_TSS_Cleanup_keys_destroyer)) - { - ACE_ASSERT (false); - return 0; // Major problems, this should *never* happen! - } + return 0; // Major problems, this should *never* happen! } } ACE_TSS_Keys *ts_keys = 0; if (ACE_OS::thr_getspecific (in_use_, ACE_reinterpret_cast (void **, &ts_keys)) == -1) - { - ACE_ASSERT (false); - return 0; // This should not happen! - } + return 0; // This should not happen! if (ts_keys == 0) { @@ -1081,7 +1051,6 @@ ACE_TSS_Cleanup::tss_keys () ACE_reinterpret_cast (void *, ts_keys)) == -1) { - ACE_ASSERT (false); delete ts_keys; return 0; // Major problems, this should *never* happen! } @@ -1123,8 +1092,7 @@ ACE_OS::cleanup_tss (const u_int main_thread) { #if defined (ACE_HAS_TSS_EMULATION) || defined (ACE_WIN32) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) // Call TSS destructors for current thread. - if (ACE_TSS_Cleanup::lockable ()) - ACE_TSS_Cleanup::instance ()->exit (0); + ACE_TSS_Cleanup::instance ()->exit (0); #endif /* ACE_HAS_TSS_EMULATION || ACE_WIN32 || ACE_PSOS_HAS_TSS */ if (main_thread) @@ -1138,11 +1106,19 @@ ACE_OS::cleanup_tss (const u_int main_thread) #endif /* ! ACE_HAS_TSS_EMULATION && ! ACE_HAS_MINIMAL_ACE_OS */ #if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) +# if ! defined (ACE_HAS_TSS_EMULATION) + // Don't do this with TSS_Emulation, because the the + // ACE_TSS_Cleanup::instance () has already exited (). We can't + // safely access the TSS values that were created by the main + // thread. + + // Remove all TSS_Info table entries. + ACE_TSS_Cleanup::instance ()->free_all_keys_left (); +# endif /* ! ACE_HAS_TSS_EMULATION */ + // Finally, free up the ACE_TSS_Cleanup instance. This method gets // called by the ACE_Object_Manager. - if (ACE_TSS_Cleanup::lockable ()) - delete ACE_TSS_Cleanup::instance (); - + delete ACE_TSS_Cleanup::instance (); #endif /* WIN32 || ACE_HAS_TSS_EMULATION || ACE_PSOS_HAS_TSS */ #if defined (ACE_HAS_TSS_EMULATION) @@ -3222,11 +3198,11 @@ ACE_OS::thr_join (ACE_thread_t waiter_id, #endif /* VXWORKS */ int -ACE_OS::thr_key_detach (ACE_thread_key_t key, void * inst) +ACE_OS::thr_key_detach (void *inst) { #if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION) || (defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS)) if (ACE_TSS_Cleanup::lockable ()) - return ACE_TSS_Cleanup::instance()->detach (key, inst); + return ACE_TSS_Cleanup::instance()->detach (inst); else // We're in static constructor/destructor phase. Don't // try to use the ACE_TSS_Cleanup instance because its lock @@ -3234,7 +3210,6 @@ ACE_OS::thr_key_detach (ACE_thread_key_t key, void * inst) // destroyed already. Just leak the key . . . return -1; #else - ACE_UNUSED_ARG (key); ACE_UNUSED_ARG (inst); ACE_NOTSUP_RETURN (-1); #endif /* ACE_WIN32 || ACE_HAS_TSS_EMULATION */ @@ -3385,7 +3360,7 @@ ACE_OS::thr_keycreate (ACE_thread_key_t *key, // Extract out the thread-specific table instance and stash away // the key and destructor so that we can free it up later on... return ACE_TSS_Cleanup::instance ()->insert (*key, dest, inst); - } + } else ACE_FAIL_RETURN (-1); /* NOTREACHED */ @@ -3411,10 +3386,7 @@ ACE_OS::thr_keyfree (ACE_thread_key_t key) # if defined (ACE_HAS_TSS_EMULATION) // Release the key in the TSS_Emulation administration ACE_TSS_Emulation::release_key (key); - if (ACE_TSS_Cleanup::lockable ()) - return ACE_TSS_Cleanup::instance ()->remove (key); - else - return -1; + return ACE_TSS_Cleanup::instance ()->remove (key); # elif defined (ACE_HAS_PTHREADS_DRAFT4) || defined (ACE_HAS_PTHREADS_DRAFT6) ACE_UNUSED_ARG (key); ACE_NOTSUP_RETURN (-1); @@ -3428,14 +3400,12 @@ ACE_OS::thr_keyfree (ACE_thread_key_t key) # elif defined (ACE_HAS_WTHREADS) // Extract out the thread-specific table instance and free up // the key and destructor. - if (ACE_TSS_Cleanup::lockable ()) - return ACE_TSS_Cleanup::instance ()->remove (key); + ACE_TSS_Cleanup::instance ()->remove (key); ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::TlsFree (key), ace_result_), int, -1); # elif defined (ACE_PSOS) && defined (ACE_PSOS_HAS_TSS) // Extract out the thread-specific table instance and free up // the key and destructor. - if (ACE_TSS_Cleanup::lockable ()) - return ACE_TSS_Cleanup::instance ()->remove (key); + ACE_TSS_Cleanup::instance ()->remove (key); return (::tsd_delete (key) == 0) ? 0 : -1; # else ACE_UNUSED_ARG (key); diff --git a/ace/OS_NS_Thread.h b/ace/OS_NS_Thread.h index cb93d65773d..d3308a99116 100644 --- a/ace/OS_NS_Thread.h +++ b/ace/OS_NS_Thread.h @@ -957,12 +957,9 @@ public: class ACE_TSS_Info { public: - /// Declare pointer to function to destroy tss object. - typedef void (*Destructor)(void *); - /// Constructor ACE_TSS_Info (ACE_thread_key_t key, - Destructor dest = 0, + void (*dest)(void *) = 0, void *tss_inst = 0); /// Default constructor @@ -989,10 +986,10 @@ private: ACE_thread_key_t key_; /// "Destructor" that gets called when the item is finally released. - Destructor destructor_; + void (*destructor_)(void *); /// Pointer to ACE_TSS<xxx> instance that has/will allocate the key. - void *tss_inst_; + void *tss_obj_; /// Count of threads that are using this key. Contains -1 when the /// key is not in use. @@ -1660,7 +1657,7 @@ namespace ACE_OS { ACE_THR_FUNC_RETURN *status); extern ACE_Export - int thr_key_detach (ACE_thread_key_t key, void * inst); + int thr_key_detach (void *inst); extern ACE_Export int thr_key_used (ACE_thread_key_t key); diff --git a/ace/OS_NS_Thread.inl b/ace/OS_NS_Thread.inl index 89a9c934870..f71b7a03a02 100644 --- a/ace/OS_NS_Thread.inl +++ b/ace/OS_NS_Thread.inl @@ -88,7 +88,7 @@ ACE_TSS_Emulation::ts_object (const ACE_thread_key_t key) // Zero the entire TSS array. Do it manually instead of using // memset, for optimum speed. Though, memset may be faster :-) void **tss_base_p = - reinterpret_cast<void **> (taskIdCurrent->ACE_VXWORKS_SPARE); + reinterpret_cast> (void **> (taskIdCurrent->ACE_VXWORKS_SPARE); for (u_int i = 0; i < ACE_TSS_THREAD_KEYS_MAX; ++i, ++tss_base_p) { *tss_base_p = 0; @@ -668,9 +668,9 @@ ACE_OS::mutex_init (ACE_mutex_t *m, { # if defined (ACE_HAS_PTHREADS_DRAFT7) || defined (ACE_HAS_PTHREADS_STD) # if defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_MUTEXATTR_PSHARED) - (void) ACE_ADAPT_RETVAL (::pthread_mutexattr_setpshared (attributes, - lock_scope), - result); + ACE_ADAPT_RETVAL (::pthread_mutexattr_setpshared (attributes, + lock_scope), + result); # endif /* _POSIX_THREAD_PROCESS_SHARED && !ACE_LACKS_MUTEXATTR_PSHARED */ # else /* Pthreads draft 6 */ # if !defined (ACE_LACKS_MUTEXATTR_PSHARED) @@ -4557,7 +4557,7 @@ ACE_OS::thread_mutex_init (ACE_thread_mutex_t *m, # elif defined (ACE_HAS_STHREADS) || defined (ACE_HAS_PTHREADS) // Force the use of USYNC_THREAD! - return ACE_OS::mutex_init (m, USYNC_THREAD, name, arg, 0, lock_type); + return ACE_OS::mutex_init (m, USYNC_THREAD, name, arg, lock_type); # elif defined (VXWORKS) || defined (ACE_PSOS) return mutex_init (m, type, name, arg); diff --git a/ace/OS_NS_ctype.h b/ace/OS_NS_ctype.h index ce738790ef1..b6c9e8d1de3 100644 --- a/ace/OS_NS_ctype.h +++ b/ace/OS_NS_ctype.h @@ -42,7 +42,8 @@ namespace ACE_OS { * equivalents. * * Since they are often implemented as macros, we don't use the same name - * here. Instead, we change by prepending "ace_". + * here. Instead, we change by prepending "ace_" (with the exception of + * to_lower and to_upper). */ //@{ @@ -92,22 +93,22 @@ namespace ACE_OS { /// Converts a character to lower case (char version). ACE_NAMESPACE_INLINE_FUNCTION - int ace_tolower (int c); + int to_lower (int c); #if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_TOWLOWER) /// Converts a character to lower case (wchar_t version). ACE_NAMESPACE_INLINE_FUNCTION - wint_t ace_towlower (wint_t c); + wint_t to_lower (wint_t c); #endif /* ACE_HAS_WCHAR && !ACE_LACKS_TOWLOWER */ /// Converts a character to upper case (char version). ACE_NAMESPACE_INLINE_FUNCTION - int ace_toupper (int c); + int to_upper (int c); #if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_TOWUPPER) /// Converts a character to upper case (wchar_t version). ACE_NAMESPACE_INLINE_FUNCTION - wint_t ace_towupper (wint_t c); + wint_t to_upper (wint_t c); #endif /* ACE_HAS_WCHAR && !ACE_LACKS_TOWUPPER */ //@} diff --git a/ace/OS_NS_ctype.inl b/ace/OS_NS_ctype.inl index 13b8e05a1aa..89a7270814d 100644 --- a/ace/OS_NS_ctype.inl +++ b/ace/OS_NS_ctype.inl @@ -114,29 +114,30 @@ ACE_OS::ace_isxdigit (const ACE_TCHAR c) } ACE_INLINE int -ACE_OS::ace_tolower (int c) +ACE_OS::to_lower (int c) { return tolower (c); } #if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_TOWLOWER) ACE_INLINE wint_t -ACE_OS::ace_towlower (wint_t c) +ACE_OS::to_lower (wint_t c) { return towlower (c); } #endif /* ACE_HAS_WCHAR && !ACE_LACKS_TOWLOWER */ ACE_INLINE int -ACE_OS::ace_toupper (int c) +ACE_OS::to_upper (int c) { return toupper (c); } #if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_TOWUPPER) ACE_INLINE wint_t -ACE_OS::ace_towupper (wint_t c) +ACE_OS::to_upper (wint_t c) { return towupper (c); } #endif /* ACE_HAS_WCHAR && !ACE_LACKS_TOWUPPER */ + diff --git a/ace/OS_NS_dirent.inl b/ace/OS_NS_dirent.inl index 7fe98c850db..ceb27b371a8 100644 --- a/ace/OS_NS_dirent.inl +++ b/ace/OS_NS_dirent.inl @@ -51,11 +51,9 @@ ACE_OS::opendir (const ACE_TCHAR *filename) # else /* ! ACE_PSOS */ # if defined (ACE_WIN32) && defined (ACE_LACKS_OPENDIR) return ::ACE_OS::opendir_emulation (filename); -# elif defined (VXWORKS) - // VxWorks' ::opendir () is declared with a non-const argument. - return ::opendir (const_cast<char *> (filename)); # else /* ! ACE_WIN32 && ACE_LACKS_OPENDIR */ - return ::opendir (ACE_TEXT_ALWAYS_CHAR (filename)); + // VxWorks' ::opendir () is declared with a non-const argument. + return ::opendir (const_cast<ACE_TCHAR *> (filename)); # endif /* ACE_WIN32 && ACE_LACKS_OPENDIR */ # endif /* ACE_PSOS */ #else @@ -167,14 +165,7 @@ ACE_OS::scandir (const ACE_TCHAR *dirname, const struct dirent **f2)) { #if defined (ACE_HAS_SCANDIR) - return ::scandir (ACE_TEXT_ALWAYS_CHAR (dirname), - namelist, - selector, -# if defined (ACE_SCANDIR_CMP_USES_VOIDPTR) - reinterpret_cast<int(*)(const void*, const void*)> (comparator)); -# else - comparator); -# endif /* ACE_SCANDIR_CMP_USES_VOIDPTR */ + return ::scandir (dirname, namelist, selector, comparator); #else /* ! defined ( ACE_HAS_SCANDIR) */ return ACE_OS::scandir_emulation (dirname, namelist, selector, comparator); #endif /* ACE_HAS_SCANDIR */ diff --git a/ace/OS_NS_dlfcn.inl b/ace/OS_NS_dlfcn.inl index 181c679b7e5..f939c41dcbe 100644 --- a/ace/OS_NS_dlfcn.inl +++ b/ace/OS_NS_dlfcn.inl @@ -4,7 +4,6 @@ #include "ace/OS_NS_macros.h" #include "ace/OS_NS_errno.h" #include "ace/OS_NS_fcntl.h" -#include "ace/OS_NS_string.h" #include "ace/OS_NS_unistd.h" #include "ace/Default_Constants.h" #include "ace/os_include/os_fcntl.h" @@ -71,22 +70,11 @@ ACE_OS::dlerror (void) { ACE_OS_TRACE ("ACE_OS::dlerror"); # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) - const char *err; -# if defined(_M_UNIX) - ACE_OSCALL (::_dlerror (), const char *, 0, err); -# else /* _M_UNIX */ - ACE_OSCALL (::dlerror (), const char *, 0, err); -# endif /* _M_UNIX */ - if (err == 0) - return 0; -# if defined (ACE_USES_WCHAR) - const size_t BufLen = 256; - static wchar_t buf[BufLen]; - ACE_OS::strncpy (buf, ACE_TEXT_CHAR_TO_TCHAR (err), BufLen); - return buf; -# else - return const_cast <char *> (err); -# endif /* ACE_USES_WCHAR */ +#if defined(_M_UNIX) + ACE_OSCALL_RETURN ((char *)::_dlerror (), char *, 0); +#else /* _M_UNIX */ + ACE_OSCALL_RETURN ((char *)::dlerror (), char *, 0); +#endif /* _M_UNIX */ # elif defined (__hpux) || defined (VXWORKS) ACE_OSCALL_RETURN (::strerror(errno), char *, 0); # elif defined (ACE_WIN32) @@ -126,14 +114,11 @@ ACE_OS::dlopen (const ACE_TCHAR *fname, # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) void *handle; # if defined (ACE_HAS_SGIDLADD) - ACE_OSCALL - (::sgidladd (ACE_TEXT_ALWAYS_CHAR (filename), mode), void *, 0, handle); + ACE_OSCALL (::sgidladd (filename, mode), void *, 0, handle); # elif defined (_M_UNIX) - ACE_OSCALL - (::_dlopen (ACE_TEXT_ALWAYS_CHAR (filename), mode), void *, 0, handle); + ACE_OSCALL (::_dlopen (filename, mode), void *, 0, handle); # else - ACE_OSCALL - (::dlopen (ACE_TEXT_ALWAYS_CHAR (filename), mode), void *, 0, handle); + ACE_OSCALL (::dlopen (filename, mode), void *, 0, handle); # endif /* ACE_HAS_SGIDLADD */ # if !defined (ACE_HAS_AUTOMATIC_INIT_FINI) if (handle != 0) @@ -213,15 +198,11 @@ ACE_OS::dlsym (ACE_SHLIB_HANDLE handle, // Get the correct OS type. #if defined (ACE_HAS_WINCE) const wchar_t *symbolname = sname; -#elif defined (ACE_USES_WCHAR) - // WinCE is WCHAR always; other platforms need a char * symbol name - ACE_Wide_To_Ascii w_sname (sname); - char *symbolname = w_sname.char_rep (); #elif defined (ACE_HAS_CHARPTR_DL) char *symbolname = const_cast<char *> (sname); -#else +#elif !defined (ACE_WIN32) || !defined (ACE_USES_WCHAR) const char *symbolname = sname; -#endif /* ACE_HAS_WINCE */ +#endif /* ACE_HAS_CHARPTR_DL */ # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) @@ -241,6 +222,10 @@ ACE_OS::dlsym (ACE_SHLIB_HANDLE handle, ACE_OSCALL_RETURN (::dlsym (handle, symbolname), void *, 0); # endif /* ACE_USES_ASM_SYMBOL_IN_DLSYM */ +# elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR) && !defined (ACE_HAS_WINCE) + + ACE_WIN32CALL_RETURN (::GetProcAddress (handle, ACE_TEXT_ALWAYS_CHAR (sname)), void *, 0); + # elif defined (ACE_WIN32) ACE_WIN32CALL_RETURN (::GetProcAddress (handle, symbolname), void *, 0); diff --git a/ace/OS_NS_errno.h b/ace/OS_NS_errno.h index a3fcaabfb7c..3dbef6784ff 100644 --- a/ace/OS_NS_errno.h +++ b/ace/OS_NS_errno.h @@ -19,7 +19,7 @@ # include /**/ "ace/pre.h" -# include "ace/config-lite.h" +# include "ace/config-all.h" # if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -49,41 +49,6 @@ namespace ACE_OS { } /* namespace ACE_OS */ -#if defined (ACE_HAS_WINCE_BROKEN_ERRNO) -/** - * @class ACE_CE_Errno - * - * Some versions of CE don't support <errno> and some versions' - * implementations are busted. So we implement our own. - * Our implementation takes up one Tls key, however, it does not - * allocate memory fromt the heap so there's no problem with cleanin - * up the errno when a thread exit. - */ -class ACE_Export ACE_CE_Errno -{ -public: - ACE_CE_Errno () {} - static void init (); - static void fini (); - static ACE_CE_Errno *instance (); - - operator int (void) const; - int operator= (int); - -private: - static ACE_CE_Errno *instance_; - static DWORD errno_key_; -}; - -# define errno (* (ACE_CE_Errno::instance ())) -#endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ - -#if defined (ACE_HAS_WINCE_BROKEN_ERRNO) -# define ACE_ERRNO_TYPE ACE_CE_Errno -#else -# define ACE_ERRNO_TYPE int -#endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ - # if defined (ACE_HAS_INLINED_OSCALLS) # if defined (ACE_INLINE) # undef ACE_INLINE diff --git a/ace/OS_NS_errno.inl b/ace/OS_NS_errno.inl index 63eaaba1c14..0e468d74851 100644 --- a/ace/OS_NS_errno.inl +++ b/ace/OS_NS_errno.inl @@ -1,8 +1,6 @@ // -*- C++ -*- // $Id$ -#include "ace/config-all.h" /* Need ACE_TRACE */ - ACE_INLINE int ACE_OS::last_error (void) { @@ -69,28 +67,3 @@ ACE_OS::set_errno_to_wsa_last_error (void) return errno; # endif /* defined(ACE_WIN32) */ } - -#if defined (ACE_HAS_WINCE_BROKEN_ERRNO) - -ACE_INLINE ACE_CE_Errno * -ACE_CE_Errno::instance () -{ - // This should be inlined. - return ACE_CE_Errno::instance_; -} - -ACE_INLINE -ACE_CE_Errno::operator int (void) const -{ - return (int) TlsGetValue (ACE_CE_Errno::errno_key_); -} - -ACE_INLINE int -ACE_CE_Errno::operator= (int x) -{ - // error checking? - TlsSetValue (ACE_CE_Errno::errno_key_, (void *) x); - return x; -} - -#endif /* ACE_HAS_WINCE_BROKEN_ERRNO */ diff --git a/ace/OS_NS_fcntl.inl b/ace/OS_NS_fcntl.inl index 0e541c90575..ca18bb9250b 100644 --- a/ace/OS_NS_fcntl.inl +++ b/ace/OS_NS_fcntl.inl @@ -16,3 +16,4 @@ ACE_OS::fcntl (ACE_HANDLE handle, int cmd, long arg) ACE_OSCALL_RETURN (::fcntl (handle, cmd, arg), int, -1); # endif /* ACE_LACKS_FCNTL */ } + diff --git a/ace/OS_NS_stdio.cpp b/ace/OS_NS_stdio.cpp index 10208d96a34..a5bcfae03f0 100644 --- a/ace/OS_NS_stdio.cpp +++ b/ace/OS_NS_stdio.cpp @@ -77,9 +77,8 @@ void ACE_OS::checkUnicodeFormat (FILE* fp) // select correct buffer type. // At this point, check if the file is Unicode or not. - ACE_UINT16 first_two_bytes; - size_t numRead = - ACE_OS::fread(&first_two_bytes, sizeof (first_two_bytes), 1, fp); + WORD first_two_bytes; + size_t numRead = ACE_OS::fread(&first_two_bytes, sizeof(WORD), 1, fp); if (numRead == 1) { @@ -87,11 +86,7 @@ void ACE_OS::checkUnicodeFormat (FILE* fp) (first_two_bytes != 0xFEFF)) // not a big endian Unicode file { // set file pointer back to the beginning -#if defined (ACE_WIN32) ACE_OS::fseek(fp, 0, FILE_BEGIN); -#else - ACE_OS::fseek(fp, 0, SEEK_SET); -#endif /* ACE_WIN32 */ } } // if it is a Unicode file, file pointer will be right next to the first @@ -428,6 +423,6 @@ ACE_OS::sprintf (wchar_t *buf, const wchar_t *format, ...) ACE_UNUSED_ARG (format); ACE_NOTSUP_RETURN (-1); -# endif /* XPG5 || ACE_HAS_DINKUM_STL */ +# endif /* ACE_HAS_VSWPRINTF */ } #endif /* ACE_HAS_WCHAR */ diff --git a/ace/OS_NS_stdio.h b/ace/OS_NS_stdio.h index e1720e7f582..5ffe25db3ed 100644 --- a/ace/OS_NS_stdio.h +++ b/ace/OS_NS_stdio.h @@ -177,12 +177,7 @@ namespace ACE_OS { int fgetpos (FILE* fp, fpos_t* pos); ACE_NAMESPACE_INLINE_FUNCTION - char *fgets (char *buf, int size, FILE *fp); - -# if defined (ACE_HAS_WCHAR) && !defined(ACE_LACKS_FGETWS) - ACE_NAMESPACE_INLINE_FUNCTION - wchar_t *fgets (wchar_t *buf, int size, FILE *fp); -# endif /* ACE_HAS_WCHAR && !ACE_LACKS_FGETWS */ + ACE_TCHAR *fgets (ACE_TCHAR *buf, int size, FILE *fp); //@{ @name A set of wrappers for file locks. @@ -257,7 +252,7 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION LPSECURITY_ATTRIBUTES default_win32_security_attributes (LPSECURITY_ATTRIBUTES); ACE_NAMESPACE_INLINE_FUNCTION - LPSECURITY_ATTRIBUTES default_win32_security_attributes_r (LPSECURITY_ATTRIBUTES, + LPSECURITY_ATTRIBUTES default_win32_security_attributes_r (LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, SECURITY_DESCRIPTOR*); @@ -299,15 +294,9 @@ namespace ACE_OS { # endif /* ACE_HAS_WCHAR */ ACE_NAMESPACE_INLINE_FUNCTION - int fputs (const char *s, + int fputs (const ACE_TCHAR *s, FILE *stream); -# if defined (ACE_HAS_WCHAR) && !defined(ACE_LACKS_FPUTWS) - ACE_NAMESPACE_INLINE_FUNCTION - int fputs (const wchar_t *s, - FILE *stream); -# endif /* ACE_HAS_WCHAR && !ACE_LACKS_FPUTWS */ - ACE_NAMESPACE_INLINE_FUNCTION size_t fread (void *ptr, size_t size, @@ -349,23 +338,13 @@ namespace ACE_OS { char *gets (char *str, int n = 0); ACE_NAMESPACE_INLINE_FUNCTION - void perror (const char *s); - -#if defined (ACE_HAS_WCHAR) - ACE_NAMESPACE_INLINE_FUNCTION - void perror (const wchar_t *s); -#endif /* ACE_HAS_WCHAR */ + void perror (const ACE_TCHAR *s); extern ACE_Export int printf (const char *format, ...); ACE_NAMESPACE_INLINE_FUNCTION - int puts (const char *s); - -#if defined (ACE_HAS_WCHAR) - ACE_NAMESPACE_INLINE_FUNCTION - int puts (const wchar_t *s); -#endif /* ACE_HAS_WCHAR */ + int puts (const ACE_TCHAR *s); ACE_NAMESPACE_INLINE_FUNCTION int rename (const char *old_name, diff --git a/ace/OS_NS_stdio.inl b/ace/OS_NS_stdio.inl index 0d1459b64f7..d21702850e6 100644 --- a/ace/OS_NS_stdio.inl +++ b/ace/OS_NS_stdio.inl @@ -558,7 +558,7 @@ ACE_OS::cuserid (char *user, size_t maxlen) const size_t ACE_L_cuserid = 9; // 8 character user ID + NULL #endif /* _POSIX_SOURCE */ - static char tmp[ACE_L_cuserid] = { '\0' }; + static ACE_TCHAR tmp[ACE_L_cuserid] = { '\0' }; max_length = ACE_L_cuserid - 1; // Do not include NULL in length userid = tmp; @@ -670,8 +670,7 @@ ACE_OS::fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode) ACE_UNUSED_ARG (mode); ACE_NOTSUP_RETURN (0); # else - ACE_OSCALL_RETURN - (::fdopen (handle, ACE_TEXT_ALWAYS_CHAR (mode)), FILE *, 0); + ACE_OSCALL_RETURN (::fdopen (handle, mode), FILE *, 0); # endif /* ACE_HAS_WINCE */ } @@ -702,22 +701,17 @@ ACE_OS::fgetpos (FILE* fp, fpos_t* pos) ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fgetpos (fp, pos), int, -1); } -ACE_INLINE char * -ACE_OS::fgets (char *buf, int size, FILE *fp) +ACE_INLINE ACE_TCHAR * +ACE_OS::fgets (ACE_TCHAR *buf, int size, FILE *fp) { ACE_OS_TRACE ("ACE_OS::fgets"); +#if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + ACE_OSCALL_RETURN (::fgetws (buf, size, fp), wchar_t *, 0); +#else /* ACE_WIN32 */ ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fgets (buf, size, fp), char *, 0); +#endif /* ACE_WIN32 && ACE_USES_WCHAR */ } -#if defined (ACE_HAS_WCHAR) && !defined(ACE_LACKS_FGETWS) -ACE_INLINE wchar_t * -ACE_OS::fgets (wchar_t *buf, int size, FILE *fp) -{ - ACE_OS_TRACE ("ACE_OS::fgets"); - ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fgetws (buf, size, fp), wchar_t *, 0); -} -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_FGETWS */ - #if !defined (ACE_WIN32) // Win32 implementation of fopen () is in OS_NS_stdio.cpp. ACE_INLINE FILE * @@ -743,21 +737,16 @@ ACE_OS::fopen (const wchar_t *filename, const ACE_TCHAR *mode) #endif /* ACE_WIN32 */ ACE_INLINE int -ACE_OS::fputs (const char *s, FILE *stream) +ACE_OS::fputs (const ACE_TCHAR *s, FILE *stream) { ACE_OS_TRACE ("ACE_OS::fputs"); +#if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + ACE_OSCALL_RETURN (::fputws (s, stream), int, -1); +#else /* ACE_WIN32 */ ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fputs (s, stream), int, -1); +#endif /* ACE_WIN32 && ACE_USES_WCHAR */ } -#if defined (ACE_HAS_WCHAR) && !defined(ACE_LACKS_FPUTWS) -ACE_INLINE int -ACE_OS::fputs (const wchar_t *s, FILE *stream) -{ - ACE_OS_TRACE ("ACE_OS::fputs"); - ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fputws (s, stream), int, -1); -} -#endif /* ACE_HAS_WCHAR && !ACE_LACKS_FPUTWS */ - ACE_INLINE size_t ACE_OS::fread (void *ptr, size_t size, size_t nelems, FILE *fp) { @@ -772,11 +761,7 @@ ACE_OS::freopen (const ACE_TCHAR *filename, const ACE_TCHAR *mode, FILE* stream) #if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) ACE_OSCALL_RETURN (::_wfreopen (filename, mode, stream), FILE *, 0); #else - ACE_OSCALL_RETURN - (ACE_STD_NAMESPACE::freopen (ACE_TEXT_ALWAYS_CHAR (filename), - ACE_TEXT_ALWAYS_CHAR (mode), - stream), - FILE *, 0); + ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::freopen (filename, mode, stream), FILE *, 0); #endif /* ACE_WIN32 && ACE_USES_WCHAR */ } @@ -839,55 +824,29 @@ ACE_OS::gets (char *str) #endif /* 0 */ ACE_INLINE void -ACE_OS::perror (const char *s) +ACE_OS::perror (const ACE_TCHAR *s) { ACE_OS_TRACE ("ACE_OS::perror"); #if defined (ACE_HAS_WINCE) // @@ WINCE: How should this be handled ACE_UNUSED_ARG (s); -#else - ::perror (s); -#endif /* ACE_HAS_WINCE */ -} - -#if defined (ACE_HAS_WCHAR) -ACE_INLINE void -ACE_OS::perror (const wchar_t *s) -{ - ACE_OS_TRACE ("ACE_OS::perror"); -#if defined (ACE_HAS_WINCE) - // @@ WINCE: How should this be handled - ACE_UNUSED_ARG (s); -#elif defined (ACE_WIN32) +#elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR) ::_wperror (s); #else - ACE_Wide_To_Ascii n_s (s); - ::perror (n_s.char_rep ()); + ::perror (s); #endif /* ACE_HAS_WINCE */ } -#endif /* ACE_HAS_WCHAR */ - -ACE_INLINE int -ACE_OS::puts (const char *s) -{ - ACE_OS_TRACE ("ACE_OS::puts"); - ACE_OSCALL_RETURN (::puts (s), int, -1); -} -#if defined (ACE_HAS_WCHAR) ACE_INLINE int -ACE_OS::puts (const wchar_t *s) +ACE_OS::puts (const ACE_TCHAR *s) { ACE_OS_TRACE ("ACE_OS::puts"); -#if defined (ACE_WIN32) +#if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) ACE_OSCALL_RETURN (::_putws (s), int, -1); #else /* ACE_WIN32 */ - // There's no putws()... - ACE_Wide_To_Ascii n_s (s); - ACE_OSCALL_RETURN (::puts (n_s.char_rep ()), int, -1); -#endif /* ACE_WIN32 */ + ACE_OSCALL_RETURN (::puts (s), int, -1); +#endif /* ACE_WIN32 && ACE_USES_WCHAR */ } -#endif /* ACE_HAS_WCHAR */ ACE_INLINE int ACE_OS::rename (const char *old_name, @@ -900,10 +859,8 @@ ACE_OS::rename (const char *old_name, ACE_UNUSED_ARG (flags); ACE_NOTSUP_RETURN (-1); # elif defined (ACE_HAS_WINCE) - // Win CE is always wide-char. ACE_UNUSED_ARG (flags); - if (0 != MoveFile (ACE_TEXT_CHAR_TO_TCHAR (old_name), - ACE_TEXT_CHAR_TO_TCHAR (new_name))) + if (MoveFile (old_name, new_name) != 0) ACE_FAIL_RETURN (-1); return 0; # elif defined (ACE_WIN32) && defined (ACE_HAS_WINNT4) && (ACE_HAS_WINNT4 == 1) @@ -1037,21 +994,12 @@ ACE_OS::vsprintf (char *buffer, const char *format, va_list argptr) ACE_INLINE int ACE_OS::vsprintf (wchar_t *buffer, const wchar_t *format, va_list argptr) { -# if (defined (_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) || \ - (defined (sun) && !(defined(_XOPEN_SOURCE) && (_XOPEN_VERSION-0==4))) || \ - (defined (ACE_HAS_DINKUM_STL)) - - // The XPG4/UNIX98/C99 signature of the wide-char sprintf has a - // maxlen argument. Since this method doesn't supply one, pass in - // a length that works (ULONG_MAX doesn't). If this isn't ok, use - // ACE_OS::snprintf(). - return vswprintf (buffer, 4096, format, argptr); - -# elif defined (ACE_WIN32) - // Windows has vswprintf, but the signature is from the older ISO C - // standard. Also see ACE_OS::snprintf() for more info on this. - - return vswprintf (buffer, format, argptr); +# if defined (ACE_HAS_VSWPRINTF) +# if defined (ACE_HAS_DINKUM_STL) + return ACE_STD_NAMESPACE::vswprintf (buffer, ULONG_MAX, format, argptr); +#else + return ::vswprintf (buffer, format, argptr); +# endif /* ACE_HAS_DINKUM_STL */ # else ACE_UNUSED_ARG (buffer); @@ -1059,7 +1007,7 @@ ACE_OS::vsprintf (wchar_t *buffer, const wchar_t *format, va_list argptr) ACE_UNUSED_ARG (argptr); ACE_NOTSUP_RETURN (-1); -# endif /* XPG5 || ACE_HAS_DINKUM_STL */ +# endif /* ACE_HAS_VSWPRINTF */ } #endif /* ACE_HAS_WCHAR */ diff --git a/ace/OS_NS_stdlib.cpp b/ace/OS_NS_stdlib.cpp index 882057e6380..db9b6ac980c 100644 --- a/ace/OS_NS_stdlib.cpp +++ b/ace/OS_NS_stdlib.cpp @@ -259,21 +259,21 @@ ACE_OS::realloc (void *ptr, size_t nbytes) return ACE_REALLOC_FUNC (ACE_MALLOC_T (ptr), nbytes); } -#if defined (ACE_LACKS_REALPATH) && !defined (ACE_HAS_WINCE) -char * -ACE_OS::realpath (const char *file_name, - char *resolved_name) +#if defined (ACE_LACKS_REALPATH) +ACE_TCHAR * +ACE_OS::realpath (const ACE_TCHAR *file_name, + ACE_TCHAR *resolved_name) { ACE_OS_TRACE ("ACE_OS::realpath"); - if (file_name == 0) + if(file_name == 0) { // Single Unix Specification V3: // Return an error if parameter is a null pointer. errno = EINVAL; return 0; } - + if (*file_name == '\0') { // Single Unix Specification V3: @@ -282,151 +282,151 @@ ACE_OS::realpath (const char *file_name, errno = ENOENT; return 0; } - + char* rpath; - + if (resolved_name == 0) { // Single Unix Specification V3: // Return an error if parameter is a null pointer. - // + // // To match glibc realpath() and Win32 _fullpath() behavior, // allocate room for the return value if resolved_name is // a null pointer. rpath = static_cast<char*>(ACE_OS::malloc (PATH_MAX)); if (rpath == 0) - { - errno = ENOMEM; - return 0; - } + { + errno = ENOMEM; + return 0; + } } else { rpath = resolved_name; } - + char* dest; - + if (*file_name != '/') { // file_name is relative path so CWD needs to be added if (ACE_OS::getcwd (rpath, PATH_MAX) == 0) - { - if (resolved_name == 0) - ACE_OS::free (rpath); - return 0; - } + { + if (resolved_name == 0) + ACE_OS::free (rpath); + return 0; + } dest = ACE_OS::strchr (rpath, '\0'); } else { dest = rpath; } - + char expand_buf[PATH_MAX]; // Extra buffer needed to expand symbolic links int nlinks = 0; - + while (*file_name) - { + { *dest++ = '/'; - + // Skip multiple separators while (*file_name == '/') - ++file_name; - + ++file_name; + char* start = dest; - + // Process one path component while (*file_name && *file_name != '/') - { - *dest++ = *file_name++; - if (dest - rpath > PATH_MAX) - { - errno = ENAMETOOLONG; - if (resolved_name == 0) - ACE_OS::free (rpath); - return 0; - } - } - + { + *dest++ = *file_name++; + if (dest - rpath > PATH_MAX) + { + errno = ENAMETOOLONG; + if (resolved_name == 0) + ACE_OS::free (rpath); + return 0; + } + } + if (start == dest) // Are we done? - { - if (dest - rpath > 1) - --dest; // Remove trailing separator if not at root - break; - } + { + if (dest - rpath > 1) + --dest; // Remove trailing separator if not at root + break; + } else if (dest - start == 1 && *start == '.') - { - dest -= 2; // Remove "./" - } + { + dest -= 2; // Remove "./" + } else if (dest - start == 2 && *start == '.' && *(start +1) == '.') - { - dest -= 3; // Remove "../" - if (dest > rpath) // Remove the last path component if not at root - while (*--dest != '/') - ; - } + { + dest -= 3; // Remove "../" + if (dest > rpath) // Remove the last path component if not at root + while (*--dest != '/') + ; + } else - { - ACE_stat st; - - *dest = '\0'; - if (ACE_OS::lstat(rpath, &st) < 0) - { - if (resolved_name == 0) - ACE_OS::free (rpath); - return 0; - } - + { + ACE_stat st; + + *dest = '\0'; + if (ACE_OS::lstat(rpath, &st) < 0) + { + if (resolved_name == 0) + ACE_OS::free (rpath); + return 0; + } + // Check if current path is a link if (S_ISLNK (st.st_mode)) { if (++nlinks > MAXSYMLINKS) - { - errno = ELOOP; - if (resolved_name == 0) - ACE_OS::free (rpath); - return 0; - } - + { + errno = ELOOP; + if (resolved_name == 0) + ACE_OS::free (rpath); + return 0; + } + char link_buf[PATH_MAX]; - + int link_len = ACE_OS::readlink (rpath, link_buf, PATH_MAX); int tail_len = ACE_OS::strlen (file_name) + 1; - + // Check if there is room to expand link? if (link_len + tail_len > PATH_MAX) - { - errno = ENAMETOOLONG; - if (resolved_name == 0) - ACE_OS::free (rpath); - return 0; - } - + { + errno = ENAMETOOLONG; + if (resolved_name == 0) + ACE_OS::free (rpath); + return 0; + } + // Move tail and prefix it with expanded link ACE_OS::memmove (expand_buf + link_len, file_name, tail_len); ACE_OS::memcpy (expand_buf, link_buf, link_len); - + if (*link_buf == '/') // Absolute link? - { - dest = rpath; - } + { + dest = rpath; + } else // Relative link, remove expanded link component - { - --dest; - while (*--dest != '/') - ; - } + { + --dest; + while (*--dest != '/') + ; + } file_name = expand_buf; // Source path is now in expand_buf } + } } - } - + *dest = '\0'; - + return rpath; } -#endif /* ACE_LACKS_REALPATH && !ACE_HAS_WINCE */ +#endif /* ACE_LACKS_REALPATH */ #if defined (ACE_LACKS_STRTOL) long diff --git a/ace/OS_NS_stdlib.h b/ace/OS_NS_stdlib.h index 85b4f468e49..161f39ed902 100644 --- a/ace/OS_NS_stdlib.h +++ b/ace/OS_NS_stdlib.h @@ -97,13 +97,13 @@ namespace ACE_OS { size_t size, ACE_COMPARE_FUNC); - extern ACE_Export + extern ACE_Export void *calloc (size_t elements, size_t sizeof_elements); - extern ACE_Export + extern ACE_Export void exit (int status = 0); - extern ACE_Export + extern ACE_Export void free (void *); ACE_NAMESPACE_INLINE_FUNCTION @@ -115,7 +115,7 @@ namespace ACE_OS { # endif /* ACE_HAS_WCHAR && ACE_WIN32 */ // not in spec - extern ACE_Export + extern ACE_Export ACE_TCHAR *getenvstrings (void); // itoa not in spec @@ -131,41 +131,32 @@ namespace ACE_OS { #if !defined (ACE_HAS_ITOA) /// Emulated itoa - Converts an integer to a string. - extern ACE_Export + extern ACE_Export char *itoa_emulation (int value, char *string, int radix); #endif /* !ACE_HAS_ITOA */ #if defined (ACE_HAS_WCHAR) && defined (ACE_LACKS_ITOW) /// Emulated itow - Converts an integer to a string. - extern ACE_Export + extern ACE_Export wchar_t *itow_emulation (int value, wchar_t *string, int radix); #endif /* ACE_HAS_WCHAR && ACE_LACKS_ITOW */ - extern ACE_Export + extern ACE_Export void *malloc (size_t); #if !defined (ACE_LACKS_MKSTEMP) ACE_NAMESPACE_INLINE_FUNCTION - ACE_HANDLE mkstemp (char *t); - -# if defined (ACE_HAS_WCHAR) - ACE_NAMESPACE_INLINE_FUNCTION - ACE_HANDLE mkstemp (wchar_t *t); -# endif /* ACE_HAS_WCHAR */ +#else + extern ACE_Export #endif /* !ACE_LACKS_MKSTEMP */ + ACE_HANDLE mkstemp (ACE_TCHAR *t); #if !defined (ACE_LACKS_MKTEMP) ACE_NAMESPACE_INLINE_FUNCTION - char *mktemp (char *t); - -# if defined (ACE_HAS_WCHAR) - ACE_NAMESPACE_INLINE_FUNCTION - wchar_t *mktemp (wchar_t *t); -# endif /* ACE_HAS_WCHAR */ #else - extern ACE_Export - ACE_TCHAR *mktemp (ACE_TCHAR *t); + extern ACE_Export #endif /* !ACE_LACKS_MSTEMP */ + ACE_TCHAR *mktemp (ACE_TCHAR *t); ACE_NAMESPACE_INLINE_FUNCTION int putenv (const char *string); @@ -191,23 +182,16 @@ namespace ACE_OS { ACE_NAMESPACE_INLINE_FUNCTION int rand_r (ACE_RANDR_TYPE &seed); - extern ACE_Export + extern ACE_Export void *realloc (void *, size_t); -#if !defined (ACE_HAS_WINCE) -# if !defined (ACE_LACKS_REALPATH) - ACE_NAMESPACE_INLINE_FUNCTION -# else - extern ACE_Export -# endif /* !ACE_LACKS_REALPATH */ - char *realpath (const char *file_name, char *resolved_name); - -# if defined (ACE_HAS_WCHAR) +#if !defined (ACE_LACKS_REALPATH) ACE_NAMESPACE_INLINE_FUNCTION - wchar_t *realpath (const wchar_t *file_name, wchar_t *resolved_name); -# endif /* ACE_HAS_WCHAR */ -#endif /* ACE_HAS_WINCE */ - +#else + extern ACE_Export +#endif /* !ACE_LACKS_REALPATH */ + ACE_TCHAR *realpath (const ACE_TCHAR *file_name, ACE_TCHAR *resolved_name); + // exit_hook and set_exit_hook not in spec /// Function that is called by <ACE_OS::exit>, if non-null. extern ACE_Export ACE_EXIT_HOOK exit_hook_; @@ -246,7 +230,7 @@ namespace ACE_OS { #endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOL */ #if defined (ACE_LACKS_STRTOL) - extern ACE_Export + extern ACE_Export long strtol_emulation (const char *nptr, char **endptr, int base); #endif /* ACE_LACKS_STRTOL */ @@ -261,7 +245,7 @@ namespace ACE_OS { #endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOUL */ #if defined (ACE_LACKS_STRTOUL) - extern ACE_Export + extern ACE_Export unsigned long strtoul_emulation (const char *nptr, char **endptr, int base); diff --git a/ace/OS_NS_stdlib.inl b/ace/OS_NS_stdlib.inl index 0f067ccbe5b..b0d115fbc3d 100644 --- a/ace/OS_NS_stdlib.inl +++ b/ace/OS_NS_stdlib.inl @@ -1,7 +1,6 @@ // -*- C++ -*- // $Id$ -#include "ace/config-all.h" /* Need ACE_TRACE */ #include "ace/Object_Manager_Base.h" #include "ace/OS_NS_string.h" #include "ace/Global_Macros.h" @@ -176,52 +175,24 @@ ACE_OS::itoa (int value, wchar_t *string, int radix) #if !defined (ACE_LACKS_MKSTEMP) ACE_INLINE ACE_HANDLE -ACE_OS::mkstemp (char *s) +ACE_OS::mkstemp (ACE_TCHAR *s) { return ::mkstemp (s); } - -# if defined (ACE_HAS_WCHAR) -ACE_INLINE ACE_HANDLE -ACE_OS::mkstemp (wchar_t *s) -{ - ACE_Wide_To_Ascii narrow_s (s); - return ::mkstemp (narrow_s.char_rep ()); -} -# endif /* ACE_HAS_WCHAR */ #endif /* !ACE_LACKS_MKSTEMP */ #if !defined (ACE_LACKS_MKTEMP) -ACE_INLINE char * -ACE_OS::mktemp (char *s) +ACE_INLINE ACE_TCHAR * +ACE_OS::mktemp (ACE_TCHAR *s) { -# if defined (ACE_WIN32) +# if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + return ::_wmktemp (s); +# elif defined (ACE_WIN32) return ::_mktemp (s); # else /* ACE_WIN32 */ return ::mktemp (s); # endif /* ACE_WIN32 */ } - -# if defined (ACE_HAS_WCHAR) -ACE_INLINE wchar_t * -ACE_OS::mktemp (wchar_t *s) -{ -# if defined (ACE_WIN32) - return ::_wmktemp (s); -# else - // For narrow-char filesystems, we must convert the wide-char input to - // a narrow-char string for mktemp(), then convert the name back to - // wide-char for the caller. - ACE_Wide_To_Ascii narrow_s (s); - if (::mktemp (narrow_s.char_rep ()) == 0) - return 0; - ACE_Ascii_To_Wide wide_s (narrow_s.char_rep ()); - ACE_OS::strcpy (s, wide_s.wchar_rep ()); - return s; -# endif -} -# endif /* ACE_HAS_WCHAR */ - #endif /* !ACE_LACKS_MKTEMP */ #if defined(INTEGRITY) @@ -333,41 +304,20 @@ ACE_OS::rand_r (ACE_RANDR_TYPE& seed) #endif /* !ACE_WIN32 */ -#if !defined (ACE_HAS_WINCE) -# if !defined (ACE_LACKS_REALPATH) -ACE_INLINE char * -ACE_OS::realpath (const char *file_name, - char *resolved_name) +#if !defined (ACE_LACKS_REALPATH) +ACE_INLINE ACE_TCHAR * +ACE_OS::realpath (const ACE_TCHAR *file_name, + ACE_TCHAR *resolved_name) { -# if defined (ACE_WIN32) +# if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + return ::_wfullpath (resolved_name, file_name, PATH_MAX); +# elif defined (ACE_WIN32) return ::_fullpath (resolved_name, file_name, PATH_MAX); -# else /* ACE_WIN32 */ +# else /* ACE_WIN32 */ return ::realpath (file_name, resolved_name); -# endif /* ! ACE_WIN32 */ +# endif /* ! ACE_WIN32 */ } -# endif /* !ACE_LACKS_REALPATH */ - -# if defined (ACE_HAS_WCHAR) -ACE_INLINE wchar_t * -ACE_OS::realpath (const wchar_t *file_name, - wchar_t *resolved_name) -{ -# if defined (ACE_WIN32) - return ::_wfullpath (resolved_name, file_name, PATH_MAX); -# else /* ACE_WIN32 */ - ACE_Wide_To_Ascii n_file_name (file_name); - char n_resolved[PATH_MAX]; - if (0 != ACE_OS::realpath (n_file_name.char_rep (), n_resolved)) - { - ACE_Ascii_To_Wide w_resolved (n_resolved); - ACE_OS::strcpy (resolved_name, w_resolved.wchar_rep ()); - return resolved_name; - } - return 0; -# endif /* ! ACE_WIN32 */ -} -# endif /* ACE_HAS_WCHAR */ -#endif /* ACE_HAS_WINCE */ +#endif /* !ACE_LACKS_REALPATH */ ACE_INLINE ACE_EXIT_HOOK ACE_OS::set_exit_hook (ACE_EXIT_HOOK exit_hook) @@ -399,21 +349,11 @@ ACE_OS::strenvdup (const ACE_TCHAR *str) ACE_UNUSED_ARG (str); ACE_NOTSUP_RETURN (0); #else - if (str[0] == ACE_LIB_TEXT ('$')) - { -# if defined (ACE_WIN32) - // Always use the ACE_TCHAR for Windows. - ACE_TCHAR *temp = 0; - if ((temp = ACE_OS::getenv (&str[1])) != 0) - return ACE_OS::strdup (temp); -# else - // Use char * for environment on non-Windows. - char *temp = 0; - if ((temp = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (&str[1]))) != 0) - return ACE_OS::strdup (ACE_TEXT_CHAR_TO_TCHAR (temp)); -# endif /* ACE_WIN32 */ - return ACE_OS::strdup (str); - } + ACE_TCHAR *temp = 0; + + if (str[0] == ACE_LIB_TEXT ('$') + && (temp = ACE_OS::getenv (&str[1])) != 0) + return ACE_OS::strdup (temp); else return ACE_OS::strdup (str); #endif /* ACE_HAS_WINCE */ @@ -483,6 +423,6 @@ ACE_OS::system (const ACE_TCHAR *s) #elif defined(ACE_TANDEM_T1248_PTHREADS) ACE_OSCALL_RETURN (::spt_system (s), int, -1); #else - ACE_OSCALL_RETURN (::system (ACE_TEXT_ALWAYS_CHAR (s)), int, -1); + ACE_OSCALL_RETURN (::system (s), int, -1); #endif /* !CHORUS */ } diff --git a/ace/OS_NS_string.cpp b/ace/OS_NS_string.cpp index 02226349e5e..8a98bd5c1d9 100644 --- a/ace/OS_NS_string.cpp +++ b/ace/OS_NS_string.cpp @@ -2,12 +2,13 @@ #include "ace/OS_NS_string.h" #include "ace/OS_NS_stdlib.h" -#include "ace/ACE.h" + ACE_RCSID (ace, OS_NS_string, "$Id$") + #if !defined (ACE_HAS_INLINED_OSCALLS) # include "ace/OS_NS_string.inl" #endif /* ACE_HAS_INLINED_OS_CALLS */ @@ -152,23 +153,6 @@ ACE_OS::strecpy (wchar_t *s, const wchar_t *t) } #endif /* ACE_HAS_WCHAR */ -char * -ACE_OS::strerror (int errnum) -{ - if (ACE::is_sock_error (errnum)) - { - const ACE_TCHAR *errortext = ACE::sock_error (errnum); - static char ret_errortext[128]; - ACE_OS::strncpy (ret_errortext, ACE_TEXT_ALWAYS_CHAR(errortext), sizeof(ret_errortext)); - return ret_errortext; - } -#if defined (ACE_LACKS_STRERROR) - return ACE_OS::strerror_emulation (errnum); -#else /* ACE_LACKS_STRERROR */ - return ::strerror (errnum); -#endif /* ACE_LACKS_STRERROR */ -} - #if defined (ACE_LACKS_STRERROR) /** * Just returns "Unknown Error" all the time. diff --git a/ace/OS_NS_string.h b/ace/OS_NS_string.h index 1bcdee2c6a5..0848570ab34 100644 --- a/ace/OS_NS_string.h +++ b/ace/OS_NS_string.h @@ -19,7 +19,7 @@ # include /**/ "ace/pre.h" -# include "ace/config-lite.h" +# include "ace/config-all.h" # if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -183,7 +183,7 @@ namespace ACE_OS { #endif /* ACE_HAS_WCHAR */ /// Returns a system error message. - extern ACE_Export + ACE_NAMESPACE_INLINE_FUNCTION char *strerror (int errnum); #if defined (ACE_LACKS_STRERROR) @@ -456,13 +456,13 @@ namespace ACE_OS { /// Emulated strtok_r. extern ACE_Export char *strtok_r_emulation (char *s, const char *tokens, char **lasts); -#endif /* !ACE_HAS_REENTRANT_FUNCTIONS */ -# if defined (ACE_HAS_WCHAR) && defined(ACE_LACKS_WCSTOK) +# if defined (ACE_HAS_WCHAR) /// Emulated strtok_r (wchar_t version). extern ACE_Export wchar_t *strtok_r_emulation (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts); -# endif // ACE_HAS_WCHAR && ACE_LACKS_WCSTOK +# endif // ACE_HAS_WCHAR +#endif /* !ACE_HAS_REENTRANT_FUNCTIONS */ } /* namespace ACE_OS */ diff --git a/ace/OS_NS_string.inl b/ace/OS_NS_string.inl index cb3ee4ec3c6..13168942e68 100644 --- a/ace/OS_NS_string.inl +++ b/ace/OS_NS_string.inl @@ -166,6 +166,16 @@ ACE_OS::strcspn (const wchar_t *s, const wchar_t *reject) } #endif /* ACE_HAS_WCHAR */ +ACE_INLINE char * +ACE_OS::strerror (int errnum) +{ +#if defined (ACE_LACKS_STRERROR) + return ACE_OS::strerror_emulation (errnum); +#else /* ACE_LACKS_STRERROR */ + return ::strerror (errnum); +#endif /* ACE_LACKS_STRERROR */ +} + ACE_INLINE size_t ACE_OS::strlen (const char *s) { diff --git a/ace/OS_NS_strings.cpp b/ace/OS_NS_strings.cpp index 67ca3a809b8..21d57924e0e 100644 --- a/ace/OS_NS_strings.cpp +++ b/ace/OS_NS_strings.cpp @@ -21,8 +21,8 @@ ACE_OS::strcasecmp_emulation (const char *s, const char *t) const char *scan2 = t; while (*scan1 != 0 - && ACE_OS::ace_tolower (*scan1) - == ACE_OS::ace_tolower (*scan2)) + && ACE_OS::to_lower (*scan1) + == ACE_OS::to_lower (*scan2)) { ++scan1; ++scan2; @@ -39,7 +39,7 @@ ACE_OS::strcasecmp_emulation (const char *s, const char *t) else if (*scan2 == '\0') return 1; else - return ACE_OS::ace_tolower (*scan1) - ACE_OS::ace_tolower (*scan2); + return ACE_OS::to_lower (*scan1) - ACE_OS::to_lower (*scan2); } #endif /* ACE_LACKS_STRCASECMP */ @@ -55,8 +55,8 @@ ACE_OS::strncasecmp_emulation (const char *s, while (count++ < len && *scan1 != 0 - && ACE_OS::ace_tolower (*scan1) - == ACE_OS::ace_tolower (*scan2)) + && ACE_OS::to_lower (*scan1) + == ACE_OS::to_lower (*scan2)) { ++scan1; ++scan2; @@ -76,6 +76,6 @@ ACE_OS::strncasecmp_emulation (const char *s, else if (*scan2 == '\0') return 1; else - return ACE_OS::ace_tolower (*scan1) - ACE_OS::ace_tolower (*scan2); + return ACE_OS::to_lower (*scan1) - ACE_OS::to_lower (*scan2); } #endif /* ACE_LACKS_STRCASECMP */ diff --git a/ace/OS_NS_stropts.cpp b/ace/OS_NS_stropts.cpp index f8fe0b4ad7a..72696cb7b72 100644 --- a/ace/OS_NS_stropts.cpp +++ b/ace/OS_NS_stropts.cpp @@ -46,7 +46,7 @@ ACE_OS::ioctl (ACE_HANDLE socket, # endif /* ACE_HAS_WINSOCK2 */ } -#if !defined (ACE_HAS_WINCE) + int ACE_OS::ioctl (ACE_HANDLE socket, unsigned long io_control_code, @@ -190,4 +190,4 @@ ACE_OS::ioctl (ACE_HANDLE socket, ACE_NOTSUP_RETURN (-1); # endif /* ACE_HAS_WINSOCK2 */ } -#endif /* ACE_HAS_WINCE */ + diff --git a/ace/OS_NS_stropts.h b/ace/OS_NS_stropts.h index 9b1f6fc2f56..69685193150 100644 --- a/ace/OS_NS_stropts.h +++ b/ace/OS_NS_stropts.h @@ -25,10 +25,6 @@ # pragma once # endif /* ACE_LACKS_PRAGMA_ONCE */ -# ifndef ACE_IOCTL_TYPE_ARG2 -# define ACE_IOCTL_TYPE_ARG2 int -# endif - #include "ace/os_include/os_stropts.h" #include "ace/os_include/os_stdio.h" #include "ace/ACE_export.h" @@ -109,9 +105,10 @@ namespace ACE_OS { /// UNIX-style <ioctl>. ACE_NAMESPACE_INLINE_FUNCTION int ioctl (ACE_HANDLE handle, - ACE_IOCTL_TYPE_ARG2 cmd, + int cmd, void * = 0); +#if !defined (ACE_HAS_WINCE) /// QoS-enabled <ioctl>. extern ACE_Export int ioctl (ACE_HANDLE socket, @@ -124,7 +121,6 @@ namespace ACE_OS { ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func); -#if !defined (ACE_HAS_WINCE) /// QoS-enabled <ioctl> when the I/O control code is either /// SIO_SET_QOS or SIO_GET_QOS. extern ACE_Export @@ -136,7 +132,7 @@ namespace ACE_OS { unsigned long buffer = 0, ACE_OVERLAPPED *overlapped = 0, ACE_OVERLAPPED_COMPLETION_FUNC func = 0); -#endif /* ACE_HAS_WINCE */ +#endif // ACE_HAS_WINCE ACE_NAMESPACE_INLINE_FUNCTION int isastream (ACE_HANDLE handle); diff --git a/ace/OS_NS_stropts.inl b/ace/OS_NS_stropts.inl index 6b963ec6e63..1e33d9d59d9 100644 --- a/ace/OS_NS_stropts.inl +++ b/ace/OS_NS_stropts.inl @@ -103,7 +103,7 @@ ACE_OS::fdetach (const char *file) ACE_INLINE int ACE_OS::ioctl (ACE_HANDLE handle, - ACE_IOCTL_TYPE_ARG2 cmd, + int cmd, void *val) { ACE_OS_TRACE ("ACE_OS::ioctl"); diff --git a/ace/OS_NS_sys_mman.h b/ace/OS_NS_sys_mman.h index 1ce8939525f..bf0462afa26 100644 --- a/ace/OS_NS_sys_mman.h +++ b/ace/OS_NS_sys_mman.h @@ -27,7 +27,6 @@ #include "ace/Global_Macros.h" #include "ace/os_include/sys/os_types.h" -#include "ace/os_include/sys/os_mman.h" #include "ace/ACE_export.h" #if defined (ACE_EXPORT_MACRO) diff --git a/ace/OS_NS_sys_mman.inl b/ace/OS_NS_sys_mman.inl index 9592d4c4dfa..1e3006e259a 100644 --- a/ace/OS_NS_sys_mman.inl +++ b/ace/OS_NS_sys_mman.inl @@ -6,6 +6,7 @@ #include "ace/OS_NS_stdio.h" #include "ace/OS_NS_macros.h" #include "ace/OS_NS_errno.h" +#include "ace/os_include/sys/os_mman.h" #if defined (__Lynx__) # include "ace/OS_NS_sys_stat.h" @@ -22,7 +23,13 @@ ACE_INLINE int ACE_OS::madvise (caddr_t addr, size_t len, int map_advice) { ACE_OS_TRACE ("ACE_OS::madvise"); -#if !defined (ACE_LACKS_MADVISE) +#if defined (ACE_WIN32) + ACE_UNUSED_ARG (addr); + ACE_UNUSED_ARG (len); + ACE_UNUSED_ARG (map_advice); + + ACE_NOTSUP_RETURN (-1); +#elif !defined (ACE_LACKS_MADVISE) ACE_OSCALL_RETURN (::madvise (addr, len, map_advice), int, -1); #else ACE_UNUSED_ARG (addr); diff --git a/ace/OS_NS_sys_resource.h b/ace/OS_NS_sys_resource.h index 7486dd2a1c7..7841f7d9c52 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, - const struct rlimit *rl); + ACE_SETRLIMIT_TYPE *rl); } /* namespace ACE_OS */ diff --git a/ace/OS_NS_sys_resource.inl b/ace/OS_NS_sys_resource.inl index ea6fc92849d..fbc5ce8e3a0 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, const struct rlimit *rl) +ACE_OS::setrlimit (int resource, ACE_SETRLIMIT_TYPE *rl) { ACE_OS_TRACE ("ACE_OS::setrlimit"); @@ -70,23 +70,10 @@ ACE_OS::setrlimit (int resource, const struct rlimit *rl) ACE_NOTSUP_RETURN (-1); #else # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM) -# if defined (ACE_HAS_NONCONST_SETRLIMIT) - ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, - const_cast<struct rlimit *>(rl) - ), int, -1); + ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, rl), int, -1); # else - ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, - resource, - ), int, -1); -# endif /* ACE_HAS_NONCONST_SETRLIMIT */ -# else /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ -# if defined (ACE_HAS_NONCONST_SETRLIMIT) - ACE_OSCALL_RETURN (::setrlimit (resource, const_cast<struct rlimit *>(rl) - ), int, -1); -# else ACE_OSCALL_RETURN (::setrlimit (resource, rl), int, -1); -# endif /* ACE_HAS_NONCONST_SETRLIMIT */ -# endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ +# endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ #endif /* ACE_LACKS_RLIMIT */ } diff --git a/ace/OS_NS_sys_select.inl b/ace/OS_NS_sys_select.inl index b4b3efa117a..6c9f17d557b 100644 --- a/ace/OS_NS_sys_select.inl +++ b/ace/OS_NS_sys_select.inl @@ -1,9 +1,9 @@ // -*- C++ -*- // $Id$ -#include "ace/OS_NS_errno.h" -#include "ace/OS_NS_macros.h" +#include "ace/os_include/os_errno.h" #include "ace/Time_Value.h" +#include "ace/OS_NS_macros.h" // It would be really cool to add another version of select that would // function like the one we're defending against below! diff --git a/ace/OS_NS_sys_socket.cpp b/ace/OS_NS_sys_socket.cpp index 1eb0500ad5f..0cfdbbc19da 100644 --- a/ace/OS_NS_sys_socket.cpp +++ b/ace/OS_NS_sys_socket.cpp @@ -59,6 +59,7 @@ ACE_OS::connect (ACE_HANDLE handle, addrlen); # endif /* ACE_HAS_WINSOCK2 */ } +#endif // ACE_HAS_WINCE ACE_HANDLE ACE_OS::join_leaf (ACE_HANDLE socket, @@ -94,7 +95,6 @@ ACE_OS::join_leaf (ACE_HANDLE socket, ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE); # endif /* ACE_HAS_WINSOCK2 */ } -#endif // ACE_HAS_WINCE int ACE_OS::socket_init (int version_high, int version_low) diff --git a/ace/OS_NS_sys_socket.inl b/ace/OS_NS_sys_socket.inl index 3d3f9fbd199..59930fb6319 100644 --- a/ace/OS_NS_sys_socket.inl +++ b/ace/OS_NS_sys_socket.inl @@ -531,13 +531,11 @@ ACE_OS::sendmsg (ACE_HANDLE handle, } else return (ssize_t) bytes_sent; -# elif defined (ACE_HAS_NONCONST_SENDMSG) - ACE_SOCKCALL_RETURN (::sendmsg (handle, - const_cast<struct msghdr *>(msg), - flags), int, -1); +# elif defined (ACE_PSOS) + ACE_SOCKCALL_RETURN (::sendmsg (handle, (struct msghdr *) msg, flags), int, -1); # else - ACE_SOCKCALL_RETURN (::sendmsg (handle, msg, flags), int, -1); -# endif + ACE_SOCKCALL_RETURN (::sendmsg (handle, (ACE_SENDMSG_TYPE *) msg, flags), int, -1); +# endif /* ACE_PSOS */ #else ACE_UNUSED_ARG (flags); ACE_UNUSED_ARG (msg); diff --git a/ace/OS_NS_sys_stat.h b/ace/OS_NS_sys_stat.h index f954938b816..6f82c1930d7 100644 --- a/ace/OS_NS_sys_stat.h +++ b/ace/OS_NS_sys_stat.h @@ -34,7 +34,7 @@ #endif #define ACE_EXPORT_MACRO ACE_Export -# if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && !defined (__BORLANDC__) && !defined(__IBMCPP__) +# if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) && !defined (__BORLANDC__) typedef struct _stat ACE_stat; # else typedef struct stat ACE_stat; @@ -63,15 +63,9 @@ namespace ACE_OS { ACE_stat *); ACE_NAMESPACE_INLINE_FUNCTION - int lstat (const char *, + int lstat (const ACE_TCHAR *, ACE_stat *); -#if defined (ACE_HAS_WCHAR) - ACE_NAMESPACE_INLINE_FUNCTION - int lstat (const wchar_t *, - ACE_stat *); -#endif /* ACE_HAS_WCHAR */ - ACE_NAMESPACE_INLINE_FUNCTION int mkdir (const char *path, mode_t mode = ACE_DEFAULT_DIR_PERMS); diff --git a/ace/OS_NS_sys_stat.inl b/ace/OS_NS_sys_stat.inl index b96e5e3b1fb..8f17ae48465 100644 --- a/ace/OS_NS_sys_stat.inl +++ b/ace/OS_NS_sys_stat.inl @@ -4,7 +4,6 @@ #include "ace/OS_NS_unistd.h" #include "ace/OS_NS_fcntl.h" #include "ace/OS_NS_errno.h" -#include "ace/OS_NS_macros.h" ACE_INLINE ACE_HANDLE ACE_OS::creat (const ACE_TCHAR *filename, mode_t mode) @@ -25,7 +24,7 @@ ACE_OS::creat (const ACE_TCHAR *filename, mode_t mode) ACE_UNUSED_ARG (mode); ACE_NOTSUP_RETURN (-1); #else - ACE_OSCALL_RETURN (::creat (ACE_TEXT_ALWAYS_CHAR (filename), mode), + ACE_OSCALL_RETURN (::creat (filename, mode), ACE_HANDLE, ACE_INVALID_HANDLE); #endif /* ACE_WIN32 */ } @@ -138,7 +137,7 @@ ACE_OS::filesize (const ACE_TCHAR *filename) } ACE_INLINE int -ACE_OS::lstat (const char *file, ACE_stat *stp) +ACE_OS::lstat (const ACE_TCHAR *file, ACE_stat *stp) { ACE_OS_TRACE ("ACE_OS::lstat"); # if defined (ACE_LACKS_LSTAT) @@ -152,19 +151,6 @@ ACE_OS::lstat (const char *file, ACE_stat *stp) # endif /* ACE_LACKS_LSTAT */ } -#if defined (ACE_HAS_WCHAR) -ACE_INLINE int -ACE_OS::lstat (const wchar_t *file, ACE_stat *stp) -{ - ACE_OS_TRACE ("ACE_OS::lstat"); -# if defined (ACE_LACKS_LSTAT) - return ACE_OS::stat (file, stp); -# else - return ACE_OS::lstat (ACE_Wide_To_Ascii (file).char_rep (), stp); -# endif /* ACE_LACKS_LSTAT */ -} -#endif /* ACE_HAS_WCHAR */ - ACE_INLINE int ACE_OS::mkdir (const char *path, mode_t mode) { @@ -215,7 +201,7 @@ ACE_OS::mkdir (const char *path, mode_t mode) ACE_OSCALL_RETURN (::_mkdir ((char *) path), int, -1); #elif defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (mode); - ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::CreateDirectory (ACE_TEXT_CHAR_TO_TCHAR (path), 0), + ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::CreateDirectory (path, 0), ace_result_), int, -1); #elif defined (ACE_WIN32) @@ -255,7 +241,7 @@ ACE_OS::mkfifo (const ACE_TCHAR *file, mode_t mode) ACE_UNUSED_ARG (mode); ACE_NOTSUP_RETURN (-1); #else - ACE_OSCALL_RETURN (::mkfifo (ACE_TEXT_ALWAYS_CHAR (file), mode), int, -1); + ACE_OSCALL_RETURN (::mkfifo (file, mode), int, -1); #endif /* ACE_LACKS_MKFIFO */ } @@ -276,7 +262,7 @@ ACE_OS::stat (const char *file, ACE_stat *stp) HANDLE fhandle; - fhandle = ::FindFirstFile (ACE_TEXT_CHAR_TO_TCHAR (file), &fdata); + fhandle = ::FindFirstFile (file, &fdata); if (fhandle == INVALID_HANDLE_VALUE) { ACE_OS::set_errno_to_last_error (); @@ -299,11 +285,7 @@ ACE_OS::stat (const char *file, ACE_stat *stp) // wrapper for _xstat(). ACE_OSCALL_RETURN (::_xstat (_STAT_VER, file, stp), int, -1); #elif defined (ACE_WIN32) -# if defined(__IBMCPP__) - ACE_OSCALL_RETURN (::_stat (file, stp), int, -1); -#else ACE_OSCALL_RETURN (::_stat (file, (struct _stat *) stp), int, -1); -#endif /* __IBMCPP__ */ #else /* VXWORKS */ ACE_OSCALL_RETURN (::stat (file, stp), int, -1); #endif /* VXWORKS */ diff --git a/ace/OS_NS_sys_uio.cpp b/ace/OS_NS_sys_uio.cpp index 7c52d91bab7..5936e84eaec 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, - const iovec *iov, + ACE_READV_TYPE *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, const iovec *iov, int n) +ACE_OS::writev_emulation (ACE_HANDLE handle, ACE_WRITEV_TYPE 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 2978b95501f..0450563f5f1 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, - const iovec *iov, + iovec *iov, int iovlen); #if defined (ACE_LACKS_READV) extern ACE_Export ssize_t readv_emulation (ACE_HANDLE handle, - const iovec *iov, + ACE_READV_TYPE *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, - const iovec *iov, + ACE_WRITEV_TYPE *iov, int iovcnt); #endif /* ACE_LACKS_WRITEV */ diff --git a/ace/OS_NS_sys_uio.inl b/ace/OS_NS_sys_uio.inl index c216e9d0a8f..2b944d4684b 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, - const iovec *iov, + iovec *iov, int iovlen) { ACE_OS_TRACE ("ACE_OS::readv"); @@ -15,15 +15,7 @@ ACE_OS::readv (ACE_HANDLE handle, ssize_t, -1); #else /* ACE_LACKS_READV */ -#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 */ + ACE_OSCALL_RETURN (::readv (handle, iov, iovlen), ssize_t, -1); #endif /* ACE_LACKS_READV */ } @@ -35,17 +27,11 @@ 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, - iov, + (ACE_WRITEV_TYPE *) iov, iovcnt), ssize_t, -1); #else /* ACE_LACKS_WRITEV */ -#if defined (ACE_HAS_NONCONST_WRITEV) ACE_OSCALL_RETURN (::writev (handle, - const_cast<iovec *>(iov), + (ACE_WRITEV_TYPE *) 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/OS_NS_time.cpp b/ace/OS_NS_time.cpp index cf4fb7076a4..7563d9002ce 100644 --- a/ace/OS_NS_time.cpp +++ b/ace/OS_NS_time.cpp @@ -9,34 +9,26 @@ ACE_RCSID(ace, OS_NS_time, "$Id$") # include "ace/OS_NS_time.inl" #endif /* ACE_HAS_INLINED_OS_CALLS */ -#if defined (ACE_LACKS_NATIVE_STRPTIME) -# include "ace/os_include/os_ctype.h" -#endif /* ACE_LACKS_NATIVE_STRPTIME */ - #include "ace/OS_NS_Thread.h" #include "ace/Object_Manager_Base.h" -#if defined (ACE_HAS_WINCE) -# include "ace/OS_NS_stdio.h" /* Need ACE_OS::sprintf() */ -const wchar_t *ACE_OS::day_of_week_name[7] = - {ACE_LIB_TEXT ("Sun"), - ACE_LIB_TEXT ("Mon"), - ACE_LIB_TEXT ("Tue"), - ACE_LIB_TEXT ("Wed"), - ACE_LIB_TEXT ("Thu"), - ACE_LIB_TEXT ("Fri"), - ACE_LIB_TEXT ("Sat")}; - -const wchar_t *ACE_OS::month_name[12] = - {ACE_LIB_TEXT ("Jan"), ACE_LIB_TEXT ("Feb"), - ACE_LIB_TEXT ("Mar"), ACE_LIB_TEXT ("Apr"), - ACE_LIB_TEXT ("May"), ACE_LIB_TEXT ("Jun"), - ACE_LIB_TEXT ("Jul"), ACE_LIB_TEXT ("Aug"), - ACE_LIB_TEXT ("Sep"), ACE_LIB_TEXT ("Oct"), - ACE_LIB_TEXT ("Nov"), ACE_LIB_TEXT ("Dec") }; +// hmmm, should this be only for ACE_MT_SAFE? dhinton +#if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) +# if defined (ACE_HAS_WINCE) +const wchar_t *ACE_OS::day_of_week_name[] = {ACE_LIB_TEXT ("Sun"), ACE_LIB_TEXT ("Mon"), + ACE_LIB_TEXT ("Tue"), ACE_LIB_TEXT ("Wed"), + ACE_LIB_TEXT ("Thu"), ACE_LIB_TEXT ("Fri"), + ACE_LIB_TEXT ("Sat")}; +const wchar_t *ACE_OS::month_name[] = {ACE_LIB_TEXT ("Jan"), ACE_LIB_TEXT ("Feb"), + ACE_LIB_TEXT ("Mar"), ACE_LIB_TEXT ("Apr"), + ACE_LIB_TEXT ("May"), ACE_LIB_TEXT ("Jun"), + ACE_LIB_TEXT ("Jul"), ACE_LIB_TEXT ("Aug"), + ACE_LIB_TEXT ("Sep"), ACE_LIB_TEXT ("Oct"), + ACE_LIB_TEXT ("Nov"), ACE_LIB_TEXT ("Dec") }; static const ACE_TCHAR *ACE_OS_CTIME_R_FMTSTR = ACE_LIB_TEXT ("%3s %3s %02d %02d:%02d:%02d %04d\n"); -#endif /* ACE_HAS_WINCE */ +# endif /* ACE_HAS_WINCE */ +#endif /* ACE_MT_SAFE && ACE_MT_SAFE != 0 */ # if defined (ACE_PSOS) diff --git a/ace/OS_NS_time.h b/ace/OS_NS_time.h index 8cb05fa4cda..10efa75c8d5 100644 --- a/ace/OS_NS_time.h +++ b/ace/OS_NS_time.h @@ -25,7 +25,6 @@ # pragma once # endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "ace/OS_NS_errno.h" #include "ace/Basic_Types.h" #include "ace/os_include/os_time.h" #include "ace/ACE_export.h" @@ -106,6 +105,10 @@ private: #endif /* ACE_PSOS_HAS_TIME */ #if defined (ACE_HAS_WINCE) + /// Supporting data for ctime and ctime_r functions on WinCE. + const wchar_t *day_of_week_name[7]; + const wchar_t *month_name[12]; + // WinCE doesn't have most of the standard C library time functions. It // also doesn't define struct tm. SYSTEMTIME has pretty much the same // info though, so we can map it when needed. Define struct tm here and @@ -134,35 +137,48 @@ struct tm { */ inline long ace_timezone() { -#if defined (ACE_HAS_WINCE) +#if !defined (VXWORKS) && !defined (ACE_PSOS) && !defined (CHORUS) +# if defined (ACE_HAS_WINCE) TIME_ZONE_INFORMATION tz; GetTimeZoneInformation (&tz); return tz.Bias * 60; -#elif defined (ACE_WIN32) && !defined (ACE_HAS_DINKUM_STL) +# elif defined (ACE_WIN32) && !defined (ACE_HAS_DINKUM_STL) return _timezone; // For Win32. -#elif defined (ACE_WIN32) && defined (ACE_HAS_DINKUM_STL) +# elif defined (ACE_WIN32) && defined (ACE_HAS_DINKUM_STL) time_t tod = time(0); // get current time time_t t1 = mktime(gmtime(&tod)); // convert without timezone time_t t2 = mktime(localtime(&tod)); // convert with timezone return difftime(t1, t2); // compute difference in seconds -#elif defined (ACE_HAS_TIMEZONE) - // The XPG/POSIX specification requires that tzset() be called to - // set the global variable <timezone>. - ::tzset(); - return timezone; -#elif defined (ACE_HAS_TIMEZONE_GETTIMEOFDAY) +# elif defined (ACE_HAS_TIMEZONE_GETTIMEOFDAY) \ + && !defined (__linux__) \ + && !defined (__FreeBSD__) \ + && !defined (__NetBSD__) // The XPG/POSIX specification does not require gettimeofday to // set the timezone struct (it leaves the behavior of passing a - // non-null struct undefined). + // non-null struct undefined). We know gettimeofday() on Linux + // *BSD systems does not set the timezone, so we avoid using it + // and use the global variable <timezone> instead. + // + // @note As of this writing, OpenBSD does not provide the global + // variable timezone. + // + // @todo It would be better if we had a feature test macro that + // could be used instead of a list of operating systems. long result = 0; struct timeval time; struct timezone zone; ACE_UNUSED_ARG (result); ACE_OSCALL (::gettimeofday (&time, &zone), int, -1, result); return zone.tz_minuteswest * 60; -#else +# else /* ACE_HAS_TIMEZONE_GETTIMEOFDAY */ + // The XPG/POSIX specification requires that tzset() be called to + // set the global variable <timezone>. + ::tzset(); + return timezone; +# endif /* ACE_HAS_TIMEZONE_GETTIMEOFDAY */ +#else ACE_NOTSUP_RETURN (0); -#endif +#endif /* !ACE_HAS_WINCE && !VXWORKS && !ACE_PSOS */ } @@ -214,12 +230,6 @@ typedef ACE_UINT64 ACE_hrtime_t; namespace ACE_OS { -# if defined (ACE_HAS_WINCE) - /// Supporting data for ctime and ctime_r functions on WinCE. - const wchar_t *day_of_week_name[]; - const wchar_t *month_name[]; -# endif /* ACE_HAS_WINCE */ - # if defined (CHORUS) && !defined (CHORUS_4) // We must format this code as follows to avoid confusing OSE. enum ACE_HRTimer_Op diff --git a/ace/OS_NS_time.inl b/ace/OS_NS_time.inl index ac13858669c..294f802bbfe 100644 --- a/ace/OS_NS_time.inl +++ b/ace/OS_NS_time.inl @@ -91,26 +91,10 @@ ACE_OS::ctime (const time_t *t) return ACE_OS::ctime_r (t, buf, ctime_buf_size); -#elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR) +#elif defined (ACE_USES_WCHAR) ACE_OSCALL_RETURN (::_wctime (t), wchar_t *, 0); #else -# if defined (ACE_USES_WCHAR) /* Not Win32, else it would do the above */ - char *narrow_time; - ACE_OSCALL (::ctime (t), char *, 0, narrow_time); - if (narrow_time == 0) - return 0; - // ACE_Ascii_To_Wide::convert allocates (via new []) a wchar_t[]. If - // we've done this before, free the previous one. Yes, this leaves a - // small memory leak (26 characters) but there's no way around this - // that I know of. (Steve Huston, 12-Feb-2003). - static wchar_t *wide_time = 0; - if (wide_time != 0) - delete [] wide_time; - wide_time = ACE_Ascii_To_Wide::convert (narrow_time); - return wide_time; -# else ACE_OSCALL_RETURN (::ctime (t), char *, 0); -# endif /* ACE_USES_WCHAR */ # endif /* ACE_HAS_BROKEN_CTIME */ } @@ -121,15 +105,6 @@ ACE_OS::ctime_r (const time_t *t, ACE_TCHAR *buf, int buflen) ACE_OS_TRACE ("ACE_OS::ctime_r"); #if defined (ACE_HAS_REENTRANT_FUNCTIONS) - - char *bufp = 0; -# if defined (ACE_USES_WCHAR) - char narrow_buf[ctime_buf_size]; - bufp = narrow_buf; -# else - bufp = buf; -# endif /* ACE_USES_WCHAR */ - # if defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R) if (buflen < ctime_buf_size) { @@ -137,31 +112,20 @@ ACE_OS::ctime_r (const time_t *t, ACE_TCHAR *buf, int buflen) return 0; } # if defined (DIGITAL_UNIX) - ACE_OSCALL (::_Pctime_r (t, bufp), ACE_TCHAR *, 0, bufp); + ACE_OSCALL_RETURN (::_Pctime_r (t, buf), ACE_TCHAR *, 0); # else /* DIGITAL_UNIX */ - ACE_OSCALL (::ctime_r (t, bufp), char *, 0, bufp); + ACE_OSCALL_RETURN (::ctime_r (t, buf), ACE_TCHAR *, 0); # endif /* DIGITAL_UNIX */ + return buf; # else /* ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R */ # if defined (ACE_CTIME_R_RETURNS_INT) - bufp = ::ctime_r (t, bufp, buflen) == -1 ? 0 : bufp; + return (::ctime_r (t, buf, buflen) == -1 ? 0 : buf); # else /* ACE_CTIME_R_RETURNS_INT */ - bufp = ::ctime_r (t, bufp, buflen); + ACE_OSCALL_RETURN (::ctime_r (t, buf, buflen), ACE_TCHAR *, 0); # endif /* ACE_CTIME_R_RETURNS_INT */ # endif /* ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R */ - - if (bufp == 0) - return 0; - -# if defined (ACE_USES_WCHAR) - ACE_Ascii_To_Wide wide_buf (bufp); - ACE_OS_String::strcpy (buf, wide_buf.wchar_rep ()); - return buf; -# else - return bufp; -# endif /* ACE_USES_WCHAR */ - #else /* ACE_HAS_REENTRANT_FUNCTIONS */ # if defined(ACE_PSOS) && ! defined (ACE_PSOS_HAS_TIME) ACE_OS::strsncpy (buf, "ctime-return", buflen); diff --git a/ace/OS_NS_unistd.cpp b/ace/OS_NS_unistd.cpp index 370ff5f4510..c472f5d7cca 100644 --- a/ace/OS_NS_unistd.cpp +++ b/ace/OS_NS_unistd.cpp @@ -16,7 +16,14 @@ ACE_RCSID(ace, OS_NS_unistd, "$Id$") #include "ace/OS_Memory.h" #include "ace/OS_NS_Thread.h" #include "ace/Object_Manager_Base.h" -#include "ace/os_include/sys/os_pstat.h" + +// This is here for ACE_OS::num_processors_online(). On HP-UX, it +// needs sys/param.h (above) and sys/pstat.h. The implementation of the +// num_processors_online() method also uses 'defined (__hpux)' to decide +// whether or not to try the syscall. +#if defined (__hpux) +# include /**/ <sys/pstat.h> +#endif /* __hpux **/ #if defined (ACE_NEEDS_FTRUNCATE) extern "C" int @@ -48,30 +55,14 @@ ACE_OS::argv_to_string (ACE_TCHAR **argv, for (int i = 0; argv[i] != 0; i++) { + ACE_TCHAR *temp = 0; + #if !defined (ACE_LACKS_ENV) // Account for environment variables. - if (substitute_env_args && argv[i][0] == ACE_LIB_TEXT ('$')) - { -# if defined (ACE_WIN32) || !defined (ACE_HAS_WCHAR) - ACE_TCHAR *temp = 0; - // Win32 is the only platform with a wide-char ACE_OS::getenv(). - if ((temp = ACE_OS::getenv (&argv[i][1])) != 0) - buf_len += ACE_OS::strlen (temp); - else - buf_len += ACE_OS::strlen (argv[i]); -# else - // This is an ACE_HAS_WCHAR platform and not ACE_WIN32. - // Convert the env variable name for getenv(), then add - // the length of the returned char *string. Later, when we - // actually use the returned env variable value, convert it - // as well. - char *ctemp = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (&argv[i][1])); - if (ctemp == 0) - buf_len += ACE_OS::strlen (argv[i]); - else - buf_len += ACE_OS::strlen (ctemp); -# endif /* ACE_WIN32 || !ACE_HAS_WCHAR */ - } + if (substitute_env_args + && (argv[i][0] == '$' + && (temp = ACE_OS::getenv (&argv[i][1])) != 0)) + buf_len += ACE_OS::strlen (temp); else #endif /* ACE_LACKS_ENV */ buf_len += ACE_OS::strlen (argv[i]); @@ -94,29 +85,14 @@ ACE_OS::argv_to_string (ACE_TCHAR **argv, for (j = 0; argv[j] != 0; j++) { + ACE_TCHAR *temp = 0; #if !defined (ACE_LACKS_ENV) // Account for environment variables. - if (substitute_env_args && argv[j][0] == ACE_LIB_TEXT ('$')) - { -# if defined (ACE_WIN32) || !defined (ACE_HAS_WCHAR) - // Win32 is the only platform with a wide-char ACE_OS::getenv(). - ACE_TCHAR *temp = ACE_OS::getenv (&argv[j][1]); - if (temp != 0) - end = ACE_OS::strecpy (end, temp); - else - end = ACE_OS::strecpy (end, argv[j]); -# else - // This is an ACE_HAS_WCHAR platform and not ACE_WIN32. - // Convert the env variable name for getenv(), then convert - // the returned char *string back to wchar_t. - char *ctemp = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (&argv[j][1])); - if (ctemp == 0) - end = ACE_OS::strecpy (end, argv[j]); - else - end = ACE_OS::strecpy (end, ACE_TEXT_CHAR_TO_TCHAR (ctemp)); -# endif /* ACE_WIN32 || !ACE_HAS_WCHAR */ - } + if (substitute_env_args + && (argv[j][0] == '$' + && (temp = ACE_OS::getenv (&argv[j][1])) != 0)) + end = ACE_OS::strecpy (end, temp); else #endif /* ACE_LACKS_ENV */ end = ACE_OS::strecpy (end, argv[j]); @@ -253,13 +229,6 @@ ACE_OS::fork_exec (ACE_TCHAR *argv[]) # else pid_t result = ACE_OS::fork (); -# if defined (ACE_USES_WCHAR) - // Wide-char builds need to convert the command-line args to - // narrow char strings for execv(). - char **cargv; - int arg_count; -# endif /* ACE_HAS_WCHAR */ - switch (result) { case -1: @@ -267,22 +236,6 @@ ACE_OS::fork_exec (ACE_TCHAR *argv[]) return -1; case 0: // Child process. -# if defined (ACE_USES_WCHAR) - for (arg_count = 0; argv[arg_count] != 0; ++arg_count) - ; - ++arg_count; // Need a 0-pointer end-of-array marker - ACE_NEW_NORETURN (cargv, char*[arg_count]); - if (cargv == 0) - ACE_OS::exit (errno); - --arg_count; // Back to 0-indexed - cargv[arg_count] = 0; - while (--arg_count >= 0) - cargv[arg_count] = ACE_Wide_To_Ascii::convert (argv[arg_count]); - // Don't worry about freeing the cargv or the strings it points to. - // Either the process will be replaced, or we'll exit. - if (ACE_OS::execv (cargv[0], cargv) == -1) - ACE_OS::exit (errno); -# else if (ACE_OS::execv (argv[0], argv) == -1) { // The OS layer should not print stuff out @@ -292,8 +245,6 @@ ACE_OS::fork_exec (ACE_TCHAR *argv[]) // If the execv fails, this child needs to exit. ACE_OS::exit (errno); } -# endif /* ACE_HAS_WCHAR */ - default: // Server process. The fork succeeded. return result; @@ -312,7 +263,7 @@ ACE_OS::num_processors (void) SYSTEM_INFO sys_info; ::GetSystemInfo (&sys_info); return sys_info.dwNumberOfProcessors; -#elif defined (linux) || defined (sun) || defined (DIGITAL_UNIX) || defined (CYGWIN32) +#elif defined (linux) || defined (sun) return ::sysconf (_SC_NPROCESSORS_CONF); #else ACE_NOTSUP_RETURN (-1); @@ -330,7 +281,7 @@ ACE_OS::num_processors_online (void) SYSTEM_INFO sys_info; ::GetSystemInfo (&sys_info); return sys_info.dwNumberOfProcessors; -#elif defined (linux) || defined (sun) || defined (DIGITAL_UNIX) || defined (CYGWIN32) +#elif defined (linux) || defined (sun) return ::sysconf (_SC_NPROCESSORS_ONLN); #elif defined (__hpux) struct pst_dynamic psd; diff --git a/ace/OS_NS_unistd.h b/ace/OS_NS_unistd.h index bc75ef75be8..54200f5e648 100644 --- a/ace/OS_NS_unistd.h +++ b/ace/OS_NS_unistd.h @@ -74,12 +74,7 @@ namespace ACE_OS { #endif /* ACE_LACKS_CHDIR */ ACE_NAMESPACE_INLINE_FUNCTION - int rmdir (const char *path); - -#if defined (ACE_HAS_WCHAR) - ACE_NAMESPACE_INLINE_FUNCTION - int rmdir (const wchar_t *path); -#endif /* ACE_HAS_WCHAR */ + int rmdir (const ACE_TCHAR * path); ACE_NAMESPACE_INLINE_FUNCTION int close (ACE_HANDLE handle); @@ -139,12 +134,7 @@ namespace ACE_OS { off_t); ACE_NAMESPACE_INLINE_FUNCTION - char *getcwd (char *, size_t); - -#if defined (ACE_HAS_WCHAR) - ACE_NAMESPACE_INLINE_FUNCTION - wchar_t *getcwd (wchar_t *, size_t); -#endif /* ACE_HAS_WCHAR */ + ACE_TCHAR *getcwd (ACE_TCHAR *, size_t); ACE_NAMESPACE_INLINE_FUNCTION gid_t getgid (void); diff --git a/ace/OS_NS_unistd.inl b/ace/OS_NS_unistd.inl index 549ea9530e8..c1e2b1535c7 100644 --- a/ace/OS_NS_unistd.inl +++ b/ace/OS_NS_unistd.inl @@ -118,8 +118,9 @@ ACE_OS::chdir (const char *path) ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::change_dir ((char *) path), result), int, -1); -#elif defined (ACE_WIN32) && defined (__IBMCPP__) && (__IBMCPP__ >= 400) - ACE_OSCALL_RETURN (::_chdir (const_cast<char *> (path)), int, -1); +// This #elif seems weird... is Visual Age on NT not setting ACE_WIN32? +#elif !defined (ACE_WIN32) && !defined (AIX) && defined (__IBMCPP__) && (__IBMCPP__ >= 400) + ACE_OSCALL_RETURN (::_chdir (path), int, -1); #elif defined (ACE_HAS_WINCE) ACE_UNUSED_ARG (path); @@ -145,7 +146,7 @@ ACE_OS::chdir (const wchar_t *path) #endif /* ACE_LACKS_CHDIR */ ACE_INLINE int -ACE_OS::rmdir (const char *path) +ACE_OS::rmdir (const ACE_TCHAR * path) { #if defined (ACE_PSOS_LACKS_PHILE) ACE_UNUSED_ARG (path); @@ -189,31 +190,16 @@ ACE_OS::rmdir (const char *path) #elif defined (ACE_WIN32) && defined (__IBMCPP__) && (__IBMCPP__ >= 400) ACE_OSCALL_RETURN (::_rmdir ((char *) path), int, -1); #elif defined (ACE_HAS_WINCE) - ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::RemoveDirectory (ACE_TEXT_CHAR_TO_TCHAR (path)), + ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::RemoveDirectory (path, NULL), ace_result_), int, -1); +#elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR) + ACE_OSCALL_RETURN (::_wrmdir (path), int, -1); #else ACE_OSCALL_RETURN (::rmdir (path), int, -1); #endif /* ACE_HAS_PACE */ } -#if defined (ACE_HAS_WCHAR) -ACE_INLINE int -ACE_OS::rmdir (const wchar_t *path) -{ -#if defined (ACE_HAS_WINCE) - ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::RemoveDirectory (path), - ace_result_), - int, -1); -#elif defined (ACE_WIN32) - ACE_OSCALL_RETURN (::_wrmdir (path), int, -1); -#else - ACE_Wide_To_Ascii n_path (path); - return ACE_OS::rmdir (n_path.char_rep ()); -#endif /* ACE_HAS_WINCE */ -} -#endif /* ACE_HAS_WCHAR */ - // @todo: which 4 and why??? dhinton // NOTE: The following four function definitions must appear before // ACE_OS::sema_init (). @@ -415,8 +401,8 @@ ACE_OS::ftruncate (ACE_HANDLE handle, off_t offset) #endif /* ACE_WIN32 */ } -ACE_INLINE char * -ACE_OS::getcwd (char *buf, size_t size) +ACE_INLINE ACE_TCHAR * +ACE_OS::getcwd (ACE_TCHAR *buf, size_t size) { ACE_OS_TRACE ("ACE_OS::getcwd"); #if defined (ACE_PSOS_LACKS_PHILE) @@ -508,35 +494,16 @@ ACE_OS::getcwd (char *buf, size_t size) ACE_UNUSED_ARG (size); ACE_NOTSUP_RETURN (0); #elif defined (ACE_WIN32) +# if defined (ACE_USES_WCHAR) + return ::_wgetcwd (buf, static_cast<int> (size)); +# else return ::getcwd (buf, static_cast<int> (size)); +# endif /* ACE_USES_WCHAR */ #else ACE_OSCALL_RETURN (::getcwd (buf, size), char *, 0); #endif /* ACE_PSOS_LACKS_PHILE */ } -#if defined (ACE_HAS_WCHAR) -ACE_INLINE wchar_t * -ACE_OS::getcwd (wchar_t *buf, size_t size) -{ -# if defined (ACE_HAS_WINCE) - ACE_UNUSED_ARG (buf); - ACE_UNUSED_ARG (size); - ACE_NOTSUP_RETURN (0); -# elif defined (ACE_WIN32) - return ::_wgetcwd (buf, ACE_static_cast (int, size)); -# else - char *narrow_buf = new char[size]; - char *result = 0; - result = ACE_OS::getcwd (narrow_buf, size); - ACE_Ascii_To_Wide wide_buf (result); - delete [] narrow_buf; - if (result != 0) - ACE_OS::strsncpy (buf, wide_buf.wchar_rep (), size); - return result == 0 ? 0 : buf; -# endif /* ACE_WIN32 */ -} -#endif /* ACE_HAS_WCHAR */ - ACE_INLINE gid_t ACE_OS::getgid (void) { @@ -562,6 +529,8 @@ ACE_OS::getopt (int argc, char *const *argv, const char *optstring) ACE_UNUSED_ARG (argv); ACE_UNUSED_ARG (optstring); ACE_NOTSUP_RETURN (-1); +# elif defined (ACE_LACKS_GETOPT_PROTO) + ACE_OSCALL_RETURN (::getopt (argc, (char**) argv, optstring), int, -1); # else ACE_OSCALL_RETURN (::getopt (argc, argv, optstring), int, -1); # endif /* VXWORKS */ @@ -1226,8 +1195,7 @@ ACE_OS::truncate (const ACE_TCHAR *filename, } /* NOTREACHED */ #elif !defined (ACE_LACKS_TRUNCATE) - ACE_OSCALL_RETURN - (::truncate (ACE_TEXT_ALWAYS_CHAR (filename), offset), int, -1); + ACE_OSCALL_RETURN (::truncate (filename, offset), int, -1); #else ACE_UNUSED_ARG (filename); ACE_UNUSED_ARG (offset); @@ -1287,7 +1255,7 @@ ACE_OS::unlink (const char *path) int, -1); # elif defined (ACE_HAS_WINCE) // @@ The problem is, DeleteFile is not actually equals to unlink. ;( - ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::DeleteFile (ACE_TEXT_CHAR_TO_TCHAR (path)), ace_result_), + ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::DeleteFile (path), ace_result_), int, -1); # elif defined (ACE_LACKS_UNLINK) ACE_UNUSED_ARG (path); diff --git a/ace/OS_NS_wchar.cpp b/ace/OS_NS_wchar.cpp index 7150d7f3627..03c480e9ea1 100644 --- a/ace/OS_NS_wchar.cpp +++ b/ace/OS_NS_wchar.cpp @@ -129,8 +129,8 @@ ACE_OS::wcsicmp_emulation (const wchar_t *s, const wchar_t *t) const wchar_t *scan2 = t; while (*scan1 != 0 - && ACE_OS::ace_towlower (*scan1) - == ACE_OS::ace_towlower (*scan2)) + && ACE_OS::to_lower (*scan1) + == ACE_OS::to_lower (*scan2)) { ++scan1; ++scan2; @@ -147,7 +147,7 @@ ACE_OS::wcsicmp_emulation (const wchar_t *s, const wchar_t *t) else if (*scan2 == '\0') return 1; else - return ACE_OS::ace_tolower (*scan1) - ACE_OS::ace_towlower (*scan2); + return ACE_OS::to_lower (*scan1) - ACE_OS::to_lower (*scan2); } #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSICMP */ @@ -253,8 +253,8 @@ ACE_OS::wcsnicmp_emulation (const wchar_t *s, while (count++ < len && *scan1 != 0 - && ACE_OS::ace_towlower (*scan1) - == ACE_OS::ace_towlower (*scan2)) + && ACE_OS::to_lower (*scan1) + == ACE_OS::to_lower (*scan2)) { ++scan1; ++scan2; @@ -274,7 +274,7 @@ ACE_OS::wcsnicmp_emulation (const wchar_t *s, else if (*scan2 == '\0') return 1; else - return ACE_OS::ace_towlower (*scan1) - ACE_OS::ace_towlower (*scan2); + return ACE_OS::to_lower (*scan1) - ACE_OS::to_lower (*scan2); } #endif /* ACE_HAS_WCHAR && ACE_LACKS_WCSNICMP */ diff --git a/ace/OS_main.h b/ace/OS_main.h index 87e932a4dd9..4a80cb624d7 100644 --- a/ace/OS_main.h +++ b/ace/OS_main.h @@ -36,20 +36,7 @@ # if defined (ACE_WIN32) && defined (ACE_USES_WCHAR) # define ACE_TMAIN wmain # else -# if defined (ACE_USES_WCHAR) /* Not Win32, but uses wchar */ - // Replace main() with a version that converts the char** argv to - // ACE_TCHAR and calls the ACE_TMAIN entrypoint. -# include "ace/Argv_Type_Converter.h" -# define ACE_TMAIN \ - ace_main_i (int, ACE_TCHAR *[]); /* forward declaration */ \ - int main (int argc, char *argv[]) { \ - ACE_Argv_Type_Converter wide_argv (argc, argv); \ - return ace_main_i (argc, wide_argv.get_TCHAR_argv ()); \ - } \ - int ace_main_i -# else -# define ACE_TMAIN main -# endif /* ACE_USES_WCHAR */ +# define ACE_TMAIN main # endif # if defined (ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER) diff --git a/ace/Object_Manager.cpp b/ace/Object_Manager.cpp index c911792a188..a1dcfdb729b 100644 --- a/ace/Object_Manager.cpp +++ b/ace/Object_Manager.cpp @@ -16,7 +16,6 @@ #include "ace/Signal.h" #include "ace/Framework_Component.h" #include "ace/Atomic_Op.h" -#include "ace/OS_NS_sys_time.h" #if !defined (__ACE_INLINE__) # include "ace/Object_Manager.inl" @@ -604,7 +603,7 @@ ACE_Object_Manager::fini (void) // No mutex here. Only the main thread should destroy the singleton // ACE_Object_Manager instance. - // Indicate that this ACE_Object_Manager instance is being + // First, indicate that this ACE_Object_Manager instance is being // shut down. object_manager_state_ = OBJ_MAN_SHUTTING_DOWN; diff --git a/ace/Object_Manager_Base.cpp b/ace/Object_Manager_Base.cpp index 6a2b512ef67..32d2e1f5482 100644 --- a/ace/Object_Manager_Base.cpp +++ b/ace/Object_Manager_Base.cpp @@ -408,7 +408,7 @@ ACE_OS_Object_Manager::print_error_message (u_int line_number, #if !defined (ACE_HAS_WINCE) fprintf (stderr, "ace/OS.cpp, line %u: %s ", line_number, - ACE_TEXT_ALWAYS_CHAR (message)); + message); perror ("failed"); #else // @@ Need to use the following information. diff --git a/ace/Object_Manager_Base.h b/ace/Object_Manager_Base.h index dc09e8daeb5..5619b3af323 100644 --- a/ace/Object_Manager_Base.h +++ b/ace/Object_Manager_Base.h @@ -18,7 +18,7 @@ #define ACE_OBJECT_MANAGER_BASE_H #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/POSIX_Asynch_IO.cpp b/ace/POSIX_Asynch_IO.cpp index 10558ce4fa7..d601ed0763e 100644 --- a/ace/POSIX_Asynch_IO.cpp +++ b/ace/POSIX_Asynch_IO.cpp @@ -421,7 +421,7 @@ ACE_POSIX_Asynch_Write_Stream::write (ACE_Message_Block &message_block, bytes_to_write = len; if (bytes_to_write == 0) - ACE_ERROR_RETURN + ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("ACE_POSIX_Asynch_Write_Stream::write:") ACE_LIB_TEXT ("Attempt to write 0 bytes\n")), @@ -536,7 +536,7 @@ ACE_POSIX_Asynch_Read_File::read (ACE_Message_Block &message_block, bytes_to_read=space; if ( bytes_to_read == 0 ) - ACE_ERROR_RETURN + ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("ACE_POSIX_Asynch_Read_File::read:") ACE_LIB_TEXT ("Attempt to read 0 bytes or no space in the message block\n")), @@ -667,7 +667,7 @@ ACE_POSIX_Asynch_Write_File::write (ACE_Message_Block &message_block, bytes_to_write = len; if (bytes_to_write == 0) - ACE_ERROR_RETURN + ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("ACE_POSIX_Asynch_Write_File::write:") ACE_LIB_TEXT ("Attempt to write 0 bytes\n")), @@ -1529,14 +1529,14 @@ ACE_POSIX_Asynch_Connect::connect_i (ACE_POSIX_Asynch_Connect_Result *result, } // set non blocking mode - if (ACE::set_flags (handle, ACE_NONBLOCK) != 0) + if (ACE_Flag_Manip::set_flags (handle, ACE_NONBLOCK) != 0) { result->set_error (errno); ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT("ACE_POSIX_Asynch_Connect::connect_i, %p\n") - ACE_LIB_TEXT("ACE::set_flags failed")), + ACE_LIB_TEXT("ACE_Flag_Manip::set_flags failed")), -1); } @@ -2512,15 +2512,15 @@ ACE_POSIX_Asynch_Read_Dgram::recv (ACE_Message_Block *message_block, ACE_POSIX_Proactor *proactor = this->posix_proactor (); ACE_NEW_RETURN (result, ACE_POSIX_Asynch_Read_Dgram_Result (*this->handler_, - this->handle_, - message_block, - space, - flags, - protocol_family, - act, - proactor->get_handle (), - priority, - signal_number), + this->handle_, + message_block, + space, + flags, + protocol_family, + act, + proactor->get_handle (), + priority, + signal_number), -1); int return_val = proactor->start_aio (result, ACE_POSIX_Proactor::READ); @@ -2554,7 +2554,7 @@ ACE_POSIX_Asynch_Write_Dgram::send (ACE_Message_Block *message_block, { size_t len = message_block->length (); if (len == 0) - ACE_ERROR_RETURN + ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("ACE_POSIX_Asynch_Write_Stream::write:") ACE_LIB_TEXT ("Attempt to write 0 bytes\n")), @@ -2564,14 +2564,14 @@ ACE_POSIX_Asynch_Write_Dgram::send (ACE_Message_Block *message_block, ACE_POSIX_Proactor *proactor = this->posix_proactor (); ACE_NEW_RETURN (result, ACE_POSIX_Asynch_Write_Dgram_Result (*this->handler_, - this->handle_, - message_block, - len, - flags, - act, - proactor->get_handle (), - priority, - signal_number), + this->handle_, + message_block, + len, + flags, + act, + proactor->get_handle (), + priority, + signal_number), -1); int return_val = proactor->start_aio (result, ACE_POSIX_Proactor::WRITE); diff --git a/ace/POSIX_Proactor.cpp b/ace/POSIX_Proactor.cpp index 2c31ead9383..72004069c8e 100644 --- a/ace/POSIX_Proactor.cpp +++ b/ace/POSIX_Proactor.cpp @@ -57,11 +57,11 @@ public: // ********************************************************************* ACE_POSIX_Proactor::ACE_POSIX_Proactor (void) - : os_id_ (ACE_OS_UNDEFINED) + : os_id_ (OS_UNDEFINED) { #if defined(sun) - os_id_ = ACE_OS_SUN; // set family + os_id_ = OS_SUN; // set family char Buf [32]; @@ -70,23 +70,23 @@ ACE_POSIX_Proactor::ACE_POSIX_Proactor (void) ACE_OS::sysinfo (SI_RELEASE , Buf, sizeof(Buf)-1); if (ACE_OS::strcasecmp (Buf , "5.6") == 0) - os_id_ = ACE_OS_SUN_56; + os_id_ = OS_SUN_56; else if (ACE_OS::strcasecmp (Buf , "5.7") == 0) - os_id_ = ACE_OS_SUN_57; + os_id_ = OS_SUN_57; else if (ACE_OS::strcasecmp (Buf , "5.8") == 0) - os_id_ = ACE_OS_SUN_58; + os_id_ = OS_SUN_58; #elif defined(HPUX) - os_id_ = ACE_OS_HPUX; // set family + os_id_ = OS_HPUX; // set family #elif defined(__sgi) - os_id_ = ACE_OS_IRIX; // set family + os_id_ = OS_IRIX; // set family #elif defined(__OpenBSD) - os_id_ = ACE_OS_OPENBSD; // set family + os_id_ = OS_OPENBSD; // set family // do the same @@ -650,7 +650,7 @@ ACE_AIOCB_Notify_Pipe_Manager::ACE_AIOCB_Notify_Pipe_Manager (ACE_POSIX_AIOCB_Pr this->pipe_.open (); // Set write side in NONBLOCK mode - ACE::set_flags (this->pipe_.write_handle (), ACE_NONBLOCK); + ACE_Flag_Manip::set_flags (this->pipe_.write_handle (), ACE_NONBLOCK); // Let AIOCB_Proactor know about our handle posix_aiocb_proactor_->set_notify_handle (this->pipe_.read_handle ()); @@ -1878,7 +1878,7 @@ ACE_POSIX_SIG_Proactor::handle_events_i (const ACE_Time_Value *timeout) int error_status = 0; size_t transfer_count = 0; - if (sig_info.si_code == SI_ASYNCIO || this->os_id_ == ACE_OS_SUN_56) + if (sig_info.si_code == SI_ASYNCIO || this->os_id_ == OS_SUN_56) { flg_aio = 1; // AIO signal received // define index to start @@ -1892,7 +1892,7 @@ ACE_POSIX_SIG_Proactor::handle_events_i (const ACE_Time_Value *timeout) // there is one I/O to process, and it's correctly specified in the // siginfo received. There are, however, some special situations // where this isn't true... - if (os_id_ == ACE_OS_SUN_56) // Solaris 6 + if (os_id_ == OS_SUN_56) // Solaris 6 { // 1. Solaris 6 always loses any RT signal, // if it has more SIGQUEMAX=32 pending signals diff --git a/ace/POSIX_Proactor.h b/ace/POSIX_Proactor.h index e8e0897e3d4..a86c5be69cb 100644 --- a/ace/POSIX_Proactor.h +++ b/ace/POSIX_Proactor.h @@ -47,8 +47,8 @@ * AIOCBs are stored and completion status of the corresponding * operations are queried on them. The other one is based on * POSIX Real Time signals. This class abstracts out the common - * code needed for both the strategies. <ACE_POSIX_AIOCB_Proactor> and - * <ACE_POSIX_SIG_Proactor> specialize this class for each strategy. + * code needed for both the strategies. <ACE_AIOCB_Proactor> and + * <ACE_SIG_Proactor> specialize this class for each strategy. */ class ACE_Export ACE_POSIX_Proactor : public ACE_Proactor_Impl { @@ -74,21 +74,21 @@ public: enum SystemType // open for future extention { - ACE_OS_UNDEFINED= 0x0000, - ACE_OS_WIN = 0x0100, // for future - ACE_OS_WIN_NT = ACE_OS_WIN | 0x0001, - ACE_OS_WIN_2000 = ACE_OS_WIN | 0x0002, - ACE_OS_SUN = 0x0200, // Sun Solaris family - ACE_OS_SUN_55 = ACE_OS_SUN | 0x0001, - ACE_OS_SUN_56 = ACE_OS_SUN | 0x0002, - ACE_OS_SUN_57 = ACE_OS_SUN | 0x0004, - ACE_OS_SUN_58 = ACE_OS_SUN | 0x0008, - ACE_OS_HPUX = 0x0400, // HPUX family - ACE_OS_HPUX_11 = ACE_OS_HPUX | 0x0001, - ACE_OS_LINUX = 0x0800, // Linux family - ACE_OS_FREEBSD = 0x1000, // FreeBSD family - ACE_OS_IRIX = 0x2000, // SGI IRIX family - ACE_OS_OPENBSD = 0x4000 // OpenBSD familty + OS_UNDEFINED= 0x0000, + OS_WIN = 0x0100, // for future + OS_WIN_NT = OS_WIN | 0x0001, + OS_WIN_2000 = OS_WIN | 0x0002, + OS_SUN = 0x0200, // Sun Solaris family + OS_SUN_55 = OS_SUN | 0x0001, + OS_SUN_56 = OS_SUN | 0x0002, + OS_SUN_57 = OS_SUN | 0x0004, + OS_SUN_58 = OS_SUN | 0x0008, + OS_HPUX = 0x0400, // HPUX family + OS_HPUX_11 = OS_HPUX | 0x0001, + OS_LINUX = 0x0800, // Linux family + OS_FREEBSD = 0x1000, // FreeBSD family + OS_IRIX = 0x2000, // SGI IRIX family + OS_OPENBSD = 0x4000 // OpenBSD familty }; enum Opcode { diff --git a/ace/Pipe.cpp b/ace/Pipe.cpp index 50ad4221b79..7f0ef736814 100644 --- a/ace/Pipe.cpp +++ b/ace/Pipe.cpp @@ -6,12 +6,6 @@ #include "ace/Log_Msg.h" #include "ace/OS_NS_sys_socket.h" -#if defined (ACE_HAS_STREAM_PIPES) || defined (__QNX__) -# include "ace/OS_NS_unistd.h" -#endif // ACE_HAS_STREAM_PIPES || __QNX__ - -#include "ace/os_include/netinet/os_tcp.h" - #if !defined (__ACE_INLINE__) #include "ace/Pipe.inl" #endif /* __ACE_INLINE__ */ diff --git a/ace/Priority_Reactor.cpp b/ace/Priority_Reactor.cpp index 8a996fdf79e..e52aabd626f 100644 --- a/ace/Priority_Reactor.cpp +++ b/ace/Priority_Reactor.cpp @@ -17,7 +17,7 @@ ACE_ALLOC_HOOK_DEFINE(ACE_Priority_Reactor) // Initialize ACE_Select_Reactor. #define npriorities \ - ACE_Event_Handler::HI_PRIORITY-ACE_Event_Handler::LO_PRIORITY+1 + ACE_Event_Handler::HI_PRIORITY-ACE_Event_Handler::LO_PRIORITY+1 void ACE_Priority_Reactor::init_bucket (void) @@ -71,11 +71,24 @@ ACE_Priority_Reactor::~ACE_Priority_Reactor (void) delete tuple_allocator_; } -void -ACE_Priority_Reactor::build_bucket (ACE_Handle_Set &dispatch_mask, - int &min_priority, - int &max_priority) +int +ACE_Priority_Reactor::dispatch_io_set (int number_of_active_handles, + int& number_dispatched, + int mask, + ACE_Handle_Set& dispatch_mask, + ACE_Handle_Set& ready_mask, + ACE_EH_PTMF callback) { + ACE_TRACE ("ACE_Priority_Reactor::dispatch_io_set"); + + if (number_of_active_handles == 0) + return 0; + + // The range for which there exists any Event_Tuple is computed on + // the ordering loop, minimizing iterations on the dispatching loop. + int min_priority = ACE_Event_Handler::HI_PRIORITY; + int max_priority = ACE_Event_Handler::LO_PRIORITY; + ACE_Handle_Set_Iterator handle_iter (dispatch_mask); for (ACE_HANDLE handle; @@ -100,66 +113,30 @@ ACE_Priority_Reactor::build_bucket (ACE_Handle_Set &dispatch_mask, max_priority = prio; } -} - -int -ACE_Priority_Reactor::dispatch_io_set (int number_of_active_handles, - int& number_dispatched, - int mask, - ACE_Handle_Set& dispatch_mask, - ACE_Handle_Set& ready_mask, - ACE_EH_PTMF callback) -{ - ACE_TRACE ("ACE_Priority_Reactor::dispatch_io_set"); - - if (number_of_active_handles == 0) - return 0; - - // The range for which there exists any Event_Tuple is computed on - // the ordering loop, minimizing iterations on the dispatching loop. - int min_priority = - ACE_Event_Handler::HI_PRIORITY; - int max_priority = - ACE_Event_Handler::LO_PRIORITY; - - (void) this->build_bucket (dispatch_mask, - min_priority, - max_priority); - for (int i = max_priority; i >= min_priority; --i) { + // Remove all the entries from the wrappers while (!bucket_[i]->is_empty () - && number_dispatched < number_of_active_handles) + && number_dispatched < number_of_active_handles + && this->state_changed_ == 0) { - ACE_Event_Tuple et; - bucket_[i]->dequeue_head (et); - this->notify_handle (et.handle_, mask, ready_mask, et.event_handler_, callback); number_dispatched++; - - // clear the bit from that dispatch mask, - // so when we need to restart the iteration (rebuilding the iterator...) - // we will not dispatch the already dipatched handlers - this->clear_dispatch_mask (et.handle_, - mask); - - if (this->state_changed_) - { - this->state_changed_ = false; // so it will not rebuild it ... - } } - // Even if we are aborting the loop due to this->state_changed // or another error we still want to cleanup the buckets. bucket_[i]->reset (); } + if (number_dispatched > 0 && this->state_changed_) + return -1; + return 0; } diff --git a/ace/Priority_Reactor.h b/ace/Priority_Reactor.h index e9f2809d583..9a10b354138 100644 --- a/ace/Priority_Reactor.h +++ b/ace/Priority_Reactor.h @@ -71,11 +71,6 @@ private: /// A small helper to initialize the bucket. void init_bucket (void); - /// Build the bucket from the given dispatch_mask - void build_bucket (ACE_Handle_Set& dispatch_mask, - int &min_priority, - int &max_priority); - /// There is a queue per-priority, which simply holds the /// Event_Handlers until we know who goes first. typedef ACE_Unbounded_Queue<ACE_Event_Tuple> QUEUE; diff --git a/ace/Proactor.cpp b/ace/Proactor.cpp index 65f426a9f2b..942cae1f2fc 100644 --- a/ace/Proactor.cpp +++ b/ace/Proactor.cpp @@ -1,6 +1,5 @@ // $Id$ -#include "ace/config-lite.h" #include "ace/Proactor.h" #if ((defined (ACE_WIN32) && !defined (ACE_HAS_WINCE)) || (defined (ACE_HAS_AIO_CALLS))) @@ -1191,9 +1190,10 @@ ACE_Proactor::run_event_loop (void) } int -ACE_Proactor::run_event_loop (ACE_Time_Value &) +ACE_Proactor::run_event_loop (ACE_Time_Value &tv) { // not implemented + ACE_UNUSED_ARG (tv); return -1; } diff --git a/ace/Process.cpp b/ace/Process.cpp index bfecc19732c..e7c784a6c6b 100644 --- a/ace/Process.cpp +++ b/ace/Process.cpp @@ -22,7 +22,7 @@ ACE_RCSID (ace, Process, "$Id$") // This function acts as a signal handler for SIGCHLD. We don't really want // to do anything with the signal - it's just needed to interrupt a sleep. // See wait() for more info. -#if !defined (ACE_WIN32) && !defined(ACE_LACKS_UNIX_SIGNALS) +#if !defined (ACE_WIN32) static void sigchld_nop (int, siginfo_t *, ucontext_t *) { @@ -198,66 +198,6 @@ ACE_Process::spawn (ACE_Process_Options &options) } return this->child_id_; -#elif defined(ACE_OPENVMS) - if (ACE_BIT_ENABLED (options.creation_flags (), - ACE_Process_Options::NO_EXEC)) - ACE_NOTSUP_RETURN (ACE_INVALID_PID); - - int saved_stdin = ACE_STDIN; - int saved_stdout = ACE_STDOUT; - int saved_stderr = ACE_STDERR; - // Save STD file descriptors and redirect - if (options.get_stdin () != ACE_INVALID_HANDLE) { - if ((saved_stdin = ACE_OS::dup (ACE_STDIN)) == -1 && errno != EBADF) - ACE_OS::exit (errno); - if (ACE_OS::dup2 (options.get_stdin (), ACE_STDIN) == -1) - ACE_OS::exit (errno); - } - if (options.get_stdout () != ACE_INVALID_HANDLE) { - if ((saved_stdout = ACE_OS::dup (ACE_STDOUT)) == -1 && errno != EBADF) - ACE_OS::exit (errno); - if (ACE_OS::dup2 (options.get_stdout (), ACE_STDOUT) == -1) - ACE_OS::exit (errno); - } - if (options.get_stderr () != ACE_INVALID_HANDLE) { - if ((saved_stderr = ACE_OS::dup (ACE_STDERR)) == -1 && errno != EBADF) - ACE_OS::exit (errno); - if (ACE_OS::dup2 (options.get_stderr (), ACE_STDERR) == -1) - ACE_OS::exit (errno); - } - - if (options.working_directory () != 0) - ACE_NOTSUP_RETURN (ACE_INVALID_PID); - - this->child_id_ = vfork(); - if (this->child_id_ == 0) { - ACE_OS::execvp (options.process_name (), - options.command_line_argv ()); - // something went wrong - this->child_id_ = ACE_INVALID_PID; - } - - // restore STD file descriptors (if necessary) - if (options.get_stdin () != ACE_INVALID_HANDLE) { - if (saved_stdin == -1) - ACE_OS::close (ACE_STDIN); - else - ACE_OS::dup2 (saved_stdin, ACE_STDIN); - } - if (options.get_stdout () != ACE_INVALID_HANDLE) { - if (saved_stdout == -1) - ACE_OS::close (ACE_STDOUT); - else - ACE_OS::dup2 (saved_stdout, ACE_STDOUT); - } - if (options.get_stderr () != ACE_INVALID_HANDLE) { - if (saved_stderr == -1) - ACE_OS::close (ACE_STDERR); - else - ACE_OS::dup2 (saved_stderr, ACE_STDERR); - } - - return this->child_id_; #else /* ACE_WIN32 */ // Fork the new process. this->child_id_ = ACE::fork (options.process_name (), @@ -344,56 +284,31 @@ ACE_Process::spawn (ACE_Process_Options &options) // Child process executes the command. int result = 0; - // Wide-char builds not on Windows need narrow-char strings for - // exec() and environment variables. Don't need to worry about - // releasing any of the converted string memory since this - // process will either exec() or exit() shortly. -# if defined (ACE_USES_WCHAR) - ACE_Wide_To_Ascii n_procname (options.process_name ()); - const char *procname = n_procname.char_rep (); - - wchar_t * const *wargv = options.command_line_argv (); - size_t vcount, i; - for (vcount = 0; wargv[vcount] != 0; ++vcount) - ; - char **procargv = new char *[vcount + 1]; // Need 0 at the end - procargv[vcount] = 0; - for (i = 0; i < vcount; ++i) - procargv[i] = ACE_Wide_To_Ascii::convert (wargv[i]); - - wargv = options.env_argv (); - for (vcount = 0; wargv[vcount] != 0; ++vcount) - ; - char **procenv = new char *[vcount + 1]; // Need 0 at the end - procenv[vcount] = 0; - for (i = 0; i < vcount; ++i) - procenv[i] = ACE_Wide_To_Ascii::convert (wargv[i]); -# else - const char *procname = options.process_name (); - char *const *procargv = options.command_line_argv (); - char *const *procenv = options.env_argv (); -# endif /* ACE_USES_WCHAR */ - if (options.inherit_environment ()) { // Add the new environment variables to the environment // context of the context before doing an <execvp>. - for (size_t i = 0; procenv[i] != 0; i++) - if (ACE_OS::putenv (procenv[i]) != 0) + for (char *const *user_env = options.env_argv (); + *user_env != 0; + user_env++) + if (ACE_OS::putenv (*user_env) != 0) return ACE_INVALID_PID; // Now the forked process has both inherited variables and // the user's supplied variables. - result = ACE_OS::execvp (procname, procargv); + result = ACE_OS::execvp (options.process_name (), + options.command_line_argv ()); } else { -# if defined (ghs) +#if defined (ghs) // GreenHills 1.8.8 (for VxWorks 5.3.x) can't compile this // code. Processes aren't supported on VxWorks anyways. ACE_NOTSUP_RETURN (ACE_INVALID_PID); -# else - result = ACE_OS::execve (procname, procargv, procenv); +#else + result = ACE_OS::execve (options.process_name (), + options.command_line_argv (), + options.env_argv ()); # endif /* ghs */ } if (result == -1) @@ -473,45 +388,7 @@ ACE_Process::wait (const ACE_Time_Value &tv, ACE_OS::set_errno_to_last_error (); return -1; } -#elif defined(ACE_LACKS_UNIX_SIGNALS) - if (tv == ACE_Time_Value::zero) - { - pid_t retv = - ACE_OS::waitpid (this->child_id_, - &this->exit_code_, - WNOHANG); - if (status != 0) - *status = this->exit_code_; - - return retv; - } - - if (tv == ACE_Time_Value::max_time) - return this->wait (status); - - pid_t pid = 0; - ACE_Time_Value sleeptm (1); // 1 msec - if (sleeptm > tv) // if sleeptime > waittime - sleeptm = tv; - ACE_Time_Value tmo (tv); // Need one we can change - for (ACE_Countdown_Time time_left (&tmo); tmo > ACE_Time_Value::zero ; time_left.update ()) - { - pid = ACE_OS::waitpid (this->getpid (), - &this->exit_code_, - WNOHANG); - if (status != 0) - *status = this->exit_code_; - - if (pid > 0 || pid == ACE_INVALID_PID) - break; // Got a child or an error - all done - - // pid 0, nothing is ready yet, so wait. - // Do a (very) short sleep (only this thread sleeps). - ACE_OS::sleep (sleeptm); - } - - return pid; -#else /* !ACE_WIN32 && !ACE_LACKS_UNIX_SIGNALS */ +#else /* ACE_WIN32 */ if (tv == ACE_Time_Value::zero) { pid_t retv = diff --git a/ace/Process.inl b/ace/Process.inl index 7b561b5c59d..cf0c17b6f60 100644 --- a/ace/Process.inl +++ b/ace/Process.inl @@ -247,7 +247,7 @@ ACE_INLINE int ACE_Process_Options::setreugid (const ACE_TCHAR* user) { #if !defined (ACE_LACKS_PWD_FUNCTIONS) - struct passwd *ent = ACE_OS::getpwnam (ACE_TEXT_ALWAYS_CHAR (user)); + struct passwd *ent = ACE_OS::getpwnam (user); if (ent != 0) { diff --git a/ace/Process_Manager.cpp b/ace/Process_Manager.cpp index 4aa30ef5c5d..c51ec494015 100644 --- a/ace/Process_Manager.cpp +++ b/ace/Process_Manager.cpp @@ -40,7 +40,7 @@ ACE_Process_Manager::cleanup (void *, void *) // This function acts as a signal handler for SIGCHLD. We don't really want // to do anything with the signal - it's just needed to interrupt a sleep. // See wait() for more info. -#if !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SIGNALS) +#if !defined (ACE_WIN32) static void sigchld_nop (int, siginfo_t *, ucontext_t *) { @@ -190,9 +190,6 @@ ACE_Process_Manager::resize (size_t size) { ACE_TRACE ("ACE_Process_Manager::resize"); - if (size <= this->max_process_table_size_) - return 0; - ACE_Process_Descriptor *temp; ACE_NEW_RETURN (temp, @@ -224,7 +221,7 @@ ACE_Process_Manager::open (size_t size, if (r) { this->reactor (r); -#if !defined (ACE_WIN32) && !defined (ACE_PSOS) && !defined (ACE_LACKS_UNIX_SIGNALS) +#if !defined (ACE_WIN32) && !defined (ACE_PSOS) // Register signal handler object. if (r->register_handler (SIGCHLD, this) == -1) return -1; @@ -267,7 +264,7 @@ ACE_Process_Manager::close (void) { ACE_TRACE ("ACE_Process_Manager::close"); -#if !defined (ACE_WIN32) && !defined (ACE_LACKS_UNIX_SIGNALS) +#if !defined (ACE_WIN32) if (this->reactor ()) { this->reactor ()->remove_handler (SIGCHLD, (ACE_Sig_Action *) 0); @@ -379,7 +376,9 @@ ACE_Process_Manager::handle_signal (int, } #else /* !ACE_WIN32 */ ACE_UNUSED_ARG (si); - return reactor ()->notify (this, ACE_Event_Handler::READ_MASK); + return reactor ()->notify + (this, + ACE_Event_Handler::READ_MASK); #endif /* !ACE_WIN32 */ } @@ -441,7 +440,8 @@ ACE_Process_Manager::spawn (ACE_Process *process, pid_t pid = process->spawn (options); // Only include the pid in the parent's table. - if (pid == ACE_INVALID_PID || pid == 0) + if (pid == ACE_INVALID_PID + || pid == 0) return pid; ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, @@ -492,35 +492,33 @@ ACE_Process_Manager::append_proc (ACE_Process *proc) { ACE_TRACE ("ACE_Process_Manager::append_proc"); - // Try to resize the array to twice its existing size (or the DEFAULT_SIZE, - // if there are no array entries) if we run out of space... - if (this->current_count_ >= this->max_process_table_size_) + // Try to resize the array to twice its existing size if we run out + // of space... + if (this->current_count_ >= this->max_process_table_size_ + && this->resize (this->max_process_table_size_ * 2) == -1) + return -1; + else { - size_t new_size = this->max_process_table_size_ * 2; - if (new_size == 0) - new_size = ACE_Process_Manager::DEFAULT_SIZE; - if (this->resize (new_size) == -1) - return -1; - } - - ACE_Process_Descriptor &proc_desc = - this->process_table_[this->current_count_]; + ACE_Process_Descriptor &proc_desc = + this->process_table_[this->current_count_]; - proc_desc.process_ = proc; - proc_desc.exit_notify_ = 0; + proc_desc.process_ = proc; + proc_desc.exit_notify_ = 0; #if defined (ACE_WIN32) - // If we have a Reactor, then we're supposed to reap Processes - // automagically. Get a handle to this new Process and tell the - // Reactor we're interested in <handling_input> on it. - - ACE_Reactor *r = this->reactor (); - if (r != 0) - r->register_handler (this, proc->gethandle ()); + // If we have a Reactor, then we're supposed to reap Processes + // automagically. Get a handle to this new Process and tell the + // Reactor we're interested in <handling_input> on it. + + ACE_Reactor *r = this->reactor (); + if (r != 0) + r->register_handler (this, + proc->gethandle ()); #endif /* ACE_WIN32 */ - this->current_count_++; - return 0; + this->current_count_++; + return 0; + } } // Insert a process into the pool (checks for duplicates and doesn't @@ -840,23 +838,6 @@ ACE_Process_Manager::wait (pid_t pid, } else { -# if defined (ACE_LACKS_UNIX_SIGNALS) - pid = 0; - ACE_Time_Value sleeptm (1); // 1 msec - if (sleeptm > timeout) // if sleeptime > waittime - sleeptm = timeout; - ACE_Time_Value tmo (timeout); // Need one we can change - for (ACE_Countdown_Time time_left (&tmo); tmo > ACE_Time_Value::zero ; time_left.update ()) - { - pid = ACE_OS::waitpid (-1, status, WNOHANG); - if (pid > 0 || pid == ACE_INVALID_PID) - break; // Got a child or an error - all done - - // pid 0, nothing is ready yet, so wait. - // Do a (very) short sleep (only this thread sleeps). - ACE_OS::sleep (sleeptm); - } -# else // Force generation of SIGCHLD, even though we don't want to // catch it - just need it to interrupt the sleep below. // If this object has a reactor set, assume it was given at @@ -893,7 +874,6 @@ ACE_Process_Manager::wait (pid_t pid, { old_action.register_action (SIGCHLD); } -# endif /* !ACE_LACKS_UNIX_SIGNALS */ } #endif /* !defined (ACE_WIN32) */ } diff --git a/ace/Process_Mutex.cpp b/ace/Process_Mutex.cpp index 1cf0aaa1902..7d762c9e6c4 100644 --- a/ace/Process_Mutex.cpp +++ b/ace/Process_Mutex.cpp @@ -38,7 +38,8 @@ ACE_Process_Mutex::unique_name (void) ACE_Process_Mutex::ACE_Process_Mutex (const char *name, void *arg, mode_t mode) #if defined (_ACE_USE_SV_SEM) - : lock_ (name ? name : ACE_TEXT_ALWAYS_CHAR (this->unique_name ()), + : lock_ (name ? + ACE_TEXT_CHAR_TO_TCHAR (name) : this->unique_name (), ACE_SV_Semaphore_Complex::ACE_CREATE, 1, 1, @@ -62,8 +63,7 @@ ACE_Process_Mutex::ACE_Process_Mutex (const wchar_t *name, mode_t mode) #if defined (_ACE_USE_SV_SEM) : lock_ (name ? - ACE_Wide_To_Ascii (name).char_rep () : - ACE_TEXT_ALWAYS_CHAR (this->unique_name ()), + ACE_TEXT_WCHAR_TO_TCHAR (name) : this->unique_name (), ACE_SV_Semaphore_Complex::ACE_CREATE, 1, 1, diff --git a/ace/Process_Semaphore.cpp b/ace/Process_Semaphore.cpp index 0e78f9b7ea5..88355398384 100644 --- a/ace/Process_Semaphore.cpp +++ b/ace/Process_Semaphore.cpp @@ -30,9 +30,7 @@ ACE_Process_Semaphore::ACE_Process_Semaphore (u_int count, #if defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM) || defined (ACE_PSOS) : lock_ (count, USYNC_PROCESS, name, arg, max) #else - : lock_ (ACE_TEXT_ALWAYS_CHAR (name), - ACE_SV_Semaphore_Complex::ACE_CREATE, - count) + : lock_ (name, ACE_SV_Semaphore_Complex::ACE_CREATE, count) #endif /* ACE_WIN32 || ACE_HAS_POSIX_SEM || ACE_PSOS */ { arg = arg; diff --git a/ace/QoS/SOCK_Dgram_Mcast_QoS.cpp b/ace/QoS/SOCK_Dgram_Mcast_QoS.cpp index b02952fbeb7..8f33bb1a863 100644 --- a/ace/QoS/SOCK_Dgram_Mcast_QoS.cpp +++ b/ace/QoS/SOCK_Dgram_Mcast_QoS.cpp @@ -18,11 +18,7 @@ #define IMR_MULTIADDR imr_multiaddr #endif /* ! defined (IMR_MULTIADDR) */ - -ACE_RCSID (QoS, - SOCK_Dgram_Mcast_QoS, - "$Id$") - +ACE_RCSID(ace, SOCK_Dgram_Mcast_QoS, "$Id $") ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Dgram_Mcast_QoS) @@ -104,7 +100,8 @@ ACE_SOCK_Dgram_Mcast_QoS::subscribe_ifs (const ACE_INET_Addr &mcast_addr, ACE_INET_Addr *if_addrs = 0; size_t if_cnt; - if (ACE::get_ip_interfaces (if_cnt, if_addrs) != 0) + if (ACE_Sock_Connect::get_ip_interfaces (if_cnt, + if_addrs) != 0) return -1; size_t nr_subscribed = 0; @@ -216,24 +213,24 @@ ACE_SOCK_Dgram_Mcast_QoS::subscribe (const ACE_INET_Addr &mcast_addr, // Check if the mcast_addr passed into this method is the // same as the QoS session address. if (mcast_addr == qos_session->dest_addr ()) - { - // Subscribe to the QoS session. - if (this->qos_manager_.join_qos_session (qos_session) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - ACE_LIB_TEXT ("Unable to join QoS Session\n")), - -1); - } + { + // Subscribe to the QoS session. + if (this->qos_manager_.join_qos_session (qos_session) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_LIB_TEXT ("Unable to join QoS Session\n")), + -1); + } else - { - if (this->close () != 0) - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("Unable to close socket\n"))); + { + if (this->close () != 0) + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("Unable to close socket\n"))); ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("Dest Addr in the QoS Session does") ACE_LIB_TEXT (" not match the address passed into") ACE_LIB_TEXT (" subscribe\n")), -1); - } + } ip_mreq ret_mreq; this->make_multicast_ifaddr (&ret_mreq, mcast_addr, net_if); @@ -248,9 +245,13 @@ ACE_SOCK_Dgram_Mcast_QoS::subscribe (const ACE_INET_Addr &mcast_addr, return -1; else - if (qos_params.socket_qos () != 0) - qos_session->qos (*(qos_params.socket_qos ())); + if (qos_params.socket_qos () != 0) + qos_session->qos (*(qos_params.socket_qos ())); return 0; } } + + + + diff --git a/ace/QtReactor.cpp b/ace/QtReactor.cpp index 164d5f317b1..1406a3dbbae 100644 --- a/ace/QtReactor.cpp +++ b/ace/QtReactor.cpp @@ -1,6 +1,8 @@ //$Id$ #include "ace/QtReactor.h" #if defined (ACE_HAS_QT) +#include <qeventloop.h> + ACE_ALLOC_HOOK_DEFINE (ACE_QtReactor) // Must be called with lock held diff --git a/ace/RB_Tree.cpp b/ace/RB_Tree.cpp index 3c903ee8efd..52f37cbd799 100644 --- a/ace/RB_Tree.cpp +++ b/ace/RB_Tree.cpp @@ -98,20 +98,6 @@ ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree (const ACE_RB_T *(iter.item ())); } -template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> -ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK>::ACE_RB_Tree ( - void *location, - ACE_Allocator *alloc -) -{ - if (location != this) - { - this->root_ = 0; - this->current_size_ = 0; - } - - this->allocator_ = alloc; -} // Destructor. template <class EXT_ID, class INT_ID, class COMPARE_KEYS, class ACE_LOCK> diff --git a/ace/RB_Tree.h b/ace/RB_Tree.h index e2ba71cee94..f5e6dc84b12 100644 --- a/ace/RB_Tree.h +++ b/ace/RB_Tree.h @@ -208,7 +208,6 @@ public: /// Constructor. ACE_RB_Tree (ACE_Allocator *alloc = 0); - /// Copy constructor. ACE_RB_Tree (const ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> &rbt); @@ -362,10 +361,10 @@ public: size_t current_size (void) const; /// Assignment operator. - void operator= (const ACE_RB_Tree<EXT_ID, - INT_ID, - COMPARE_KEYS, - ACE_LOCK> &rbt); + void operator= (const ACE_RB_Tree<EXT_ID, INT_ID, COMPARE_KEYS, ACE_LOCK> &rbt); + + /// Less than comparison function for keys, using comparison functor. + virtual int lessthan (const EXT_ID &k1, const EXT_ID &k2); /** * Returns a reference to the underlying <ACE_LOCK>. This makes it @@ -441,14 +440,6 @@ public: void clear (void); protected: - /// Reinitialize constructor. - /** - * This constructor is used to provide a valid vtable and allocator - * if the tree is reconstructed from shared memory. Constructor - * used by the derived class that has an allocator - */ - ACE_RB_Tree (void *location, - ACE_Allocator *alloc); // = Protected methods. These should only be called with locks held. @@ -558,9 +549,6 @@ protected: /// provide definitions for various EXT_ID and INT_ID types. void dump_node_i (ACE_RB_Tree_Node<EXT_ID, INT_ID> &node) const; - /// Less than comparison function for keys, using comparison functor. - int lessthan (const EXT_ID &k1, const EXT_ID &k2); - private: // = Private members. diff --git a/ace/README b/ace/README index 0e1394d90c0..28b08493a1b 100644 --- a/ace/README +++ b/ace/README @@ -133,6 +133,8 @@ ACE_THREAD_MANAGER_USES_SAFE_SPAWN Disable the "check before lock" feature macro avoids a potential race condition on platforms with aggressive read/write reordering. +ACE_HAS_GNUG_PRE_2_8 Compiling with g++ prior to + version 2.8.0. ACE_HAS_PRIOCNTL OS has priocntl (2). ACE_HAS_RECURSIVE_MUTEXES Mutexes are inherently recursive (e.g., Win32) @@ -241,6 +243,14 @@ 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 @@ -251,6 +261,9 @@ 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) @@ -318,7 +331,7 @@ ACE_HAS_GETPAGESIZE Platform supports except on Win32) ACE_HAS_GETRUSAGE Platform supports the getrusage() system call. -ACE_HAS_GETRUSAGE_PROTOTYPE Platform has a getrusage () +ACE_HAS_GETRUSAGE_PROTO Platform has a getrusage () prototype in sys/resource.h that differs from the one in ace/OS.i. @@ -347,9 +360,9 @@ ACE_HAS_INLINED_OSCALLS Inline all the static class OS overhead ACE_HAS_IP_MULTICAST Platform supports IP multicast ACE_HAS_IPV6 Platform supports IPv6. -ACE_USES_IPV4_IPV6_MIGRATION Enable IPv6 support in ACE on - platforms that don't have IPv6 - turned on by default. +ACE_USES_IPV4_IPV6_MIGRATION Enable IPv6 support in ACE on + platforms that don't have IPv6 + turned on by default. ACE_HAS_IRIX62_THREADS Platform supports the very odd IRIX 6.2 threads... ACE_HAS_NONSTATIC_OBJECT_MANAGER Causes the ACE_Object_Manager @@ -381,31 +394,21 @@ ACE_HAS_MSG Platform supports recvmsg and ACE_HAS_MT_SAFE_MKTIME Platform supports MT safe mktime() call (do any of them?) -ACE_HAS_MUTEX_TIMEOUTS Compiler supports timed mutex +ACE_HAS_MUTEX_TIMEOUTS Compiler supports timed mutex acquisitions (e.g. pthread_mutex_timedlock()). -ACE_HAS_NEW_NOTHROW Compiler offers new (nothrow). +ACE_HAS_NEW_NOTHROW Compiler offers new (nothrow). ACE_HAS_NONCONST_GETBY Platform uses non-const char * in calls to gethostbyaddr, gethostbyname, getservbyname 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) @@ -532,6 +535,8 @@ ACE_HAS_SIZET_SOCKET_LEN OS/compiler uses size_t * ACE_HAS_SOCKADDR_MSG_NAME Platform requires (struct sockaddr *) for msg_name field of struct msghdr. +ACE_HAS_SOCKIO_H Compiler/platform provides the + sockio.h file ACE_HAS_SOCKLEN_T Platform provides socklen_t type, such as Linux with glibc2. @@ -577,6 +582,8 @@ ACE_HAS_SVR4_TLI Compiler/platform supports isn't used if ACE_HAS_XTI is set. ACE_HAS_SYSCALL_GETRUSAGE HP/UX has an undefined syscall for GETRUSAGE... +ACE_HAS_SYSCALL_H Compiler/platform contains the + <sys/syscall.h> file. ACE_HAS_SYSENT_H Platform provides <sysent.h> header ACE_HAS_SYSINFO Platform supports system @@ -588,16 +595,8 @@ ACE_HAS_SYS_ERRLIST Platform/compiler supports _sys_errlist symbol ACE_HAS_SYS_FILIO_H Platform provides <sys/filio.h> header -ACE_HAS_SYS_LOADAVG_H Compiler/platform contains the - <sys/loadavg.h> file. -ACE_HAS_SYS_PSTAT_H Compiler/platform contains the - <sys/pstat.h> file. ACE_HAS_SYS_SIGLIST Compiler/platform supports _sys_siglist array -ACE_HAS_SYS_SOCKIO_H Compiler/platform provides the - sockio.h file -ACE_HAS_SYS_SYSCALL_H Compiler/platform contains the - <sys/syscall.h> file. ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA Compiler's template instantiation mechanism supports the use of "#pragma @@ -632,8 +631,6 @@ ACE_HAS_THR_C_DEST The pthread_keycreate() ACE_HAS_THR_C_FUNC The pthread_create() routine *must* take extern C functions. -ACE_HAS_TIMEZONE Platform/compiler supports - global "timezone" variable. ACE_HAS_TIMEZONE_GETTIMEOFDAY Platform/compiler supports timezone * as second parameter to gettimeofday() @@ -669,8 +666,8 @@ ACE_HAS_VERBOSE_NOTSUP Prints out console message in tracking down origin of ACE_NOTSUP. ACE_HAS_VOIDPTR_GETTIMEOFDAY Platform/compiler supports - void * as second parameter - to gettimeofday + void * as second parameter + to gettimeofday ACE_HAS_VOIDPTR_MMAP Platform requires void * for mmap(). ACE_HAS_VOIDPTR_SOCKOPT OS/compiler uses void * arg 4 @@ -757,7 +754,7 @@ ACE_LACKS_FLOATING_POINT Platform does not support ACE_LACKS_FORK Platform lacks the fork() system call (e.g., Win32, VxWorks, Chorus) -ACE_LACKS_GETOPT_PROTOTYPE Platform lacks the getopt() +ACE_LACKS_GETOPT_PROTO Platform lacks the getopt() prototype (e.g., LynxOS) ACE_LACKS_GETPGID Platform lacks getpgid() call (e.g., Win32, Chorus, and @@ -767,9 +764,6 @@ ACE_LACKS_GETSERVBYNAME Platforms lacks and Chorus). ACE_LACKS_INET_ATON Platform lacks the inet_aton() function. -ACE_LACKS_INET_ATON_PROTOTYPE Platform/compiler lacks the - inet_aton() prototype (e.g., - LynxOS) ACE_LACKS_IOSTREAMS_TOTALLY Iostreams are not supported adequately on the given platform. ACE_LACKS_IOSTREAM_FX iostream header does not @@ -791,12 +785,6 @@ ACE_LACKS_MEMORY_H Platform lacks memory.h (e.g., ACE_LACKS_MKFIFO Platform lacks mkfifo() e.g., VxWorks, Chorus, pSoS, and WinNT. ACE_LACKS_MKTEMP ACE has no mktemp() -ACE_LACKS_MKTEMP_PROTOTYPE Platform/compiler lacks the - mktemp() prototype (e.g., - LynxOS) -ACE_LACKS_MKSTEMP_PROTOTYPE Platform/compiler lacks the - mkstemp() prototype (e.g., - LynxOS) ACE_LACKS_MMAP The platform doesn't have mmap(2) (e.g., SCO UNIX). ACE_LACKS_MODE_MASKS Platform/compiler doesn't have @@ -828,6 +816,8 @@ ACE_LACKS_NEW_H OS doesn't have, or we don't want to use, new.h. ACE_LACKS_NULL_PTHREAD_STATUS OS requires non-null status pointer for ::pthread_join (). +ACE_LACKS_PARAM_H Platform lacks <sys/param.h> + (e.g., MVS) ACE_LACKS_PERFECT_MULTICAST_FILTERING Platform lacks IGMPv3 "perfect" filtering of multicast dgrams at the socket level. If == 1, ACE_SOCK_Dgram_Mcast will bind @@ -843,9 +833,6 @@ ACE_LACKS_PTHREAD_SIGMASK Platform lacks pthread_sigmask (). ACE_LACKS_PTHREAD_THR_SIGSETMASK Platform lacks pthread_thr_sigsetmask (e.g., MVS, HP/UX, and OSF/1 3.2) -ACE_LACKS_PUTENV_PROTOTYPE Platform/compiler lacks the - putenv() prototype (e.g., - LynxOS) ACE_LACKS_PWD_REENTRANT_FUNCTIONS Platform lacks getpwnam_r() methods (e.g., SGI 6.2). ACE_LACKS_SID Platform lacks setsid @@ -868,8 +855,7 @@ ACE_LACKS_READDIR_R Platform uses ACE_HAS_DIRENT but does not have readdir_r (). ACE_LACKS_REALPATH Platform/compiler lacks - realpath () function (e.g., - LynxOS) + realpath () function. ACE_LACKS_RECVMSG Platform lacks recvmsg() (e.g., Linux) ACE_LACKS_RWLOCK_T Platform lacks readers/writer @@ -909,10 +895,8 @@ ACE_LACKS_SYS_NERR Platforms/compiler lacks the VxWorks and MVS). ACE_LACKS_SYSTIME_H <time.h> doesn't automatically #include /**/ <sys/time.h> -ACE_LACKS_SYS_MSG_H Platform lacks sys/msg.h +ACE_LACKS_SYS_MSG_H Platform lacks sys/msg.h (e.g., Chorus and VxWorks) -ACE_LACKS_SYS_PARAM_H Platform lacks <sys/param.h> - (e.g., MVS) ACE_LACKS_SENDMSG Platform lacks sendmsg() (e.g., Linux) ACE_LACKS_SI_ADDR Platform lacks the si_addr @@ -933,12 +917,6 @@ ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES Compiler doesn't support ACE_LACKS_STRCASECMP Compiler/platform lacks strcasecmp() (e.g., DG/UX, UNIXWARE, VXWORKS) -ACE_LACKS_STRCASECMP_PROTOTYPE Platform/compiler lacks the - strcasecmp() prototype (e.g., - LynxOS) -ACE_LACKS_STRNCASECMP_PROTOTYPE Platform/compiler lacks the - strncasecmp() prototype (e.g., - LynxOS) ACE_LACKS_STRRECVFD Platform doesn't define struct strrecvfd. ACE_LACKS_SYSCALL Platform doesn't have @@ -998,7 +976,7 @@ ACE_LEGACY_MODE When defined, it will enable some code t ACE_NEEDS_DEV_IO_CONVERSION Necessary with some compilers to pass ACE_TTY_IO as parameter to DEV_Connector. -ACE_NEEDS_FUNC_DEFINITIONS Compiler requires a definition +ACE_NEEDS_FUNC_DEFINITIONS Compiler requires a definition for a "hidden" function, e.g., a private, unimplemented copy constructor or assignment @@ -1033,15 +1011,15 @@ ACE_WSTRING_HAS_USHORT_SUPPORT If a platform has wchar_t as a separate macro enables one. (mostly used my ACE Name Space). ACE_HAS_BROKEN_PREALLOCATED_OBJECTS_AFTER_FORK - Under QNX/RTP the objects preallocated - in ACE_OS_Object_Manager cannot be - destroyed after a fork() call. - Since these objects are only destroyed - at application shutdown we take the - simpler approach of not destroying - them at all. - Both QNX/RTP and LynxOS suffer from - this problem. + Under QNX/RTP the objects preallocated + in ACE_OS_Object_Manager cannot be + destroyed after a fork() call. + Since these objects are only destroyed + at application shutdown we take the + simpler approach of not destroying + them at all. + Both QNX/RTP and LynxOS suffer from + this problem. ACE_LACKS_MEMBER_TEMPLATES Compiler does not support member template feature. @@ -1663,20 +1641,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/Read_Buffer.cpp b/ace/Read_Buffer.cpp index c6645957729..0921d83ea0c 100644 --- a/ace/Read_Buffer.cpp +++ b/ace/Read_Buffer.cpp @@ -2,8 +2,6 @@ #include "ace/Read_Buffer.h" -#include "ace/config-all.h" - #if !defined (__ACE_INLINE__) #include "ace/Read_Buffer.inl" #endif /* __ACE_INLINE__ */ diff --git a/ace/Reverse_Lock_T.inl b/ace/Reverse_Lock_T.inl index 191e3623549..79d9c47c788 100644 --- a/ace/Reverse_Lock_T.inl +++ b/ace/Reverse_Lock_T.inl @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ -#include "ace/config-all.h" #include "ace/OS_NS_errno.h" template <class ACE_LOCKING_MECHANISM> ACE_INLINE diff --git a/ace/SOCK_Acceptor.cpp b/ace/SOCK_Acceptor.cpp index 151c29b3ce0..87a7f34f1fb 100644 --- a/ace/SOCK_Acceptor.cpp +++ b/ace/SOCK_Acceptor.cpp @@ -366,7 +366,7 @@ ACE_SOCK_Acceptor::open (const ACE_Addr &local_sap, else if (protocol_family == PF_UNSPEC) { #if defined (ACE_HAS_IPV6) - protocol_family = ACE::ipv6_enabled () ? PF_INET6 : PF_INET; + protocol_family = ACE_Sock_Connect::ipv6_enabled () ? PF_INET6 : PF_INET; #else protocol_family = PF_INET; #endif /* ACE_HAS_IPV6 */ diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp index fe4598ea2d3..50c5f571f5b 100644 --- a/ace/SOCK_Dgram.cpp +++ b/ace/SOCK_Dgram.cpp @@ -124,8 +124,8 @@ ACE_SOCK_Dgram::shared_open (const ACE_Addr &local, ) { if (ACE::bind_port (this->get_handle (), - INADDR_ANY, - protocol_family) == -1) + INADDR_ANY, + protocol_family) == -1) error = 1; } } @@ -179,7 +179,7 @@ ACE_SOCK_Dgram::open (const ACE_Addr &local, else if (protocol_family == PF_UNSPEC) { #if defined (ACE_HAS_IPV6) - protocol_family = ACE::ipv6_enabled () ? PF_INET6 : PF_INET; + protocol_family = ACE_Sock_Connect::ipv6_enabled () ? PF_INET6 : PF_INET; #else protocol_family = PF_INET; #endif /* ACE_HAS_IPV6 */ diff --git a/ace/SOCK_Dgram_Bcast.cpp b/ace/SOCK_Dgram_Bcast.cpp index cbad8c3344c..67e6507ab23 100644 --- a/ace/SOCK_Dgram_Bcast.cpp +++ b/ace/SOCK_Dgram_Bcast.cpp @@ -142,7 +142,7 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) //Get host ip address if (host_name) { - hostent *hp = ACE_OS::gethostbyname (ACE_TEXT_ALWAYS_CHAR (host_name)); + hostent *hp = ACE_OS::gethostbyname (host_name); if (hp == 0) return -1; @@ -162,7 +162,7 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) } -#if !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) +#if !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) for (int n = ifc.ifc_len / sizeof (struct ifreq) ; n > 0; n--, ifr++) #else @@ -180,7 +180,7 @@ ACE_SOCK_Dgram_Bcast::mk_broadcast (const ACE_TCHAR *host_name) ifr = (struct ifreq *) ((caddr_t) &ifr->ifr_addr + ifr->ifr_addr.sa_len)) : (nbytes -= sizeof (struct ifreq), ifr++))) -#endif /* !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) */ +#endif /* !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) */ { #if defined (__QNX__) // Silently skip link interfaces diff --git a/ace/SOCK_Dgram_Mcast.cpp b/ace/SOCK_Dgram_Mcast.cpp index f63bf302777..aa1d96803fa 100644 --- a/ace/SOCK_Dgram_Mcast.cpp +++ b/ace/SOCK_Dgram_Mcast.cpp @@ -332,7 +332,7 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr, ACE_INET_Addr *if_addrs = 0; size_t if_cnt; - if (ACE::get_ip_interfaces (if_cnt, if_addrs) != 0) + if (ACE_Sock_Connect::get_ip_interfaces (if_cnt, if_addrs) != 0) return -1; size_t nr_subscribed = 0; @@ -383,7 +383,7 @@ ACE_SOCK_Dgram_Mcast::subscribe_ifs (const ACE_INET_Addr &mcast_addr, ACE_INET_Addr *if_addrs = 0; size_t if_cnt; - if (ACE::get_ip_interfaces (if_cnt, if_addrs) != 0) + if (ACE_Sock_Connect::get_ip_interfaces (if_cnt, if_addrs) != 0) return -1; size_t nr_subscribed = 0; @@ -692,7 +692,7 @@ ACE_SOCK_Dgram_Mcast::unsubscribe_ifs (const ACE_INET_Addr &mcast_addr, // is a limitation of the way <get_ip_interfaces> works with // old versions of MSVC. The reliable way of getting the interface // list is available only with MSVC 5 and newer. - if (ACE::get_ip_interfaces (if_cnt, if_addrs) != 0) + if (ACE_Sock_Connect::get_ip_interfaces (if_cnt, if_addrs) != 0) return -1; size_t nr_unsubscribed = 0; @@ -741,7 +741,7 @@ ACE_SOCK_Dgram_Mcast::unsubscribe_ifs (const ACE_INET_Addr &mcast_addr, // is a limitation of the way <get_ip_interfaces> works with // old versions of MSVC. The reliable way of getting the interface list // is available only with MSVC 5 and newer. - if (ACE::get_ip_interfaces (if_cnt, if_addrs) != 0) + if (ACE_Sock_Connect::get_ip_interfaces (if_cnt, if_addrs) != 0) return -1; size_t nr_unsubscribed = 0; @@ -975,7 +975,7 @@ ACE_SOCK_Dgram_Mcast::make_multicast_ifaddr (ip_mreq *ret_mreq, // Look up the interface by number, not name. if_address.ifr_ifno = ACE_OS::atoi (net_if); #else - ACE_OS::strcpy (if_address.ifr_name, ACE_TEXT_ALWAYS_CHAR (net_if)); + ACE_OS::strcpy (if_address.ifr_name, net_if); #endif /* defined (ACE_PSOS) */ if (ACE_OS::ioctl (this->get_handle (), diff --git a/ace/SOCK_Dgram_Mcast.h b/ace/SOCK_Dgram_Mcast.h index b0724223fae..c4d55ab2314 100644 --- a/ace/SOCK_Dgram_Mcast.h +++ b/ace/SOCK_Dgram_Mcast.h @@ -14,6 +14,7 @@ */ //============================================================================= + #ifndef ACE_SOCK_DGRAM_MCAST_H #define ACE_SOCK_DGRAM_MCAST_H #include /**/ "ace/pre.h" @@ -100,7 +101,7 @@ public: * comments in source file for environment-specific restrictions). Default * values are always valid values for the compilation environment. */ - enum options + enum options { // Define whether a specific (multicast) address (in addition to the port#) // is bound to the socket. diff --git a/ace/SOCK_SEQPACK_Acceptor.cpp b/ace/SOCK_SEQPACK_Acceptor.cpp index fa45e5d83a0..8744185f52e 100644 --- a/ace/SOCK_SEQPACK_Acceptor.cpp +++ b/ace/SOCK_SEQPACK_Acceptor.cpp @@ -503,7 +503,7 @@ ACE_SOCK_SEQPACK_Acceptor::open (const ACE_Addr &local_sap, else if (protocol_family == PF_UNSPEC) { #if defined (ACE_HAS_IPV6) - protocol_family = ACE::ipv6_enabled () ? PF_INET6 : PF_INET; + protocol_family = ACE_Sock_Connect::ipv6_enabled () ? PF_INET6 : PF_INET; #else protocol_family = PF_INET; #endif /* ACE_HAS_IPV6 */ @@ -540,7 +540,7 @@ ACE_SOCK_SEQPACK_Acceptor::open (const ACE_Multihomed_INET_Addr &local_sap, else if (protocol_family == PF_UNSPEC) { #if defined (ACE_HAS_IPV6) - protocol_family = ACE::ipv6_enabled () ? PF_INET6 : PF_INET; + protocol_family = ACE_Sock_Connect::ipv6_enabled () ? PF_INET6 : PF_INET; #else protocol_family = PF_INET; #endif /* ACE_HAS_IPV6 */ diff --git a/ace/SPIPE_Acceptor.cpp b/ace/SPIPE_Acceptor.cpp index deeead76ef3..0cd7dc63a9e 100644 --- a/ace/SPIPE_Acceptor.cpp +++ b/ace/SPIPE_Acceptor.cpp @@ -6,10 +6,6 @@ #include "ace/OS_NS_sys_stat.h" #include "ace/OS_NS_sys_time.h" -#if defined (ACE_HAS_STREAM_PIPES) -# include "ace/OS_NS_unistd.h" -#endif // ACE_HAS_STREAM_PIPES - ACE_RCSID(ace, SPIPE_Acceptor, "$Id$") ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor (void) @@ -28,7 +24,7 @@ ACE_SPIPE_Acceptor::remove (void) int result = this->close (); // Remove the underlying file. - return ACE_OS::unlink (this->local_addr_.get_path_name ()) == -1 + return ACE_OS::unlink (this->local_addr_.get_path_name ()) == -1 || result == -1 ? -1 : 0; #else this->close (); @@ -49,7 +45,7 @@ ACE_SPIPE_Acceptor::dump (void) const // General purpose routine for performing server ACE_SPIPE creation. int -ACE_SPIPE_Acceptor::open (const ACE_SPIPE_Addr &local_sap, +ACE_SPIPE_Acceptor::open (const ACE_SPIPE_Addr &local_sap, int reuse_addr, int perms, LPSECURITY_ATTRIBUTES sa, @@ -103,7 +99,7 @@ ACE_SPIPE_Acceptor::create_new_instance (int perms) // an instance of the named pipe that is already connected to a // client process is reused with a new client process, // ::ConnectNamedPipe () would fail. - + ACE_UNUSED_ARG (perms); ACE_TRACE ("ACE_SPIPE_Acceptor::create_new_instance"); int status; @@ -151,7 +147,7 @@ ACE_SPIPE_Acceptor::create_new_instance (int perms) ACE_ASSERT (!result); status = ::GetLastError (); - switch (status) + switch (status) { case ERROR_IO_PENDING: break; @@ -196,7 +192,7 @@ ACE_SPIPE_Acceptor::close (void) return result; } -ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor (const ACE_SPIPE_Addr &local_sap, +ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor (const ACE_SPIPE_Addr &local_sap, int reuse_addr, int perms, LPSECURITY_ATTRIBUTES sa, @@ -213,9 +209,9 @@ ACE_SPIPE_Acceptor::ACE_SPIPE_Acceptor (const ACE_SPIPE_Addr &local_sap, // General purpose routine for accepting new connections. int -ACE_SPIPE_Acceptor::accept (ACE_SPIPE_Stream &new_io, +ACE_SPIPE_Acceptor::accept (ACE_SPIPE_Stream &new_io, ACE_SPIPE_Addr *remote_addr, - ACE_Time_Value *timeout, + ACE_Time_Value *timeout, int restart, int reset_new_handle) { @@ -229,7 +225,7 @@ ACE_SPIPE_Acceptor::accept (ACE_SPIPE_Stream &new_io, // ACE_OS::ioctl (). Otherwise, we will wait for the desired number // of milli seconds using ACE_OS::poll. - if (timeout != 0 && + if (timeout != 0 && ACE::handle_timed_accept (this->get_handle (), timeout, restart) == -1) diff --git a/ace/SPIPE_Connector.cpp b/ace/SPIPE_Connector.cpp index b715aa67690..ffc975cc805 100644 --- a/ace/SPIPE_Connector.cpp +++ b/ace/SPIPE_Connector.cpp @@ -104,7 +104,7 @@ ACE_SPIPE_Connector::connect (ACE_SPIPE_Stream &new_io, if (relative_time <= ACE_Time_Value::zero) { // Mimick the errno value returned by - // ACE::handle_timed_open. + // ACE_Handle_Ops::handle_timed_open. if (*timeout == ACE_Time_Value::zero) errno = EWOULDBLOCK; else @@ -146,7 +146,7 @@ ACE_SPIPE_Connector::connect (ACE_SPIPE_Stream &new_io, } } #else /* ACE_WIN32 && !ACE_HAS_PHARLAP */ - handle = ACE::handle_timed_open (timeout, + handle = ACE_Handle_Ops::handle_timed_open (timeout, remote_sap.get_path_name (), flags, perms, sa); #endif /* !ACE_WIN32 || ACE_HAS_PHARLAP || ACE_HAS_WINCE */ diff --git a/ace/SSL/SSL_SOCK_Stream.cpp b/ace/SSL/SSL_SOCK_Stream.cpp index f4d4ff8b924..c6b1bb99998 100644 --- a/ace/SSL/SSL_SOCK_Stream.cpp +++ b/ace/SSL/SSL_SOCK_Stream.cpp @@ -1,3 +1,5 @@ +// -*- C++ -*- +// // $Id$ #include "ace/Handle_Set.h" @@ -51,6 +53,7 @@ ACE_SSL_SOCK_Stream::~ACE_SSL_SOCK_Stream (void) ACE_TRACE ("ACE_SSL_SOCK_Stream::~ACE_SSL_SOCK_Stream"); ::SSL_free (this->ssl_); + this->ssl_ = 0; // @@ Question: should we reference count the Context object or // leave that to the application developer? We do not reference diff --git a/ace/SV_Message.inl b/ace/SV_Message.inl index 51c035370b8..44cd5e25759 100644 --- a/ace/SV_Message.inl +++ b/ace/SV_Message.inl @@ -4,7 +4,6 @@ // SV_Message.i #include "ace/Global_Macros.h" -#include "ace/config-all.h" ACE_INLINE ACE_SV_Message::ACE_SV_Message (long t) diff --git a/ace/SV_Semaphore_Simple.cpp b/ace/SV_Semaphore_Simple.cpp index e28ba4a923c..f54a843cc96 100644 --- a/ace/SV_Semaphore_Simple.cpp +++ b/ace/SV_Semaphore_Simple.cpp @@ -187,25 +187,6 @@ ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (const char *name, ACE_LIB_TEXT ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"))); } -#if defined (ACE_HAS_WCHAR) -ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple (const wchar_t *name, - int flags, - int initial_value, - u_short nsems, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple(wchar_t)"); - if (this->open (ACE_Wide_To_Ascii (name).char_rep (), - flags, - initial_value, - nsems, - perms) == -1) - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE_SV_Semaphore_Simple::ACE_SV_Semaphore_Simple"))); -} -#endif /* ACE_HAS_WCHAR */ - ACE_SV_Semaphore_Simple::~ACE_SV_Semaphore_Simple (void) { ACE_TRACE ("ACE_SV_Semaphore_Simple::~ACE_SV_Semaphore_Simple"); diff --git a/ace/SV_Semaphore_Simple.h b/ace/SV_Semaphore_Simple.h index 85ba4c0daa0..d6d28374434 100644 --- a/ace/SV_Semaphore_Simple.h +++ b/ace/SV_Semaphore_Simple.h @@ -67,14 +67,6 @@ public: int initial_value = 1, u_short nsems = 1, int perms = ACE_DEFAULT_FILE_PERMS); -#if defined (ACE_HAS_WCHAR) - ACE_SV_Semaphore_Simple (const wchar_t *name, - int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); -#endif /* ACE_HAS_WCHAR */ - ~ACE_SV_Semaphore_Simple (void); int open (const char *name, @@ -83,14 +75,6 @@ public: u_short nsems = 1, int perms = ACE_DEFAULT_FILE_PERMS); -#if defined (ACE_HAS_WCHAR) - int open (const wchar_t *name, - int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, - int initial_value = 1, - u_short nsems = 1, - int perms = ACE_DEFAULT_FILE_PERMS); -#endif /* ACE_HAS_WCHAR */ - /// Open or create one or more SV_Semaphores. We return 0 if all is /// OK, else -1. int open (key_t key, diff --git a/ace/SV_Semaphore_Simple.inl b/ace/SV_Semaphore_Simple.inl index 85aad8d5b0c..a6490c18ac8 100644 --- a/ace/SV_Semaphore_Simple.inl +++ b/ace/SV_Semaphore_Simple.inl @@ -6,25 +6,6 @@ #include "ace/Global_Macros.h" #include "ace/OS_NS_Thread.h" -#if defined (ACE_HAS_WCHAR) -// Semaphores don't offer wide-char names, so convert the name and forward -// to the narrow-char open(). -ACE_INLINE int -ACE_SV_Semaphore_Simple::open (const wchar_t *name, - int flags, - int initial_value, - u_short nsems, - int perms) -{ - ACE_TRACE ("ACE_SV_Semaphore_Simple::open (wchar_t)"); - return this->open (ACE_Wide_To_Ascii (name).char_rep (), - flags, - initial_value, - nsems, - perms); -} -#endif /* ACE_HAS_WCHAR */ - ACE_INLINE int ACE_SV_Semaphore_Simple::control (int cmd, semun arg, diff --git a/ace/Select_Reactor_Base.cpp b/ace/Select_Reactor_Base.cpp index 294417c0511..1fc1e58b5af 100644 --- a/ace/Select_Reactor_Base.cpp +++ b/ace/Select_Reactor_Base.cpp @@ -109,7 +109,7 @@ ACE_Select_Reactor_Handler_Repository::open (size_t size) // Try to increase the number of handles if <size> is greater than // the current limit. - return ACE::set_handle_limit (static_cast<int> (size), 1); + return ACE::set_handle_limit (static_cast<int> (size)); } // Initialize a repository of the appropriate <size>. @@ -308,7 +308,7 @@ ACE_Select_Reactor_Handler_Repository::bind (ACE_HANDLE handle, // Note the fact that we've changed the state of the <wait_set_>, // which is used by the dispatching loop to determine whether it can // keep going or if it needs to reconsult select(). - // this->select_reactor_.state_changed_ = 1; + this->select_reactor_.state_changed_ = 1; } // If new entry, call add_reference() if needed. @@ -347,7 +347,7 @@ ACE_Select_Reactor_Handler_Repository::unbind (ACE_HANDLE handle, // Note the fact that we've changed the state of the <wait_set_>, // which is used by the dispatching loop to determine whether it can // keep going or if it needs to reconsult select(). - // this->select_reactor_.state_changed_ = 1; + this->select_reactor_.state_changed_ = 1; // If there are no longer any outstanding events on this <handle> // then we can totally shut down the Event_Handler. @@ -398,19 +398,13 @@ ACE_Select_Reactor_Handler_Repository::unbind (ACE_HANDLE handle, // We've deleted the last entry, so we need to figure out // the last valid place in the array that is worth looking // at. - ACE_HANDLE wait_rd_max = - this->select_reactor_.wait_set_.rd_mask_.max_set (); - ACE_HANDLE wait_wr_max = - this->select_reactor_.wait_set_.wr_mask_.max_set (); - ACE_HANDLE wait_ex_max = - this->select_reactor_.wait_set_.ex_mask_.max_set (); - - ACE_HANDLE suspend_rd_max = - this->select_reactor_.suspend_set_.rd_mask_.max_set (); - ACE_HANDLE suspend_wr_max = - this->select_reactor_.suspend_set_.wr_mask_.max_set (); - ACE_HANDLE suspend_ex_max = - this->select_reactor_.suspend_set_.ex_mask_.max_set (); + ACE_HANDLE wait_rd_max = this->select_reactor_.wait_set_.rd_mask_.max_set (); + ACE_HANDLE wait_wr_max = this->select_reactor_.wait_set_.wr_mask_.max_set (); + ACE_HANDLE wait_ex_max = this->select_reactor_.wait_set_.ex_mask_.max_set (); + + ACE_HANDLE suspend_rd_max = this->select_reactor_.suspend_set_.rd_mask_.max_set (); + ACE_HANDLE suspend_wr_max = this->select_reactor_.suspend_set_.wr_mask_.max_set (); + ACE_HANDLE suspend_ex_max = this->select_reactor_.suspend_set_.ex_mask_.max_set (); // Compute the maximum of six values. this->max_handlep1_ = wait_rd_max; @@ -957,8 +951,8 @@ ACE_Select_Reactor_Notify::dispatch_notify (ACE_Notification_Buffer &buffer) // If eh == 0 then another thread is unblocking the // <ACE_Select_Reactor> to update the <ACE_Select_Reactor>'s // internal structures. Otherwise, we need to dispatch the - // appropriate handle_* method on the <ACE_Event_Handler> pointer - // we've been passed. + // appropriate handle_* method on the <ACE_Event_Handler> + // pointer we've been passed. if (buffer.eh_ != 0) { ACE_Event_Handler *event_handler = @@ -1103,8 +1097,7 @@ ACE_Select_Reactor_Impl::bit_ops (ACE_HANDLE handle, return -1; #if !defined (ACE_WIN32) - ACE_Sig_Guard sb (0, - this->mask_signals_); // Block out all signals until method returns. + ACE_Sig_Guard sb; // Block out all signals until method returns. #endif /* ACE_WIN32 */ ACE_FDS_PTMF ptmf = &ACE_Handle_Set::set_bit; @@ -1127,11 +1120,6 @@ ACE_Select_Reactor_Impl::bit_ops (ACE_HANDLE handle, break; case ACE_Reactor::CLR_MASK: ptmf = &ACE_Handle_Set::clr_bit; - // State was changed. we need to reflect that change in the - // dispatch_mask I assume that only ACE_Reactor::CLR_MASK should - // be treated here which means we need to clear the handle|mask - // from the current dispatch handler - this->clear_dispatch_mask (handle, mask); /* FALLTHRU */ case ACE_Reactor::SET_MASK: /* FALLTHRU */ @@ -1185,51 +1173,6 @@ ACE_Select_Reactor_Impl::bit_ops (ACE_HANDLE handle, return omask; } -void -ACE_Select_Reactor_Impl::clear_dispatch_mask (ACE_HANDLE handle, - ACE_Reactor_Mask mask) -{ - ACE_TRACE ("ACE_Select_Reactor_Impl::clear_dispatch_mask"); - - // Use handle and mask in order to modify the sets - // (wait/suspend/ready/dispatch), that way, the dispatch_io_set loop - // will not be interrupt, and there will no reason to rescan the - // wait_set and re-calling select function, which is *very* - // expensive. It seems that wait/suspend/ready sets are getting - // updated in register/remove bind/unbind etc functions. The only - // thing need to be updated is the dispatch_set (also can be found - // in that file code as dispatch_mask). Because of that, we need - // that dispatch_set to be member of the ACE_Select_Reactor_impl in - // Select_Reactor_Base.h file That way we will have access to that - // member in that function. - - // We kind of invalidate the iterator in dispatch_io_set because its - // an array and index built from the original dispatch-set. Take a - // look at dispatch_io_set for more details. - - // We only need to clr_bit, because we are interested in clearing the - // handles that was removed, so no dispatching to these handles will - // occur. - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::READ_MASK) || - ACE_BIT_ENABLED (mask, ACE_Event_Handler::ACCEPT_MASK)) - { - this->dispatch_set_.rd_mask_.clr_bit (handle); - } - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::WRITE_MASK)) - { - this->dispatch_set_.wr_mask_.clr_bit (handle); - } - if (ACE_BIT_ENABLED (mask, ACE_Event_Handler::EXCEPT_MASK)) - { - this->dispatch_set_.ex_mask_.clr_bit (handle); - } - - // That will make the dispatch_io_set iterator re-start and rescan - // the dispatch set. - this->state_changed_ = true; -} - - int ACE_Select_Reactor_Impl::resumable_handler (void) { diff --git a/ace/Select_Reactor_Base.h b/ace/Select_Reactor_Base.h index eaa97eb447a..cb8670b2262 100644 --- a/ace/Select_Reactor_Base.h +++ b/ace/Select_Reactor_Base.h @@ -201,9 +201,8 @@ public: * the reactor itself). Returns the number of notifications purged. * Returns -1 on error. */ - virtual int purge_pending_notifications ( - ACE_Event_Handler *, - ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); + virtual int purge_pending_notifications (ACE_Event_Handler *, + ACE_Reactor_Mask = ACE_Event_Handler::ALL_EVENTS_MASK); /// Dump the state of an object. virtual void dump (void) const; @@ -431,7 +430,7 @@ public: }; /// Constructor. - ACE_Select_Reactor_Impl (bool mask_signals = true); + ACE_Select_Reactor_Impl (void); friend class ACE_Select_Reactor_Notify; friend class ACE_Select_Reactor_Handler_Repository; @@ -465,18 +464,9 @@ protected: /// suspended. Returns 0 if not, 1 if so. virtual int is_suspended_i (ACE_HANDLE handle) = 0; - /// When register/unregister occur, then we need to re-eval our - /// wait/suspend/dispatch set. - virtual void clear_dispatch_mask (ACE_HANDLE handle, - ACE_Reactor_Mask mask); - /// Table that maps <ACE_HANDLEs> to <ACE_Event_Handler *>'s. ACE_Select_Reactor_Handler_Repository handler_rep_; - - /// Tracks handles that are ready for dispatch from <select> - ACE_Select_Reactor_Handle_Set dispatch_set_; - /// Tracks handles that are waited for by <select>. ACE_Select_Reactor_Handle_Set wait_set_; @@ -534,15 +524,7 @@ protected: * whether we need to make another trip through the * <Select_Reactor>'s <wait_for_multiple_events> loop. */ - bool state_changed_; - - /** - * If 0 then the Reactor will not mask the signals during the event - * dispatching. This is useful for applications that do not - * register any signal handlers and want to reduce the overhead - * introduce by the kernel level locks required to change the mask. - */ - bool mask_signals_; + int state_changed_; /// Controls/access whether the notify handler should renew the /// Select_Reactor's token or not. diff --git a/ace/Select_Reactor_Base.inl b/ace/Select_Reactor_Base.inl index 5cb2b0749cc..73c4b7faa21 100644 --- a/ace/Select_Reactor_Base.inl +++ b/ace/Select_Reactor_Base.inl @@ -38,7 +38,7 @@ ACE_Event_Tuple::ACE_Event_Tuple (void) ACE_INLINE ACE_Event_Tuple::ACE_Event_Tuple (ACE_Event_Handler* eh, - ACE_HANDLE h) + ACE_HANDLE h) : handle_ (h), event_handler_ (eh) { @@ -57,17 +57,16 @@ ACE_Event_Tuple::operator!= (const ACE_Event_Tuple &rhs) const } ACE_INLINE -ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl (bool ms) - : handler_rep_ (*this) - , timer_queue_ (0) - , delete_timer_queue_ (0) - , delete_signal_handler_ (0) - , delete_notify_handler_ (0) - , requeue_position_ (-1) // Requeue at end of waiters by default. - , initialized_ (0) - , state_changed_ (0) - , mask_signals_ (ms) - , supress_renew_ (0) +ACE_Select_Reactor_Impl::ACE_Select_Reactor_Impl () + : handler_rep_ (*this), + timer_queue_ (0), + delete_timer_queue_ (0), + delete_signal_handler_ (0), + delete_notify_handler_ (0), + requeue_position_ (-1), // Requeue at end of waiters by default. + initialized_ (0), + state_changed_ (0), + supress_renew_ (0) { } diff --git a/ace/Select_Reactor_T.cpp b/ace/Select_Reactor_T.cpp index 8ae95b9ebb9..d47532db04c 100644 --- a/ace/Select_Reactor_T.cpp +++ b/ace/Select_Reactor_T.cpp @@ -64,16 +64,10 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::any_ready ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::any_ready_i (ACE_Select_Reactor_Handle_Set &wait_set) { - ACE_TRACE ("ACE_Select_Reactor_T::any_ready_i"); - int number_ready = this->ready_set_.rd_mask_.num_set () + this->ready_set_.wr_mask_.num_set () + this->ready_set_.ex_mask_.num_set (); - // number_ready > 0 meaning there are handles in the ready_set - // &wait_set != &(this->ready_set_) means that we need to copy - // the handles from the ready_set to the wait set because the - // wait_set_ doesn't contain all the handles in the ready_set_ if (number_ready > 0 && &wait_set != &(this->ready_set_)) { wait_set.rd_mask_ = this->ready_set_.rd_mask_; @@ -542,10 +536,10 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ACE_Select_Reactor_T ACE_Reactor_Notify *notify, int mask_signals, int s_queue) - : ACE_Select_Reactor_Impl (mask_signals) - , token_ (*this, s_queue) - , lock_adapter_ (token_) - , deactivated_ (0) + : token_ (*this, s_queue), + lock_adapter_ (token_), + deactivated_ (0), + mask_signals_ (mask_signals) { ACE_TRACE ("ACE_Select_Reactor_T::ACE_Select_Reactor_T"); @@ -594,10 +588,10 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::ACE_Select_Reactor_T ACE_Reactor_Notify *notify, int mask_signals, int s_queue) - : ACE_Select_Reactor_Impl (mask_signals) - , token_ (*this, s_queue) - , lock_adapter_ (token_) - , deactivated_ (0) + : token_ (*this, s_queue), + lock_adapter_ (token_), + deactivated_ (0), + mask_signals_ (mask_signals) { ACE_TRACE ("ACE_Select_Reactor_T::ACE_Select_Reactor_T"); @@ -1015,11 +1009,6 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::suspend_i (ACE_HANDLE handle) this->suspend_set_.ex_mask_.set_bit (handle); this->wait_set_.ex_mask_.clr_bit (handle); } - - // Kobi: we need to remove that handle from the - // dispatch set as well. We use that function with all the relevant - // masks - rd/wr/ex - all the mask. it is completely suspended - this->clear_dispatch_mask (handle, ACE_Event_Handler::RWE_MASK); return 0; } @@ -1184,8 +1173,10 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_timer_handlers (int &number_of_handlers_dispatched) { number_of_handlers_dispatched += this->timer_queue_->expire (); - - return 0; + if (this->state_changed_) + return -1; + else + return 0; } template <class ACE_SELECT_REACTOR_TOKEN> int @@ -1200,21 +1191,15 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_notification_handlers // ACE_Select_Reactor_T's internal tables or the notify pipe is // enabled. We'll handle all these threads and notifications, and // then break out to continue the event loop. - int n = - this->notify_handler_->dispatch_notifications (number_of_active_handles, - dispatch_set.rd_mask_); + + int n = this->notify_handler_->dispatch_notifications (number_of_active_handles, + dispatch_set.rd_mask_); if (n == -1) return -1; else number_of_handlers_dispatched += n; - // Same as dispatch_timer_handlers - // No need to do anything with the state changed. That is because - // unbind already handles the case where someone unregister some - // kind of handle and unbind it. (::unbind calls the function - // state_changed () to reflect ant change with that) - // return this->state_changed_ ? -1 : 0; - return 0; + return this->state_changed_ ? -1 : 0; } template <class ACE_SELECT_REACTOR_TOKEN> int @@ -1226,35 +1211,26 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_io_set ACE_Handle_Set &ready_mask, ACE_EH_PTMF callback) { - ACE_TRACE ("ACE_Select_Reactor_T::dispatch_io_set"); ACE_HANDLE handle; ACE_Handle_Set_Iterator handle_iter (dispatch_mask); - while ((handle = handle_iter ()) != ACE_INVALID_HANDLE && - number_of_handlers_dispatched < number_of_active_handles) + while ((handle = handle_iter ()) != ACE_INVALID_HANDLE + && number_of_handlers_dispatched < number_of_active_handles + && this->state_changed_ == 0) { + // ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("ACE_Select_Reactor_T::dispatching\n"))); ++number_of_handlers_dispatched; - this->notify_handle (handle, mask, ready_mask, this->handler_rep_.find (handle), callback); - - // clear the bit from that dispatch mask, - // so when we need to restart the iteration (rebuilding the iterator...) - // we will not dispatch the already dipatched handlers - this->clear_dispatch_mask (handle, mask); - - if (this->state_changed_) - { - - handle_iter.reset_state (); - this->state_changed_ = false; - } } + if (number_of_handlers_dispatched > 0 && this->state_changed_) + return -1; + return 0; } @@ -1264,12 +1240,11 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch_io_handlers int &number_of_active_handles, int &number_of_handlers_dispatched) { - ACE_TRACE ("ACE_Select_Reactor_T::dispatch_io_handlers"); - // Handle output events (this code needs to come first to handle the // obscure case of piggy-backed data coming along with the final // handshake message of a nonblocking connection). + // ACE_DEBUG ((LM_DEBUG, ACE_LIB_TEXT ("ACE_Select_Reactor_T::dispatch - WRITE\n"))); if (this->dispatch_io_set (number_of_active_handles, number_of_handlers_dispatched, ACE_Event_Handler::WRITE_MASK, @@ -1338,7 +1313,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::dispatch // every iteration (i.e., due to signals), our state starts out // unchanged again. - this->state_changed_ = false; + this->state_changed_ = 0; // Perform the Template Method for dispatching all the handlers. @@ -1451,21 +1426,14 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events_i ACE_SEH_TRY { - // We use the data member dispatch_set_ as the current dispatch - // set. - - // We need to start from a clean dispatch_set - this->dispatch_set_.rd_mask_.reset (); - this->dispatch_set_.wr_mask_.reset (); - this->dispatch_set_.ex_mask_.reset (); + ACE_Select_Reactor_Handle_Set dispatch_set; int number_of_active_handles = - this->wait_for_multiple_events (this->dispatch_set_, + this->wait_for_multiple_events (dispatch_set, max_wait_time); - result = - this->dispatch (number_of_active_handles, - this->dispatch_set_); + result = this->dispatch (number_of_active_handles, + dispatch_set); } ACE_SEH_EXCEPT (this->release_token ()) { @@ -1474,6 +1442,8 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::handle_events_i // <token_> lock correctly. } + this->state_changed_ = 1; + return result; } @@ -1534,6 +1504,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::check_handles (void) { result = 1; this->remove_handler_i (h, ACE_Event_Handler::ALL_EVENTS_MASK); + this->state_changed_ = 1; } rd_mask.clr_bit (h); #else /* !ACE_WIN32 && !MVS && !ACE_PSOS */ @@ -1543,6 +1514,7 @@ ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN>::check_handles (void) { result = 1; this->remove_handler_i (h, ACE_Event_Handler::ALL_EVENTS_MASK); + this->state_changed_ = 1; } #endif /* ACE_WIN32 || MVS || ACE_PSOS */ } diff --git a/ace/Select_Reactor_T.h b/ace/Select_Reactor_T.h index 9ac26f75e1b..892592ee0aa 100644 --- a/ace/Select_Reactor_T.h +++ b/ace/Select_Reactor_T.h @@ -753,6 +753,14 @@ protected: /// events or not. sig_atomic_t deactivated_; + /** + * If 0 then the Reactor will not mask the signals during the event + * dispatching. This is useful for applications that do not + * register any signal handlers and want to reduce the overhead + * introduce by the kernel level locks required to change the mask. + */ + int mask_signals_; + private: /// Deny access since member-wise won't work... ACE_UNIMPLEMENTED_FUNC (ACE_Select_Reactor_T (const ACE_Select_Reactor_T<ACE_SELECT_REACTOR_TOKEN> &)) diff --git a/ace/Shared_Object.cpp b/ace/Shared_Object.cpp index 86164c16759..596bdbc3bd9 100644 --- a/ace/Shared_Object.cpp +++ b/ace/Shared_Object.cpp @@ -3,7 +3,6 @@ #include "ace/Shared_Object.h" #include "ace/Global_Macros.h" -#include "ace/config-all.h" /* Provide the abstract base class used to access dynamic linking facilities */ diff --git a/ace/Signal.cpp b/ace/Signal.cpp index 24c72078cc0..5c156bc3029 100644 --- a/ace/Signal.cpp +++ b/ace/Signal.cpp @@ -858,7 +858,6 @@ ACE_MT (template class ACE_TSS_Guard<ACE_Recursive_Thread_Mutex>); ACE_MT (template class ACE_Guard<ACE_Recursive_Thread_Mutex>); template class ACE_Fixed_Set<ACE_Event_Handler *, ACE_MAX_SIGNAL_HANDLERS>; template class ACE_Fixed_Set_Iterator<ACE_Event_Handler *, ACE_MAX_SIGNAL_HANDLERS>; -template class ACE_Fixed_Set_Iterator_Base<ACE_Event_Handler *, ACE_MAX_SIGNAL_HANDLERS>; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) #pragma instantiate ACE_TSS_Guard<ACE_Recursive_Thread_Mutex> @@ -866,7 +865,6 @@ template class ACE_Fixed_Set_Iterator_Base<ACE_Event_Handler *, ACE_MAX_SIGNAL_H #endif /* ACE_MT_SAFE */ #pragma instantiate ACE_Fixed_Set<ACE_Event_Handler *, ACE_MAX_SIGNAL_HANDLERS> #pragma instantiate ACE_Fixed_Set_Iterator<ACE_Event_Handler *, ACE_MAX_SIGNAL_HANDLERS> -#pragma instantiate ACE_Fixed_Set_Iterator_Base<ACE_Event_Handler *, ACE_MAX_SIGNAL_HANDLERS> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ #endif /* ACE_HAS_BROKEN_HPUX_TEMPLATES */ diff --git a/ace/Signal.h b/ace/Signal.h index 3cefd3ce112..9f802aa4ba6 100644 --- a/ace/Signal.h +++ b/ace/Signal.h @@ -232,10 +232,8 @@ class ACE_Export ACE_Sig_Guard { public: // = Initialization and termination methods. - /// This is kind of conditional Guard, needed when guard should be - /// activated only when a spcific condition met. When condition == - /// true (default), Guard is activated - ACE_Sig_Guard (ACE_Sig_Set *mask = 0, bool condition = true); + /// Block out signals in <mask>. Default is to block all signals! + ACE_Sig_Guard (ACE_Sig_Set *mask = 0); /// Restore blocked signals. ~ACE_Sig_Guard (void); @@ -249,9 +247,6 @@ public: private: /// Original signal mask. ACE_Sig_Set omask_; - - /// Guard Condition - bool condition_; }; /** diff --git a/ace/Signal.inl b/ace/Signal.inl index df65d471f1c..e88f62ca4df 100644 --- a/ace/Signal.inl +++ b/ace/Signal.inl @@ -228,14 +228,10 @@ ACE_Sig_Action::restore_action (int signum, ACE_Sig_Action &oaction) // Block out the signal MASK until the destructor is called. ACE_INLINE -ACE_Sig_Guard::ACE_Sig_Guard (ACE_Sig_Set *mask, - bool condition) +ACE_Sig_Guard::ACE_Sig_Guard (ACE_Sig_Set *mask) : omask_ () - , condition_ (condition) { //ACE_TRACE ("ACE_Sig_Guard::ACE_Sig_Guard"); - if (!this->condition_) - return; #if defined (ACE_LACKS_UNIX_SIGNALS) ACE_UNUSED_ARG (mask); @@ -274,9 +270,6 @@ ACE_INLINE ACE_Sig_Guard::~ACE_Sig_Guard (void) { //ACE_TRACE ("ACE_Sig_Guard::~ACE_Sig_Guard"); - if (!this->condition_) - return; - #if !defined (ACE_LACKS_UNIX_SIGNALS) #if defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK) ACE_OS::sigprocmask (SIG_SETMASK, diff --git a/ace/Sock_Connect.cpp b/ace/Sock_Connect.cpp index 91d6cb5b89b..ba7b8900669 100644 --- a/ace/Sock_Connect.cpp +++ b/ace/Sock_Connect.cpp @@ -7,11 +7,6 @@ #include "ace/Auto_Ptr.h" #include "ace/SString.h" #include "ace/OS_Memory.h" - -#if defined (sparc) && ! defined (CHORUS) -# include "ace/OS_NS_fcntl.h" -#endif // sparc && !CHORUS - #include "ace/OS_NS_stdlib.h" #include "ace/OS_NS_string.h" #include "ace/OS_NS_sys_socket.h" @@ -34,7 +29,6 @@ extern "C" { extern struct in_ifaddr* in_ifaddr; } -#include "ace/OS_NS_stdio.h" #endif /* VXWORKS */ #if defined (ACE_HAS_WINCE) @@ -46,14 +40,8 @@ extern "C" { # include "ace/Object_Manager.h" # endif /* ACE_HAS_THREADS */ -namespace ACE -{ - // private: - // Used internally so not exported. - - /// Does this box have ipv6 turned on? - int ipv6_enabled_ = -1; -} +// Whether or not ipv6 is turned on in this box +int ACE_Sock_Connect::ipv6_enabled_ = -1; #endif /* ACE_HAS_IPV6 */ // This is a hack to work around a problem with Visual Age C++ 5 and 6 on AIX. @@ -69,11 +57,7 @@ namespace ACE static ACE_Auto_Array_Ptr<sockaddr> force_compiler_to_include_socket_h; #endif /* AIX && __IBMCPP__ >= 500 */ - -ACE_RCSID (ace, - Sock_Connect, - "$Id$") - +ACE_RCSID(ace, Sock_Connect, "$Id$") #if defined (ACE_WIN32) && \ (!defined (ACE_HAS_WINSOCK2) \ @@ -273,11 +257,11 @@ get_windows_version() // Bind socket to an unused port. int -ACE::bind_port (ACE_HANDLE handle, - ACE_UINT32 ip_addr, +ACE_Sock_Connect::bind_port (ACE_HANDLE handle, + ACE_UINT32 ip_addr, int address_family) { - ACE_TRACE ("ACE::bind_port"); + ACE_TRACE ("ACE_Sock_Connect::bind_port"); ACE_INET_Addr addr; @@ -343,12 +327,12 @@ ACE::bind_port (ACE_HANDLE handle, } int -ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, +ACE_Sock_Connect::get_bcast_addr (ACE_UINT32 &bcast_addr, const ACE_TCHAR *host_name, ACE_UINT32 host_addr, ACE_HANDLE handle) { - ACE_TRACE ("ACE::get_bcast_addr"); + ACE_TRACE ("ACE_Sock_Connect::get_bcast_addr"); #if !defined(ACE_WIN32) ACE_HANDLE s = handle; @@ -378,7 +362,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, if (ACE_OS::ioctl (s, cmd, (char *) &ifc) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::get_bcast_addr:") + ACE_LIB_TEXT ("ACE_Sock_Connect::get_bcast_addr:") ACE_LIB_TEXT ("ioctl (get interface configuration)")), -1); @@ -389,7 +373,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, // Get host ip address if necessary. if (host_name) { - hostent *hp = ACE_OS::gethostbyname (ACE_TEXT_ALWAYS_CHAR (host_name)); + hostent *hp = ACE_OS::gethostbyname (host_name); if (hp == 0) return -1; @@ -419,11 +403,11 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, #endif /* ! _UNICOS */ } -#if !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) +#if !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) for (int n = ifc.ifc_len / sizeof (struct ifreq) ; n > 0; n--, ifr++) #else - // see mk_broadcast@SOCK_Dgram_Bcast.cpp + // see mk_broadcast@SOCK_Dgram_Bcast.cpp for (int nbytes = ifc.ifc_len; nbytes >= (int) sizeof (struct ifreq) && ((ifr->ifr_addr.sa_len > sizeof (struct sockaddr)) ? (nbytes >= (int) sizeof (ifr->ifr_name) + ifr->ifr_addr.sa_len) : 1); @@ -432,7 +416,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, ifr = (struct ifreq *) ((caddr_t) &ifr->ifr_addr + ifr->ifr_addr.sa_len)) : (nbytes -= sizeof (struct ifreq), ifr++))) -#endif /* !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) */ +#endif /* !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) */ { struct sockaddr_in if_addr; @@ -448,7 +432,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, { ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::get_bcast_addr:") + ACE_LIB_TEXT ("ACE_Sock_Connect::get_bcast_addr:") ACE_LIB_TEXT ("Not AF_INET"))); continue; } @@ -460,7 +444,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, { ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::get_bcast_addr:") + ACE_LIB_TEXT ("ACE_Sock_Connect::get_bcast_addr:") ACE_LIB_TEXT (" ioctl (get interface flags)"))); continue; } @@ -469,7 +453,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, { ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::get_bcast_addr:") + ACE_LIB_TEXT ("ACE_Sock_Connect::get_bcast_addr:") ACE_LIB_TEXT ("Network interface is not up"))); continue; } @@ -484,7 +468,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, (char *) &if_req) == -1) ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::get_bcast_addr:") + ACE_LIB_TEXT ("ACE_Sock_Connect::get_bcast_addr:") ACE_LIB_TEXT ("ioctl (get broadaddr)"))); else { @@ -506,7 +490,7 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, else ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::get_bcast_addr:") + ACE_LIB_TEXT ("ACE_Sock_Connect::get_bcast_addr:") ACE_LIB_TEXT ("Broadcast is not enable for this interface."))); if (handle == ACE_INVALID_HANDLE) @@ -531,10 +515,10 @@ ACE::get_bcast_addr (ACE_UINT32 &bcast_addr, // responsible for calling delete [] on parray int -ACE::get_ip_interfaces (size_t &count, - ACE_INET_Addr *&addrs) +ACE_Sock_Connect::get_ip_interfaces (size_t &count, + ACE_INET_Addr *&addrs) { - ACE_TRACE ("ACE::get_ip_interfaces"); + ACE_TRACE ("ACE_Sock_Connect::get_ip_interfaces"); count = 0; addrs = 0; @@ -732,7 +716,7 @@ ACE::get_ip_interfaces (size_t &count, } if (n_interfaces == 0) { ACE_ERROR_RETURN ((LM_ERROR, - ACE_LIB_TEXT ("%p\nACE::get_ip_interfaces - "), + ACE_LIB_TEXT ("%p\nACE_Sock_Connect::get_ip_interfaces - "), ACE_LIB_TEXT ("No adapter found.")), -1); } @@ -757,28 +741,28 @@ ACE::get_ip_interfaces (size_t &count, case ERROR_NOT_SUPPORTED: // OS does not support this method ACE_ERROR_RETURN ((LM_ERROR, - ACE_LIB_TEXT ("%p\nACE::get_ip_interfaces - "), + ACE_LIB_TEXT ("%p\nACE_Sock_Connect::get_ip_interfaces - "), ACE_LIB_TEXT ("This version of WinCE does not support GetAdapterInfo.")), -1); break; case ERROR_NO_DATA: // no adapter installed ACE_ERROR_RETURN ((LM_ERROR, - ACE_LIB_TEXT ("%p\nACE::get_ip_interfaces - "), + ACE_LIB_TEXT ("%p\nACE_Sock_Connect::get_ip_interfaces - "), ACE_LIB_TEXT ("No network adapter installed.")), -1); break; case ERROR_INVALID_PARAMETER: ACE_ERROR_RETURN ((LM_ERROR, - ACE_LIB_TEXT ("%p\nACE::get_ip_interfaces - "), + ACE_LIB_TEXT ("%p\nACE_Sock_Connect::get_ip_interfaces - "), ACE_LIB_TEXT ("Invalid parameter.")), -1); break; default: ACE_ERROR_RETURN ((LM_ERROR, - ACE_LIB_TEXT ("%p\nACE::get_ip_interfaces - "), + ACE_LIB_TEXT ("%p\nACE_Sock_Connect::get_ip_interfaces - "), ACE_LIB_TEXT ("Adapter info access permission denied.")), -1); break; @@ -1026,9 +1010,9 @@ ACE::get_ip_interfaces (size_t &count, if (handle == ACE_INVALID_HANDLE) ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::get_ip_interfaces:open")), + ACE_LIB_TEXT ("ACE_Sock_Connect::get_ip_interfaces:open")), -1); - if (ACE::count_interfaces (handle, num_ifs)) + if (ACE_Sock_Connect::count_interfaces (handle, num_ifs)) { ACE_OS::close (handle); return -1; @@ -1070,7 +1054,7 @@ ACE::get_ip_interfaces (size_t &count, ACE_OS::close (handle); ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::get_ip_interfaces:") + ACE_LIB_TEXT ("ACE_Sock_Connect::get_ip_interfaces:") ACE_LIB_TEXT ("ioctl - SIOCGIFCONF failed")), -1); } @@ -1128,7 +1112,7 @@ ACE::get_ip_interfaces (size_t &count, #endif /* ! _UNICOS */ } -#if !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) +#if !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) pcur++; #else if (pcur->ifr_addr.sa_len <= sizeof (struct sockaddr)) @@ -1140,7 +1124,7 @@ ACE::get_ip_interfaces (size_t &count, pcur = (struct ifreq *) (pcur->ifr_addr.sa_len + (caddr_t) &pcur->ifr_addr); } -#endif /* !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) */ +#endif /* !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) */ } return 0; #elif defined (VXWORKS) @@ -1202,7 +1186,7 @@ ACE::get_ip_interfaces (size_t &count, // list of ifreq structs. int -ACE::count_interfaces (ACE_HANDLE handle, size_t &how_many) +ACE_Sock_Connect::count_interfaces (ACE_HANDLE handle, size_t &how_many) { #if defined (sparc) && defined (SIOCGIFNUM) int tmp_how_many; // For 64 bit Solaris @@ -1211,7 +1195,7 @@ ACE::count_interfaces (ACE_HANDLE handle, size_t &how_many) (caddr_t) &tmp_how_many) == -1) ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::count_interfaces:") + ACE_LIB_TEXT ("ACE_Sock_Connect::count_interfaces:") ACE_LIB_TEXT ("ioctl - SIOCGIFNUM failed")), -1); how_many = (size_t) tmp_how_many; @@ -1275,7 +1259,7 @@ ACE::count_interfaces (ACE_HANDLE handle, size_t &how_many) ACE_OS::free (ifcfg.ifc_req); ACE_ERROR_RETURN ((LM_ERROR, ACE_LIB_TEXT ("%p\n"), - ACE_LIB_TEXT ("ACE::count_interfaces:") + ACE_LIB_TEXT ("ACE_Sock_Connect::count_interfaces:") ACE_LIB_TEXT ("ioctl - SIOCGIFCONF failed")), -1); } @@ -1294,7 +1278,7 @@ ACE::count_interfaces (ACE_HANDLE handle, size_t &how_many) break; if_count++; -#if !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) +#if !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) p_ifs++; #else if (p_ifs->ifr_addr.sa_len <= sizeof (struct sockaddr)) @@ -1306,7 +1290,7 @@ ACE::count_interfaces (ACE_HANDLE handle, size_t &how_many) p_ifs = (struct ifreq *) (p_ifs->ifr_addr.sa_len + (caddr_t) &p_ifs->ifr_addr); } -#endif /* !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) && !defined(__NetBSD__) */ +#endif /* !defined(CHORUS_4) && !defined(AIX) && !defined (__QNX__) && !defined (__FreeBSD__) */ } ACE_OS::free (ifcfg.ifc_req); @@ -1322,7 +1306,7 @@ ACE::count_interfaces (ACE_HANDLE handle, size_t &how_many) // Routine to return a handle from which ioctl() requests can be made. ACE_HANDLE -ACE::get_handle (void) +ACE_Sock_Connect::get_handle (void) { // Solaris 2.x ACE_HANDLE handle = ACE_INVALID_HANDLE; @@ -1339,33 +1323,33 @@ ACE::get_handle (void) int -ACE::ipv6_enabled (void) +ACE_Sock_Connect::ipv6_enabled (void) { #if defined (ACE_HAS_IPV6) - if (ACE::ipv6_enabled_ == -1) + if (ACE_Sock_Connect::ipv6_enabled_ == -1) { // Perform Double-Checked Locking Optimization. ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance (), 0)); - if (ACE::ipv6_enabled_ == -1) + if (ACE_Sock_Connect::ipv6_enabled_ == -1) { // Determine if the kernel has IPv6 support by attempting to // create a PF_INET6 socket and see if it fails. ACE_HANDLE s = ACE_OS::socket (PF_INET6, SOCK_DGRAM, 0); if (s == ACE_INVALID_HANDLE) { - ACE::ipv6_enabled_ = 0; + ACE_Sock_Connect::ipv6_enabled_ = 0; } else { - ACE::ipv6_enabled_ = 1; + ACE_Sock_Connect::ipv6_enabled_ = 1; ACE_OS::closesocket (s); } } } - return ACE::ipv6_enabled_; + return ACE_Sock_Connect::ipv6_enabled_; #else return 0; #endif /* ACE_HAS_IPV6 */ diff --git a/ace/Sock_Connect.h b/ace/Sock_Connect.h index 532892d64fa..1803636a2e2 100644 --- a/ace/Sock_Connect.h +++ b/ace/Sock_Connect.h @@ -28,14 +28,16 @@ // Forward Declarations class ACE_INET_Addr; -namespace ACE +class ACE_Export ACE_Sock_Connect { + public: + // = Socket connection establishment calls. /// Bind a new unused port to @a handle. - extern ACE_Export int bind_port (ACE_HANDLE handle, - ACE_UINT32 ip_addr = INADDR_ANY, - int address_family = AF_UNSPEC); + static int bind_port (ACE_HANDLE handle, + ACE_UINT32 ip_addr = INADDR_ANY, + int address_family = AF_UNSPEC); /** * Get our broadcast address based on our @a host_addr. If @@ -45,31 +47,30 @@ namespace ACE * socket internally (and free it). Returns -1 on failure and 0 on * success. */ - extern ACE_Export int get_bcast_addr ( - ACE_UINT32 &bcast_addr, - const ACE_TCHAR *hostname = 0, - ACE_UINT32 host_addr = 0, - ACE_HANDLE handle = ACE_INVALID_HANDLE); + static int get_bcast_addr (ACE_UINT32 &bcast_addr, + const ACE_TCHAR *hostname = 0, + ACE_UINT32 host_addr = 0, + ACE_HANDLE handle = ACE_INVALID_HANDLE); /** * Return count and array of all configured IP interfaces on this * host, rc = 0 on success (count == number of interfaces else -1). * Caller is responsible for calling delete [] on @a addr_array. */ - extern ACE_Export int get_ip_interfaces (size_t &count, - ACE_INET_Addr *&addr_array); + static int get_ip_interfaces (size_t &count, + ACE_INET_Addr *&addr_array); /** * Helper routine for get_ip_interfaces, differs by UNIX platform so * put into own subroutine. perform some ioctls to retrieve ifconf * list of ifreq structs. */ - extern ACE_Export int count_interfaces (ACE_HANDLE handle, + static int count_interfaces (ACE_HANDLE handle, size_t &how_many); /// Routine to return a handle from which @c ioctl requests can be /// made. Caller must close the handle. - extern ACE_Export ACE_HANDLE get_handle (void); + static ACE_HANDLE get_handle (void); /** * Returns 1 if IPv6 is enabled on the current host; 0 if not. @@ -79,8 +80,14 @@ namespace ACE * returning 1 if it succeeds, and 0 if it fails. Caches the result * so it only gets checked once. */ - extern ACE_Export int ipv6_enabled (void); -} + static int ipv6_enabled (void); + +#if defined (ACE_HAS_IPV6) +private: + /// Does this box have ipv6 turned on? + static int ipv6_enabled_; +#endif /* ACE_HAS_IPV6 */ +}; #include /**/ "ace/post.h" diff --git a/ace/Stream.h b/ace/Stream.h index fed079368e4..c5fe5787e21 100644 --- a/ace/Stream.h +++ b/ace/Stream.h @@ -85,14 +85,10 @@ public: // = ACE_Stream plumbing operations - /// Add a new module <mod> right below the Stream head. The - /// <open()> hook methods of the <ACE_Tasks> in this <ACE_Module> - /// are invoked to initialize the tasks. + /// Add a new module <mod> right below the Stream head. virtual int push (ACE_Module<ACE_SYNCH_USE> *mod); /// Remove the <mod> right below the Stream head and close it down. - // The <close()> hook methods of the <ACE_Tasks> in this <ACE_Module> - /// are invoked to cleanup the tasks. virtual int pop (int flags = M_DELETE); /// Return the top module on the stream (right below the stream diff --git a/ace/Synch_Options.cpp b/ace/Synch_Options.cpp index d8f4e9bba9a..780c664099f 100644 --- a/ace/Synch_Options.cpp +++ b/ace/Synch_Options.cpp @@ -5,7 +5,6 @@ #endif /* __ACE_INLINE__ */ #include "ace/Global_Macros.h" -#include "ace/config-all.h" ACE_RCSID (ace, Synch_Options, diff --git a/ace/System_Time.cpp b/ace/System_Time.cpp index dcb1480aa51..da8e6bbba07 100644 --- a/ace/System_Time.cpp +++ b/ace/System_Time.cpp @@ -22,7 +22,7 @@ ACE_System_Time::ACE_System_Time (const ACE_TCHAR *poolname) ACE_OS::strcpy (this->poolname_, ACE_DEFAULT_BACKING_STORE); #else /* ACE_DEFAULT_BACKING_STORE */ - if (ACE::get_temp_dir (this->poolname_, + if (ACE_Lib_Find::get_temp_dir (this->poolname_, MAXPATHLEN - 17) == -1) // -17 for ace-malloc-XXXXXX { @@ -82,14 +82,14 @@ ACE_System_Time::get_master_system_time (ACE_UINT32 &time_out) // Try to find it void * temp; if (this->shmem_->find (ACE_DEFAULT_TIME_SERVER_STR, temp) == -1) - { - // No time entry in shared memory (meaning no Clerk exists) - // so return the local time of the host. - return this->get_local_system_time (time_out); - } + { + // No time entry in shared memory (meaning no Clerk exists) + // so return the local time of the host. + return this->get_local_system_time (time_out); + } else - // Extract the delta time. - this->delta_time_ = (long *) temp; + // Extract the delta time. + this->delta_time_ = (long *) temp; } ACE_UINT32 local_time; @@ -141,3 +141,4 @@ template class ACE_Allocator_Adapter<ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_Null_M #pragma instantiate ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_Null_Mutex> #pragma instantiate ACE_Allocator_Adapter<ACE_Malloc<ACE_MMAP_MEMORY_POOL, ACE_Null_Mutex> > #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + diff --git a/ace/TP_Reactor.cpp b/ace/TP_Reactor.cpp index af29cdca943..0a8daf74dd7 100644 --- a/ace/TP_Reactor.cpp +++ b/ace/TP_Reactor.cpp @@ -516,6 +516,7 @@ ACE_TP_Reactor::handle_socket_events (int &event_count, int ACE_TP_Reactor::get_event_for_dispatching (ACE_Time_Value *max_wait_time) { + // If the reactor handler state has changed, clear any remembered // ready bits and re-scan from the master wait_set. if (this->state_changed_) @@ -523,8 +524,7 @@ ACE_TP_Reactor::get_event_for_dispatching (ACE_Time_Value *max_wait_time) this->ready_set_.rd_mask_.reset (); this->ready_set_.wr_mask_.reset (); this->ready_set_.ex_mask_.reset (); - - this->state_changed_ = false; + this->state_changed_ = 0; } else { diff --git a/ace/TP_Reactor.h b/ace/TP_Reactor.h index 75a05e93fab..5833e809652 100644 --- a/ace/TP_Reactor.h +++ b/ace/TP_Reactor.h @@ -287,11 +287,8 @@ public: ACE_ALLOC_HOOK_DECLARE; protected: - // = Internal methods that do the actual work. - /// Template method from the base class. - virtual void clear_dispatch_mask (ACE_HANDLE handle, - ACE_Reactor_Mask mask); + // = Internal methods that do the actual work. /// Dispatch just 1 signal, timer, notification handlers int dispatch_i (ACE_Time_Value *max_wait_time, diff --git a/ace/TP_Reactor.inl b/ace/TP_Reactor.inl index 08c17a7e65e..a3a9de3d1de 100644 --- a/ace/TP_Reactor.inl +++ b/ace/TP_Reactor.inl @@ -100,12 +100,3 @@ ACE_TP_Reactor::clear_handle_read_set (ACE_HANDLE handle) this->ready_set_.ex_mask_.clr_bit (handle); this->ready_set_.rd_mask_.clr_bit (handle); } - -ACE_INLINE void -ACE_TP_Reactor::clear_dispatch_mask (ACE_HANDLE , - ACE_Reactor_Mask ) -{ - this->ready_set_.rd_mask_.reset (); - this->ready_set_.wr_mask_.reset (); - this->ready_set_.ex_mask_.reset (); -} diff --git a/ace/TSS_T.cpp b/ace/TSS_T.cpp index fc25332dd1f..ac474228bda 100644 --- a/ace/TSS_T.cpp +++ b/ace/TSS_T.cpp @@ -29,15 +29,10 @@ ACE_ALLOC_HOOK_DEFINE(ACE_TSS) template <class TYPE> ACE_TSS<TYPE>::~ACE_TSS (void) { -#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) - if (this->once_ != 0) - { - ACE_OS::thr_key_detach (this->key_, this); - } -#else // defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) - // We own it, we need to delete it. - delete type_; -#endif // defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)) + // We can't call <ACE_OS::thr_keyfree> until *all* of the threads + // that are using that key have done an <ACE_OS::thr_key_detach>. + // Otherwise, we'll end up with "dangling TSS pointers." + ACE_OS::thr_key_detach (this); } template <class TYPE> TYPE * diff --git a/ace/Task.cpp b/ace/Task.cpp index a7fa0894b26..a5a51d0da93 100644 --- a/ace/Task.cpp +++ b/ace/Task.cpp @@ -202,12 +202,12 @@ ACE_Task_Base::svc_run (void *args) // Call the Task's svc() hook method. int svc_status = t->svc (); ACE_THR_FUNC_RETURN status; -#if (defined (__BORLANDC__) && (__BORLANDC__ < 0x570)) || defined (__MINGW32__) || (defined (_MSC_VER) && (_MSC_VER <= 1400)) || (defined (ACE_WIN32) && defined(__IBMCPP__)) +#if (defined (__BORLANDC__) && (__BORLANDC__ < 0x570)) || defined (__MINGW32__) || (defined (_MSC_VER) && (_MSC_VER <= 1400)) // Some compilers complain about reinterpret_cast from int to unsigned long... status = static_cast<ACE_THR_FUNC_RETURN> (svc_status); #else status = reinterpret_cast<ACE_THR_FUNC_RETURN> (svc_status); -#endif /* (__BORLANDC__ < 0x570) || __MINGW32__ || _MSC_VER <= 1400 || __IBMCPP__ */ +#endif /* (__BORLANDC__ < 0x570) || __MINGW32__ || _MSC_VER <= 1400 */ // If we changed this zero change the other if in OS.cpp Thread_Adapter::invoke #if 1 diff --git a/ace/Task.h b/ace/Task.h index 5b2580cfa9b..eea6e6f8f8e 100644 --- a/ace/Task.h +++ b/ace/Task.h @@ -77,8 +77,8 @@ public: // These methods should be overridden by subclasses if you'd like to // provide <Task>-specific initialization and termination behavior. - /// Hook called to initialize a task and prepare it for execution. - /// <args> can be used to pass arbitrary information into <open>. + /// Hook called to open a Task. <args> can be used to pass arbitrary + /// information into <open>. virtual int open (void *args = 0); /** diff --git a/ace/Time_Value.cpp b/ace/Time_Value.cpp index 00f44a0a173..7618da2931a 100644 --- a/ace/Time_Value.cpp +++ b/ace/Time_Value.cpp @@ -1,4 +1,5 @@ #include "ace/Time_Value.h" +#include "ace/Basic_Types.h" ACE_RCSID (ace, Time_Value, diff --git a/ace/Time_Value.h b/ace/Time_Value.h index a2f7c856ef8..d523f8f8eba 100644 --- a/ace/Time_Value.h +++ b/ace/Time_Value.h @@ -44,10 +44,23 @@ typedef struct timespec timespec_t; #define ACE_ONE_SECOND_IN_USECS 1000000L #define ACE_ONE_SECOND_IN_NSECS 1000000000L +// ------------------------------------------------------------------- +// These forward declarations are only used to circumvent a bug in +// MSVC 6.0 compiler. They shouldn't cause any problem for other +// compilers and they can be removed once MS release a SP that contains +// the fix. +class ACE_Time_Value; +ACE_Export ACE_Time_Value operator + (const ACE_Time_Value &tv1, + const ACE_Time_Value &tv2); + +ACE_Export ACE_Time_Value operator - (const ACE_Time_Value &tv1, + const ACE_Time_Value &tv2); + // This forward declaration is needed by the set() and FILETIME() functions #if defined (ACE_LACKS_LONGLONG_T) class ACE_Export ACE_U_LongLong; #endif /* ACE_LACKS_LONGLONG_T */ +// ------------------------------------------------------------------- # if !defined (ACE_HAS_POSIX_TIME) && !defined (ACE_PSOS) // Definition per POSIX. @@ -67,9 +80,6 @@ typedef struct timespec typedef struct timespec timespec_t; # endif /* ACE_LACKS_TIMESPEC_T */ -// needed for ACE_UINT64 -#include "ace/Basic_Types.h" - // ------------------------------------------------------------------- /** @@ -82,15 +92,6 @@ typedef struct timespec timespec_t; * ACE. These time values are typically used in conjunction with OS * mechanisms like <select>, <poll>, or <cond_timedwait>. */ -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -// Something is a bit brain-damaged here and I'm not sure what... this code -// compiled before the OS reorg for ACE 5.4. Since then it hasn't - eVC -// complains that the operators that return ACE_Time_Value are C-linkage -// functions that can't return a C++ class. The only way I've found to -// defeat this is to wrap the whole class in extern "C++". -// - Steve Huston, 23-Aug-2004 -extern "C++" { -#endif class ACE_Export ACE_Time_Value { public: @@ -150,9 +151,7 @@ public: /// Converts from ACE_Time_Value format into milli-seconds format. /** * @return Sum of second field (in milliseconds) and microsecond field - * (in milliseconds). Note that this method can overflow if - * the second and microsecond field values are large, so use - * the msec (ACE_UINT64 &ms) method instead. + * (in milliseconds). * * @note The semantics of this method differs from the sec() and * usec() methods. There is no analogous "millisecond" @@ -160,19 +159,6 @@ public: */ unsigned long msec (void) const; -#if !defined (ACE_LACKS_LONGLONG_T) - /** - * @return Sum of second field (in milliseconds) and microsecond field - * (in milliseconds) and return them via the @param ms parameter. - * - * @note The semantics of this method differs from the sec() and - * usec() methods. There is no analogous "millisecond" - * component in an ACE_Time_Value. - */ - void msec (ACE_UINT64 &ms) const; - -#endif /*ACE_LACKS_LONGLONG_T */ - /// Converts from milli-seconds format into ACE_Time_Value format. /** * @note The semantics of this method differs from the sec() and @@ -334,9 +320,6 @@ private: /// Store the values as a timeval. timeval tv_; }; -#if defined (ACE_WIN32) && defined (_WIN32_WCE) -} -#endif /** * @class ACE_Countdown_Time diff --git a/ace/Time_Value.inl b/ace/Time_Value.inl index f139d5f7daa..8c907ce8b3f 100644 --- a/ace/Time_Value.inl +++ b/ace/Time_Value.inl @@ -120,17 +120,6 @@ ACE_Time_Value::msec (void) const return this->tv_.tv_sec * 1000 + this->tv_.tv_usec / 1000; } -#if !defined (ACE_LACKS_LONGLONG_T) -ACE_INLINE void -ACE_Time_Value::msec (ACE_UINT64 &ms) const -{ - // ACE_OS_TRACE ("ACE_Time_Value::msec"); - ms = this->tv_.tv_sec; - ms *= 1000; - ms += (this->tv_.tv_usec / 1000); -} -#endif /*ACE_LACKS_LONGLONG_T*/ - // Converts from milli-seconds format into Time_Value format. ACE_INLINE void diff --git a/ace/Typed_SV_Message.inl b/ace/Typed_SV_Message.inl index a2dde0af39e..27949626500 100644 --- a/ace/Typed_SV_Message.inl +++ b/ace/Typed_SV_Message.inl @@ -1,7 +1,8 @@ /* -*- C++ -*- */ // $Id$ -#include "ace/config-all.h" +// Typed_SV_Message.i + #include "ace/Global_Macros.h" template <class T> ACE_INLINE diff --git a/ace/UPIPE_Connector.cpp b/ace/UPIPE_Connector.cpp index 64af6e9a58d..9702f1da622 100644 --- a/ace/UPIPE_Connector.cpp +++ b/ace/UPIPE_Connector.cpp @@ -40,7 +40,7 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, ACE_TRACE ("ACE_UPIPE_Connector::connect"); ACE_ASSERT (new_stream.get_handle () == ACE_INVALID_HANDLE); - ACE_HANDLE handle = ACE::handle_timed_open (timeout, + ACE_HANDLE handle = ACE_Handle_Ops::handle_timed_open (timeout, addr.get_path_name (), flags, perms); @@ -64,12 +64,12 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, // to our corresponding ACE_UPIPE_Acceptor, so he may link the // two streams. ssize_t result = ACE_OS::write (handle, - (const char *) &ustream, - sizeof ustream); + (const char *) &ustream, + sizeof ustream); if (result == -1) - ACE_ERROR ((LM_ERROR, - ACE_LIB_TEXT ("ACE_UPIPE_Connector %p\n"), - ACE_LIB_TEXT ("write to pipe failed"))); + ACE_ERROR ((LM_ERROR, + ACE_LIB_TEXT ("ACE_UPIPE_Connector %p\n"), + ACE_LIB_TEXT ("write to pipe failed"))); // Wait for confirmation of stream linking. ACE_Message_Block *mb_p = 0; @@ -80,15 +80,15 @@ ACE_UPIPE_Connector::connect (ACE_UPIPE_Stream &new_stream, // Do *not* coalesce the following two checks for result == -1. // They perform different checks and cannot be merged. if (result == -1) - ACE_ERROR ((LM_ERROR, + ACE_ERROR ((LM_ERROR, ACE_LIB_TEXT ("ACE_UPIPE_Connector %p\n"), - ACE_LIB_TEXT ("no confirmation from server"))); + ACE_LIB_TEXT ("no confirmation from server"))); else - // Close down the new_stream at this point in order to - // conserve handles. Note that we don't need the SPIPE - // connection anymore since we're linked via the Message_Queue - // now. - new_stream.ACE_SPIPE::close (); + // Close down the new_stream at this point in order to + // conserve handles. Note that we don't need the SPIPE + // connection anymore since we're linked via the Message_Queue + // now. + new_stream.ACE_SPIPE::close (); return result; } } diff --git a/ace/ace.mpc b/ace/ace.mpc index 58bdf1fece2..b010fc6ca43 100644 --- a/ace/ace.mpc +++ b/ace/ace.mpc @@ -5,7 +5,6 @@ project(ACE) : acedefaults, aceversion, core, qt_reactor, other, codecs, token, libout = $(ACE_ROOT)/lib sharedname = ACE dynamicflags = ACE_BUILD_DLL - install = $(ACE_ROOT)/lib // This mpc file could be greatly simplified by putting the separate components // in subdirectories. diff --git a/ace/ace_wchar.h b/ace/ace_wchar.h index 8b115c13cb6..a2eb7b91511 100644 --- a/ace/ace_wchar.h +++ b/ace/ace_wchar.h @@ -50,9 +50,6 @@ #endif /* ACE_LEGACY_MODE */ #if defined (ACE_HAS_XPG4_MULTIBYTE_CHAR) -# if !defined (ACE_HAS_WCHAR) -# define ACE_HAS_WCHAR -# endif # include /**/ <wchar.h> #endif /* ACE_HAS_XPG4_MULTIBYPTE_CHAR */ @@ -62,9 +59,6 @@ # include /**/ <stdlib.h> /* For mbstowcs, etc. */ # include /**/ <string.h> /* For strlen */ # define wint_t unsigned int /* VxWorks has wchar_t but not wint_t */ -# elif defined (ACE_OPENVMS) -# include /**/ <wchar.h> -# include /**/ <wctype.h> # elif defined (ACE_HAS_STANDARD_CPP_LIBRARY) && \ (ACE_HAS_STANDARD_CPP_LIBRARY != 0) # include /**/ <cwchar> diff --git a/ace/config-WinCE.h b/ace/config-WinCE.h index 2e4ba28e98c..4a18f7a8fba 100644 --- a/ace/config-WinCE.h +++ b/ace/config-WinCE.h @@ -23,14 +23,11 @@ # error ACE requires Windows CE 3.0 and later. #endif // UNDER_CE -#if (UNDER_CE < 400) // CE 3 doesn't have Winsock 2, but CE 4 does. +#if (UNDER_CE < 400) # if !defined (ACE_HAS_WINSOCK2) # define ACE_HAS_WINSOCK2 0 # endif -# define ACE_LACKS_ASSERT_H -# define ACE_LACKS_SEARCH_H -# define ACE_LACKS_WCHAR_H #endif /* UNDER_CE < 400 */ #if !defined (ACE_HAS_WINCE) @@ -193,8 +190,6 @@ #define ACE_LACKS_CHDIR #define ACE_LACKS_ENV #define ACE_LACKS_HOSTNAME -#define ACE_LACKS_REALPATH -#define ACE_LACKS_SWAB #if defined (_WIN32_WCE_EMULATION) // @@ For some reason, qsort isn't defined correctly (_stdcall vs _cdecl) diff --git a/ace/config-aix-4.x.h b/ace/config-aix-4.x.h index 6358813be38..bd4641ad3d4 100644 --- a/ace/config-aix-4.x.h +++ b/ace/config-aix-4.x.h @@ -252,15 +252,8 @@ #define ACE_HAS_UTIME -// Platform has XPG4 wide character type and functions. However, the size -// of wchar_t changes for 32- vs. 64-bit builds (unsigned short vs. unsigned -// int, respectively). +// Platform has XPG4 wide character type and functions #define ACE_HAS_XPG4_MULTIBYTE_CHAR -#ifdef __64BIT__ -# define ACE_SIZEOF_WCHAR 4 -#else -# define ACE_SIZEOF_WCHAR 2 -#endif /* __64BIT__ */ #define ACE_LACKS_NETINET_TCP_H @@ -316,7 +309,7 @@ #define ACE_MALLOC_ALIGN 8 -#if (_XOPEN_SOURCE >= 500) && !defined(_UNIX95) +#if (_XOPEN_SOURCE == 500) && !defined(_UNIX95) # define ACE_HAS_3_PARAM_WCSTOK #endif /* _XOPEN_SOURCE == 500 && !_UNIX95 */ diff --git a/ace/config-aix-5.x.h b/ace/config-aix-5.x.h index 9f6cc07c3af..21c305745e7 100644 --- a/ace/config-aix-5.x.h +++ b/ace/config-aix-5.x.h @@ -2,9 +2,6 @@ // // Config file for AIX 5.1 and 5.2. -#ifndef ACE_CONFIG_AIX_5_X_H -#define ACE_CONFIG_AIX_5_X_H - // This define is needed for building with Visual Age C++ 5 in incremental // mode. In the batch mode build, platform_aix_ibm.GNU sets it. The incremental // mode compiler won't be supported after ACE 5.3, so this will also go away @@ -43,7 +40,3 @@ #if (defined (_AIX) && defined (__GNUC__)) #define ACE_HAS_POSIX_GETPWNAM_R #endif /* (defined (_AIX) && defined (__GNUC__)) */ - -#define ACE_HAS_TIMEZONE /* Call tzset() to set timezone */ - -#endif /* ACE_CONFIG_AIX_5_X_H */ diff --git a/ace/config-all.h b/ace/config-all.h index 165761fc0ef..0c0bb5e7c9b 100644 --- a/ace/config-all.h +++ b/ace/config-all.h @@ -59,6 +59,10 @@ # define ACE_NOTSUP do { errno = ENOTSUP; return; } while (0) #endif /* ! ACE_HAS_VERBOSE_NOTSUP */ +// These includes are here to avoid circular dependencies. +// Keep this at the bottom of the file. It contains the main macros. +#include "ace/OS_main.h" + // ---------------------------------------------------------------- # define ACE_TRACE_IMPL(X) ACE_Trace ____ (ACE_LIB_TEXT (X), __LINE__, ACE_LIB_TEXT (__FILE__)) @@ -95,10 +99,6 @@ # include "ace/Trace.h" #endif /* ACE_OS_NTRACE */ -// These includes are here to avoid circular dependencies. -// Keep this at the bottom of the file. It contains the main macros. -#include "ace/OS_main.h" - #include /**/ "ace/post.h" #endif /* ACE_CONFIG_ALL_H */ diff --git a/ace/config-chorus.h b/ace/config-chorus.h index 6f534c51a06..99a2e580869 100644 --- a/ace/config-chorus.h +++ b/ace/config-chorus.h @@ -71,7 +71,7 @@ # define ACE_LACKS_LONGLONG_T #endif -#define ACE_HAS_NONCONST_READV +#define ACE_HAS_BROKEN_READV #define ACE_HAS_CLOCK_GETTIME #define ACE_HAS_CPLUSPLUS_HEADERS #define ACE_HAS_DIRENT @@ -101,7 +101,7 @@ #define ACE_LACKS_MPROTECT #define ACE_LACKS_MSYNC #define ACE_LACKS_NAMED_POSIX_SEM -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_READDIR_R #define ACE_LACKS_READV #define ACE_LACKS_RLIMIT diff --git a/ace/config-cygwin32.h b/ace/config-cygwin32.h index f6962309bd0..230a42ecd1d 100644 --- a/ace/config-cygwin32.h +++ b/ace/config-cygwin32.h @@ -123,8 +123,9 @@ #define ACE_LACKS_MKFIFO +// Cygwin has no siginfo.h #define ACE_LACKS_SIGINFO_H - +// Cygwin has no ucontext.h #define ACE_LACKS_UCONTEXT_H #define ACE_LACKS_STROPTS_H @@ -136,9 +137,6 @@ #define ACE_HAS_SIGWAIT #define ACE_HAS_SIGINFO_T -#define ACE_HAS_POSIX_SEM -#define ACE_LACKS_NAMED_POSIX_SEM - // Cygwin DLL suffix is .dll #define ACE_DLL_SUFFIX ACE_LIB_TEXT (".dll") diff --git a/ace/config-dgux-4.11-epc.h b/ace/config-dgux-4.11-epc.h index 1168f6d03a7..7f0a01ee5ae 100644 --- a/ace/config-dgux-4.11-epc.h +++ b/ace/config-dgux-4.11-epc.h @@ -32,7 +32,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -// #define ACE_HAS_SYS_SYSCALL_H +// #define ACE_HAS_SYSCALL_H // Platform supports reentrant functions (i.e., all the POSIX *_r functions). #define ACE_HAS_REENTRANT_FUNCTIONS @@ -81,7 +81,7 @@ #define ACE_HAS_SIGINFO_T // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T diff --git a/ace/config-dgux-4.x-ghs.h b/ace/config-dgux-4.x-ghs.h index 41e1bd527cf..a39d8bd83cd 100644 --- a/ace/config-dgux-4.x-ghs.h +++ b/ace/config-dgux-4.x-ghs.h @@ -81,7 +81,7 @@ #define ACE_HAS_SIGINFO_T // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T diff --git a/ace/config-freebsd.h b/ace/config-freebsd.h index ea171b4a78f..389d1f9a6e6 100644 --- a/ace/config-freebsd.h +++ b/ace/config-freebsd.h @@ -117,7 +117,7 @@ extern "C" { char * cuserid (char *s); } #define ACE_HAS_SYSV_IPC // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H #if (__FreeBSD_version >= 300000) #define ACE_HAS_SIGINFO_T @@ -190,7 +190,7 @@ extern "C" { char * cuserid (char *s); } #define ACE_HAS_STRERROR // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Defines the page size of the system. #define ACE_PAGE_SIZE 4096 @@ -265,6 +265,12 @@ typedef union sigval sigval_t; #define ACE_LACKS_ITOW #define ACE_HAS_3_PARAM_WCSTOK +// Even though we do have tolower, we have a conflict when ACE_HAS_WCHAR is defined. +#define ACE_LACKS_TOWLOWER + +// Even though we do have toupper, we have a conflict when ACE_HAS_WCHAR is defined. +#define ACE_LACKS_TOWUPPER + #if (__FreeBSD_version >= 501000) # define ACE_HAS_PTHREAD_SETSTACK #endif diff --git a/ace/config-g++-common.h b/ace/config-g++-common.h index 9937e35c0e3..0b49b272e19 100644 --- a/ace/config-g++-common.h +++ b/ace/config-g++-common.h @@ -90,9 +90,9 @@ # define ACE_HAS_PENTIUM #endif /* i386 */ -// // GNU g++ 3.4.x implements "#pragma once". +// GNU g++ 3.4.x implements "#pragma once". // #if (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)) && !defined (ACE_LACKS_PRAGMA_ONCE) -// // We define it with a -D with make depend. +// // We define it with a -D with make depend. // # define ACE_LACKS_PRAGMA_ONCE // #endif /* ! ACE_LACKS_PRAGMA_ONCE */ diff --git a/ace/config-hpux-10.x.h b/ace/config-hpux-10.x.h index 1f36459ddc9..628307e98fd 100644 --- a/ace/config-hpux-10.x.h +++ b/ace/config-hpux-10.x.h @@ -67,7 +67,7 @@ extern int h_errno; /* This isn't declared in a header file on HP-UX */ #define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // But doesn't have a prototype for syscall() #define ACE_LACKS_SYSCALL diff --git a/ace/config-hpux-11.00.h b/ace/config-hpux-11.00.h index 63a08044532..5e812f3df7f 100644 --- a/ace/config-hpux-11.00.h +++ b/ace/config-hpux-11.00.h @@ -125,7 +125,6 @@ // new(nothrow_t) is offered. # define ACE_NEW_THROWS_EXCEPTIONS # define ACE_HAS_NEW_NOTHROW -# define ACE_HAS_NEW_NO_H 1 // Compiler's template mechanism must see source code (i.e., .C files). # define ACE_TEMPLATES_REQUIRE_SOURCE @@ -135,8 +134,6 @@ // ... and uses the template<> syntax # define ACE_HAS_STD_TEMPLATE_SPECIALIZATION -# define ACE_HAS_STD_TEMPLATE_CLASS_MEMBER_SPECIALIZATION - // Preprocessor needs some help with data types # if defined (__LP64__) # define ACE_SIZEOF_LONG 8 @@ -210,6 +207,12 @@ // It can also be set so that the mapped region is shareable with 32-bit // programs. To enable the 32/64 sharing, comment out the first definition // of ACE_DEFAULT_BASE_ADDR and uncomment the two lines after it. +// Note - there's a compiler bug on aC++ A.03.04 in 64-bit mode which prevents +// these from working as-is. So, there's some hackery in Naming_Context.cpp +// and Memory_Pool.cpp which works around it. It requires the +// ACE_DEFAULT_BASE_ADDRL definition below - make sure it has the same +// value as what you use for ACE_DEFAULT_BASE_ADDR. This is allegedly fixed +// in A.03.10 on the June Applications CD. #if defined (__LP64__) # define ACE_DEFAULT_BASE_ADDR ((char *) 0x0000001100000000) //# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) @@ -230,9 +233,6 @@ # define ACE_INFINITE 10000000 #endif -/* Compiler/platform correctly calls init()/fini() for shared libraries. */ -#define ACE_HAS_AUTOMATIC_INIT_FINI 1 - // Manually tweak the malloc control block paddings to properly align // things. #define ACE_MALLOC_PADDING 16 @@ -240,10 +240,7 @@ #define ACE_PI_CONTROL_BLOCK_ALIGN_LONGS 3 // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H - -#define ACE_HAS_SYS_PSTAT_H - +#define ACE_HAS_SYSCALL_H // But doesn't have a prototype for syscall() #define ACE_LACKS_SYSCALL @@ -273,12 +270,6 @@ // Platform supports IP multicast #define ACE_HAS_IP_MULTICAST -/* Platform defines MAP_FAILED as a long constant. */ -#define ACE_HAS_LONG_MAP_FAILED 1 - -/* Define to 1 if platform has memchr(). */ -#define ACE_HAS_MEMCHR 1 - // Platform supports recvmsg and sendmsg. #define ACE_HAS_MSG @@ -288,26 +279,12 @@ // Compiler/platform supports poll(). #define ACE_HAS_POLL -/* Platform supports "position-independent" features provided by - ACE_Based_Pointer<>. */ -#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 - -/* Platform supports POSIX getpwnam_r() function */ -#define ACE_HAS_POSIX_GETPWNAM_R 1 - // Platform supports POSIX O_NONBLOCK semantics. #define ACE_HAS_POSIX_NONBLOCK // Platform supports the POSIX struct timespec type #define ACE_HAS_POSIX_TIME -/* Platform has pread() and pwrite() support. */ -#define ACE_HAS_P_READ_WRITE 1 - -/* Platform will recurse infinitely on thread exits from TSS cleanup routines - (e.g., AIX) */ -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS 1 - // Platform supports reentrant functions (all the POSIX *_r functions). #define ACE_HAS_REENTRANT_FUNCTIONS // ctime_r and asctime_r conform to POSIX.1c (2 param version) @@ -321,36 +298,21 @@ // in the future (problem ID P64). #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -/* Platform lacks pri_t (e.g., Tandem NonStop UNIX). */ -#define ACE_LACKS_PRI_T 1 - // Platform has shm_open #define ACE_HAS_SHM_OPEN // Compiler/platform defines the sig_atomic_t typedef #define ACE_HAS_SIG_ATOMIC_T -/* Compiler requires extern "C" functions for signals. */ -#define ACE_HAS_SIG_C_FUNC 1 - // Platform's sigaction() function takes const sigaction* as 2nd parameter. #define ACE_HAS_SIGACTION_CONSTP2 // Platform supports SVR4 extended signals #define ACE_HAS_SIGINFO_T -/* Define to 1 if platform has sigsuspend(). */ -#define ACE_HAS_SIGSUSPEND 1 - // Platform doesn't detect a signal out of range unless it's way out of range. #define ACE_HAS_SIGISMEMBER_BUG -/* Platform provides socklen_t type, such as Linux with glibc2. */ -#define ACE_HAS_SOCKLEN_T 1 - -/* Platform/compiler supports _sys_errlist symbol */ -#define ACE_HAS_SYS_ERRLIST 1 - #define ACE_HAS_UALARM // Platform supports ucontext_t (which is used in the extended signal API). @@ -362,24 +324,17 @@ // Platform/compiler supports void * as second parameter to gettimeofday(). #define ACE_HAS_VOIDPTR_GETTIMEOFDAY -/* Platform requires void * for mmap(). */ -#define ACE_HAS_VOIDPTR_MMAP 1 - -/* OS/compiler uses void * arg 4 setsockopt() rather than const char * */ -#define ACE_HAS_VOIDPTR_SOCKOPT 1 - // Platform supports SVR4 dynamic linking semantics, in 64-bit mode only. // When used, this requires -ldl on the ACE library link line. #ifdef __LP64__ #define ACE_HAS_SVR4_DYNAMIC_LINKING #endif -// Platform supports the getrusage() system call. +// HP/UX has an undefined syscall for GETRUSAGE... +#define ACE_HAS_SYSCALL_GETRUSAGE +// Note, this only works if the flag is set above! #define ACE_HAS_GETRUSAGE -/* Define to 1 if platform has the declaration of getrusage(). */ -#define ACE_HAS_GETRUSAGE_PROTOTYPE 1 - // Platform has the sigwait function in a header file #define ACE_HAS_SIGWAIT #define ACE_HAS_SIGTIMEDWAIT @@ -417,8 +372,6 @@ // But the putmsg signature doesn't have it as const... // Well, it really does, but it depends on preprocessor defines. #define ACE_LACKS_CONST_STRBUF_PTR -/* Platform supports TLI timod STREAMS module */ -#define ACE_HAS_TIMOD_H 1 // Platform supports STREAM pipes // This is possible, but not by default - need to rebuild the kernel to @@ -439,8 +392,6 @@ // The definitions of TCP_NODELAY and TCP_MAXSEG conflict between // sys/xti.h and netinet/tcp.h. #define ACE_HAS_CONFLICTING_XTI_MACROS -/* Platform provides <sys/xti.h> header */ -#define ACE_HAS_SYS_XTI_H 1 ///////////////////////////////////////////////////////////////////////// // @@ -475,7 +426,6 @@ # define ACE_HAS_PTHREADS_STD # define ACE_HAS_PTHREADS_UNIX98_EXT # define ACE_HAS_PTHREAD_CONTINUE -# define ACE_HAS_PTHREAD_RESUME_NP # define ACE_HAS_PTHREAD_SUSPEND # define ACE_HAS_RECURSIVE_MUTEXES # define ACE_HAS_THREAD_SPECIFIC_STORAGE diff --git a/ace/config-hpux11.h b/ace/config-hpux11.h new file mode 100644 index 00000000000..843c4fed432 --- /dev/null +++ b/ace/config-hpux11.h @@ -0,0 +1,245 @@ +/* -*- C++ -*- */ +// $Id$ + +// The following configuration file is designed to work for HP +// platforms running HP/UX 11.x. It includes all of the ACE information +// needed for HP-UX 11.x itself. The compiler-specific information is in +// config-hpux-11.x-<compiler>.h - they include this file. + +#ifndef ACE_CONFIG_H +#error "You need to use a compiler-specific .h file - they include this file" +#endif + +// Compiling for HPUX. +#if !defined (HPUX) +#define HPUX +#endif /* HPUX */ +#define HPUX_11 + +#ifndef _HPUX_SOURCE +#define _HPUX_SOURCE +#include /**/ "ace/pre.h" +#endif + +#include /**/ <sys/stdsyms.h> + +//////////////////////////////////////////////////////////////////////////// +// +// General OS information - see README for more details on what they mean +// +/////////////////////////////////////////////////////////////////////////// + +// HP/UX needs to have these addresses in a special range. +// If this is on a 64-bit model, the default is to use 64-bit addressing. +// It can also be set so that the mapped region is shareable with 32-bit +// programs. To enable the 32/64 sharing, comment out the first definition +// of ACE_DEFAULT_BASE_ADDR and uncomment the two lines after it. +// Note - there's a compiler bug on aC++ A.03.04 in 64-bit mode which prevents +// these from working as-is. So, there's some hackery in Naming_Context.cpp +// and Memory_Pool.cpp which works around it. It requires the +// ACE_DEFAULT_BASE_ADDRL definition below - make sure it has the same +// value as what you use for ACE_DEFAULT_BASE_ADDR. This is allegedly fixed +// in A.03.10 on the June Applications CD. +#if defined (__LP64__) +# define ACE_DEFAULT_BASE_ADDR ((char *) 0x0000001100000000) +//# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) +//# define ACE_OS_EXTRA_MMAP_FLAGS MAP_ADDR32 + +# define ACE_DEFAULT_BASE_ADDRL (0x0000001100000000) +//# define ACE_DEFAULT_BASE_ADDRL (0x80000000) +#else +# define ACE_DEFAULT_BASE_ADDR ((char *) 0x80000000) +#endif /* __LP64__ */ + +// Platform can do async I/O (aio_*) +#define ACE_HAS_AIO_CALLS +// ... but seems to require this in order to keep from hanging. Needs some +// investigation, maybe with HP. John Mulhern determined this value +// empirically. YMMV. If it does vary, set it up in your own config.h which +// then includes the ACE-supplied config. +#if !defined (ACE_INFINITE) +# define ACE_INFINITE 10000000 +#endif + +// Compiler/platform contains the <sys/syscall.h> file. +#define ACE_HAS_SYSCALL_H +// But doesn't have a prototype for syscall() +#define ACE_LACKS_SYSCALL + +// Platform supports POSIX 1.b clock_gettime () +#define ACE_HAS_CLOCK_GETTIME + +// Prototypes for both signal() and struct sigaction are consistent. +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES + +// Compiler/platform has correctly prototyped header files. +#define ACE_HAS_CPLUSPLUS_HEADERS + +// Compiler/platform has Dirent iterator functions. +#define ACE_HAS_DIRENT + +// Platform supports getpagesize() call +#define ACE_HAS_GETPAGESIZE +// But we define this just to be safe +#define ACE_PAGE_SIZE 4096 + +// Platform supports IP multicast +#define ACE_HAS_IP_MULTICAST + +// Platform supports recvmsg and sendmsg. +#define ACE_HAS_MSG + +// Platform's select() has non-const timeval argument +#define ACE_HAS_NONCONST_SELECT_TIMEVAL + +// Compiler/platform supports poll(). +#define ACE_HAS_POLL + +// Platform supports POSIX O_NONBLOCK semantics. +#define ACE_HAS_POSIX_NONBLOCK + +// Platform supports the POSIX struct timespec type +#define ACE_HAS_POSIX_TIME + +// Platform supports reentrant functions (all the POSIX *_r functions). +#define ACE_HAS_REENTRANT_FUNCTIONS + +// HP-UX 11 has reentrant netdb functions. The catch is that the old +// functions (gethostbyname, etc.) are thread-safe and the _r versions are +// not used and will be removed at some point. So, define things so +// the _r versions are not used. This will slow things down a bit due to +// the extra mutex lock in the ACE_NETDBCALL_RETURN macro, and will be fixed +// in the future (problem ID P64). +#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS + +// Compiler/platform defines the sig_atomic_t typedef +#define ACE_HAS_SIG_ATOMIC_T + +// Platform supports SVR4 extended signals +#define ACE_HAS_SIGINFO_T + +// Platform doesn't detect a signal out of range unless it's way out of range. +#define ACE_HAS_SIGISMEMBER_BUG + +#define ACE_HAS_UALARM + +// Platform supports ucontext_t (which is used in the extended signal API). +#define ACE_HAS_UCONTEXT_T + +// Compiler/platform supports strerror (). +#define ACE_HAS_STRERROR + +// Platform/compiler supports void * as second parameter to gettimeofday(). +#define ACE_HAS_VOIDPTR_GETTIMEOFDAY + +// Platform supports SVR4 dynamic linking semantics, in 64-bit mode only. +// When used, this requires -ldl on the ACE library link line. +#ifdef __LP64__ +#define ACE_HAS_SVR4_DYNAMIC_LINKING +#endif + +// HP/UX has an undefined syscall for GETRUSAGE... +#define ACE_HAS_SYSCALL_GETRUSAGE +// Note, this only works if the flag is set above! +#define ACE_HAS_GETRUSAGE + +// Platform has the sigwait function in a header file +#define ACE_HAS_SIGWAIT + +// Platform supports System V IPC (most versions of UNIX, but not Win32) +#define ACE_HAS_SYSV_IPC + +// accept() is thread-safe +#define ACE_HAS_THREAD_SAFE_ACCEPT + +// Platform has XPG4 wide character support +#define ACE_HAS_XPG4_MULTIBYTE_CHAR + +// Platform lacks a typedef for timespec_t, but has struct timespec +#define ACE_LACKS_TIMESPEC_T + +// Shared library name/path components +#define ACE_DLL_SUFFIX ".sl" +#if defined (__LP64__) +# define ACE_LD_SEARCH_PATH "LD_LIBRARY_PATH" +#else +# define ACE_LD_SEARCH_PATH "SHLIB_PATH" +#endif /* __LP64__ */ + +////////////////////////////////////////////////////////////////////////// +// +// STREAMS information +// +////////////////////////////////////////////////////////////////////////// + +// Platform supports STREAMS +#define ACE_HAS_STREAMS +// Compiler/platform supports struct strbuf. +#define ACE_HAS_STRBUF_T +// But the putmsg signature doesn't have it as const... +// Well, it really does, but it depends on preprocessor defines. +#define ACE_LACKS_CONST_STRBUF_PTR + +// Platform supports STREAM pipes +// This is possible, but not by default - need to rebuild the kernel to +// get them enabled - see pipe(2) and "STREAMS/UX for the HP 9000" +// #define ACE_HAS_STREAM_PIPES + +///////////////////////////////////////////////////////////////////////// +// +// TLI/XTI information +// +//////////////////////////////////////////////////////////////////////// + +// Platform supports XTI (includes TLI), including SVR4 facilities. +#define ACE_HAS_TLI +// ACE_HAS_SVR4_TLI should work on HP-UX, but doesn't yet. Riverace +// problem ID P27. +//#define ACE_HAS_SVR4_TLI +// Platform uses <xti.h>, not tiuser.h +#define ACE_HAS_XTI +// But it has _terrno() outside the extern "C" stuff. +#define ACE_HAS_TIUSER_H_BROKEN_EXTERN_C +// Platform provides ACE_TLI function prototypes. +#define ACE_HAS_TLI_PROTOTYPES +// HP-UX 11.00 (at least at initial releases) has some busted macro defs +#define ACE_HAS_BROKEN_XTI_MACROS +// HP-UX 11 conforms to the XPG4 spec, which ACE calls broken for the +// errmsg not being const... +#define ACE_HAS_BROKEN_T_ERROR + +///////////////////////////////////////////////////////////////////////// +// +// Threads information. +// +// Use of threads is controlled by the 'threads' argument to make. See +// include/makeinclude/platform_hpux_aCC.GNU for details. If it's not set, +// the default is to enable it, since kernel threads are always available +// on HP-UX 11, as opposed to 10.x where it was optional software. +// +//////////////////////////////////////////////////////////////////////// + +#if defined (ACE_HAS_THREADS) +# if (ACE_HAS_THREADS == 0) +# undef ACE_HAS_THREADS +# endif /* ACE_HAS_THREADS == 0 */ +#else +# define ACE_HAS_THREADS +#endif /* ACE_HAS_THREADS */ + +#if defined (ACE_HAS_THREADS) + +# if !defined (ACE_MT_SAFE) +# define ACE_MT_SAFE 1 +# endif + +# define ACE_HAS_PTHREADS +# define ACE_HAS_PTHREADS_STD +# define ACE_HAS_PTHREADS_UNIX98_EXT + +# define ACE_HAS_THREAD_SPECIFIC_STORAGE +#endif /* ACE_HAS_THREADS */ + +#define ACE_HAS_POSIX_SEM + +#include /**/ "ace/post.h" diff --git a/ace/config-icc-common.h b/ace/config-icc-common.h index ec6614d365f..f599992bacd 100644 --- a/ace/config-icc-common.h +++ b/ace/config-icc-common.h @@ -11,7 +11,6 @@ # define ACE_HAS_TEMPLATE_TYPEDEFS # define ACE_HAS_TYPENAME_KEYWORD # define ACE_HAS_STD_TEMPLATE_SPECIALIZATION -# define ACE_HAS_STD_TEMPLATE_CLASS_MEMBER_SPECIALIZATION # define ACE_HAS_STANDARD_CPP_LIBRARY 1 # define ACE_HAS_TEMPLATE_SPECIALIZATION # define ACE_HAS_USING_KEYWORD diff --git a/ace/config-integritySCA.h b/ace/config-integritySCA.h index 990987673ef..62456383599 100644 --- a/ace/config-integritySCA.h +++ b/ace/config-integritySCA.h @@ -35,6 +35,7 @@ #define _REENTRANT #define ACE_MT_SAFE 1 #define __ACE_INLINE__ +#define ACE_HAS_ONE_DEFINITION_RULE // Compiler/platform has correctly prototyped header files. #define ACE_HAS_CPLUSPLUS_HEADERS @@ -97,6 +98,7 @@ #define ACE_LACKS_MUTEXATTR_PSHARED #define ACE_LACKS_PIPE #define ACE_LACKS_RLIMIT +#define ACE_LACKS_RPC_H #define ACE_LACKS_RECVMSG #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SEMBUF_T @@ -110,6 +112,7 @@ #endif #define ACE_LACKS_FILE_FCNTL #define ACE_LACKS_FCNTL +#define ACE_LACKS_SYS_FILE_H #if 0 #define ACE_LACKS_DIRECTORY_FUNCTIONS #define ACE_LACKS_UNLINK @@ -129,7 +132,7 @@ #define ACE_LACKS_PID_STUFF #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS #define ACE_LACKS_IPC_H -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_SYS_MSG_H #define ACE_LACKS_UTSNAME_T #define ACE_LACKS_ISATTY diff --git a/ace/config-irix5.2.h b/ace/config-irix5.2.h index cdb1fb49bdd..c3027e86065 100644 --- a/ace/config-irix5.2.h +++ b/ace/config-irix5.2.h @@ -28,7 +28,7 @@ #define ACE_HAS_VOIDPTR_MMAP // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Platform supports recvmsg and sendmsg. #define ACE_HAS_MSG diff --git a/ace/config-irix5.3-g++.h b/ace/config-irix5.3-g++.h index a3034d95583..51a5762e9b7 100644 --- a/ace/config-irix5.3-g++.h +++ b/ace/config-irix5.3-g++.h @@ -36,7 +36,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform supports alloca() // Although ACE does have alloca() on this compiler/platform combination, it is diff --git a/ace/config-irix5.3-sgic++.h b/ace/config-irix5.3-sgic++.h index 8be382ce9f4..7cfa35e77ec 100644 --- a/ace/config-irix5.3-sgic++.h +++ b/ace/config-irix5.3-sgic++.h @@ -37,7 +37,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform supports alloca() // Although ACE does have alloca() on this compiler/platform combination, it is diff --git a/ace/config-irix6.x-common.h b/ace/config-irix6.x-common.h index 7f7e172a8c1..103f6e9771e 100644 --- a/ace/config-irix6.x-common.h +++ b/ace/config-irix6.x-common.h @@ -75,7 +75,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform supports snprintf #define ACE_HAS_SNPRINTF diff --git a/ace/config-linux-common.h b/ace/config-linux-common.h index 3be0898f3a5..915b26d60ef 100644 --- a/ace/config-linux-common.h +++ b/ace/config-linux-common.h @@ -32,10 +32,8 @@ // First the machine specific part #if defined (__alpha) -# if __GLIBC_MINOR__ < 2 // This is necessary on Alphas with glibc 2.0.7-13. # define ACE_POLL_IS_BROKEN -# endif #elif defined (__powerpc__) # if !defined (ACE_DEFAULT_BASE_ADDR) # define ACE_DEFAULT_BASE_ADDR ((char *) 0x40000000) @@ -51,7 +49,7 @@ // Then glibc/libc5 specific parts #if defined(__GLIBC__) -# define ACE_HAS_NONCONST_SETRLIMIT +# define ACE_HAS_BROKEN_SETRLIMIT # define ACE_HAS_RUSAGE_WHO_ENUM enum __rusage_who # define ACE_HAS_RLIMIT_RESOURCE_ENUM enum __rlimit_resource # define ACE_HAS_SOCKLEN_T @@ -207,6 +205,8 @@ #define ACE_LACKS_ITOW #define ACE_LACKS_WCSICMP #define ACE_LACKS_WCSNICMP +#define ACE_LACKS_TOWLOWER +#define ACE_LACKS_TOWUPPER #if __GLIBC__ >= 2 # define ACE_HAS_3_PARAM_WCSTOK @@ -227,7 +227,7 @@ // Compiler/platform has the getrusage() system call. #define ACE_HAS_GETRUSAGE -#define ACE_HAS_GETRUSAGE_PROTOTYPE +#define ACE_HAS_GETRUSAGE_PROTO #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES @@ -269,6 +269,9 @@ #endif +// glibc supports the mkstemp() function. +#define ACE_HAS_MKSTEMP + // glibc requires _XOPEN_SOURCE_EXTENDED to make this prototype // visible, so force ACE to declare one. Yuk! #define ACE_LACKS_MKSTEMP_PROTOTYPE @@ -276,10 +279,6 @@ // Platform defines struct timespec but not timespec_t #define ACE_LACKS_TIMESPEC_T -// Platform supplies scandir() -#define ACE_HAS_SCANDIR -#define ACE_SCANDIR_CMP_USES_VOIDPTR - //#define ACE_LACKS_STRRECVFD #define ACE_HAS_STRBUF_T @@ -293,10 +292,7 @@ #define ACE_HAS_SYSV_IPC // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H - -// Platform/compiler supports global timezone variable. -#define ACE_HAS_TIMEZONE +#define ACE_HAS_SYSCALL_H // Platform/compiler supports void * as second parameter to gettimeofday(). #define ACE_HAS_VOIDPTR_GETTIMEOFDAY @@ -325,7 +321,7 @@ #define ACE_HAS_DIRENT -#if defined (__ia64) || defined(__alpha) +#if defined (__ia64) // On 64 bit platforms, the "long" type is 64-bits. Override the // default 32-bit platform-specific format specifiers appropriately. # define ACE_UINT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%lu") diff --git a/ace/config-lite.h b/ace/config-lite.h index 026671f9e84..07116fcf89a 100644 --- a/ace/config-lite.h +++ b/ace/config-lite.h @@ -125,12 +125,6 @@ # define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 # endif /* ACE_HAS_POSITION_INDEPENDENT_POINTERS */ -# if !defined (ACE_HAS_PROCESS_SPAWN) -# if !defined (ACE_LACKS_FORK) || defined (ACE_WIN32) || defined (ACE_WINCE) || defined (ACE_OPENVMS) || defined (CHORUS) -# define ACE_HAS_PROCESS_SPAWN 1 -# endif -# endif /* ACE_HAS_PROCESS_SPAWN */ - // ========================================================================= // RCSID Macros // ========================================================================= diff --git a/ace/config-lynxos.h b/ace/config-lynxos.h index f36147fb310..1e2f6f34a10 100644 --- a/ace/config-lynxos.h +++ b/ace/config-lynxos.h @@ -1,7 +1,7 @@ // $Id$ // The following configuration file is designed to work for LynxOS, -// version 3.0.0 and later, using the GNU g++ compiler. +// version 2.5.0 and later, using the GNU g++ compiler. // Note on why ACE_HAS_POSIX_SEM is not #defined: // ACE_HAS_POSIX_SEM would cause native LynxOS mutexes and condition @@ -21,9 +21,31 @@ #endif /* ! __ACE_INLINE__ */ #if defined (__GNUG__) -# include "ace/config-g++-common.h" +# if __GNUC_MINOR__ == 7 + +# include "ace/config-g++-common.h" + + // The g++ that's distributed with LynxOS 3.0.0 needs this. + // It won't hurt with 2.5.0. +# undef ACE_HAS_TEMPLATE_SPECIALIZATION +# elif __LYNXOS_SDK_VERSION <= 199603L + /* LynxOS <= 2.5.0 */ + // config-g++-common.h undef's ACE_HAS_STRING_CLASS with -frepo, so + // this must appear before its #include. + + // If ACE_HAS_STRING_CLASS is used with LynxOS 3.0.0, some + // executables, such as IOStream_Test, require linking with + // libg++. +# define ACE_HAS_STRING_CLASS + +# include "ace/config-g++-common.h" +# endif /* __GNUC_MINOR__ == 7 */ #endif /* __GNUG__ */ +#if defined ( __LYNXOS_SDK_VERSION ) && ( __LYNXOS_SDK_VERSION <= 199701L ) +# define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 0 +#endif /* __LYNXOS_SDK_VERSION */ + #if _POSIX_VERSION >= 199506L // LynxOS 3.1.0 or greater need ipc_1c.h to be included before net/if.h // to avoid macro conflict. @@ -45,9 +67,9 @@ #define ACE_HAS_ALLOCA #define ACE_HAS_ALLOCA_H #define ACE_HAS_AUTOMATIC_INIT_FINI -#define ACE_HAS_NONCONST_READV -#define ACE_HAS_NONCONST_SETRLIMIT -#define ACE_HAS_NONCONST_WRITEV +#define ACE_HAS_BROKEN_READV +#define ACE_HAS_BROKEN_SETRLIMIT +#define ACE_HAS_BROKEN_WRITEV #define ACE_HAS_CLOCK_GETTIME #define ACE_HAS_CPLUSPLUS_HEADERS #define ACE_HAS_DIRENT @@ -71,7 +93,7 @@ #define ACE_HAS_SIGINFO_T #define ACE_HAS_SIGWAIT #define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H #define ACE_HAS_SSIZE_T #define ACE_HAS_STRBUF_T #define ACE_HAS_STREAMS @@ -81,24 +103,16 @@ #define ACE_HAS_TERM_IOCTLS #define ACE_HAS_TYPENAME_KEYWORD #define ACE_HAS_TIMEZONE_GETTIMEOFDAY -#define ACE_LACKS_SWAB_PROTOTYPE #define ACE_LACKS_CONST_TIMESPEC_PTR -#define ACE_LACKS_GETOPT_PROTOTYPE #define ACE_LACKS_GETPGID #define ACE_LACKS_SETPGID #define ACE_LACKS_SETREGID #define ACE_LACKS_SETREUID -#define ACE_LACKS_INET_ATON_PROTOTYPE #define ACE_LACKS_MADVISE -#define ACE_LACKS_MKTEMP_PROTOTYPE -#define ACE_LACKS_MKSTEMP_PROTOTYPE -#define ACE_LACKS_PUTENV_PROTOTYPE #define ACE_LACKS_REALPATH #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SIGINFO_H #define ACE_LACKS_SI_ADDR -#define ACE_LACKS_STRCASECMP_PROTOTYPE -#define ACE_LACKS_STRNCASECMP_PROTOTYPE #define ACE_LACKS_TIMESPEC_T #define ACE_LACKS_UCONTEXT_H #define ACE_LACKS_DLFCN_H @@ -168,8 +182,6 @@ # define ACE_HAS_STD_TEMPLATE_CLASS_MEMBER_SPECIALIZATION # define ACE_HAS_STD_TEMPLATE_SPECIALIZATION # define ACE_HAS_TEMPLATE_SPECIALIZATION -# define ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION -# undef ACE_LACKS_STATIC_DATA_MEMBER_TEMPLATES #endif /* __GNUC__ == 2 && __GNUC_MINOR__ == 9 */ // By default, don't include RCS Id strings in object code. diff --git a/ace/config-m88k.h b/ace/config-m88k.h index 64c4ae8e298..699e9e3f4d6 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_NONCONST_SENDMSG +#define ACE_HAS_BROKEN_SENDMSG // The SunOS 5.x version of rand_r is inconsistent with the header files... #define ACE_HAS_BROKEN_RANDR @@ -84,7 +84,7 @@ struct ip_mreq #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H #if !defined (ACE_HAS_FSU_PTHREADS) // Platform supports reentrant functions (i.e., all the POSIX *_r functions). @@ -144,7 +144,7 @@ struct ip_mreq #define ACE_HAS_UCONTEXT_T // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T diff --git a/ace/config-macosx-panther.h b/ace/config-macosx-panther.h index d02fae7ccd3..096214367f3 100644 --- a/ace/config-macosx-panther.h +++ b/ace/config-macosx-panther.h @@ -86,7 +86,7 @@ //#define ACE_HAS_SYSV_IPC // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES @@ -122,7 +122,7 @@ #define ACE_HAS_STRERROR // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Defines the page size of the system. #define ACE_HAS_GETPAGESIZE @@ -148,6 +148,8 @@ #endif /* ! ACE_MT_SAFE */ #define ACE_HAS_PTHREADS #define ACE_HAS_PTHREADS_STD +#define ACE_HAS_PTHREAD_KILL +#define ACE_HAS_PTHREAD_CANCEL #define ACE_HAS_PTHREAD_SIGMASK #define ACE_LACKS_THREAD_PROCESS_SCOPING #define ACE_HAS_THREAD_SPECIFIC_STORAGE diff --git a/ace/config-macosx.h b/ace/config-macosx.h index 93f905e990a..8295575e316 100644 --- a/ace/config-macosx.h +++ b/ace/config-macosx.h @@ -88,7 +88,7 @@ //#define ACE_HAS_SYSV_IPC // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES @@ -124,7 +124,7 @@ #define ACE_HAS_STRERROR // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Defines the page size of the system. #define ACE_HAS_GETPAGESIZE @@ -150,6 +150,8 @@ #endif /* ! ACE_MT_SAFE */ #define ACE_HAS_PTHREADS #define ACE_HAS_PTHREADS_STD +#define ACE_HAS_PTHREAD_KILL +#define ACE_HAS_PTHREAD_CANCEL #define ACE_HAS_PTHREAD_SIGMASK #define ACE_LACKS_THREAD_PROCESS_SCOPING #define ACE_HAS_THREAD_SPECIFIC_STORAGE diff --git a/ace/config-mvs.h b/ace/config-mvs.h index ddab94da911..bf8af448678 100644 --- a/ace/config-mvs.h +++ b/ace/config-mvs.h @@ -86,7 +86,7 @@ #define ACE_LACKS_LINEBUFFERED_STREAMBUF #define ACE_LACKS_MADVISE #define ACE_LACKS_MALLOC_H -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_PLACEMENT_OPERATOR_DELETE #define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_LACKS_READDIR_R diff --git a/ace/config-netbsd.h b/ace/config-netbsd.h index 3e2b76af37e..1bfaf1a6c8f 100644 --- a/ace/config-netbsd.h +++ b/ace/config-netbsd.h @@ -1,155 +1,181 @@ /* -*- C++ -*- */ // $Id$ +// ***** This configuration file is still under testing. ***** + +// The following configuration file is designed to work for NetBSD +// platforms using GNU g++. + #ifndef ACE_CONFIG_H #define ACE_CONFIG_H +#include /**/ "ace/pre.h" + +#if ! defined (__ACE_INLINE__) +#define __ACE_INLINE__ +#endif /* ! __ACE_INLINE__ */ + +// ******************************************************** +// uncomment next line if you are using FreeBSD 2.1.x[R] +// #define FreeBSD_2_1 +// ******************************************************** +#define ACE_NETBSD -#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R 1 -#define ACE_HAS_3_PARAM_WCSTOK 1 -#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG 1 -#define ACE_HAS_ALT_CUSERID 1 -#define ACE_HAS_AUTOMATIC_INIT_FINI 1 -#define ACE_HAS_CLOCK_GETTIME 1 -#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES 1 -#define ACE_HAS_CPLUSPLUS_HEADERS 1 -#define ACE_HAS_DIRENT 1 -#define ACE_HAS_EXCEPTIONS 1 -#define ACE_HAS_GETIFADDRS 1 -#define ACE_HAS_GETPAGESIZE 1 -#define ACE_HAS_GETRUSAGE 1 -#define ACE_HAS_GETRUSAGE_PROTOTYPE 1 -#define ACE_HAS_GNU_CSTRING_H 1 -#define ACE_HAS_GPERF 1 -#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT 1 -#define ACE_HAS_IP_MULTICAST 1 -#define ACE_HAS_MEMCHR 1 -#define ACE_HAS_MSG 1 -#define ACE_HAS_NEW_NOTHROW 1 -#define ACE_HAS_NEW_NO_H 1 -#define ACE_HAS_NONCONST_SELECT_TIMEVAL 1 -#define ACE_HAS_ONLY_SCHED_OTHER 1 -#define ACE_HAS_POLL 1 -#define ACE_HAS_POSITION_INDEPENDENT_POINTERS 1 -#define ACE_HAS_POSIX_NONBLOCK 1 -#define ACE_HAS_POSIX_TIME 1 -#define ACE_HAS_PTHREADS 1 -#define ACE_HAS_PTHREADS_STD 1 -#define ACE_HAS_PTHREADS_UNIX98_EXT 1 -#define ACE_HAS_PTHREAD_RESUME_NP 1 -#define ACE_HAS_PTHREAD_SUSPEND_NP 1 -#define ACE_HAS_P_READ_WRITE 1 -#define ACE_HAS_RECURSIVE_THR_EXIT_SEMANTICS 1 -#define ACE_HAS_REENTRANT_FUNCTIONS 1 -#define ACE_HAS_SIGACTION_CONSTP2 1 -#define ACE_HAS_SIGINFO_T 1 -#define ACE_HAS_SIGSUSPEND 1 -#define ACE_HAS_SIGTIMEDWAIT 1 -#define ACE_HAS_SIGWAIT 1 -#define ACE_HAS_SIG_ATOMIC_T 1 -#define ACE_HAS_SIG_C_FUNC 1 -#define ACE_HAS_SIN_LEN 1 -#define ACE_HAS_SNPRINTF 1 -#define ACE_HAS_SOCKADDR_MSG_NAME 1 -#define ACE_HAS_SOCKLEN_T 1 -#define ACE_HAS_SSIZE_T 1 -#define ACE_HAS_STANDARD_CPP_LIBRARY 1 -#define ACE_HAS_STDCPP_STL_INCLUDES 1 -#define ACE_HAS_STDEXCEPT_NO_H 1 -#define ACE_HAS_STD_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 1 -#define ACE_HAS_STD_TEMPLATE_SPECIALIZATION 1 -#define ACE_HAS_STRERROR 1 -#define ACE_HAS_STRINGS 1 -#define ACE_HAS_STRING_CLASS 1 -#define ACE_HAS_STRPTIME 1 -#define ACE_HAS_SVR4_DYNAMIC_LINKING 1 -#define ACE_HAS_SYSV_IPC 1 -#define ACE_HAS_SYS_ERRLIST 1 -#define ACE_HAS_SYS_FILIO_H 1 -#define ACE_HAS_SYS_IOCTL_H 1 -#define ACE_HAS_SYS_SIGLIST 1 -#define ACE_HAS_SYS_SOCKIO_H 1 -#define ACE_HAS_SYS_SYSCALL_H 1 -#define ACE_HAS_TEMPLATE_SPECIALIZATION 1 -#define ACE_HAS_TEMPLATE_TYPEDEFS 1 -#define ACE_HAS_THREADS 1 -#define ACE_HAS_THREAD_SPECIFIC_STORAGE 1 -#define ACE_HAS_TIMEZONE 1 -#define ACE_HAS_TIMEZONE_GETTIMEOFDAY 1 -#define ACE_HAS_TYPENAME_KEYWORD 1 -#define ACE_HAS_UALARM 1 -#define ACE_HAS_UCONTEXT_T 1 -#define ACE_HAS_USING_KEYWORD 1 -#define ACE_HAS_VOIDPTR_MMAP 1 -#define ACE_HAS_VOIDPTR_SOCKOPT 1 -#define ACE_HAS_WCHAR 1 -#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR 1 -#define ACE_HAS_XPG4_MULTIBYTE_CHAR 1 -#define ACE_IOCTL_TYPE_ARG2 u_long -#define ACE_LACKS_CONDATTR_PSHARED 1 -#define ACE_LACKS_GETHOSTENT 1 -#define ACE_LACKS_IOSTREAM_FX 1 -#define ACE_LACKS_ITOW 1 -#define ACE_LACKS_LINEBUFFERED_STREAMBUF 1 -#define ACE_LACKS_MSG_ACCRIGHTS 1 -#define ACE_LACKS_MUTEXATTR_PSHARED 1 -#define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS 1 -#define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 -#define ACE_LACKS_PRAGMA_ONCE 1 -#define ACE_LACKS_PRI_T 1 -#define ACE_LACKS_PTHREAD_THR_SIGSETMASK 1 -#define ACE_LACKS_PTHREAD_YIELD 1 -#define ACE_LACKS_PWD_REENTRANT_FUNCTIONS 1 -#define ACE_LACKS_RWLOCKATTR_PSHARED 1 -#define ACE_LACKS_RWLOCK_T 1 -#define ACE_LACKS_SETSCHED 1 -#define ACE_LACKS_SIGINFO_H 1 -#define ACE_LACKS_STROPTS_H 1 -#define ACE_LACKS_STRRECVFD 1 -#define ACE_LACKS_TIMEDWAIT_PROTOTYPES 1 -#define ACE_LACKS_TIMESPEC_T 1 -#define ACE_LACKS_UNBUFFERED_STREAMBUF 1 -#define ACE_LACKS_WCSDUP 1 -#define ACE_LACKS_WCSICMP 1 -#define ACE_LACKS_WCSNICMP 1 -#define ACE_MT_SAFE 1 -#define ACE_NEW_THROWS_EXCEPTIONS 1 -#define ACE_TEMPLATES_REQUIRE_SOURCE 1 -#define ACE_UINT64_TYPEDEF unsigned long long -#define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 - -typedef unsigned long long ACE_UINT64; - -#if defined(__x86_64__) -#define ACE_SIZEOF_DOUBLE 8 -#define ACE_SIZEOF_FLOAT 4 -#define ACE_SIZEOF_INT 4 -#define ACE_SIZEOF_LONG 8 -#define ACE_SIZEOF_LONG_DOUBLE 16 -#define ACE_SIZEOF_LONG_LONG 8 -#define ACE_SIZEOF_SHORT 2 -#define ACE_SIZEOF_VOID_P 8 -#define ACE_SIZEOF_WCHAR 4 -#define ACE_SSIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("%ld") -#define ACE_SIZE_T_FORMAT_SPECIFIER ACE_LIB_TEXT ("%lu") - -#elif defined(__i386__) -#define ACE_HAS_PENTIUM 1 - -#define ACE_SIZEOF_DOUBLE 8 -#define ACE_SIZEOF_FLOAT 4 -#define ACE_SIZEOF_INT 4 -#define ACE_SIZEOF_LONG 4 #define ACE_SIZEOF_LONG_DOUBLE 12 -#define ACE_SIZEOF_LONG_LONG 8 -#define ACE_SIZEOF_SHORT 2 -#define ACE_SIZEOF_VOID_P 4 -#define ACE_SIZEOF_WCHAR 4 -#else -# error unknown CPU architecture -#endif - -#endif /* ACE_CONFIG_H */ - -// Local Variables: -// mode:C++ -// End: + +#if defined (__GNUG__) +# include "ace/config-g++-common.h" +#endif /* __GNUG__ */ + +// #define ACE_HAS_BROKEN_NETBSD_MSYNC + +// Platform specific directives +#define ACE_LACKS_GETPGID +#define ACE_LACKS_SETPGID +#define ACE_LACKS_SETREGID +#define ACE_LACKS_SETREUID +#define ACE_LACKS_RWLOCK_T +#define ACE_HAS_SIG_MACROS +#define ACE_HAS_CHARPTR_DL +#define ACE_USES_ASM_SYMBOL_IN_DLSYM + +// NetBSD appears to have dirent support. +#define ACE_HAS_DIRENT + +// NetBSD appears to have a sigset_t type. +// #define ACE_LACKS_SIGSET + +// This is for 2.1.x only. By default, gcc defines __FreeBSD__ automatically +#if defined(FreeBSD_2_1) + +#define ACE_HAS_CPLUSPLUS_HEADERS + +// This is to fix the nested struct if_data definition on FreeBSD 2.1.x +#include <sys/types.h> +#include <sys/time.h> +struct if_data { +/* generic interface information */ + u_char ifi_type; /* ethernet, tokenring, etc */ + u_char ifi_physical; /* e.g., AUI, Thinnet, 10base-T, etc */ + u_char ifi_addrlen; /* media address length */ + u_char ifi_hdrlen; /* media header length */ + u_long ifi_mtu; /* maximum transmission unit */ + u_long ifi_metric; /* routing metric (external only) */ + u_long ifi_baudrate; /* linespeed */ +/* volatile statistics */ + u_long ifi_ipackets; /* packets received on interface */ + u_long ifi_ierrors; /* input errors on interface */ + u_long ifi_opackets; /* packets sent on interface */ + u_long ifi_oerrors; /* output errors on interface */ + u_long ifi_collisions; /* collisions on csma interfaces */ + u_long ifi_ibytes; /* total number of octets received */ + u_long ifi_obytes; /* total number of octets sent */ + u_long ifi_imcasts; /* packets received via multicast */ + u_long ifi_omcasts; /* packets sent via multicast */ + u_long ifi_iqdrops; /* dropped on input, this interface */ + u_long ifi_noproto; /* destined for unsupported protocol */ + struct timeval ifi_lastchange;/* time of last administrative ch +ange */ +} ; + +// this is a hack, but since this only occured in FreeBSD 2.1.x, +// I guess it is ok. +#define ACE_HAS_BROKEN_TIMESPEC_MEMBERS + +#endif /* defined FreeBSD_2_1 */ + +// Platform supports POSIX timers via struct timespec. +#define ACE_HAS_POSIX_TIME +#define ACE_HAS_UALARM + +// Platform defines struct timespec but not timespec_t +#define ACE_LACKS_TIMESPEC_T + +#define ACE_LACKS_SYSTIME_H + +#define ACE_LACKS_STRRECVFD + +#define ACE_HAS_SIN_LEN + +// Platform supports System V IPC (most versions of UNIX, but not Win32) +#define ACE_HAS_SYSV_IPC + +// Compiler/platform contains the <sys/syscall.h> file. +#define ACE_HAS_SYSCALL_H + +#if !defined(FreeBSD_2_1) +#define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES +#endif /* defined FreeBSD_2_1 */ + +// Compiler/platform supports SVR4 signal typedef +#define ACE_HAS_SVR4_SIGNAL_T + +// Compiler/platform supports alloca(). +// Although ACE does have alloca() on this compiler/platform combination, it is +// disabled by default since it can be dangerous. Uncomment the following line +// if you ACE to use it. +//#define ACE_HAS_ALLOCA + +// Compiler/platform supports SVR4 dynamic linking semantics.. +#define ACE_HAS_SVR4_DYNAMIC_LINKING + +// Compiler/platform correctly calls init()/fini() for shared libraries. +#define ACE_HAS_AUTOMATIC_INIT_FINI + +// Explicit dynamic linking permits "lazy" symbol resolution +#define ACE_HAS_RTLD_LAZY_V + +// platform supports POSIX O_NONBLOCK semantics +#define ACE_HAS_POSIX_NONBLOCK + +// platform supports IP multicast +#define ACE_HAS_IP_MULTICAST + +// Lacks perfect filtering, must bind group address. +#if !defined ACE_LACKS_PERFECT_MULTICAST_FILTERING +# define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 +#endif /* ACE_LACKS_PERFECT_MULTICAST_FILTERING */ + +// Compiler/platform has <alloca.h> +//#define ACE_HAS_ALLOCA_H + +// Compiler/platform has the getrusage() system call. +#define ACE_HAS_GETRUSAGE + +// Compiler/platform defines the sig_atomic_t typedef. +#define ACE_HAS_SIG_ATOMIC_T + +// Compiler/platform supports sys_siglist array. +// *** This refers to (_sys_siglist) instead of (sys_siglist) +// #define ACE_HAS_SYS_SIGLIST + +// Compiler/platform defines a union semun for SysV shared memory. +#define ACE_HAS_SEMUN + +// Compiler supports the ssize_t typedef. +#define ACE_HAS_SSIZE_T + +// Compiler/platform supports strerror (). +#define ACE_HAS_STRERROR + +// Compiler/platform provides the sockio.h file. +#define ACE_HAS_SOCKIO_H + +// Defines the page size of the system. +#define ACE_PAGE_SIZE 4096 + +// Platform provides <sys/filio.h> header. +#define ACE_HAS_SYS_FILIO_H + +// Platform/compiler supports timezone * as second parameter to gettimeofday(). +#define ACE_HAS_TIMEZONE_GETTIMEOFDAY + +#define ACE_HAS_MSG +#define ACE_HAS_4_4BSD_SENDMSG_RECVMSG + +// Optimize ACE_Handle_Set for select(). +#define ACE_HAS_HANDLE_SET_OPTIMIZED_FOR_SELECT + +#define ACE_LACKS_GETHOSTENT + +#include /**/ "ace/post.h" +#endif /* ACE_CONFIG_H */ diff --git a/ace/config-openbsd.h b/ace/config-openbsd.h index 1894a3da92d..88b464a43f9 100644 --- a/ace/config-openbsd.h +++ b/ace/config-openbsd.h @@ -111,7 +111,7 @@ #define ACE_HAS_SYSV_IPC // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // OpenBSD supports the getifaddrs interface #define ACE_HAS_GETIFADDRS @@ -169,7 +169,7 @@ #define ACE_HAS_STRERROR // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Defines the page size of the system. #define ACE_PAGE_SIZE 4096 @@ -230,6 +230,8 @@ // bogus compiler syntax error. #define ACE_LACKS_CLEARERR +#define ACE_HAS_MKSTEMP + #define ACE_HAS_SNPRINTF // OpenBSD 3.2 lacks sched_setscheduler (see /usr/src/lib/libc_r/TODO) diff --git a/ace/config-openvms.h b/ace/config-openvms.h index 797db7091ca..8a103c8f815 100644 --- a/ace/config-openvms.h +++ b/ace/config-openvms.h @@ -21,18 +21,108 @@ //#define MAXHOSTNAMELEN 255 //#define MAXNAMLEN FILENAME_MAX //#define __unix__ - -// OpenVMS does not support symlinks and does not define this. -// Defining this as 0 effectively cancels out the one bit of code using this in -// OS_NS_stdlib.cpp. -#define MAXSYMLINKS 0 - #define ACE_OPENVMS #define ACE_DLL_SUFFIX ACE_LIB_TEXT("") #define ACE_HAS_DUMP 1 -//#define ACE_NEEDS_PTHREAD_UPPERCASE 1 +/* +** These defines take care of the upper/lower casing problem that occurs +** if you are using pthreads and are compiling /NAMES=AS_IS (which is necessary for ACE/TAO) +** +** Note that it does NOT take care of any argument differences between +** the various implementations of pthreads. +*/ + +#define pthread_attr_create PTHREAD_ATTR_CREATE +#define pthread_attr_delete PTHREAD_ATTR_DELETE +#define pthread_attr_destroy PTHREAD_ATTR_DESTROY +#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP +#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP +#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED +#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO +#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED +#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM +#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE +#define pthread_attr_init PTHREAD_ATTR_INIT +#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP +#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE +#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP +#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED +#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO +#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED +#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM +#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY +#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE +#define pthread_cancel PTHREAD_CANCEL +#define pthread_cancel_e PTHREAD_CANCEL_E +#define pthread_cond_broadcast PTHREAD_COND_BROADCAST +#define pthread_cond_destroy PTHREAD_COND_DESTROY +#define pthread_cond_init PTHREAD_COND_INIT +#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP +#define pthread_cond_signal PTHREAD_COND_SIGNAL +#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP +#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT +#define pthread_cond_wait PTHREAD_COND_WAIT +#define pthread_condattr_create PTHREAD_CONDATTR_CREATE +#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE +#define pthread_condattr_init PTHREAD_CONDATTR_INIT +#define pthread_create PTHREAD_CREATE +#define pthread_delay_np PTHREAD_DELAY_NP +#define pthread_detach PTHREAD_DETACH +#define pthread_equal PTHREAD_EQUAL +#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP +#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP +#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP +#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP +#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP +#define pthread_exit PTHREAD_EXIT +#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP +#define pthread_getprio PTHREAD_GETPRIO +#define pthread_getschedparam PTHREAD_GETSCHEDPARAM +#define pthread_getscheduler PTHREAD_GETSCHEDULER +#define pthread_getspecific PTHREAD_GETSPECIFIC +#define pthread_getunique_np PTHREAD_GETUNIQUE_NP +#define pthread_join PTHREAD_JOIN +#define pthread_join32 PTHREAD_JOIN32 +#define pthread_keycreate PTHREAD_KEYCREATE +#define pthread_key_create PTHREAD_KEY_CREATE +#define pthread_kill PTHREAD_KILL +#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP +#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY +#define pthread_mutex_init PTHREAD_MUTEX_INIT +#define pthread_mutex_lock PTHREAD_MUTEX_LOCK +#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK +#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK +#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE +#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE +#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY +#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP +#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT +#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP +#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP +#define pthread_once PTHREAD_ONCE +#define pthread_resume_np PTHREAD_RESUME_NP +#define pthread_self PTHREAD_SELF +#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL +#define pthread_setcancel PTHREAD_SETCANCEL +#define pthread_setcancelstate PTHREAD_SETCANCELSTATE +#define pthread_setprio PTHREAD_SETPRIO +#define pthread_setschedparam PTHREAD_SETSCHEDPARAM +#define pthread_setscheduler PTHREAD_SETSCHEDULER +#define pthread_setspecific PTHREAD_SETSPECIFIC +#define pthread_suspend_np PTHREAD_SUSPEND_NP +#define pthread_testcancel PTHREAD_TESTCANCEL +#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP +#define pthread_yield PTHREAD_YIELD +#define pthread_yield_np PTHREAD_YIELD_NP + +/* new for OpenVMS 7.3.2 ECO 1 */ +#define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE +#define pthread_attr_setstackaddr PTHREAD_ATTR_SETSTACKADDR +#define pthread_condattr_destroy PTHREAD_CONDATTR_DESTROY +#define pthread_key_delete PTHREAD_KEY_DELETE +#define pthread_setcanceltype PTHREAD_SETCANCELTYPE /* #define XtAppAddInput XTAPPADDINPUT @@ -72,8 +162,6 @@ #define ACE_LACKS_SETSID 1 #define ACE_LACKS_FCNTL 1 -#define ACE_LACKS_REALPATH 1 - #define ACE_LACKS_TIMESPEC_T 1 #define ACE_LACKS_CONST_TIMESPEC_PTR 1 @@ -89,8 +177,6 @@ #define ACE_LACKS_PWD_REENTRANT_FUNCTIONS 1 #define ACE_LACKS_RAND_REENTRANT_FUNCTIONS 1 -#define ACE_LACKS_UNIX_SIGNALS 1 - #define ACE_MT_SAFE 1 /*Compile using multi-thread libraries*/ #define ACE_NEW_THROWS_EXCEPTIONS 1 @@ -104,8 +190,6 @@ #define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 /*Platform has its standard c++ library in the namespace std.*/ -#define ACE_HAS_VOIDPTR_GETTIMEOFDAY 1 - /* 2nd arg 'void*' instead of 'struct timezone*' */ #define ACE_HAS_SNPRINTF 1 /*Platform offers snprintf().*/ #define ACE_HAS_P_READ_WRITE @@ -211,8 +295,6 @@ #define ACE_HAS_SIGWAIT 1 /*Platform/compiler has the sigwait(2) prototype*/ -#define ACE_HAS_SIGTIMEDWAIT 1 - #define ACE_HAS_SIG_C_FUNC 1 /*Compiler requires extern "C" functions for signals.*/ @@ -244,9 +326,6 @@ #define ACE_HAS_TEMPLATE_SPECIALIZATION 1 /*Compiler implements template specialization*/ - -#define ACE_HAS_STD_TEMPLATE_CLASS_MEMBER_SPECIALIZATION 1 - #define ACE_HAS_TEMPLATE_TYPEDEFS 1 /*Compiler implements templates that support typedefs inside @@ -266,6 +345,10 @@ /*The pthread_create() routine *must* take extern C functions.*/ +#define ACE_HAS_TIMEZONE_GETTIMEOFDAY + /*Platform/compiler supports + timezone * as second parameter + to gettimeofday()*/ #define ACE_HAS_UALARM 1 /*Platform supports ualarm()*/ #define ACE_HAS_USING_KEYWORD 1 @@ -300,7 +383,7 @@ gethostbyaddr_r, gethostbyname_r, getservbyname_r).*/ -#define ACE_LACKS_SYS_PARAM_H 1 +#define ACE_LACKS_PARAM_H 1 /*Platform lacks <sys/param.h> (e.g., MVS)*/ #define ACE_LACKS_PRI_T 1 @@ -360,107 +443,4 @@ #define ACE_NEEDS_HUGE_THREAD_STACKSIZE (64U*1024) /*Required by platforms with small default stacks.*/ - -#ifdef ACE_NEEDS_PTHREAD_UPPERCASE - -/* -** These defines take care of the upper/lower casing problem that occurs -** if you are using pthreads and are compiling /NAMES=AS_IS (which is necessary for ACE/TAO) -** -** Note that it does NOT take care of any argument differences between -** the various implementations of pthreads. -*/ - -#define pthread_attr_create PTHREAD_ATTR_CREATE -#define pthread_attr_delete PTHREAD_ATTR_DELETE -#define pthread_attr_destroy PTHREAD_ATTR_DESTROY -#define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP -#define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP -#define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED -#define pthread_attr_getprio PTHREAD_ATTR_GETPRIO -#define pthread_attr_getsched PTHREAD_ATTR_GETSCHED -#define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM -#define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE -#define pthread_attr_init PTHREAD_ATTR_INIT -#define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP -#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE -#define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP -#define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED -#define pthread_attr_setprio PTHREAD_ATTR_SETPRIO -#define pthread_attr_setsched PTHREAD_ATTR_SETSCHED -#define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM -#define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY -#define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE -#define pthread_cancel PTHREAD_CANCEL -#define pthread_cancel_e PTHREAD_CANCEL_E -#define pthread_cond_broadcast PTHREAD_COND_BROADCAST -#define pthread_cond_destroy PTHREAD_COND_DESTROY -#define pthread_cond_init PTHREAD_COND_INIT -#define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP -#define pthread_cond_signal PTHREAD_COND_SIGNAL -#define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP -#define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT -#define pthread_cond_wait PTHREAD_COND_WAIT -#define pthread_condattr_create PTHREAD_CONDATTR_CREATE -#define pthread_condattr_delete PTHREAD_CONDATTR_DELETE -#define pthread_condattr_init PTHREAD_CONDATTR_INIT -#define pthread_create PTHREAD_CREATE -#define pthread_delay_np PTHREAD_DELAY_NP -#define pthread_detach PTHREAD_DETACH -#define pthread_equal PTHREAD_EQUAL -#define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP -#define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP -#define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP -#define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP -#define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP -#define pthread_exit PTHREAD_EXIT -#define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP -#define pthread_getprio PTHREAD_GETPRIO -#define pthread_getschedparam PTHREAD_GETSCHEDPARAM -#define pthread_getscheduler PTHREAD_GETSCHEDULER -#define pthread_getspecific PTHREAD_GETSPECIFIC -#define pthread_getunique_np PTHREAD_GETUNIQUE_NP -#define pthread_join PTHREAD_JOIN -#define pthread_join32 PTHREAD_JOIN32 -#define pthread_keycreate PTHREAD_KEYCREATE -#define pthread_key_create PTHREAD_KEY_CREATE -#define pthread_kill PTHREAD_KILL -#define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP -#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY -#define pthread_mutex_init PTHREAD_MUTEX_INIT -#define pthread_mutex_lock PTHREAD_MUTEX_LOCK -#define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK -#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK -#define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE -#define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE -#define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY -#define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP -#define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT -#define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP -#define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP -#define pthread_once PTHREAD_ONCE -#define pthread_resume_np PTHREAD_RESUME_NP -#define pthread_self PTHREAD_SELF -#define pthread_setasynccancel PTHREAD_SETASYNCCANCEL -#define pthread_setcancel PTHREAD_SETCANCEL -#define pthread_setcancelstate PTHREAD_SETCANCELSTATE -#define pthread_setprio PTHREAD_SETPRIO -#define pthread_setschedparam PTHREAD_SETSCHEDPARAM -#define pthread_setscheduler PTHREAD_SETSCHEDULER -#define pthread_setspecific PTHREAD_SETSPECIFIC -#define pthread_suspend_np PTHREAD_SUSPEND_NP -#define pthread_testcancel PTHREAD_TESTCANCEL -#define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP -#define pthread_yield PTHREAD_YIELD -#define pthread_yield_np PTHREAD_YIELD_NP - -/* new for OpenVMS 7.3.2 ECO 1 */ -#define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE -#define pthread_attr_setstackaddr PTHREAD_ATTR_SETSTACKADDR -#define pthread_condattr_destroy PTHREAD_CONDATTR_DESTROY -#define pthread_key_delete PTHREAD_KEY_DELETE -#define pthread_setcanceltype PTHREAD_SETCANCELTYPE - -#endif // if ACE_NEEDS_PTHREAD_UPPERCASE - #endif diff --git a/ace/config-osf1-3.2.h b/ace/config-osf1-3.2.h index 5b947116f63..4fe6d10fb79 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_NONCONST_SENDMSG +#define ACE_HAS_BROKEN_SENDMSG // Platform's implementation of writev() has a non-const iovec parameter. -#define ACE_HAS_NONCONST_WRITEV +#define ACE_HAS_BROKEN_WRITEV // Platform's implementation of setlrmit() has a non-const rlimit parameter. -#define ACE_HAS_NONCONST_SETRLIMIT +#define ACE_HAS_BROKEN_SETRLIMIT // Platform supports System V IPC (most versions of UNIX, but not Win32) #define ACE_HAS_SYSV_IPC @@ -76,7 +76,7 @@ extern "C" pid_t getpgid (pid_t); #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform correctly calls init()/fini(). #define ACE_HAS_AUTOMATIC_INIT_FINI diff --git a/ace/config-osf1-4.0.h b/ace/config-osf1-4.0.h index 51ddb61800a..a070449e84c 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_NONCONST_SETRLIMIT +#define ACE_HAS_BROKEN_SETRLIMIT #define ACE_HAS_BROKEN_T_ERROR -#define ACE_HAS_NONCONST_WRITEV +#define ACE_HAS_BROKEN_WRITEV #define ACE_HAS_CLOCK_GETTIME #define ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES #define ACE_HAS_CPLUSPLUS_HEADERS @@ -153,7 +153,7 @@ #define ACE_HAS_STRPTIME #define ACE_HAS_SVR4_DYNAMIC_LINKING #define ACE_HAS_SVR4_SIGNAL_T -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H #define ACE_HAS_SYSV_IPC #if (ACE_MT_SAFE == 0) // clearerr is not defined when _REENTRANT is not defined @@ -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_NONCONST_SENDMSG +#define ACE_HAS_BROKEN_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 daa02b75560..cf9a689f2e5 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_NONCONST_SENDMSG */ +/* #define ACE_HAS_BROKEN_SENDMSG */ -/* #define ACE_HAS_NONCONST_WRITEV */ +/* #define ACE_HAS_BROKEN_WRITEV */ #define ACE_HAS_BROKEN_CONVERSIONS @@ -175,12 +175,14 @@ #define ACE_LACKS_MSYNC -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_PWD_FUNCTIONS #define ACE_LACKS_RLIMIT +#define ACE_LACKS_RPC_H + #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SBRK diff --git a/ace/config-psos-diab-ppc.h b/ace/config-psos-diab-ppc.h index 9347e12861c..98dd63db07e 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_NONCONST_SENDMSG */ +/* #define ACE_HAS_BROKEN_SENDMSG */ -/* #define ACE_HAS_NONCONST_WRITEV */ +/* #define ACE_HAS_BROKEN_WRITEV */ #define ACE_HAS_BROKEN_CONVERSIONS @@ -183,7 +183,7 @@ #define ACE_LACKS_MSYNC -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_PWD_FUNCTIONS diff --git a/ace/config-psos-diab.h b/ace/config-psos-diab.h index 842cd7a00c3..857647ebd2b 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_NONCONST_SENDMSG */ +/* #define ACE_HAS_BROKEN_SENDMSG */ -/* #define ACE_HAS_NONCONST_WRITEV */ +/* #define ACE_HAS_BROKEN_WRITEV */ #define ACE_HAS_BROKEN_CONVERSIONS @@ -166,7 +166,7 @@ #define ACE_LACKS_MSYNC -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_PWD_FUNCTIONS diff --git a/ace/config-psos-tm.h b/ace/config-psos-tm.h index 917ee850c71..50696703dbe 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_NONCONST_SENDMSG */ +/* #define ACE_HAS_BROKEN_SENDMSG */ -/* #define ACE_HAS_NONCONST_WRITEV */ +/* #define ACE_HAS_BROKEN_WRITEV */ #define ACE_HAS_BROKEN_CONVERSIONS @@ -135,7 +135,7 @@ #define ACE_LACKS_MSYNC -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_PWD_FUNCTIONS diff --git a/ace/config-psosim-g++.h b/ace/config-psosim-g++.h index b6d83a38ffa..3e0ecb11b70 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_NONCONST_SENDMSG */ +/* #define ACE_HAS_BROKEN_SENDMSG */ -/* #define ACE_HAS_NONCONST_WRITEV */ +/* #define ACE_HAS_BROKEN_WRITEV */ #define ACE_HAS_CHARPTR_SOCKOPT @@ -177,7 +177,7 @@ #define ACE_LACKS_MSYNC -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_PWD_FUNCTIONS diff --git a/ace/config-qnx-neutrino.h b/ace/config-qnx-neutrino.h index fc2f55d1968..5c92d03875f 100644 --- a/ace/config-qnx-neutrino.h +++ b/ace/config-qnx-neutrino.h @@ -110,6 +110,7 @@ #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS #define ACE_LACKS_PTHREAD_THR_SIGSETMASK +#define ACE_LACKS_RPC_H #define ACE_LACKS_RTTI #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SBRK diff --git a/ace/config-qnx-rtp-62x.h b/ace/config-qnx-rtp-62x.h index c24ff841715..c01295ad7aa 100644 --- a/ace/config-qnx-rtp-62x.h +++ b/ace/config-qnx-rtp-62x.h @@ -85,6 +85,7 @@ #define ACE_LACKS_PERFECT_MULTICAST_FILTERING 1 #define ACE_LACKS_POLL_H #define ACE_LACKS_PTHREAD_THR_SIGSETMASK +#define ACE_LACKS_RPC_H #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SOCKET_BUFSIZ #define ACE_LACKS_STREAM_MODULES diff --git a/ace/config-qnx-rtp-pre62x.h b/ace/config-qnx-rtp-pre62x.h index c2afa521c55..6239520ec06 100644 --- a/ace/config-qnx-rtp-pre62x.h +++ b/ace/config-qnx-rtp-pre62x.h @@ -83,6 +83,7 @@ #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS #define ACE_LACKS_PTHREAD_THR_SIGSETMASK +#define ACE_LACKS_RPC_H #define ACE_LACKS_RTTI #define ACE_LACKS_RWLOCK_T #define ACE_LACKS_SBRK diff --git a/ace/config-rtems.h b/ace/config-rtems.h index 291a55854d6..51abb8be168 100644 --- a/ace/config-rtems.h +++ b/ace/config-rtems.h @@ -87,7 +87,7 @@ #define ACE_LACKS_EXEC #define ACE_LACKS_FILELOCKS #define ACE_LACKS_FORK -#define ACE_LACKS_GETOPT_PROTOTYPE +#define ACE_LACKS_GETOPT_PROTO #define ACE_LACKS_GETPGID #define ACE_LACKS_TIMESPEC_T #define ACE_LACKS_MADVISE @@ -99,7 +99,7 @@ #define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_LACKS_READDIR_R #define ACE_LACKS_READLINK -#define ACE_HAS_NONCONST_READV +#define ACE_HAS_BROKEN_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_NONCONST_WRITEV +#define ACE_HAS_BROKEN_WRITEV #define ACE_LACKS_WRITEV #define ACE_NEEDS_HUGE_THREAD_STACKSIZE 65536 #define ACE_NEEDS_SCHED_H diff --git a/ace/config-sco-4.2-nothread.h b/ace/config-sco-4.2-nothread.h index 67ff29a6333..ba10b484f46 100644 --- a/ace/config-sco-4.2-nothread.h +++ b/ace/config-sco-4.2-nothread.h @@ -55,7 +55,7 @@ //#define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -//#define ACE_HAS_SYS_SYSCALL_H +//#define ACE_HAS_SYSCALL_H // Fixes a problem with HP/UX not wrapping the mmap(2) header files // with extern "C". @@ -91,6 +91,9 @@ // Platform/compiler supports void * as second parameter to gettimeofday(). #define ACE_HAS_VOIDPTR_GETTIMEOFDAY +// HP/UX has an undefined syscall for GETRUSAGE... +//#define ACE_HAS_SYSCALL_GETRUSAGE + // Note, this only works if the flag is set above! //#define ACE_HAS_GETRUSAGE diff --git a/ace/config-sco-5.0.0-mit-pthread.h b/ace/config-sco-5.0.0-mit-pthread.h index 29797535bd2..fc43c24f358 100644 --- a/ace/config-sco-5.0.0-mit-pthread.h +++ b/ace/config-sco-5.0.0-mit-pthread.h @@ -58,7 +58,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -//#define ACE_HAS_SYS_SYSCALL_H +//#define ACE_HAS_SYSCALL_H // Fixes a problem with HP/UX not wrapping the mmap(2) header files // with extern "C". @@ -95,6 +95,9 @@ // #define ACE_HAS_VOIDPTR_GETTIMEOFDAY #define ACE_HAS_TIMEZONE_GETTIMEOFDAY +// HP/UX has an undefined syscall for GETRUSAGE... +//#define ACE_HAS_SYSCALL_GETRUSAGE + // Note, this only works if the flag is set above! //#define ACE_HAS_GETRUSAGE diff --git a/ace/config-sco-5.0.0.h b/ace/config-sco-5.0.0.h index 1820a96f3ca..a5d94c82cb3 100644 --- a/ace/config-sco-5.0.0.h +++ b/ace/config-sco-5.0.0.h @@ -39,7 +39,7 @@ #define ACE_HAS_TERM_IOCTLS // Compiler/platform contains the <sys/syscall.h> file. -//#define ACE_HAS_SYS_SYSCALL_H +//#define ACE_HAS_SYSCALL_H // Fixes a problem with HP/UX not wrapping the mmap(2) header files // with extern "C". @@ -74,6 +74,9 @@ #define ACE_HAS_TIMEZONE_GETTIMEOFDAY +// HP/UX has an undefined syscall for GETRUSAGE... +//#define ACE_HAS_SYSCALL_GETRUSAGE + // Note, this only works if the flag is set above! //#define ACE_HAS_GETRUSAGE diff --git a/ace/config-sunos4-g++.h b/ace/config-sunos4-g++.h index 29e62b6dc69..21663d0cfe7 100644 --- a/ace/config-sunos4-g++.h +++ b/ace/config-sunos4-g++.h @@ -38,7 +38,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform has the getrusage() system call. #define ACE_HAS_GETRUSAGE @@ -63,7 +63,7 @@ #define ACE_HAS_SEMUN // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler/platform supports struct strbuf #define ACE_HAS_STRBUF_T diff --git a/ace/config-sunos4-lucid3.2.h b/ace/config-sunos4-lucid3.2.h index c4ec4919a5d..062699f983a 100644 --- a/ace/config-sunos4-lucid3.2.h +++ b/ace/config-sunos4-lucid3.2.h @@ -24,7 +24,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform supports alloca() // Although ACE does have alloca() on this compiler/platform combination, it is @@ -54,7 +54,7 @@ #define ACE_HAS_SEMUN // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler/platform supports struct strbuf #define ACE_HAS_STRBUF_T diff --git a/ace/config-sunos4-sun3.x.h b/ace/config-sunos4-sun3.x.h index 2a6fd6cde09..0ee548bff80 100644 --- a/ace/config-sunos4-sun3.x.h +++ b/ace/config-sunos4-sun3.x.h @@ -25,7 +25,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform has the getrusage() system call. #define ACE_HAS_GETRUSAGE @@ -46,7 +46,7 @@ #define ACE_HAS_SEMUN // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler/platform supports struct strbuf #define ACE_HAS_STRBUF_T diff --git a/ace/config-sunos4-sun4.1.4.h b/ace/config-sunos4-sun4.1.4.h index 2783cd42875..aa75e37665a 100644 --- a/ace/config-sunos4-sun4.1.4.h +++ b/ace/config-sunos4-sun4.1.4.h @@ -26,7 +26,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform has the getrusage() system call. #define ACE_HAS_GETRUSAGE @@ -51,7 +51,7 @@ #define ACE_HAS_SEMUN // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler has brain-damaged SPARCwork signal prototype... #define ACE_HAS_SPARCWORKS_401_SIGNALS diff --git a/ace/config-sunos4-sun4.x.h b/ace/config-sunos4-sun4.x.h index f3ed77a046d..ee3e46e1a5c 100644 --- a/ace/config-sunos4-sun4.x.h +++ b/ace/config-sunos4-sun4.x.h @@ -31,7 +31,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform has the getrusage() system call. #define ACE_HAS_GETRUSAGE @@ -56,7 +56,7 @@ #define ACE_HAS_SEMUN // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler has brain-damaged SPARCwork signal prototype... #define ACE_HAS_SPARCWORKS_401_SIGNALS diff --git a/ace/config-sunos5.4-centerline-2.x.h b/ace/config-sunos5.4-centerline-2.x.h index 9d827efe50a..3e078451f10 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_NONCONST_SENDMSG +#define ACE_HAS_BROKEN_SENDMSG // The SunOS 5.x version of rand_r is inconsistent with the header files... #define ACE_HAS_BROKEN_RANDR @@ -36,7 +36,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Platform has terminal ioctl flags like TCGETS and TCSETS. #define ACE_HAS_TERM_IOCTLS @@ -76,7 +76,7 @@ #define ACE_HAS_UCONTEXT_T // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T diff --git a/ace/config-sunos5.4-g++.h b/ace/config-sunos5.4-g++.h index 4a75f7feb77..4d0217cdc40 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_NONCONST_SENDMSG +#define ACE_HAS_BROKEN_SENDMSG // The SunOS 5.x version of rand_r is inconsistent with the header files... #define ACE_HAS_BROKEN_RANDR @@ -47,7 +47,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Compiler/platform correctly calls init()/fini() for shared libraries. #define ACE_HAS_AUTOMATIC_INIT_FINI @@ -93,7 +93,7 @@ #define ACE_HAS_UCONTEXT_T // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T diff --git a/ace/config-sunos5.4-sunc++-4.x.h b/ace/config-sunos5.4-sunc++-4.x.h index ea80d7c51c1..b52eae3f9e6 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_NONCONST_SENDMSG +#define ACE_HAS_BROKEN_SENDMSG // The SunOS 5.x version of rand_r is inconsistent with the header files... #define ACE_HAS_BROKEN_RANDR @@ -41,7 +41,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Platform has terminal ioctl flags like TCGETS and TCSETS. #define ACE_HAS_TERM_IOCTLS @@ -90,7 +90,7 @@ #define ACE_HAS_UCONTEXT_T // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T diff --git a/ace/config-sunos5.5.h b/ace/config-sunos5.5.h index 65986361746..af4e2634591 100644 --- a/ace/config-sunos5.5.h +++ b/ace/config-sunos5.5.h @@ -175,7 +175,7 @@ #define ACE_HAS_MSG // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Platform has terminal ioctl flags like TCGETS and TCSETS. #define ACE_HAS_TERM_IOCTLS @@ -229,7 +229,7 @@ #define ACE_HAS_UCONTEXT_T // Compiler/platform provides the sockio.h file. -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler supports the ssize_t typedef. #define ACE_HAS_SSIZE_T diff --git a/ace/config-sunos5.8.h b/ace/config-sunos5.8.h index 1a2595ad992..de6803e9822 100644 --- a/ace/config-sunos5.8.h +++ b/ace/config-sunos5.8.h @@ -11,12 +11,6 @@ // #include the SunOS 5.7 config, then add any SunOS 5.8 updates below. #include "ace/config-sunos5.7.h" -// This may be true for versions prior to Solaris 8 as well, but I don't -// have any to try it on. -#if !defined (ACE_HAS_TIMEZONE) -# define ACE_HAS_TIMEZONE -#endif - // The range of thread priorities for 5.8 differs from 5.7 in the // minimum priority for the SCHED_OTHER policy (i.e., // ACE_THR_PRI_OTHER_MIN) diff --git a/ace/config-tandem-nsk-mips-v2.h b/ace/config-tandem-nsk-mips-v2.h index d37a2769ce3..5996dad3f32 100644 --- a/ace/config-tandem-nsk-mips-v2.h +++ b/ace/config-tandem-nsk-mips-v2.h @@ -274,7 +274,7 @@ extern int cma_sigwait (sigset_t *); //========================================================================= // Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H // Platform lacks malloc.h #define ACE_LACKS_MALLOC_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_NONCONST_WRITEV +#define ACE_HAS_BROKEN_WRITEV // Platform lacks <stdint.h> #define ACE_LACKS_STDINT_H diff --git a/ace/config-tandem.h b/ace/config-tandem.h index fe25aef308a..dac4b85a623 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_NONCONST_SENDMSG +#define ACE_HAS_BROKEN_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 @@ -52,7 +52,7 @@ #define ACE_HAS_MSG //Compiler/platform contains the <sys/syscall.h> file. -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H //Platform provides <sysent.h> header #define ACE_HAS_SYSENT_H @@ -116,7 +116,7 @@ #define ACE_HAS_SIGWAIT //Compiler/platform provides the sockio.h file -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H // Compiler supports the ssize_t typedef #define ACE_HAS_SSIZE_T // Limits.h must be included @@ -272,9 +272,9 @@ // files with extern "C". //ACE_HAS_BROKEN_POSIX_TIME Platform defines struct timespec in // <sys/timers.h> -//ACE_HAS_NONCONST_SETRLIMIT OS/compiler omits the const from the +//ACE_HAS_BROKEN_SETRLIMIT OS/compiler omits the const from the // rlimit parameter in the setrlimit() prototype. -//ACE_HAS_NONCONST_WRITEV OS/compiler omits the const from the +//ACE_HAS_BROKEN_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) @@ -327,6 +327,8 @@ //? ACE_HAS_STRUCT_NETDB_DATA Compiler/platform has strange // hostent API for socket *_r() calls //ACE_HAS_VOIDPTR_GETTIMEOFDAY +//? ACE_HAS_SYSCALL_GETRUSAGE HP/UX has an undefined syscall for +//GETRUSAGE... //ACE_HAS_TEMPLATE_TYPEDEFS Compiler implements templates that // support typedefs inside of classes used as formal arguments to a template // class. @@ -368,7 +370,7 @@ //ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support reentrant // netdb functions (getprotobyname_r, getprotobynumber_r, gethostbyaddr_r, // gethostbyname_r, getservbyname_r). -//ACE_LACKS_SYS_PARAM_H Platform lacks <sys/param.h> (e.g., +//ACE_LACKS_PARAM_H Platform lacks <sys/param.h> (e.g., //MVS) //certain System V functions like shared memory and message queues. //ACE_LACKS_RECVMSG Platform lacks recvmsg() (e.g., Linux) diff --git a/ace/config-unixware-2.01-g++.h b/ace/config-unixware-2.01-g++.h index ebfd2b9af31..a9b83075a08 100644 --- a/ace/config-unixware-2.01-g++.h +++ b/ace/config-unixware-2.01-g++.h @@ -40,12 +40,13 @@ #define ACE_HAS_POSIX_TIME #define ACE_HAS_REENTRANT_FUNCTIONS #define ACE_HAS_REGEX +#define ACE_HAS_LAZY_V #define ACE_HAS_SELECT_H #define ACE_HAS_SIGINFO_T #define ACE_HAS_UCONTEXT_T #define ACE_HAS_SIGWAIT #define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H #define ACE_HAS_SSIZE_T #define ACE_HAS_STHREADS #define ACE_HAS_THR_KEYDELETE @@ -54,7 +55,7 @@ #define ACE_HAS_STREAM_PIPES #define ACE_HAS_STRERROR #define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H #define ACE_HAS_SYSINFO #define ACE_HAS_SYSV_IPC #define ACE_HAS_SYS_FILIO_H diff --git a/ace/config-unixware-2.1.2-g++.h b/ace/config-unixware-2.1.2-g++.h index 31587be6605..5f8046dd2e1 100644 --- a/ace/config-unixware-2.1.2-g++.h +++ b/ace/config-unixware-2.1.2-g++.h @@ -42,12 +42,13 @@ #define ACE_LACKS_TIMESPEC_T #define ACE_HAS_REENTRANT_FUNCTIONS #define ACE_HAS_REGEX +#define ACE_HAS_LAZY_V #define ACE_HAS_SELECT_H #define ACE_HAS_SIGINFO_T #define ACE_HAS_UCONTEXT_T #define ACE_HAS_SIGWAIT #define ACE_HAS_SIG_ATOMIC_T -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H #define ACE_HAS_SSIZE_T #define ACE_HAS_STHREADS #define ACE_HAS_THR_KEYDELETE @@ -56,7 +57,7 @@ #define ACE_HAS_STREAM_PIPES #define ACE_HAS_STRERROR #define ACE_HAS_SVR4_DYNAMIC_LINKING -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H #define ACE_HAS_SYSINFO #define ACE_HAS_SYSV_IPC #define ACE_HAS_SYS_FILIO_H diff --git a/ace/config-unixware-7.1.0.h b/ace/config-unixware-7.1.0.h index 33fd6dd4df6..673f5c24561 100644 --- a/ace/config-unixware-7.1.0.h +++ b/ace/config-unixware-7.1.0.h @@ -36,6 +36,7 @@ #define ACE_HAS_NEW_NO_H 1 #define ACE_HAS_STDEXCEPT_NO_H 1 +#define ACE_HAS_IOMANIP_NO_H 1 /* Platform provides <sys/ioctl.h> header */ #define ACE_HAS_SYS_IOCTL_H 1 @@ -118,7 +119,7 @@ /* Platform has a getrusage () prototype in sys/resource.h that differs from the one in ace/OS.i. */ -#define ACE_HAS_GETRUSAGE_PROTOTYPE 1 +#define ACE_HAS_GETRUSAGE_PROTO 1 /* Denotes that GNU has cstring.h as standard which redefines memchr() */ #define ACE_HAS_GNU_CSTRING_H @@ -228,7 +229,7 @@ #define ACE_HAS_SIZET_SOCKET_LEN 1 /* Compiler/platform provides the sys/sockio.h file */ -#define ACE_HAS_SYS_SOCKIO_H 1 +#define ACE_HAS_SOCKIO_H 1 /* Compiler supports the ssize_t typedef */ #define ACE_HAS_SSIZE_T 1 @@ -267,7 +268,7 @@ #define ACE_HAS_SVR4_TLI 1 /* Compiler/platform contains the <sys/syscall.h> file. */ -#define ACE_HAS_SYS_SYSCALL_H 1 +#define ACE_HAS_SYSCALL_H 1 /* Platform supports system configuration information */ #define ACE_HAS_SYSINFO 1 diff --git a/ace/config-unixware-7.1.0.udk.h b/ace/config-unixware-7.1.0.udk.h index 15c635df0a5..9f2b290cffc 100644 --- a/ace/config-unixware-7.1.0.udk.h +++ b/ace/config-unixware-7.1.0.udk.h @@ -41,6 +41,7 @@ #define ACE_HAS_NEW_NO_H 1 #define ACE_HAS_STDEXCEPT_NO_H 1 +#define ACE_HAS_IOMANIP_NO_H 1 /* Platform provides <sys/ioctl.h> header */ #define ACE_HAS_SYS_IOCTL_H 1 @@ -146,7 +147,7 @@ /* Platform has a getrusage () prototype in sys/resource.h that differs from the one in ace/OS.i. */ -#define ACE_HAS_GETRUSAGE_PROTOTYPE +#define ACE_HAS_GETRUSAGE_PROTO /* The GPERF utility is compiled for this platform */ #define ACE_HAS_GPERF @@ -282,7 +283,7 @@ #define ACE_HAS_SIZET_SOCKET_LEN /* Compiler/platform provides the sys/sockio.h file */ -#define ACE_HAS_SYS_SOCKIO_H +#define ACE_HAS_SOCKIO_H /* Compiler supports the ssize_t typedef */ #define ACE_HAS_SSIZE_T @@ -327,7 +328,7 @@ #define ACE_HAS_SVR4_TLI /* Compiler/platform contains the <sys/syscall.h> file. */ -#define ACE_HAS_SYS_SYSCALL_H +#define ACE_HAS_SYSCALL_H /* Platform supports system configuration information */ #define ACE_HAS_SYSINFO 1 diff --git a/ace/config-vxworks5.x.h b/ace/config-vxworks5.x.h index c7b41c9ea97..43e6e6cc60f 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_NONCONST_SENDMSG -#define ACE_HAS_NONCONST_WRITEV +#define ACE_HAS_BROKEN_SENDMSG +#define ACE_HAS_BROKEN_WRITEV #define ACE_HAS_CHARPTR_DL #define ACE_HAS_CHARPTR_SOCKOPT #define ACE_HAS_CLOCK_GETTIME @@ -149,7 +149,7 @@ #define ACE_LACKS_MPROTECT #define ACE_LACKS_MSYNC #define ACE_LACKS_NETDB_REENTRANT_FUNCTIONS -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_PWD_FUNCTIONS #define ACE_LACKS_READDIR_R #define ACE_LACKS_READLINK diff --git a/ace/config-win32-common.h b/ace/config-win32-common.h index 079ba1fb143..345b73f5de3 100644 --- a/ace/config-win32-common.h +++ b/ace/config-win32-common.h @@ -88,7 +88,7 @@ // #endif // Define the special export macros needed to export symbols outside a dll -#if !defined(__BORLANDC__) && !defined(__IBMCPP__) +#ifndef __BORLANDC__ #define ACE_HAS_CUSTOM_EXPORT_MACROS #define ACE_Proper_Export_Flag __declspec (dllexport) #define ACE_Proper_Import_Flag __declspec (dllimport) @@ -219,10 +219,9 @@ #define ACE_LACKS_REWINDDIR #define ACE_LACKS_READDIR_R #define ACE_LACKS_INET_ATON -#define ACE_LACKS_SYS_PARAM_H +#define ACE_LACKS_PARAM_H #define ACE_LACKS_PTHREAD_H #define ACE_LACKS_ARPA_INET_H -#define ACE_LACKS_MADVISE #define ACE_HAS_SNPRINTF #define ACE_HAS_VFWPRINTF diff --git a/ace/config-win32-msvc-7.h b/ace/config-win32-msvc-7.h index f3f47bfd8f7..edde4e820a2 100644 --- a/ace/config-win32-msvc-7.h +++ b/ace/config-win32-msvc-7.h @@ -70,7 +70,6 @@ #define ACE_LACKS_STRRECVFD #define ACE_HAS_CPLUSPLUS_HEADERS -#define ACE_HAS_TEMPLATE_TYPEDEFS #define ACE_TEMPLATES_REQUIRE_SOURCE #define ACE_HAS_TEMPLATE_SPECIALIZATION diff --git a/ace/config-win32-msvc.h b/ace/config-win32-msvc.h index 02e0daa03a4..84a6307949e 100644 --- a/ace/config-win32-msvc.h +++ b/ace/config-win32-msvc.h @@ -46,20 +46,7 @@ # endif /* ACE_LD_DECORATOR_STR */ #endif /* _MSC_VER >= 1200 */ -// Compiler sets _CPPRTTI if rtti is enabled. -#if defined (_CPPRTTI) -# if defined (ACE_LACKS_RTTI) -# undef ACE_LACKS_RTTI -# endif -#else -# if !defined (ACE_LACKS_RTTI) -# define ACE_LACKS_RTTI -# endif -#endif /* _CPPRTTI */ - -#if (_MSC_VER >= 1400) -# include "ace/config-win32-msvc-8.h" -#elif (_MSC_VER >= 1300) +#if (_MSC_VER >= 1300) # include "ace/config-win32-msvc-7.h" #elif (_MSC_VER >= 1200) # include "ace/config-win32-msvc-6.h" diff --git a/ace/config-win32-visualage.h b/ace/config-win32-visualage.h index 8aa12dd65eb..6b14c88c866 100644 --- a/ace/config-win32-visualage.h +++ b/ace/config-win32-visualage.h @@ -31,14 +31,6 @@ #define ACE_CC_PREPROCESSOR "" #define ACE_CC_PREPROCESSOR_ARGS "" -#define ACE_HAS_CUSTOM_EXPORT_MACROS -#define ACE_Proper_Export_Flag __declspec (dllexport) -#define ACE_Proper_Import_Flag __declspec (dllimport) -#define ACE_EXPORT_SINGLETON_DECLARATION(T) template class T -#define ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class __declspec (dllexport) SINGLETON_TYPE<CLASS, LOCK>; -#define ACE_IMPORT_SINGLETON_DECLARATION(T) template class T -#define ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) template class SINGLETON_TYPE <CLASS, LOCK>; - // By default WIN32 has FD_SETSIZE of 64, which places the limit // between 61 and 64 on the number of clients a server using the // Select Reactor can support at the same time (i.e., 64 - standard in, @@ -82,44 +74,9 @@ #define ACE_UINT64_FORMAT_SPECIFIER ACE_LIB_TEXT ("%I64u") #define ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB 1 -#define ACE_LACKS_NET_IF_H -#define ACE_LACKS_NETINET_IN_H -#define ACE_LACKS_DIRENT_H -#define ACE_LACKS_DLFCN_H -#define ACE_LACKS_NETDB_H -#define ACE_LACKS_PWD_H -#define ACE_LACKS_SEMAPHORE_H -#define ACE_LACKS_STDINT_H -#define ACE_LACKS_STRINGS_H -#define ACE_LACKS_SYS_IOCTL_H -#define ACE_LACKS_STROPTS_H -#define ACE_LACKS_UCONTEXT_H -#define ACE_LACKS_SYS_IPC_H -#define ACE_LACKS_SYS_MMAN_H -#define ACE_LACKS_SYS_RESOURCE_H -#define ACE_LACKS_SYS_SELECT_H -#define ACE_LACKS_SYS_SEM_H -#define ACE_LACKS_SYS_SOCKET_H -#define ACE_LACKS_SYS_TIME_H -#define ACE_LACKS_SYS_UIO_H -#define ACE_LACKS_SYS_WAIT_H -#define ACE_LACKS_SYS_SHM_H -#define ACE_LACKS_SYS_MSG_H -#define ACE_LACKS_TERMIOS_H -#define ACE_LACKS_POLL_H -#define ACE_LACKS_NETINET_TCP_H -#define ACE_HAS_3_PARAM_WCSTOK -#define ACE_LACKS_STRCASECMP -#define ENOTEMPTY WSAENOTEMPTY -#define ACE_HAS_STD_TEMPLATE_SPECIALIZATION - #undef WIFEXITED #undef WEXITSTATUS -#define _O_CREAT O_CREAT -#define _O_TRUNC O_TRUNC -#define _O_TEMPORARY 0 -#define _O_EXCL O_EXCL #define _O_RDWR O_RDWR #define _O_WRONLY O_WRONLY #define _O_RDONLY O_RDONLY diff --git a/ace/os_include/arpa/os_inet.h b/ace/os_include/arpa/os_inet.h index 34efdeed433..1ba2a0c1051 100644 --- a/ace/os_include/arpa/os_inet.h +++ b/ace/os_include/arpa/os_inet.h @@ -70,9 +70,9 @@ extern "C" unsigned long inet_network (const char *); #endif /* ! (ACE_VXWORKS) && ACE_VXWORKS <= 0x540 */ -#if defined (ACE_LACKS_INET_ATON_PROTOTYPE) +#if defined (__Lynx__) int inet_aton (const char *, struct in_addr *); -#endif /* ACE_LACKS_INET_ATON_PROTOTYPE */ +#endif /* __Lynx__ */ #ifdef __cplusplus } diff --git a/ace/os_include/os_errno.h b/ace/os_include/os_errno.h index 4c39bc04dfa..142b5338cfa 100644 --- a/ace/os_include/os_errno.h +++ b/ace/os_include/os_errno.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/os_float.h b/ace/os_include/os_float.h index 94cfb3dc5ef..b876600aa33 100644 --- a/ace/os_include/os_float.h +++ b/ace/os_include/os_float.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/os_inttypes.h b/ace/os_include/os_inttypes.h index 12ce23d9b8c..f01cf4b2803 100644 --- a/ace/os_include/os_inttypes.h +++ b/ace/os_include/os_inttypes.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/os_limits.h b/ace/os_include/os_limits.h index 27be31af2b4..0724e4c5ed3 100644 --- a/ace/os_include/os_limits.h +++ b/ace/os_include/os_limits.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -31,15 +31,9 @@ # include /**/ <limits.h> #endif /* !ACE_LACKS_LIMITS_H */ -#if !defined (ACE_LACKS_SYS_PARAM_H) +#if !defined (ACE_LACKS_PARAM_H) # include /**/ <sys/param.h> -#endif /* ACE_LACKS_SYS_PARAM_H */ - -// On VxWorks _POSIX_TIMER_MAX is defined in time.h, report this to WindRiver -// support. -#if defined (VXWORKS) -# include /**/ <time.h> -#endif /* VXWORKS */ +#endif /* ACE_LACKS_PARAM_H */ // Place all additions (especially function declarations) within extern "C" {} #ifdef __cplusplus diff --git a/ace/os_include/os_signal.h b/ace/os_include/os_signal.h index 45a1a0fddaf..86e619b41a0 100644 --- a/ace/os_include/os_signal.h +++ b/ace/os_include/os_signal.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/os_stdint.h b/ace/os_include/os_stdint.h index 3d9327ac99a..02fe7101725 100644 --- a/ace/os_include/os_stdint.h +++ b/ace/os_include/os_stdint.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/os_stdlib.h b/ace/os_include/os_stdlib.h index 5bcb77f430c..006272ef84c 100644 --- a/ace/os_include/os_stdlib.h +++ b/ace/os_include/os_stdlib.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -67,22 +67,21 @@ extern "C" int putenv (char *); // stdlib.h #endif /* ACE_PSOS_SNARFS_HEADER_INFO */ +// These prototypes are chronically lacking from many versions of +// UNIX. +#if !defined (ACE_WIN32) && defined (ACE_LACKS_MKTEMP) + char *mktemp (char *); +#endif /* !ACE_WIN32 && ACE_LACKS_MKTEMP */ #if defined (DIGITAL_UNIX) extern int _Prand_r (unsigned int *seedptr); #endif /* DIGITAL_UNIX */ -#if defined (ACE_LACKS_PUTENV_PROTOTYPE) +#if defined (__Lynx__) int putenv (char *); -#endif /* ACE_LACKS_PUTENV_PROTOTYPE */ - -#if defined (ACE_LACKS_MKTEMP_PROTOTYPE) char *mktemp (char *); -#endif /* ACE_LACKS_MKTEMP_PROTOTYPE */ - -#if defined (ACE_LACKS_MKSTEMP_PROTOTYPE) int mkstemp(char *); -#endif /* ACE_LACKS_MKSTEMP_PROTOTYPE */ +#endif /* __Lynx__ */ #ifdef __cplusplus } diff --git a/ace/os_include/os_strings.h b/ace/os_include/os_strings.h index 2fdcf723bec..850b21f60a5 100644 --- a/ace/os_include/os_strings.h +++ b/ace/os_include/os_strings.h @@ -36,13 +36,10 @@ extern "C" { #endif /* __cplusplus */ -#if defined (ACE_LACKS_STRCASECMP_PROTOTYPE) +#if defined (__Lynx__) int strcasecmp(const char *, const char *); -#endif /* ACE_LACKS_STRCASECMP_PROTOTYPE */ - -#if defined (ACE_LACKS_STRNCASECMP_PROTOTYPE) int strncasecmp(const char *, const char *, size_t); -#endif /* ACE_LACKS_STRNCASECMP_PROTOTYPE */ +#endif /* __Lynx__ */ #ifdef __cplusplus } diff --git a/ace/os_include/os_stropts.h b/ace/os_include/os_stropts.h index e28b672f560..d4113e49983 100644 --- a/ace/os_include/os_stropts.h +++ b/ace/os_include/os_stropts.h @@ -46,7 +46,7 @@ # include /**/ <sys/filio.h> #endif /* ACE_HAS_SYS_FILIO_H */ -#if defined (ACE_HAS_SYS_SOCKIO_H) +#if defined (ACE_HAS_SOCKIO_H) # include /**/ <sys/sockio.h> #endif /* ACE_HAS_SOCKIO_ */ diff --git a/ace/os_include/os_time.h b/ace/os_include/os_time.h index 80f49200187..17d945a7074 100644 --- a/ace/os_include/os_time.h +++ b/ace/os_include/os_time.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/os_ucontext.h b/ace/os_include/os_ucontext.h index dd4b5001ba9..67ce5ba9b10 100644 --- a/ace/os_include/os_ucontext.h +++ b/ace/os_include/os_ucontext.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/os_unistd.h b/ace/os_include/os_unistd.h index 8a9324cd741..5594604b260 100644 --- a/ace/os_include/os_unistd.h +++ b/ace/os_include/os_unistd.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -166,14 +166,11 @@ extern "C" # endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */ -#if defined (ACE_LACKS_SWAB_PROTOTYPE) +#if defined (__Lynx__) void swab(const void *, void *, ssize_t); -#endif /* ACE_LACKS_SWAB_PROTOTYPE */ - -#if defined (ACE_LACKS_GETOPT_PROTOTYPE) int getopt(int, char * const [], const char *); -#endif /* ACE_LACKS_GETOPT_PROTOTYPE */ - +#endif /* __Lynx__ */ + #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/ace/os_include/sys/os_ipc.h b/ace/os_include/sys/os_ipc.h index ee5d198048e..3acd1ed78cc 100644 --- a/ace/os_include/sys/os_ipc.h +++ b/ace/os_include/sys/os_ipc.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_mman.h b/ace/os_include/sys/os_mman.h index 6ccb58d548f..d481cafaad8 100644 --- a/ace/os_include/sys/os_mman.h +++ b/ace/os_include/sys/os_mman.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_msg.h b/ace/os_include/sys/os_msg.h index e6b2c6c1c63..e5b4a0b4214 100644 --- a/ace/os_include/sys/os_msg.h +++ b/ace/os_include/sys/os_msg.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_resource.h b/ace/os_include/sys/os_resource.h index dd289b10a7a..8845e544782 100644 --- a/ace/os_include/sys/os_resource.h +++ b/ace/os_include/sys/os_resource.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -35,9 +35,9 @@ # include /**/ <sys/systeminfo.h> #endif /* ACE_HAS_SYS_INFO */ -#if defined (ACE_HAS_SYS_SYSCALL_H) +#if defined (ACE_HAS_SYSCALL_H) # include /**/ <sys/syscall.h> -#endif /* ACE_HAS_SYS_SYSCALL_H */ +#endif /* ACE_HAS_SYSCALL_H */ // prusage_t is defined in <sys/procfs.h> #if defined (ACE_HAS_PROC_FS) @@ -61,6 +61,12 @@ 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 @@ -92,7 +98,7 @@ extern "C" #if !defined (ACE_WIN32) // These prototypes are chronically lacking from many versions of // UNIX. -# if !defined (ACE_HAS_GETRUSAGE_PROTOTYPE) +# if !defined (ACE_HAS_GETRUSAGE_PROTO) int getrusage (int who, struct rusage *rusage); # endif /* ! ACE_HAS_GETRUSAGE_PROTO */ diff --git a/ace/os_include/sys/os_select.h b/ace/os_include/sys/os_select.h index f8da718e6a9..99f32bb4936 100644 --- a/ace/os_include/sys/os_select.h +++ b/ace/os_include/sys/os_select.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_sem.h b/ace/os_include/sys/os_sem.h index 93f669d2913..b0f3544dd26 100644 --- a/ace/os_include/sys/os_sem.h +++ b/ace/os_include/sys/os_sem.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_shm.h b/ace/os_include/sys/os_shm.h index af005e8dbb2..47c40660344 100644 --- a/ace/os_include/sys/os_shm.h +++ b/ace/os_include/sys/os_shm.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_socket.h b/ace/os_include/sys/os_socket.h index 938a71b39db..8f232a67b81 100644 --- a/ace/os_include/sys/os_socket.h +++ b/ace/os_include/sys/os_socket.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -50,6 +50,12 @@ 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 @@ -196,7 +202,7 @@ extern "C" struct timespec *timeout); ssize_t sendmsg_timedwait (ACE_HANDLE handle, - const struct msghdr *msg, + ACE_SENDMSG_TYPE *msg, int flags, struct timespec *timeout); diff --git a/ace/os_include/sys/os_stat.h b/ace/os_include/sys/os_stat.h index 375a91714f4..1a9a357cf92 100644 --- a/ace/os_include/sys/os_stat.h +++ b/ace/os_include/sys/os_stat.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_statvfs.h b/ace/os_include/sys/os_statvfs.h index 546c20b10f2..e24c85daab8 100644 --- a/ace/os_include/sys/os_statvfs.h +++ b/ace/os_include/sys/os_statvfs.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_time.h b/ace/os_include/sys/os_time.h index 4fb260bcd7e..37edcd8d328 100644 --- a/ace/os_include/sys/os_time.h +++ b/ace/os_include/sys/os_time.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_timeb.h b/ace/os_include/sys/os_timeb.h index c3b3559269b..aa2102e8b95 100644 --- a/ace/os_include/sys/os_timeb.h +++ b/ace/os_include/sys/os_timeb.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_times.h b/ace/os_include/sys/os_times.h index c63b9e0098c..62e69921e7d 100644 --- a/ace/os_include/sys/os_times.h +++ b/ace/os_include/sys/os_times.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_types.h b/ace/os_include/sys/os_types.h index da7cb514c75..ee5999c5cbb 100644 --- a/ace/os_include/sys/os_types.h +++ b/ace/os_include/sys/os_types.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_uio.h b/ace/os_include/sys/os_uio.h index 1a7fd505c39..6c39c1e15b8 100644 --- a/ace/os_include/sys/os_uio.h +++ b/ace/os_include/sys/os_uio.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -63,15 +63,27 @@ 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, - const iovec *iov, + iovec *iov, int iovcnt, struct timespec* timeout); ssize_t writev_timedwait (ACE_HANDLE handle, - const iovec *iov, + ACE_WRITEV_TYPE *iov, int iovcnt, struct timespec *timeout); diff --git a/ace/os_include/sys/os_un.h b/ace/os_include/sys/os_un.h index 1b2e5aca9ef..29e35fb8252 100644 --- a/ace/os_include/sys/os_un.h +++ b/ace/os_include/sys/os_un.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_utsname.h b/ace/os_include/sys/os_utsname.h index d707cbecc7d..906ae60dca6 100644 --- a/ace/os_include/sys/os_utsname.h +++ b/ace/os_include/sys/os_utsname.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once diff --git a/ace/os_include/sys/os_wait.h b/ace/os_include/sys/os_wait.h index eb9f7e1d2de..8e6ec6e1624 100644 --- a/ace/os_include/sys/os_wait.h +++ b/ace/os_include/sys/os_wait.h @@ -18,7 +18,7 @@ #include /**/ "ace/pre.h" -#include "ace/config-lite.h" +#include "ace/config-all.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once |