summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ace/Hash_Map_Manager.cpp4
-rw-r--r--ace/INET_Addr.cpp2
-rw-r--r--ace/OS.h56
-rw-r--r--ace/OS.i3
-rw-r--r--ace/README11
5 files changed, 63 insertions, 13 deletions
diff --git a/ace/Hash_Map_Manager.cpp b/ace/Hash_Map_Manager.cpp
index 189f8ea182c..ba1ad76feab 100644
--- a/ace/Hash_Map_Manager.cpp
+++ b/ace/Hash_Map_Manager.cpp
@@ -152,7 +152,11 @@ ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::close_i (void)
// Now deal with the sentinel by explicitly calling the
// destructor.
+#ifdef HPUX_11
+ (&table_[i])->ACE_Hash_Map_Entry<EXT_ID, INT_ID>::~ACE_Hash_Map_Entry ();
+#else
table_[i].ACE_Hash_Map_Entry<EXT_ID, INT_ID>::~ACE_Hash_Map_Entry ();
+#endif
}
// Free table memory
diff --git a/ace/INET_Addr.cpp b/ace/INET_Addr.cpp
index df6e9bb7757..8f8244f1082 100644
--- a/ace/INET_Addr.cpp
+++ b/ace/INET_Addr.cpp
@@ -283,7 +283,7 @@ ACE_INET_Addr::ACE_INET_Addr (u_short port_number,
{
ACE_TRACE ("ACE_INET_Addr::ACE_INET_Addr");
if (this->set (port_number, host_name) == -1)
- ACE_ERROR ((LM_ERROR, "ACE_INET_Addr::ACE_INET_Addr"));
+ ACE_ERROR ((LM_ERROR, "ACE_INET_Addr::ACE_INET_Addr: %p\n", host_name));
}
// Creates a ACE_INET_Addr from a sockaddr_in structure.
diff --git a/ace/OS.h b/ace/OS.h
index 1eb52c19efc..84a216d0760 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -916,6 +916,22 @@ extern "C" pthread_t pthread_self (void);
}
#endif /* ACE_HAS_DCETHREADS */
+// There are a lot of threads-related macro definitions in the config files.
+// They came in at different times and from different places and platform
+// requirements as threads evolved. They are probably not all needed - some
+// overlap or are otherwise confused. This is an attempt to start
+// straightening them out.
+#if defined (ACE_HAS_PTHREADS_1003_DOT_1C) /* POSIX.1C threads (pthreads) */
+// POSIX.1C threads implies pthread_sigmask()
+#ifndef ACE_HAS_PTHREAD_SIGMASK
+#define ACE_HAS_PTHREAD_SIGMASK
+#endif
+// ... and 2-parameter asctime_r and ctime_r
+#ifndef ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
+#define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R
+#endif
+#endif /* ACE_HAS_PTHREADS_1003_DOT_1C */
+
#if (ACE_NTRACE == 1)
#define ACE_TRACE(X)
#else
@@ -1546,6 +1562,12 @@ struct cancel_state
#include /**/ <sys/stat.h>
#endif /*ACE_HAS_WINCE */
+#if defined (ACE_NEW_THROWS_EXCEPTIONS)
+// I know this works for HP aC++... if <stdexcept> is used, it introduces other
+// stuff that breaks things, like <memory>, which screws up auto_ptr.
+#include /**/ <new>
+#endif /* ACE_NEW_THROWS_EXCEPTIONS */
+
#if defined (ACE_HAS_THREADS)
# if defined (ACE_HAS_STHREADS)
@@ -2162,6 +2184,8 @@ protected:
#endif /* ACE_HAS_THREADS */
// Standard C Library includes
+// NOTE: stdarg.h must be #included before stdio.h on LynxOS.
+# include /**/ <stdarg.h>
#if !defined (ACE_HAS_WINCE)
# include /**/ <assert.h>
# include /**/ <stdio.h>
@@ -2170,8 +2194,6 @@ protected:
# include /**/ <errno.h>
#endif /* ACE_HAS_WINCE */
# include /**/ <limits.h>
-// NOTE: stdarg.h must be #included before stdio.h on LynxOS.
-# include /**/ <stdarg.h>
# include /**/ <ctype.h>
# include /**/ <string.h>
# include /**/ <stdlib.h>
@@ -2230,12 +2252,12 @@ typedef const struct msghdr ACE_SENDMSG_TYPE;
typedef u_int ACE_RANDR_TYPE;
extern "C" int rand_r (ACE_RANDR_TYPE seed);
#else
-# if defined (__hpux)
-// HP-UX's stdlib.h (long *) doesn't match that man page (u_int *)
+# if defined (HPUX_10)
+// HP-UX 10.x's stdlib.h (long *) doesn't match that man page (u_int *)
typedef long *ACE_RANDR_TYPE;
# else
typedef u_int *ACE_RANDR_TYPE;
-# endif /* __hpux */
+# endif /* HPUX_10 */
#endif /* ACE_HAS_BROKEN_RANDR */
#if defined (ACE_HAS_UTIME)
@@ -2998,15 +3020,19 @@ extern int t_errno;
#include /**/ <alloca.h>
#endif /* ACE_HAS_ALLOCA_H */
-#if defined (ACE_HAS_TIUSER_H)
+#if defined (ACE_HAS_TIUSER_H) || defined (ACE_HAS_XTI)
#if defined (ACE_HAS_TIUSER_H_BROKEN_EXTERN_C)
extern "C" {
#endif
+#if defined (ACE_HAS_TIUSER_H)
#include /**/ <tiuser.h>
+#else
+#include /**/ <xti.h>
+#endif /* ACE_HAS_TIUSER_H */
#if defined (ACE_HAS_TIUSER_H_BROKEN_EXTERN_C)
}
#endif /* ACE_HAS_TIUSER_H_BROKEN_EXTERN_C */
-#endif /* ACE_HAS_TIUSER_H */
+#endif /* ACE_HAS_TIUSER_H || ACE_HAS_XTI */
/* Set the proper handle type for dynamically-loaded libraries. */
/* Also define a default 'mode' for loading a library - the names and values */
@@ -4944,14 +4970,26 @@ private:
// depending on whether ANSI/ISO exception handling semantics are
// being used).
-#define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \
+#if defined(ACE_NEW_THROWS_EXCEPTIONS)
+# define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \
+ do { try { POINTER = new CONSTRUCTOR; } \
+ catch (bad_alloc) { errno = ENOMEM; return RET_VAL; } \
+ } while (0)
+
+# define ACE_NEW(POINTER,CONSTRUCTOR) \
+ do { try { POINTER = new CONSTRUCTOR; } \
+ catch (bad_alloc) { errno = ENOMEM; return; } \
+ } while (0)
+#else
+# define ACE_NEW_RETURN(POINTER,CONSTRUCTOR,RET_VAL) \
do { POINTER = new CONSTRUCTOR; \
if (POINTER == 0) { errno = ENOMEM; return RET_VAL; } \
} while (0)
-#define ACE_NEW(POINTER,CONSTRUCTOR) \
+# define ACE_NEW(POINTER,CONSTRUCTOR) \
do { POINTER = new CONSTRUCTOR; \
if (POINTER == 0) { errno = ENOMEM; return; } \
} while (0)
+#endif /* ACE_NEW_THROWS_EXCEPTIONS */
// Some useful abstration for expressions involving
// ACE_Allocator.malloc (). The difference between ACE_NEW_MALLOC*
diff --git a/ace/OS.i b/ace/OS.i
index a91e6ff451e..f2d3d82f235 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -2006,7 +2006,7 @@ ACE_OS::sema_init (ACE_sema_t *s,
O_CREAT,
ACE_DEFAULT_FILE_PERMS,
count);
- return (int) s->sema_ == -1 ? -1 : 0;
+ return (s->sema_ == (sem_t *)-1 ? -1 : 0);
}
else
#endif /*ACE_LACKS_NAMED_POSIX_SEM */
@@ -5217,6 +5217,7 @@ ACE_OS::thr_yield (void)
::thr_yield ();
#elif defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS)
#if defined (ACE_HAS_IRIX62_THREADS) || defined (ACE_HAS_PTHREADS_1003_DOT_1C)
+ // Note - this is a POSIX.4 function - not a POSIX.1C function...
::sched_yield ();
#elif defined (ACE_HAS_FSU_PTHREADS) || defined (ACE_HAS_YIELD_VOID_PTR)
::pthread_yield (NULL);
diff --git a/ace/README b/ace/README
index 38636245825..632a3fc2ce2 100644
--- a/ace/README
+++ b/ace/README
@@ -111,6 +111,10 @@ ACE_HAS_PROC_FS Platform supports the /proc file system and defines tid_t in
ACE_HAS_POWERPC Platform is a PowerPC microprocessor.
ACE_HAS_PRUSAGE_T Platform supports the prusage_t struct
ACE_HAS_PTHREADS Platform supports POSIX Pthreads
+ACE_HAS_PTHREADS_1003_DOT_1C Platform supports POSIX.1C threads
+ (This should be synonomous with
+ ACE_HAS_PTHREADS, but probably isn't
+ in the sources)
ACE_HAS_PTHREAD_CONDATTR_SETKIND_NP Platform has pthread_condattr_setkind_np().
ACE_HAS_PTHREAD_DSTATE_PTR pthread_attr_setdetachstate() takes pointer to 2nd arg.
ACE_HAS_PTHREAD_EQUAL Platform has pthread_equal().
@@ -205,6 +209,9 @@ ACE_HAS_WIN32_TRYLOCK The Win32 platform support TryEnterCriticalSection() (Wi
ACE_HAS_WINSOCK2 The Win32 platform supports WinSock 2.0
ACE_HAS_XLI Platform has the XLI version of TLI
ACE_HAS_XT Platform has Xt and Motif
+ACE_HAS_XTI Platform has XTI (X/Open-standardized
+ superset of TLI). Implies ACE_HAS_TLI
+ but uses a different header file.
ACE_HAS_YIELD_VOID_PTR Platform requires pthread_yield() to take a NULL.
ACE_LACKS_ACCESS Platform lacks access() (e.g., VxWorks and Chorus)
ACE_LACKS_ACE_IOSTREAM Platform can not build ace/IOStream{,_T}.cpp. This does not necessarily mean that the platform does not support iostreams.
@@ -286,6 +293,8 @@ ACE_NEEDS_HUGE_THREAD_STACKSIZE Required by platforms with small default stacks
ACE_NEEDS_READV Platform doesn't define readv, so use our own
ACE_NEEDS_SYSTIME_H <time.h> doesn't automatically #include /**/ <sys/time.h>
ACE_NEEDS_WRITEV Platform doesn't define writev, so use our own
+ACE_NEW_THROWS_EXCEPTIONS Compiler's 'new' throws exception on
+ failure (ANSI C++ behavior).
ACE_NLOGGING Turns off the LM_DEBUG and LM_ERROR logging macros...
ACE_NTRACE Turns off the tracing feature.
ACE_NO_THREAD_ADAPTER Don't use the ACE_Thread_Adapter feature...
@@ -891,5 +900,3 @@ ACE_USE_POLL_IMPLEMENTATION:
Notes:
in the reactor, use poll instead of select. In general,
good thing to have set.
-
- Don't set this, it will get set by ACE_HAS_SVR4_POLL