summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-04-10 22:54:22 +0000
committeriliyan <iliyan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-04-10 22:54:22 +0000
commit4188231a388606a1f0dde08e23b91344bc508a4e (patch)
tree658b61cbd239686f008548ca39a8f92d7b4cc703
parentff8463c0927e06c4b9eb156c736aa0446583527f (diff)
downloadATCD-4188231a388606a1f0dde08e23b91344bc508a4e.tar.gz
Merged revisions 81311-81315,81317-81318,81322-81323,81326,81332 via svnmerge from
https://svn.dre.vanderbilt.edu/DOC/Middleware/trunk/ACE ........ r81311 | iliyan | 2008-04-09 15:23:57 -0500 (Wed, 09 Apr 2008) | 1 line ChangeLogTag: Wed Apr 9 20:22:46 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> ........ r81312 | iliyan | 2008-04-09 16:01:34 -0500 (Wed, 09 Apr 2008) | 1 line ChangeLogTag: Wed Apr 9 22:05:30 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> ........ r81313 | iliyan | 2008-04-09 19:52:07 -0500 (Wed, 09 Apr 2008) | 1 line ChangeLogTag: Thu Apr 10 00:50:53 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> ........ r81314 | johnnyw | 2008-04-10 01:41:35 -0500 (Thu, 10 Apr 2008) | 1 line Thu Apr 10 06:41:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> ........ r81315 | johnnyw | 2008-04-10 02:14:15 -0500 (Thu, 10 Apr 2008) | 1 line Thu Apr 10 07:13:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> ........ r81317 | johnnyw | 2008-04-10 05:05:39 -0500 (Thu, 10 Apr 2008) | 1 line Thu Apr 10 10:03:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> ........ r81318 | johnnyw | 2008-04-10 05:12:05 -0500 (Thu, 10 Apr 2008) | 1 line Thu Apr 10 10:11:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> ........ r81322 | elliott_c | 2008-04-10 08:27:02 -0500 (Thu, 10 Apr 2008) | 1 line ChangeLogTag: Thu Apr 10 13:27:13 UTC 2008 Chad Elliott <elliott_c@ociweb.com> ........ r81323 | elliott_c | 2008-04-10 08:29:47 -0500 (Thu, 10 Apr 2008) | 1 line ChangeLogTag: Thu Apr 10 13:27:13 UTC 2008 Chad Elliott <elliott_c@ociweb.com> ........ r81326 | iliyan | 2008-04-10 09:57:51 -0500 (Thu, 10 Apr 2008) | 1 line ChangeLogTag: Thu Apr 10 14:42:04 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> ........ r81332 | iliyan | 2008-04-10 17:47:04 -0500 (Thu, 10 Apr 2008) | 1 line ChangeLogTag: Thu Apr 10 22:32:58 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com> ........
-rw-r--r--ACE/ChangeLog111
-rw-r--r--ACE/ace/Dev_Poll_Reactor.cpp3
-rw-r--r--ACE/ace/Dynamic_Service.inl5
-rw-r--r--ACE/ace/Notification_Queue.cpp6
-rw-r--r--ACE/ace/Notification_Queue.inl3
-rw-r--r--ACE/ace/Service_Config.cpp118
-rw-r--r--ACE/ace/Service_Config.h35
-rw-r--r--ACE/ace/Service_Gestalt.h1
-rw-r--r--ACE/ace/Service_Object.cpp1
-rw-r--r--ACE/ace/Service_Repository.cpp3
-rw-r--r--ACE/ace/Sock_Connect.cpp1
-rw-r--r--ACE/ace/Svc_Conf.h29
-rw-r--r--ACE/ace/Svc_Conf.y8
-rw-r--r--ACE/ace/Svc_Conf_Token_Table.h83
-rw-r--r--ACE/ace/Svc_Conf_Tokens.h92
-rw-r--r--ACE/ace/Svc_Conf_y.cpp18
-rw-r--r--ACE/ace/svcconf.mpb24
-rw-r--r--ACE/include/makeinclude/platform_linux_pgi.GNU11
-rw-r--r--ACE/tests/Bug_2980_Regression_Test.cpp40
-rw-r--r--ACE/tests/tests.mpc6
20 files changed, 402 insertions, 196 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 3ae48c7ebbf..f5448d3ef8c 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,114 @@
+Thu Apr 10 22:32:58 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
+
+ * ace/Service_Config.h:
+ * ace/Service_Config.cpp:
+
+ Fixing compile problems with single-thread-only builds - using
+ the compiler's abilities (partial specialization) to generate
+ appropriate code.
+
+ * ace/Svc_Conf.h:
+ * ace/Svc_Conf_Token_Table.h:
+ * ace/Svc_Conf_Tokens.h:
+ * ace/Svc_Conf_y.cpp:
+ * ace/svcconf.mpb:
+
+ Changes to fix compile problems related to versioned namespace
+ use. Eliminated custom token file post-processing - replaced
+ with a wrapper header file (yacc(1) is now producing
+ Token_Table.h, which gets included in Tokens.h)
+
+Thu Apr 10 14:42:04 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
+
+ * ace/Svc_Conf.h:
+
+ Adding YYSTYPE_IS_DECLARED to prevent yacc(1) from trying to use a
+ trivial definition of YYSTYPE.
+
+ * ace/Svc_Conf.y:
+
+ Fixing an unused variable warning. Adding an YYSTYPE guard.
+
+ * ace/Svc_Conf_Tokens.h:
+ * ace/Svc_Conf_y.cpp:
+ * ace/svcconf.mpb:
+
+ Undefining YYSTYPE_IS_DECLARED at the bottom of Svc_Conf_Tokens.h
+ prevents it from leaking and poluting the global namespace. This
+ allows other yacc(1) based parsers to be used in ACE
+ apps. Cleaning up and recording generated files.
+
+Thu Apr 10 13:27:13 UTC 2008 Chad Elliott <elliott_c@ociweb.com>
+
+ * tests/Bug_2980_Regression_Test.cpp:
+
+ Fixed compilation issues and reversed the CAN_RUN_TEST check to
+ get it to run on non-win32 and non-vxworks operating systems.
+
+Thu Apr 10 10:11:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Dynamic_Service.inl:
+ Corrected method signatures
+
+Thu Apr 10 10:03:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * tests/Bug_2980_Regression_Test.cpp:
+ Fixed BCB compile error
+
+Thu Apr 10 07:13:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * include/makeinclude/platform_linux_pgi.GNU:
+ Removed deprecated linker flags
+
+ * ace/Dev_Poll_Reactor.cpp:
+ * ace/Notification_Queue.cpp:
+ * ace/Service_Config.cpp:
+ * ace/Service_Object.cpp:
+ * ace/Sock_Connect.cpp:
+ Added missing includes
+
+ * ace/Notification_Queue.cpp:
+ * ace/Notification_Queue.inl:
+ Added missing versioned namespace macros
+
+Thu Apr 10 06:41:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/Service_Gestalt.h:
+ Added include of Guard_T.h
+
+ * include/makeinclude/platform_linux_pgi.GNU:
+ Updated for latest pgCC version
+
+Thu Apr 10 00:50:53 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
+
+ * tests/Bug_2980_Regression_Test.cpp:
+ * tests/tests.mpc:
+
+ Fixing a compile problem with no-threads builds.
+
+Wed Apr 9 22:05:30 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
+
+ * ace/Svc_Conf.h:
+ * ace/Svc_Conf.y:
+ * ace/Svc_Conf_Lexer.h:
+ * ace/Svc_Conf_Lexer.cpp:
+ * ace/Svc_Conf_Param.h:
+ * ace/Svc_Conf_Tokens.h:
+ * ace/Svc_Conf_y.cpp:
+ * ace/svcconf.mpb:
+
+ Simplified the build sequence reducing the number of additional
+ transformations needed for Bison's parser output. That includes
+ the elimination of the ACE_YY prefix, which was necessary only
+ because of these transformations. Added ACE_TEXT around naked
+ string literals. Fixed build warnings with unicode builds.
+
+Wed Apr 9 20:22:46 UTC 2008 Iliyan Jeliazkov <iliyan@ociweb.com>
+
+ * ace/Service_Repository.cpp:
+ Fixing relocate_i to both account for empty slots _and_ provide
+ useful logging.
+
Wed Apr 9 18:24:57 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
* bin/tao_orb_tests.lst:
diff --git a/ACE/ace/Dev_Poll_Reactor.cpp b/ACE/ace/Dev_Poll_Reactor.cpp
index cfa87d00650..526a994c2c1 100644
--- a/ACE/ace/Dev_Poll_Reactor.cpp
+++ b/ACE/ace/Dev_Poll_Reactor.cpp
@@ -42,6 +42,9 @@ ACE_RCSID (ace,
#include "ace/Null_Mutex.h"
#include "ace/os_include/os_poll.h"
#include "ace/OS_NS_sys_mman.h"
+#include "ace/Guard_T.h"
+#include "ace/OS_NS_string.h"
+#include "ace/OS_NS_sys_time.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Dynamic_Service.inl b/ACE/ace/Dynamic_Service.inl
index 40c4a6bbe0a..f818cf09411 100644
--- a/ACE/ace/Dynamic_Service.inl
+++ b/ACE/ace/Dynamic_Service.inl
@@ -20,21 +20,20 @@ ACE_Dynamic_Service<TYPE>::instance (const ACE_ANTI_TCHAR *name,
}
template <class TYPE> ACE_INLINE TYPE *
-ACE_Dynamic_Service<TYPE>::instance (const ACE_Service_Gestalt_Auto_Ptr repo,
+ACE_Dynamic_Service<TYPE>::instance (const ACE_Service_Gestalt* repo,
const ACE_ANTI_TCHAR *name)
{
return instance (repo, ACE_TEXT_CHAR_TO_TCHAR (name),false);
}
template <class TYPE> ACE_INLINE TYPE *
-ACE_Dynamic_Service<TYPE>::instance (const ACE_Service_Gestalt_Auto_Ptr repo,
+ACE_Dynamic_Service<TYPE>::instance (const ACE_Service_Gestalt* repo,
const ACE_ANTI_TCHAR *name,
bool no_global)
{
return instance (repo, ACE_TEXT_CHAR_TO_TCHAR (name),no_global);
}
-
#endif // ACE_USES_WCHAR
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Notification_Queue.cpp b/ACE/ace/Notification_Queue.cpp
index ee0b6a31100..5d42ca5b44f 100644
--- a/ACE/ace/Notification_Queue.cpp
+++ b/ACE/ace/Notification_Queue.cpp
@@ -6,6 +6,10 @@
#include "ace/Notification_Queue.inl"
#endif /* __ACE_INLINE__ */
+#include "ace/Guard_T.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
ACE_Notification_Queue::
ACE_Notification_Queue()
: ACE_Copy_Disabled()
@@ -220,3 +224,5 @@ ACE_Notification_Queue::pop_next_notification(
return 1;
}
+
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Notification_Queue.inl b/ACE/ace/Notification_Queue.inl
index b7ef09a820f..247205144ce 100644
--- a/ACE/ace/Notification_Queue.inl
+++ b/ACE/ace/Notification_Queue.inl
@@ -1,5 +1,7 @@
// $Id$
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
ACE_INLINE ACE_Notification_Queue_Node::
ACE_Notification_Queue_Node()
: ACE_Intrusive_List_Node<ACE_Notification_Queue_Node>()
@@ -44,4 +46,5 @@ clear_mask(ACE_Reactor_Mask mask)
ACE_CLR_BITS(contents_.mask_, mask);
}
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Service_Config.cpp b/ACE/ace/Service_Config.cpp
index 1eda39f8a8b..37d8dcf4ffa 100644
--- a/ACE/ace/Service_Config.cpp
+++ b/ACE/ace/Service_Config.cpp
@@ -16,9 +16,13 @@
#endif /* !ACE_LACKS_UNIX_SIGNALS */
#include "ace/OS_NS_time.h"
+#include "ace/OS_NS_stdio.h"
+#include "ace/OS_NS_unistd.h"
+#include "ace/Thread.h"
#include "ace/Get_Opt.h"
#include "ace/ARGV.h"
#include "ace/Log_Msg.h"
+#include "ace/ACE.h"
ACE_RCSID (ace,
Service_Config,
@@ -26,6 +30,74 @@ ACE_RCSID (ace,
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+template <>
+ACE_Threading_Helper<ACE_Thread_Mutex>::ACE_Threading_Helper ()
+ : key_ (ACE_OS::NULL_key)
+{
+# if defined (ACE_HAS_TSS_EMULATION)
+ ACE_Object_Manager::init_tss ();
+# endif
+
+ if (ACE_Thread::keycreate (&key_, 0, 0) == -1)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Failed to create thread key: %p\n"),
+ ""));
+ }
+}
+
+template <>
+ACE_Threading_Helper<ACE_Null_Mutex>::ACE_Threading_Helper ()
+ : key_ (ACE_OS::NULL_key)
+{
+}
+
+
+template <>
+ACE_Threading_Helper<ACE_Thread_Mutex>::~ACE_Threading_Helper ()
+{
+ ACE_OS::thr_key_detach (this->key_, 0);
+ ACE_OS::thr_keyfree (this->key_);
+}
+
+template <>
+ACE_Threading_Helper<ACE_Null_Mutex>::~ACE_Threading_Helper ()
+{
+}
+
+template <> void
+ACE_Threading_Helper<ACE_Thread_Mutex>::set (void* p)
+{
+ if (ACE_Thread::setspecific (key_, p) == -1)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Service Config failed to set thread key value: %p\n"),
+ ""));
+}
+
+template <> void
+ACE_Threading_Helper<ACE_Null_Mutex>::set (void*)
+{
+}
+
+template <> void*
+ACE_Threading_Helper<ACE_Thread_Mutex>::get (void)
+{
+ void* temp = 0;
+ if (ACE_Thread::getspecific (key_, &temp) == -1)
+ ACE_ERROR_RETURN ((LM_ERROR,
+ ACE_TEXT ("(%P|%t) Service Config failed to get thread key value: %p\n"),
+ ""),
+ 0);
+ return temp;
+}
+
+template <> void*
+ACE_Threading_Helper<ACE_Null_Mutex>::get (void)
+{
+ return ACE_Service_Config::singleton()->instance_.get ();
+}
+
+
/**
* @c ACE_Service_Config is supposed to be a Singleton. This is the
* only Configuration Gestalt available for access from static
@@ -377,52 +449,6 @@ ACE_Service_Config::ACE_Service_Config (const ACE_TCHAR program_name[],
}
}
-ACE_Threading_Helper::ACE_Threading_Helper ()
- : key_ (ACE_OS::NULL_key)
-{
-#if defined (ACE_HAS_TSS_EMULATION)
- ACE_Object_Manager::init_tss ();
-#endif
-
- if (ACE_Thread::keycreate (&key_, 0, 0) == -1)
- {
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%P|%t) Failed to create thread key: %p\n"),
- ""));
- }
-}
-
-
-ACE_Threading_Helper::~ACE_Threading_Helper ()
-{
-#if defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
- ACE_OS::thr_key_detach (this->key_, 0);
- ACE_OS::thr_keyfree (this->key_);
-#else // defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
-
-#endif // defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))
-}
-
-void
-ACE_Threading_Helper::set (void* p)
-{
- if (ACE_Thread::setspecific (key_, p) == -1)
- ACE_ERROR ((LM_ERROR,
- ACE_TEXT ("(%P|%t) Service Config failed to set thread key value: %p\n"),
- ""));
-}
-
-void*
-ACE_Threading_Helper::get (void)
-{
- void* temp = 0;
- if (ACE_Thread::getspecific (key_, &temp) == -1)
- ACE_ERROR_RETURN ((LM_ERROR,
- ACE_TEXT ("(%P|%t) Service Config failed to get thread key value: %p\n"),
- ""),
- 0);
- return temp;
-}
/// Return the "global" configuration instance, for the current
diff --git a/ACE/ace/Service_Config.h b/ACE/ace/Service_Config.h
index 5a1a74be512..3268950a5ba 100644
--- a/ACE/ace/Service_Config.h
+++ b/ACE/ace/Service_Config.h
@@ -19,6 +19,7 @@
#include "ace/Default_Constants.h"
#include "ace/Intrusive_Auto_Ptr.h"
#include "ace/Service_Gestalt.h"
+#include "ace/Synch_Traits.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
@@ -133,6 +134,7 @@ public:
bool operator!= (ACE_Static_Svc_Descriptor &) const;
};
+
/**
* @class ACE_Threading_Helper
*
@@ -140,9 +142,13 @@ public:
* manipulating the value, associated with a thread-specific
* key. Relates to the ability of the created thread to inherit the
* parent thread's gestalt. Designed to be used as an instance member
- * of @c ACE_Service_Config
+ * of @c ACE_Service_Config.
+ *
+ * Partial specialization over ACE_SYNCH_MUTEX is used to implement
+ * specific behavior in both multi- and single-threaded builds.
*/
-class ACE_Export ACE_Threading_Helper
+template <typename LOCK>
+class ACE_Threading_Helper
{
public:
ACE_Threading_Helper ();
@@ -153,18 +159,13 @@ public:
private:
- /**
- * Key for the thread-specific data Service Configuration keeps
- * around. This datum is a simple pointer to the configuration
- * context (Gestalt).
- */
+ /// Key for the thread-specific data, which is a simple pointer to
+ /// the thread's (currently-) global configuration context.
ACE_thread_key_t key_;
};
#define ACE_Component_Config ACE_Service_Config
-typedef ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> ACE_Service_Gestalt_Auto_Ptr;
-
/**
* @class ACE_Service_Config
*
@@ -202,7 +203,7 @@ class ACE_Export ACE_Service_Config
// The Instance, or the global (default) configuration context.
// The monostate would forward the calls to that instance. The TSS
// will point here
- ACE_Service_Gestalt_Auto_Ptr instance_;
+ ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> instance_;
public:
@@ -257,9 +258,13 @@ protected:
virtual int parse_args_i (int argc, ACE_TCHAR *argv[]);
/**
- * A helper instance to manage thread-specific key creation
+ * A helper instance to manage thread-specific key creation.
+ * Dependent on the syncronization mutex ACE uses, the corresponding
+ * partial template instantiation will perform the right services
+ * that have to do with managing thread-specific storage. Note that,
+ * for single-threaded builds they would do (next to) nothing.
*/
- ACE_Threading_Helper threadkey_;
+ ACE_Threading_Helper<ACE_SYNCH_MUTEX> threadkey_;
/// = Static interfaces
@@ -606,6 +611,10 @@ private:
/// This class needs the intimate access to be able to swap the
/// current TSS pointer for the global Gestalt.
friend class ACE_Service_Config_Guard;
+
+ /// The helper needs intimate access (when building with no threads)
+ friend class ACE_Threading_Helper <ACE_Thread_Mutex>;
+ friend class ACE_Threading_Helper <ACE_Null_Mutex>;
};
/**
@@ -631,7 +640,7 @@ private:
ACE_Service_Config_Guard& operator= (const ACE_Service_Config_Guard&);
private:
- ACE_Service_Gestalt_Auto_Ptr saved_;
+ ACE_Intrusive_Auto_Ptr<ACE_Service_Gestalt> saved_;
};
diff --git a/ACE/ace/Service_Gestalt.h b/ACE/ace/Service_Gestalt.h
index 3c356de832f..0ec6ac0965d 100644
--- a/ACE/ace/Service_Gestalt.h
+++ b/ACE/ace/Service_Gestalt.h
@@ -30,6 +30,7 @@
#include "ace/OS_NS_signal.h"
#include "ace/Synch_Traits.h"
#include "ace/Atomic_Op.h"
+#include "ace/Guard_T.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Service_Object.cpp b/ACE/ace/Service_Object.cpp
index 4e7d16a267e..cdc3672c774 100644
--- a/ACE/ace/Service_Object.cpp
+++ b/ACE/ace/Service_Object.cpp
@@ -12,6 +12,7 @@
#include "ace/Service_Types.h"
#include "ace/DLL.h"
#include "ace/ACE.h"
+#include "ace/Log_Msg.h"
#if defined (ACE_OPENVMS)
# include "ace/Lib_Find.h"
#endif
diff --git a/ACE/ace/Service_Repository.cpp b/ACE/ace/Service_Repository.cpp
index 36ba298d1e0..126457c3ddf 100644
--- a/ACE/ace/Service_Repository.cpp
+++ b/ACE/ace/Service_Repository.cpp
@@ -316,7 +316,8 @@ ACE_Service_Repository::relocate_i (size_t begin,
ACE_Service_Type *type =
const_cast<ACE_Service_Type *> (this->service_vector_[i]);
- ACE_SHLIB_HANDLE old_handle = type->dll ().get_handle (0);
+ ACE_SHLIB_HANDLE old_handle = (type == 0) ? ACE_SHLIB_INVALID_HANDLE
+ : type->dll ().get_handle (0);
#ifndef ACE_NLOGGING
if (ACE::debug ())
diff --git a/ACE/ace/Sock_Connect.cpp b/ACE/ace/Sock_Connect.cpp
index 3046cfc1a50..a24ba1f63fd 100644
--- a/ACE/ace/Sock_Connect.cpp
+++ b/ACE/ace/Sock_Connect.cpp
@@ -8,6 +8,7 @@
#include "ace/SString.h"
#include "ace/OS_Memory.h"
#include "ace/OS_NS_stdio.h"
+#include "ace/ACE.h"
#if defined (sparc)
# include "ace/OS_NS_fcntl.h"
diff --git a/ACE/ace/Svc_Conf.h b/ACE/ace/Svc_Conf.h
index d88efcce238..783546fec77 100644
--- a/ACE/ace/Svc_Conf.h
+++ b/ACE/ace/Svc_Conf.h
@@ -23,9 +23,27 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Parse_Node.h"
-
#include "ace/Svc_Conf_Param.h"
+// Make sure the yacc(1) function declarations are _outside_
+// any ACE versioned namespace. The block below is verbatim
+// from the template that comes with bison (ver. 2.3).
+
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int ace_yyparse (void *YYPARSE_PARAM);
+#else
+int ace_yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int ace_yyparse (void);
+#else
+int ace_yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#if (ACE_USES_CLASSIC_SVC_CONF == 1)
@@ -53,16 +71,11 @@ typedef union
ACE_TCHAR *ident_;
} YYSTYPE;
+#define YYSTYPE_IS_DECLARED
+
// Forward declaration
struct ace_yy_buffer_state;
-/// Performs the parsing
-#ifdef YYPARSE_PARAM
-int ace_yyparse (void *);
-#else
-int ace_yyparse (void);
-#endif
-
/// Performs the lexical analysis
YY_DECL;
diff --git a/ACE/ace/Svc_Conf.y b/ACE/ace/Svc_Conf.y
index e38be91dd79..6c45e9c5f20 100644
--- a/ACE/ace/Svc_Conf.y
+++ b/ACE/ace/Svc_Conf.y
@@ -38,6 +38,13 @@ static ACE_Module_Type *
// Normalize the message literal's type to match yyerror() prototype
#define YY_ ACE_TEXT
+// Prevent yacc(1) from declaring a trivial YYSTYPE just because
+// YYSTYPE is not a macro definition. On the other hand we want
+// YYSTYPE_IS_DECLARED to be as localized as possible to avoid
+// poluting the global namespace - there may be other yacc(1) parsers
+// that want to play nice with ACE
+#define YYSTYPE_IS_DECLARED
+
ACE_END_VERSIONED_NAMESPACE_DECL
%}
@@ -153,6 +160,7 @@ stream_modules
}
module_list '}'
{
+ ACE_UNUSED_ARG ($2);
$$ = $3;
}
| /* EMPTY */ { $$ = 0; }
diff --git a/ACE/ace/Svc_Conf_Token_Table.h b/ACE/ace/Svc_Conf_Token_Table.h
new file mode 100644
index 00000000000..cd7c912b765
--- /dev/null
+++ b/ACE/ace/Svc_Conf_Token_Table.h
@@ -0,0 +1,83 @@
+/* A Bison parser, made by GNU Bison 2.3. */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+/* Tokens. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ /* Put the tokens into the symbol table, so that GDB and other debuggers
+ know about them. */
+ enum ace_yytokentype {
+ ACE_DYNAMIC = 258,
+ ACE_STATIC = 259,
+ ACE_SUSPEND = 260,
+ ACE_RESUME = 261,
+ ACE_REMOVE = 262,
+ ACE_USTREAM = 263,
+ ACE_MODULE_T = 264,
+ ACE_STREAM_T = 265,
+ ACE_SVC_OBJ_T = 266,
+ ACE_ACTIVE = 267,
+ ACE_INACTIVE = 268,
+ ACE_PATHNAME = 269,
+ ACE_IDENT = 270,
+ ACE_STRING = 271
+ };
+#endif
+/* Tokens. */
+#define ACE_DYNAMIC 258
+#define ACE_STATIC 259
+#define ACE_SUSPEND 260
+#define ACE_RESUME 261
+#define ACE_REMOVE 262
+#define ACE_USTREAM 263
+#define ACE_MODULE_T 264
+#define ACE_STREAM_T 265
+#define ACE_SVC_OBJ_T 266
+#define ACE_ACTIVE 267
+#define ACE_INACTIVE 268
+#define ACE_PATHNAME 269
+#define ACE_IDENT 270
+#define ACE_STRING 271
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef int YYSTYPE;
+# define ace_yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
diff --git a/ACE/ace/Svc_Conf_Tokens.h b/ACE/ace/Svc_Conf_Tokens.h
index 94204f7dcc5..f31729b838c 100644
--- a/ACE/ace/Svc_Conf_Tokens.h
+++ b/ACE/ace/Svc_Conf_Tokens.h
@@ -1,90 +1,18 @@
// $Id$
#ifndef BISON_SVC_CONF_TAB_H
-# define BISON_SVC_CONF_TAB_H
-# define YYSTYPE_IS_DECLARED 1
-/* A Bison parser, made by GNU Bison 2.3. */
+# define BISON_SVC_CONF_TAB_H
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/// This file "wraps" around the one produced by yacc(1) and ensures
+/// that various symbols do not polute the global namespace. This
+/// allows ACE-based applications to incorporate other yacc(1)-derived
+/// parsers.
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
-
-/* As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison. */
-
-/* Tokens. */
-#ifndef YYTOKENTYPE
-# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum ace_yytokentype {
- ACE_DYNAMIC = 258,
- ACE_STATIC = 259,
- ACE_SUSPEND = 260,
- ACE_RESUME = 261,
- ACE_REMOVE = 262,
- ACE_USTREAM = 263,
- ACE_MODULE_T = 264,
- ACE_STREAM_T = 265,
- ACE_SVC_OBJ_T = 266,
- ACE_ACTIVE = 267,
- ACE_INACTIVE = 268,
- ACE_PATHNAME = 269,
- ACE_IDENT = 270,
- ACE_STRING = 271
- };
-#endif
-/* Tokens. */
-#define ACE_DYNAMIC 258
-#define ACE_STATIC 259
-#define ACE_SUSPEND 260
-#define ACE_RESUME 261
-#define ACE_REMOVE 262
-#define ACE_USTREAM 263
-#define ACE_MODULE_T 264
-#define ACE_STREAM_T 265
-#define ACE_SVC_OBJ_T 266
-#define ACE_ACTIVE 267
-#define ACE_INACTIVE 268
-#define ACE_PATHNAME 269
-#define ACE_IDENT 270
-#define ACE_STRING 271
-
-
-
-
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
-# define ace_yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
+# if !defined (YYSTYPE_IS_DECLARED)
+# define YYSTYPE_IS_DECLARED 1
+# endif
+# include "ace/Svc_Conf_Token_Table.h"
+# undef YYSTYPE_IS_DECLARED
#endif /* ifndef BISON_SVC_CONF_TAB_H */
diff --git a/ACE/ace/Svc_Conf_y.cpp b/ACE/ace/Svc_Conf_y.cpp
index 0c7970258b9..fe7731a21d7 100644
--- a/ACE/ace/Svc_Conf_y.cpp
+++ b/ACE/ace/Svc_Conf_y.cpp
@@ -143,6 +143,13 @@ static ACE_Module_Type *
// Normalize the message literal's type to match ace_yyerror() prototype
#define YY_ ACE_TEXT
+// Prevent yacc(1) from declaring a trivial YYSTYPE just because
+// YYSTYPE is not a macro definition. On the other hand we want
+// YYSTYPE_IS_DECLARED to be as localized as possible to avoid
+// poluting the global namespace - there may be other yacc(1) parsers
+// that want to play nice with ACE
+#define YYSTYPE_IS_DECLARED
+
ACE_END_VERSIONED_NAMESPACE_DECL
@@ -476,11 +483,11 @@ static const ace_yytype_int8 ace_yyrhs[] =
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const ace_yytype_uint16 ace_yyrline[] =
{
- 0, 65, 65, 74, 78, 82, 83, 84, 85, 86,
- 87, 91, 101, 108, 115, 122, 129, 133, 133, 140,
- 143, 150, 149, 158, 162, 170, 174, 177, 191, 200,
- 209, 231, 238, 242, 247, 253, 257, 261, 268, 272,
- 276, 283, 284, 288, 289, 290
+ 0, 72, 72, 81, 85, 89, 90, 91, 92, 93,
+ 94, 98, 108, 115, 122, 129, 136, 140, 140, 147,
+ 150, 157, 156, 166, 170, 178, 182, 185, 199, 208,
+ 217, 239, 246, 250, 255, 261, 265, 269, 276, 280,
+ 284, 291, 292, 296, 297, 298
};
#endif
@@ -1526,6 +1533,7 @@ ace_yyreduce:
case 22:
{
+ ACE_UNUSED_ARG ((ace_yyvsp[(2) - (4)]));
(ace_yyval.parse_node_) = (ace_yyvsp[(3) - (4)].parse_node_);
;}
break;
diff --git a/ACE/ace/svcconf.mpb b/ACE/ace/svcconf.mpb
index d78712e1826..3bf43d6de78 100644
--- a/ACE/ace/svcconf.mpb
+++ b/ACE/ace/svcconf.mpb
@@ -26,14 +26,6 @@ feature(ace_svcconf) {
XML_Svc_Conf.cpp
}
-// " -e 's/->ace_yylineno/->yylineno/g' \\" // added by the substitution, above.
-/// " -e 's/^char /ACE_TCHAR /g' \\"
-/// " -e 's/\([^d]\) char /\$1 ACE_TCHAR /g' \\"
-/// " -e 's/(char/(ACE_TCHAR/g' \\"
-
-// " -e 's/ace_yyerror[ ]*([ ]*YY_/ace_yyerror (ACE_SVC_CONF_PARAM->yyerrno, ACE_SVC_CONF_PARAM->yylineno, YY_/g' \\"
-/// " -e 's/ace_yyerror (int ace_yyerrno, int ace_yylineno, const ACE_TCHAR/ace_yyerror (int ace_yyerrno, int ace_yylineno, const char/' \\"
-
verbatim(gnuace, local) {
"Svc_Conf_y.cpp: Svc_Conf.y"
"ifeq ($(notdir $(YACC)), bison)"
@@ -41,29 +33,23 @@ feature(ace_svcconf) {
" sed -e 's/fprintf/ACE_OS::fprintf/g' \\" // Use ACE's fprintf, not library's
" -e 's/\\t/ /g' \\" // Eliminate tabs (replace with 2 spaces)
" -e 's/yy/ace_yy/g' \\"
- " -e 's/->ace_yyerrno/->yyerrno/g' \\" // These reverse the unwanted ace_ prefix
- " -e 's/->ace_yylineno/->yylineno/g' \\" // added by the substitution, above.
+ " -e 's/->ace_yyerrno/->yyerrno/g' \\" // This reverses the ace_ prefix where it
+ " -e 's/->ace_yylineno/->yylineno/g' \\" // should not have been added by the substitution, above.
" -e 's/ NULL/ 0/g' \\"
" -e 's/ace_yyerror[ ]*([ ]*\"/ace_yyerror (ACE_SVC_CONF_PARAM->yyerrno, ACE_SVC_CONF_PARAM->yylineno, \"/g' \\"
" -e 's/ace_yyerror[ ]*([ ]*ace_yymsg/ace_yyerror (ACE_SVC_CONF_PARAM->yyerrno, ACE_SVC_CONF_PARAM->yylineno, ace_yymsg/g' \\"
" -e 's/ace_yyerror[ ]*([ ]*YY_/ace_yyerror (ACE_SVC_CONF_PARAM->yyerrno, ACE_SVC_CONF_PARAM->yylineno, YY_/g' \\"
" -e 's@#include <stdio\.h>@@' \\"
" -e 's/Svc_Conf\\.tab\\.c/Svc_Conf_y.cpp/g' <Svc_Conf.tab.c >$@"
-// " $(RM) -f Svc_Conf.tab.c Svc_Conf_y.cpp.orig"
+ " $(RM) -f Svc_Conf.tab.c Svc_Conf_y.cpp.orig"
"else"
" @echo 'ERROR: You must use bison 1.35 or higher to process this file'"
" @/bin/false"
"endif"
- "Svc_Conf_Tokens.h: Svc_Conf.y Svc_Conf_y.cpp"
+ "Svc_Conf_Token_Table.h: Svc_Conf.y Svc_Conf_y.cpp"
"ifeq ($(notdir $(YACC)), bison)"
- " echo \/\/ '$$I''d:$$' >$@"
- " echo '#ifndef BISON_SVC_CONF_TAB_H' >>$@" // Inclusion protection macros
- " echo '# define BISON_SVC_CONF_TAB_H' >>$@" // ... same ...
- " echo '# define YYSTYPE_IS_DECLARED 1' >>$@" // Don't use Svc_Conf_y.cpp's
- " sed -e 's/yy/ace_yy/g' <Svc_Conf.tab.h >>$@"
- " echo '#endif \/\* ifndef BISON_SVC_CONF_TAB_H \*\/' >>$@"
-// " $(RM) -f Svc_Conf.tab.h"
+ " $(MV) Svc_Conf.tab.h Svc_Conf_Token_Table.h"
"else"
" @echo 'ERROR: You must use bison 1.35 or higher to process this file'"
" @/bin/false"
diff --git a/ACE/include/makeinclude/platform_linux_pgi.GNU b/ACE/include/makeinclude/platform_linux_pgi.GNU
index 9233d146f1d..38c9a454cba 100644
--- a/ACE/include/makeinclude/platform_linux_pgi.GNU
+++ b/ACE/include/makeinclude/platform_linux_pgi.GNU
@@ -7,12 +7,9 @@
include $(ACE_ROOT)/include/makeinclude/platform_linux_common.GNU
-static_libs_only ?= 1
+CC = pgcc
+CXX = pgCC
-CC ?= pgcc
-CXX ?= pgCC
-
-CFLAGS += --one_instantiation_per_object --prelink_objects -Wc,-tused
ifeq ($(threads),1)
CPPFLAGS += -D_REENTRANT $(PLATFORM_AIO_SUPPORT)
endif # threads
@@ -32,8 +29,8 @@ endif
OCFLAGS += -O3
-SOFLAGS += $(CPPFLAGS) -shared $(PIC) --one_instantiation_per_object --prelink_objects
-SOBUILD = $(COMPILE.cc) $(PIC) --one_instantiation_per_object --prelink_objects -o $(VSHDIR)$*.so $<; \
+SOFLAGS += $(CPPFLAGS) -shared $(PIC) --prelink_objects
+SOBUILD = $(COMPILE.cc) $(PIC) --prelink_objects -o $(VSHDIR)$*.so $<; \
$(SOLINK.cc) -o $@ $(LDFLAGS) $(VSHDIR)$*.o
PRELIB = @true
diff --git a/ACE/tests/Bug_2980_Regression_Test.cpp b/ACE/tests/Bug_2980_Regression_Test.cpp
index 400452d4096..c1b8282c900 100644
--- a/ACE/tests/Bug_2980_Regression_Test.cpp
+++ b/ACE/tests/Bug_2980_Regression_Test.cpp
@@ -2,16 +2,32 @@
#include <iostream>
#include <assert.h>
+#include <stdio.h>
// This is a non-ACE driver program which loads an ACE-based DLL.
// The usual ACE-related defines will not apply and we must use
// platform-specific ones. Luckily, it is only Windows where this
// test has not been made to work yet ...
-#if !(defined (WIN32) || defined (ACE_VXWORKS))
+
+#if !(defined (WIN32) || defined (ACE_VXWORKS))
+
+# if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
+# define USE_THREAD
+# else
+# undef USE_THREAD
+# endif
+
+# define CAN_RUN_TEST
+#endif
+
+#if defined (CAN_RUN_TEST)
#include <dlfcn.h>
-#include <pthread.h>
+
+#if defined USE_THREAD
+# include <pthread.h>
+#endif
static void * dllHandle;
@@ -21,7 +37,7 @@ static voidfunction capi_init = 0;
static voidfunction capi_fini = 0;
static voidfunction capi_dosomething = 0;
-
+extern "C"
void* loadDll(void*)
{
printf ("loadDll - entered\n");
@@ -85,22 +101,26 @@ void * loadunloadDll(void *pp)
return 0;
}
-#endif /* !(defined (WIN32) || defined (ACE_VXWORKS)) */
+#endif /* defined (CAN_RUN_TEST) */
int main(int, char **)
{
-#if (defined (WIN32) || defined (ACE_VXWORKS))
+#if !defined (CAN_RUN_TEST)
+#if defined (__BORLANDC__)
+ std::printf ("Terminating because this test has not been designed "
+ "to run on platforms where WIN32 has been defined.\n");
+#else
printf ("Terminating because this test has not been designed "
- "to run on platforms where WIN32 has been defined.\n");
+ "to run on platforms where WIN32 has been defined.\n");
+#endif
#else
- int result = 0;
-
printf ("main - entered\n");
# ifdef USE_THREAD
+ int result = 0;
pthread_t tid1;
result = pthread_create(&tid1, 0, &loadDll, 0);
if (result != 0)
@@ -112,7 +132,7 @@ int main(int, char **)
printf ("loadDll thread finished\n");
# else
loadDll(0);
- printf ("loadDll finished"\n);
+ printf ("loadDll finished\n");
# endif
# ifdef USE_THREAD
@@ -132,7 +152,7 @@ int main(int, char **)
printf ("main - leaving\n");
-#endif /* (defined (WIN32) || defined (ACE_VXWORKS)) */
+#endif /* defined (CAN_RUN_TEST) */
return 0;
}
diff --git a/ACE/tests/tests.mpc b/ACE/tests/tests.mpc
index d61e13415e6..6920579fd38 100644
--- a/ACE/tests/tests.mpc
+++ b/ACE/tests/tests.mpc
@@ -256,9 +256,11 @@ project(Bug_2975_Regression_Test) : acetest {
}
project (Bug_2980_Regression_Test) {
- // The test uses a non-ACE executable, loading an ACE-based DLL
+
+ // The test uses a non-ACE executable,
+ // which loads an ACE-based DLL.
+
after += Bug_2980_Regression_Dll
- macros += USE_THREAD
exename = Bug_2980_Regression_Test
Source_Files {
Bug_2980_Regression_Test.cpp