summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog38
-rw-r--r--ChangeLogs/ChangeLog-02a38
-rw-r--r--ChangeLogs/ChangeLog-03a38
-rw-r--r--ace/ARGV.h2
-rw-r--r--ace/Addr.cpp1
-rw-r--r--ace/Basic_Types.h51
-rw-r--r--ace/Default_Constants.h11
-rw-r--r--ace/Log_Msg.cpp9
-rw-r--r--ace/Log_Msg.h24
-rw-r--r--ace/OS.h11
-rw-r--r--ace/OS_Dirent.cpp1
-rw-r--r--ace/Trace.cpp1
-rw-r--r--apps/gperf/src/Bool_Array.cpp9
-rw-r--r--examples/Log_Msg/test_callback.cpp1
-rw-r--r--examples/Logger/Acceptor-server/server_loggerd.cpp1
-rw-r--r--examples/Logger/simple-server/Logging_Handler.cpp1
-rw-r--r--tests/Log_Msg_Test.cpp1
17 files changed, 213 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 35adce5554b..6f4d715c01e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+Thu Apr 11 14:42:32 UTC 2002 Don Hinton <dhinton@ieee.org>
+
+ * ace/ARGV.h: Replaced include of ACE.h with config-all.h.
+
+ * ace/Addr.cpp:
+ * ace/OS_Dirent.cpp:
+ * ace/Trace.cpp:
+
+ Added include of OS.h.
+
+ * apps/gperf/src/Bool_Array.cpp: Changed ACE_OS::memset() to
+ ACE_OS_String::memset() and added include of OS_String.h.
+
+ * tests/Log_Msg_Test.cpp:
+ * examples/Logger/Acceptor-server.cpp:
+ * examples/Logger/simple-server/Logging_Handler.cpp:
+ * examples/Log_Msg/test_callback.cpp:
+
+ Added includes of Log_Record.h.
+
+ * ace/Log_Msg.{h,cpp}:
+
+ Added new method, last_error_adapter(), and changed the
+ ACE_DEBUG, et al, macros to use new method instead of
+ ACE_OS::last_error(). Removed includes of OS.h and
+ Log_Record. Changed ACE_Log_Record::MAXLOGMSGLEN to
+ ACE_MAXLOGMSGLEN. Removed ACE_OS::cleanup_tss friend.
+
+ * ace/Basic_Types.h: Added definition of MAXPATHLEN and
+ typedef of ACE_thread_t to prevent need to include OS.h
+ in Log_Msg.h above.
+
+ * ace/Default_Constants.h:
+ * ace/OS.h:
+
+ Moved definitions of ACE_MAXLOGMSGLEN, ACE_MAXTOKENNAMELEN,
+ and ACE_MAXCLIENTIDLEN here from OS.h.
+
Thu Apr 11 14:26:12 2002 Johnny Willemsen <jwillemsen@remedy.nl>
* Timer_Hash_T.h:
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 35adce5554b..6f4d715c01e 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,41 @@
+Thu Apr 11 14:42:32 UTC 2002 Don Hinton <dhinton@ieee.org>
+
+ * ace/ARGV.h: Replaced include of ACE.h with config-all.h.
+
+ * ace/Addr.cpp:
+ * ace/OS_Dirent.cpp:
+ * ace/Trace.cpp:
+
+ Added include of OS.h.
+
+ * apps/gperf/src/Bool_Array.cpp: Changed ACE_OS::memset() to
+ ACE_OS_String::memset() and added include of OS_String.h.
+
+ * tests/Log_Msg_Test.cpp:
+ * examples/Logger/Acceptor-server.cpp:
+ * examples/Logger/simple-server/Logging_Handler.cpp:
+ * examples/Log_Msg/test_callback.cpp:
+
+ Added includes of Log_Record.h.
+
+ * ace/Log_Msg.{h,cpp}:
+
+ Added new method, last_error_adapter(), and changed the
+ ACE_DEBUG, et al, macros to use new method instead of
+ ACE_OS::last_error(). Removed includes of OS.h and
+ Log_Record. Changed ACE_Log_Record::MAXLOGMSGLEN to
+ ACE_MAXLOGMSGLEN. Removed ACE_OS::cleanup_tss friend.
+
+ * ace/Basic_Types.h: Added definition of MAXPATHLEN and
+ typedef of ACE_thread_t to prevent need to include OS.h
+ in Log_Msg.h above.
+
+ * ace/Default_Constants.h:
+ * ace/OS.h:
+
+ Moved definitions of ACE_MAXLOGMSGLEN, ACE_MAXTOKENNAMELEN,
+ and ACE_MAXCLIENTIDLEN here from OS.h.
+
Thu Apr 11 14:26:12 2002 Johnny Willemsen <jwillemsen@remedy.nl>
* Timer_Hash_T.h:
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 35adce5554b..6f4d715c01e 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,41 @@
+Thu Apr 11 14:42:32 UTC 2002 Don Hinton <dhinton@ieee.org>
+
+ * ace/ARGV.h: Replaced include of ACE.h with config-all.h.
+
+ * ace/Addr.cpp:
+ * ace/OS_Dirent.cpp:
+ * ace/Trace.cpp:
+
+ Added include of OS.h.
+
+ * apps/gperf/src/Bool_Array.cpp: Changed ACE_OS::memset() to
+ ACE_OS_String::memset() and added include of OS_String.h.
+
+ * tests/Log_Msg_Test.cpp:
+ * examples/Logger/Acceptor-server.cpp:
+ * examples/Logger/simple-server/Logging_Handler.cpp:
+ * examples/Log_Msg/test_callback.cpp:
+
+ Added includes of Log_Record.h.
+
+ * ace/Log_Msg.{h,cpp}:
+
+ Added new method, last_error_adapter(), and changed the
+ ACE_DEBUG, et al, macros to use new method instead of
+ ACE_OS::last_error(). Removed includes of OS.h and
+ Log_Record. Changed ACE_Log_Record::MAXLOGMSGLEN to
+ ACE_MAXLOGMSGLEN. Removed ACE_OS::cleanup_tss friend.
+
+ * ace/Basic_Types.h: Added definition of MAXPATHLEN and
+ typedef of ACE_thread_t to prevent need to include OS.h
+ in Log_Msg.h above.
+
+ * ace/Default_Constants.h:
+ * ace/OS.h:
+
+ Moved definitions of ACE_MAXLOGMSGLEN, ACE_MAXTOKENNAMELEN,
+ and ACE_MAXCLIENTIDLEN here from OS.h.
+
Thu Apr 11 14:26:12 2002 Johnny Willemsen <jwillemsen@remedy.nl>
* Timer_Hash_T.h:
diff --git a/ace/ARGV.h b/ace/ARGV.h
index 613af430fed..6d29d071e51 100644
--- a/ace/ARGV.h
+++ b/ace/ARGV.h
@@ -15,7 +15,7 @@
#define ACE_ARGUMENT_VECTOR_H
#include "ace/pre.h"
-#include "ace/ACE.h"
+#include "ace/config-all.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
diff --git a/ace/Addr.cpp b/ace/Addr.cpp
index c0bb1efbf80..e523a0f2303 100644
--- a/ace/Addr.cpp
+++ b/ace/Addr.cpp
@@ -3,6 +3,7 @@
#include "ace/Addr.h"
#include "ace/Log_Msg.h"
+#include "ace/OS.h"
ACE_RCSID(ace, Addr, "$Id$")
diff --git a/ace/Basic_Types.h b/ace/Basic_Types.h
index ae0b21825a0..84c0d9eb691 100644
--- a/ace/Basic_Types.h
+++ b/ace/Basic_Types.h
@@ -69,6 +69,17 @@
# include "ace/ACE_export.h"
+// Pick up MAXPATHLEN without need of OS.h.
+#if !defined (MAXPATHLEN)
+# if defined (ACE_WIN32)
+# define MAXPATHLEN _MAX_PATH
+# elif defined (_POSIX_PATH_MAX)
+# define MAXPATHLEN _POSIX_PATH_MAX
+# else
+# define MAXPATHLEN 1024
+# endif /* ACE_WIN32 */
+#endif /* MAXPATHLEN */
+
// A char always has 1 byte, by definition.
# define ACE_SIZEOF_CHAR 1
@@ -602,6 +613,46 @@ typedef ACE_UINT16 ACE_USHORT16;
# endif
# endif /* ! BYTE_ORDER && ! __BYTE_ORDER */
+
+// These were moved from OS.h.
+#if defined (ACE_HAS_THREADS)
+# if defined (ACE_HAS_PTHREADS)
+# if defined (ACE_HAS_TSS_EMULATION)
+ typedef u_long ACE_thread_key_t;
+# else /* ! ACE_HAS_TSS_EMULATION */
+ typedef pthread_key_t ACE_thread_key_t;
+# endif /* ! ACE_HAS_TSS_EMULATION */
+# elif defined (ACE_HAS_STHREADS)
+ // Solaris threads, without PTHREADS.
+ // Typedefs to help compatibility with Windows NT and Pthreads.
+ typedef thread_t ACE_thread_t;
+ typedef thread_key_t ACE_thread_key_t;
+// typedef mutex_t ACE_mutex_t;
+# elif defined (ACE_PSOS)
+# if defined (ACE_PSOS_HAS_TSS)
+ typedef u_long ACE_thread_key_t;
+# else
+ typedef u_int ACE_thread_key_t;
+# endif /* ACE_PSOS_HAS_TSS */
+# elif defined (VXWORKS)
+ typedef u_int ACE_thread_key_t;
+# endif
+#else
+ typedef u_int ACE_thread_key_t;
+#endif
+
+#if defined (ACE_WIN32)
+# if defined (ACE_HAS_TSS_EMULATION)
+//typedef DWORD ACE_OS_thread_key_t;
+ typedef u_int ACE_thread_key_t;
+# else /* ! ACE_HAS_TSS_EMULATION */
+ typedef DWORD ACE_thread_key_t;
+# endif /* ! ACE_HAS_TSS_EMULATION */
+#endif
+
+
+
+
# if defined (__ACE_INLINE__)
# include "ace/Basic_Types.i"
# endif /* __ACE_INLINE__ */
diff --git a/ace/Default_Constants.h b/ace/Default_Constants.h
index e31e59d6d59..8a20331792d 100644
--- a/ace/Default_Constants.h
+++ b/ace/Default_Constants.h
@@ -333,6 +333,17 @@
# endif /*ACE_WIN32*/
+// Max size of an ACE Log Record data buffer. This can be reset in
+// the config.h file if you'd like to increase or decrease the size.
+# if !defined (ACE_MAXLOGMSGLEN)
+# define ACE_MAXLOGMSGLEN 4 * 1024
+# endif /* ACE_MAXLOGMSGLEN */
+
+// Max size of an ACE Token.
+# define ACE_MAXTOKENNAMELEN 40
+
+// Max size of an ACE Token client ID.
+# define ACE_MAXCLIENTIDLEN MAXHOSTNAMELEN + 20
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index 1cfef7837c6..19439f937ce 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -26,6 +26,7 @@
#include "ace/Log_Msg_IPC.h"
#include "ace/Log_Msg_NT_Event_Log.h"
#include "ace/Log_Msg_UNIX_Syslog.h"
+#include "ace/Log_Record.h"
ACE_RCSID(ace, Log_Msg, "$Id$")
@@ -364,6 +365,14 @@ ACE_Log_Msg::instance (void)
#endif /* ! ACE_MT_SAFE */
}
+// Not inlined to help prevent having to include OS.h just to
+// get ACE_DEBUG, et al, macros.
+int
+ACE_Log_Msg::last_error_adapter (void)
+{
+ return ACE_OS::last_error ();
+}
+
// Sets the flag in the default priority mask used to initialize
// ACE_Log_Msg instances, as well as the current per-thread instance.
diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h
index 658aa612dcd..931829c2f4e 100644
--- a/ace/Log_Msg.h
+++ b/ace/Log_Msg.h
@@ -19,6 +19,9 @@
// ... but ACE_NDEBUG and ACE_NLOGGING can come from the config.h file, so
// pull that one early.
#include "ace/config-all.h"
+#include "ace/Default_Constants.h"
+#include "ace/Log_Priority.h"
+#include "ace/Basic_Types.h"
// The following ASSERT macro is courtesy of Alexandre Karev
// <akg@na47sun05.cern.ch>.
@@ -27,7 +30,7 @@
#elif !defined (ACE_ASSERT)
#define ACE_ASSERT(X) \
do { if(!(X)) { \
- int __ace_error = ACE_OS::last_error (); \
+ int __ace_error = ACE_Log_Msg::last_error_adapter (); \
ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \
ace___->set (__FILE__, __LINE__, -1, __ace_error, ace___->restart (), \
ace___->msg_ostream (), ace___->msg_callback ()); \
@@ -46,14 +49,14 @@
#else
#define ACE_HEX_DUMP(X) \
do { \
- int __ace_error = ACE_OS::last_error (); \
+ int __ace_error = ACE_Log_Msg::last_error_adapter (); \
ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \
ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \
ace___->log_hexdump X; \
} while (0)
#define ACE_RETURN(Y) \
do { \
- int __ace_error = ACE_OS::last_error (); \
+ int __ace_error = ACE_Log_Msg::last_error_adapter (); \
ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \
ace___->set (__FILE__, __LINE__, Y, __ace_error, ace___->restart (), \
ace___->msg_ostream (), ace___->msg_callback ()); \
@@ -61,7 +64,7 @@
} while (0)
#define ACE_ERROR_RETURN(X, Y) \
do { \
- int __ace_error = ACE_OS::last_error (); \
+ int __ace_error = ACE_Log_Msg::last_error_adapter (); \
ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \
ace___->conditional_set (__FILE__, __LINE__, Y, __ace_error); \
ace___->log X; \
@@ -69,14 +72,14 @@
} while (0)
#define ACE_ERROR(X) \
do { \
- int __ace_error = ACE_OS::last_error (); \
+ int __ace_error = ACE_Log_Msg::last_error_adapter (); \
ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \
ace___->conditional_set (__FILE__, __LINE__, -1, __ace_error); \
ace___->log X; \
} while (0)
#define ACE_DEBUG(X) \
do { \
- int __ace_error = ACE_OS::last_error (); \
+ int __ace_error = ACE_Log_Msg::last_error_adapter (); \
ACE_Log_Msg *ace___ = ACE_Log_Msg::instance (); \
ace___->conditional_set (__FILE__, __LINE__, 0, __ace_error); \
ace___->log X; \
@@ -89,7 +92,6 @@
#define ACE_ERROR_BREAK(X) { ACE_ERROR (X); break; }
#endif /* ACE_NLOGGING */
-#include "ace/Log_Record.h"
#include "ace/OS_Log_Msg_Attributes.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
@@ -116,6 +118,7 @@ class ACE_Log_Msg_Backend;
// Forward declaration
class ACE_Thread_Descriptor;
+class ACE_Log_Record;
/**
* @class ACE_Log_Msg
@@ -181,6 +184,9 @@ public:
/// Returns a pointer to the Singleton.
static ACE_Log_Msg *instance (void);
+ /// Returns last error.
+ static int last_error_adapter (void);
+
/// Returns non-null if an ACE_Log_Msg exists for the calling thread.
static int exists (void);
@@ -547,7 +553,7 @@ private:
/// The log message, which resides in thread-specific storage. Note
/// that only the current log message is stored here -- it will be
/// overwritten by the subsequent call to <log>.
- ACE_TCHAR msg_[ACE_Log_Record::MAXLOGMSGLEN + 1]; // Add one for NUL-terminator.
+ ACE_TCHAR msg_[ACE_MAXLOGMSGLEN + 1]; // Add one for NUL-terminator.
/// Indicates whether we should restart system calls that are
/// interrupted.
@@ -649,7 +655,7 @@ private:
/// Return the TSS singleton thread descriptor
static ACE_OS_Thread_Descriptor *thr_desc_hook (void);
- friend void ACE_OS::cleanup_tss (const u_int);
+ //friend void ACE_OS::cleanup_tss (const u_int);
// = Disallow these operations.
ACE_Log_Msg &operator= (const ACE_Log_Msg &);
diff --git a/ace/OS.h b/ace/OS.h
index df1f434f374..356b1cb48f2 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -4023,17 +4023,6 @@ union semun
};
# endif /* !ACE_HAS_SEMUN || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED)) */
-// Max size of an ACE Log Record data buffer. This can be reset in
-// the config.h file if you'd like to increase or decrease the size.
-# if !defined (ACE_MAXLOGMSGLEN)
-# define ACE_MAXLOGMSGLEN 4 * 1024
-# endif /* ACE_MAXLOGMSGLEN */
-
-// Max size of an ACE Token.
-# define ACE_MAXTOKENNAMELEN 40
-
-// Max size of an ACE Token client ID.
-# define ACE_MAXCLIENTIDLEN MAXHOSTNAMELEN + 20
// Create some useful typedefs.
diff --git a/ace/OS_Dirent.cpp b/ace/OS_Dirent.cpp
index 9055eab500f..8be0cdd60d3 100644
--- a/ace/OS_Dirent.cpp
+++ b/ace/OS_Dirent.cpp
@@ -4,6 +4,7 @@
#include "ace/OS_String.h"
#include "ace/OS_Memory.h"
#include "ace/Log_Msg.h"
+#include "ace/OS.h"
ACE_RCSID(ace, OS_Dirent, "$Id$")
diff --git a/ace/Trace.cpp b/ace/Trace.cpp
index b5031352b10..5a0688ee4bd 100644
--- a/ace/Trace.cpp
+++ b/ace/Trace.cpp
@@ -14,6 +14,7 @@ ACE_RCSID (ace,
#define ACE_NTRACE 1
#include "ace/Log_Msg.h"
+#include "ace/OS.h"
// = Static initialization.
diff --git a/apps/gperf/src/Bool_Array.cpp b/apps/gperf/src/Bool_Array.cpp
index fa14f8a1930..718d997b456 100644
--- a/apps/gperf/src/Bool_Array.cpp
+++ b/apps/gperf/src/Bool_Array.cpp
@@ -24,6 +24,7 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "Bool_Array.h"
+#include "ace/OS_String.h"
ACE_RCSID(src, Bool_Array, "$Id$")
@@ -59,7 +60,7 @@ Bool_Array::open (u_long s)
u_long[s],
-1);
- ACE_OS::memset (storage_array_,
+ ACE_OS_String::memset (storage_array_,
0,
s * sizeof *storage_array_);
@@ -93,9 +94,9 @@ Bool_Array::reset (void)
"(re-initializing bool_array)..."));
this->generation_number_ = 1;
- ACE_OS::memset (storage_array_,
- 0,
- size_ * sizeof *storage_array_);
+ ACE_OS_String::memset (storage_array_,
+ 0,
+ size_ * sizeof *storage_array_);
if (option[DEBUGGING])
ACE_DEBUG ((LM_DEBUG,
"done\n"));
diff --git a/examples/Log_Msg/test_callback.cpp b/examples/Log_Msg/test_callback.cpp
index 958d3853369..a3057a88824 100644
--- a/examples/Log_Msg/test_callback.cpp
+++ b/examples/Log_Msg/test_callback.cpp
@@ -21,6 +21,7 @@
#include "ace/OS.h"
#include "ace/Log_Msg.h"
#include "ace/Log_Msg_Callback.h"
+#include "ace/Log_Record.h"
ACE_RCSID(Log_Msg, test_callback, "$Id$")
diff --git a/examples/Logger/Acceptor-server/server_loggerd.cpp b/examples/Logger/Acceptor-server/server_loggerd.cpp
index a67550e9fb7..136bb29c2ec 100644
--- a/examples/Logger/Acceptor-server/server_loggerd.cpp
+++ b/examples/Logger/Acceptor-server/server_loggerd.cpp
@@ -12,6 +12,7 @@
#include "ace/Synch.h"
#include "ace/Singleton.h"
#include "ace/streams.h"
+#include "ace/Log_Record.h"
#include "server_loggerd.h"
diff --git a/examples/Logger/simple-server/Logging_Handler.cpp b/examples/Logger/simple-server/Logging_Handler.cpp
index 93c55ac21ed..3bb62db4c49 100644
--- a/examples/Logger/simple-server/Logging_Handler.cpp
+++ b/examples/Logger/simple-server/Logging_Handler.cpp
@@ -4,6 +4,7 @@
#include "Logging_Handler.h"
#include "Reactor_Singleton.h"
+#include "ace/Log_Record.h"
ACE_RCSID(simple_server, Logging_Handler, "$Id$")
diff --git a/tests/Log_Msg_Test.cpp b/tests/Log_Msg_Test.cpp
index a325d201d50..4ebd9c76390 100644
--- a/tests/Log_Msg_Test.cpp
+++ b/tests/Log_Msg_Test.cpp
@@ -24,6 +24,7 @@
#include "ace/FILE_Connector.h"
#include "ace/Auto_Ptr.h"
#include "ace/Log_Msg_Callback.h"
+#include "ace/Log_Record.h"
#include "test_config.h"
ACE_RCSID(tests, Log_Msg_Test, "$Id$")