summaryrefslogtreecommitdiff
path: root/TAO
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-04-15 19:47:07 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-04-15 19:47:07 +0000
commitfdb1196b9394a5d1b27613200699608e422919b3 (patch)
treeba232e425b037c1a999ce7d2432750657b2e4e3f /TAO
parent93eb4acb5a0a6a3252ebc74ddfba5727c14ca31c (diff)
downloadATCD-fdb1196b9394a5d1b27613200699608e422919b3.tar.gz
ChangeLogTag: Thu Apr 15 14:27:12 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'TAO')
-rw-r--r--TAO/ChangeLog38
-rw-r--r--TAO/tao/OctetSeqC.h12
-rw-r--r--TAO/tests/IDL_Test/sequence.idl5
3 files changed, 55 insertions, 0 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 71a0200a700..cff307ff261 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,41 @@
+Thu Apr 15 14:27:12 2004 Jeff Parsons <j.parsons@vanderbilt.edu>
+
+ * tao/OctetSeqC.h:
+
+ Reluctantly added a handcraft to this generated file, but it
+ wouldn't work anywhere else. Visual Studio .NET has a bug
+ (see http://support.microsoft.com/default.aspx?scid=kb;en-us;309801)
+ where a template base class is not imported correctly, leading
+ to 'multiply defined' link errors if an application has a
+ child of the same base class. The TAO POA library uses a
+ sequence of CORBA::OctetSeq, resulting in the above link error
+ if an application server uses the same type. Since the conflict
+ is with *C.obj, the fix must go into a file that will be included
+ in that translation unit, to force the correct import. We force
+ the import with
+
+ #if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+ template class TAO_Export TAO_Unbounded_Sequence<CORBA::OctetSeq>;
+ #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
+ and the TAO export macro will be read by the application as
+ __declspec(dllimport). Placement of the instantiation was tricky,
+ since it had to be a place where
+
+ - TAO_Unbounded_Sequence is known
+ - CORBA::OctetSeq is known
+ - the instantiation will be seen when building *C.obj
+ - it will not conflict with the implicit PortableServer export
+
+ Thanks to Bala <bala@dre.vanderbilt.edu> for his help with this
+ bug, and to Scott Gammill <zumo@flashmail.com> for both reporting
+ the bug and for pointing us to the Microsoft Knowledge Base article
+ that finally explained it.
+
+ * tests/IDL_Test/sequence.idl:
+
+ Added IDL to test for the above bug.
+
Thu Apr 15 12:02:20 2004 Ossama Othman <ossama@dre.vanderbilt.edu>
* orbsvcs/orbsvcs/SSLIOP/SSLIOP_Acceptor.cpp:
diff --git a/TAO/tao/OctetSeqC.h b/TAO/tao/OctetSeqC.h
index e6d48fbdad0..c928d7a1207 100644
--- a/TAO/tao/OctetSeqC.h
+++ b/TAO/tao/OctetSeqC.h
@@ -147,6 +147,18 @@ namespace TAO
{
}
+// Workaround for a Visual Studio .NET bug where this class is not
+// properly imported by an application if typedef'd or subclassed,
+// resulting in 'multiply defined' link errors. The export macro
+// here forces an explicit import by the application. Please see
+// http://support.microsoft.com/default.aspx?scid=kb;en-us;309801
+// The problem stems from use of the type below in PortableServer,
+// but we put the instantiation here because the application will
+// need to see it in *C.h to avoid the error.
+#if defined ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT
+ template class TAO_Export TAO_Unbounded_Sequence<CORBA::OctetSeq>;
+#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION_EXPORT */
+
// TAO_IDL - Generated from
// be\be_visitor_sequence/any_op_ch.cpp:52
diff --git a/TAO/tests/IDL_Test/sequence.idl b/TAO/tests/IDL_Test/sequence.idl
index 759b4899763..9cbd802c9b4 100644
--- a/TAO/tests/IDL_Test/sequence.idl
+++ b/TAO/tests/IDL_Test/sequence.idl
@@ -19,6 +19,11 @@
//
// ============================================================================
+#include "tao/OctetSeq.pidl"
+
+// This will produce a link error if a handcraft we have added to
+// tao/OctetSeqC.h is ever removed.
+typedef sequence<CORBA::OctetSeq> OctetSeqSeq;
// Bounded string elements of a sequence,
// require the use of CORBA_Any::to_char.