summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-19 15:41:10 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-12-19 15:41:10 +0000
commit8f996543f90d048d4e7dd3c37f345b726e15ec44 (patch)
tree7bdb7cc2c81dabc81f9ce4a209d70411c1b0dd53 /ace
parentbec2422f11f16a3725ce491bcb1908bd9fd3cb90 (diff)
downloadATCD-8f996543f90d048d4e7dd3c37f345b726e15ec44.tar.gz
fixed sigwait for DEC cxx, yet again for cxx V6.0-010
Diffstat (limited to 'ace')
-rw-r--r--ace/OS.h19
-rw-r--r--ace/OS.i14
2 files changed, 22 insertions, 11 deletions
diff --git a/ace/OS.h b/ace/OS.h
index 71bda8336e6..53614e60c3e 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -2950,13 +2950,20 @@ typedef void (*__sighandler_t)(int); // keep Signal compilation happy
extern int t_errno;
#endif /* ACE_LACKS_T_ERRNO */
-#if defined (DIGITAL_UNIX) && defined (__DECCXX_VER)
-// cxx on Digital Unix 4.0 needs this declaration. With it,
-// ::sigwait () works with cxx -pthread. g++ does _not_ need it.
-extern "C" int __P_C(sigwait) __((const sigset_t *set, int *sig));
+#if defined (DIGITAL_UNIX)
+ // sigwait is yet another macro on Digital UNIX 4.0, just causing
+ // trouble when introducing member functions with the same name.
+ // Thanks to Thilo Kielmann" <kielmann@informatik.uni-siegen.de> for
+ // this fix.
+# undef sigwait
+# if defined (__DECCXX_VER)
+ // cxx on Digital Unix 4.0 needs this declaration. With it,
+ // ::_Psigwait () works with cxx -pthread. g++ does _not_ need it.
+ extern "C" int _Psigwait __((const sigset_t *set, int *sig));
+# endif /* __DECCXX_VER */
#elif !defined (ACE_HAS_SIGWAIT)
-extern "C" int sigwait (sigset_t *set);
-#endif /* ! (DIGITAL_UNIX && __DECCXX_VER) && ! ACE_HAS_SIGWAIT */
+ extern "C" int sigwait (sigset_t *set);
+#endif /* ! DIGITAL_UNIX && ! ACE_HAS_SIGWAIT */
#if defined (ACE_HAS_SELECT_H)
#include /**/ <sys/select.h>
diff --git a/ace/OS.i b/ace/OS.i
index b6d732f356f..53c9f941a48 100644
--- a/ace/OS.i
+++ b/ace/OS.i
@@ -4741,12 +4741,16 @@ ACE_OS::sigwait (sigset_t *set, int *sig)
// signal number is returned).
*sig = ::sigwait (set, 0);
return *sig;
-# else /* ! __Lynx __ */
+# elif defined (DIGITAL_UNIX) && defined (__DECCXX_VER)
+ // DEC cxx (but not g++) needs this direct call to its internal
+ // sigwait (). This allows us to #undef sigwait, so that we can
+ // have ACE_OS::sigwait. cxx gets confused by ACE_OS::sigwait if
+ // sigwait is _not_ #undef'ed.
+ errno = ::_Psigwait (set, sig);
+ return errno == 0 ? *sig : -1;
+# else /* ! __Lynx __ && ! (DIGITAL_UNIX && __DECCXX_VER) */
errno = ::sigwait (set, sig);
- if (errno == 0)
- return *sig;
- else
- return -1;
+ return errno == 0 ? *sig : -1;
# endif /* ! __Lynx__ */
#endif /* ACE_HAS_ONEARG_SIGWAIT */
#elif defined (ACE_HAS_WTHREADS)