Author: sebor
Date: Sun Jan  8 14:30:23 2006
New Revision: 367109

URL: http://svn.apache.org/viewcvs?rev=367109&view=rev
Log:
2006-01-08  Martin Sebor  <[EMAIL PROTECTED]>

        STDCXX-101
        * instantiation_before_definition.h: Avoided using the extern template
        extension to declare an explicit instantiation of a function template
        when _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE is #defined.
        * EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp: Established a dependency on
        the EXTERN_FUNCTION_TEMPLATE.cpp test.
        * EXPLICIT_INSTANTIATION_BEFORE_DEFINITION.cpp: Same.

Modified:
    
incubator/stdcxx/trunk/etc/config/src/EXPLICIT_INSTANTIATION_BEFORE_DEFINITION.cpp
    incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp
    incubator/stdcxx/trunk/etc/config/src/instantiation_before_definition.h

Modified: 
incubator/stdcxx/trunk/etc/config/src/EXPLICIT_INSTANTIATION_BEFORE_DEFINITION.cpp
URL: 
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/EXPLICIT_INSTANTIATION_BEFORE_DEFINITION.cpp?rev=367109&r1=367108&r2=367109&view=diff
==============================================================================
--- 
incubator/stdcxx/trunk/etc/config/src/EXPLICIT_INSTANTIATION_BEFORE_DEFINITION.cpp
 (original)
+++ 
incubator/stdcxx/trunk/etc/config/src/EXPLICIT_INSTANTIATION_BEFORE_DEFINITION.cpp
 Sun Jan  8 14:30:23 2006
@@ -10,6 +10,13 @@
 #  define INCLUDE_CC_FILE
 #endif   // _RWSTD_NO_IMPLICIT_INCLUSION
 
+#ifdef _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
+   // tell "instantiation_before_definition.h" to use explicit
+   // function template specialization instead of the extern
+   // template extension
+#  define SPECIALIZE_FUNCTION_TEMPLATE
+#endif   // _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
+
 #define INSTANTIATE_TEMPLATE
 #include "instantiation_before_definition.h"
 

Modified: 
incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp
URL: 
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp?rev=367109&r1=367108&r2=367109&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp 
Sun Jan  8 14:30:23 2006
@@ -16,6 +16,13 @@
 #  define INCLUDE_CC_FILE
 #endif   // _RWSTD_NO_IMPLICIT_INCLUSION
 
+#ifdef _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
+   // tell "instantiation_before_definition.h" to use explicit
+   // function template specialization instead of the extern
+   // template extension
+#  define SPECIALIZE_FUNCTION_TEMPLATE
+#endif   // _RWSTD_NO_EXTERN_FUNCTION_TEMPLATE
+
 #define EXTERN_TEMPLATE
 #include "instantiation_before_definition.h"
 

Modified: 
incubator/stdcxx/trunk/etc/config/src/instantiation_before_definition.h
URL: 
http://svn.apache.org/viewcvs/incubator/stdcxx/trunk/etc/config/src/instantiation_before_definition.h?rev=367109&r1=367108&r2=367109&view=diff
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/instantiation_before_definition.h 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/instantiation_before_definition.h Sun 
Jan  8 14:30:23 2006
@@ -1,6 +1,11 @@
 #ifndef INSTANTIATION_BEFORE_DEFINITION_INCLUDED
 #define INSTANTIATION_BEFORE_DEFINITION_INCLUDED
 
+// NOTE: do not #include config.h here and avoid relying
+// the config infrastructure automatically establishing
+// dependencies on other config tests (headers are not
+// scanned for such dependencies)
+
 template <class T>
 T instantiated_before_defined (T);
 
@@ -33,7 +38,12 @@
 #    pragma GCC system_header
 #  endif   // gcc >= 3
 
+#  ifndef SPECIALIZE_FUNCTION_TEMPLATE
 extern template int instantiated_before_defined (int);
+#  else   // if defined (SPECIALIZE_FUNCTION_TEMPLATE)
+template<> int instantiated_before_defined (int);
+#  endif   // SPECIALIZE_FUNCTION_TEMPLATE
+
 extern template struct InstantiatedBeforeDefined<int>;
 
 #endif   // INSTANTIATE_TEMPLATE, EXTERN_TEMPLATE


Reply via email to