From 880e2e46a39bde1c4d83fba0c5632c3d1e7a7b0d Mon Sep 17 00:00:00 2001 From: levine Date: Sat, 21 Dec 1996 15:43:08 +0000 Subject: fixes for VxWorks and inlining (moved #include of OS.i after #defines but before other ace #includes --- ace/OS.h | 34 ++++++++++++++++++++-------------- ace/OS.i | 8 ++++---- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/ace/OS.h b/ace/OS.h index 3e9f9c281c5..7d64b9f0d77 100644 --- a/ace/OS.h +++ b/ace/OS.h @@ -149,7 +149,13 @@ // keep the compiler from complaining of // parameters which are not used. +#if defined (ghs) +// GreenHills C++ 1.8.8 complains that the (a) expression has no effect. But, +// it doesn't complain about unused args, so don't bother with them. +#define ACE_UNUSED_ARG(a) +#else #define ACE_UNUSED_ARG(a) (a) +#endif /* ghs */ // These hooks enable ACE to have all dynamic memory management // automatically handled on a per-object basis. @@ -756,7 +762,7 @@ struct ACE_cond_t long waiters_; // Number of waiting threads. - ACE_thread_mutex waiters_lock_; + ACE_thread_mutex_t waiters_lock_; // Serialize access to the waiters count. ACE_sema_t sema_; @@ -2453,11 +2459,6 @@ private: // Ensure we can't define an instance of this class. }; -#include "ace/Trace.h" - -// These need to come here to avoid problems with circular dependencies. -#include "ace/Log_Msg.h" - // A useful abstraction for expressions involving operator new since // we can change memory allocation error handling policies (e.g., // depending on whether ANSI/ISO exception handling semantics are @@ -2515,14 +2516,6 @@ private: #endif /* UNICODE */ -#if defined (UNICODE) -#include "ace/SString.h" -#define ACE_WIDE_STRING(ASCII) \ -ACE_WString (ASCII).fast_rep () -#else -#define ACE_WIDE_STRING(ASCII) ASCII -#endif /* UNICODE */ - #if defined (ACE_HAS_INLINED_OSCALLS) #if defined (ACE_INLINE) #undef ACE_INLINE @@ -2531,4 +2524,17 @@ ACE_WString (ASCII).fast_rep () #include "ace/OS.i" #endif /* ACE_HAS_INLINED_OSCALLS */ +#include "ace/Trace.h" + +// These need to come here to avoid problems with circular dependencies. +#include "ace/Log_Msg.h" + +#if defined (UNICODE) +#include "ace/SString.h" +#define ACE_WIDE_STRING(ASCII) \ +ACE_WString (ASCII).fast_rep () +#else +#define ACE_WIDE_STRING(ASCII) ASCII +#endif /* UNICODE */ + #endif /* ACE_OS_H */ diff --git a/ace/OS.i b/ace/OS.i index dc605e44d2c..7def262f4cd 100644 --- a/ace/OS.i +++ b/ace/OS.i @@ -1107,7 +1107,7 @@ ACE_OS::cond_init (ACE_cond_t *cv, int type, LPCTSTR name, void *arg) int result = 0; if (ACE_OS::sema_init (&cv->sema_, 0, type, name, arg) == -1) result = -1; - else if (ACE_OS::mutex_init (&cs->waiters_lock_) = -1) + else if (ACE_OS::mutex_init (&cv->waiters_lock_) = -1) result = -1; else if (ACE_OS::event_init (&cv->waiters_done_) == -1) result = -1; @@ -1261,7 +1261,7 @@ ACE_OS::cond_wait (ACE_cond_t *cv, // Reset errno in case mutex_lock() also fails... errno = error; return result; -#endif /* ACE_HAS_STHREADS */ +#endif /* ACE_HAS_DCETHREADS || ACE_HAS_PTHREADS */ #else ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_THREADS */ @@ -2201,7 +2201,7 @@ ACE_OS::gethostbyname (const char *name) static int first_addr; static char *hostaddr[2]; - if ((first_addr = (char *) ::hostGetByName ((char *) name)) < 0) + if ((first_addr = ::hostGetByName ((char *) name)) < 0) return 0; hostaddr[0] = (char *) &first_addr; hostaddr[1] = 0; @@ -3187,7 +3187,7 @@ ACE_OS::thr_getprio (ACE_hthread_t thr_id, int &prio) prio = ::GetThreadPriority (thr_id); return prio == THREAD_PRIORITY_ERROR_RETURN ? -1 : 0; #elif defined (VXWORKS) - ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::taskPriorityGet (thr_id, prio), ace_result_), int, -1); + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::taskPriorityGet (thr_id, &prio), ace_result_), int, -1); #endif /* ACE_HAS_STHREADS */ #else ACE_NOTSUP_RETURN (-1); -- cgit v1.2.1