You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by ca...@apache.org on 2008/03/08 20:04:11 UTC
svn commit: r635044 - in /logging/log4cxx/trunk/src:
main/cpp/simpledateformat.cpp test/cpp/helpers/datetimedateformattestcase.cpp
Author: carnold
Date: Sat Mar 8 11:04:08 2008
New Revision: 635044
URL: http://svn.apache.org/viewvc?rev=635044&view=rev
Log:
LOGCXX-62: Sun Studio 8 fixes
Modified:
logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp
logging/log4cxx/trunk/src/test/cpp/helpers/datetimedateformattestcase.cpp
Modified: logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp?rev=635044&r1=635043&r2=635044&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp (original)
+++ logging/log4cxx/trunk/src/main/cpp/simpledateformat.cpp Sat Mar 8 11:04:08 2008
@@ -43,8 +43,13 @@
#define USE_FACET(locale, type) _USE(locale, type)
#define PUT_FACET(facet, os, time, spec) facet.put(os, os, time, spec)
#else
+#if defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE)
+#define HAS_FACET(locale, type) std::has_facet(locale, (type*) 0)
+#define USE_FACET(locale, type) std::use_facet(locale, (type*) 0)
+#else
#define HAS_FACET(locale, type) std::has_facet < type >(locale)
#define USE_FACET(locale, type) std::use_facet < type >(locale)
+#endif
#define PUT_FACET(facet, os, time, spec) facet.put(os, os, os.fill(), time, spec)
#endif
Modified: logging/log4cxx/trunk/src/test/cpp/helpers/datetimedateformattestcase.cpp
URL: http://svn.apache.org/viewvc/logging/log4cxx/trunk/src/test/cpp/helpers/datetimedateformattestcase.cpp?rev=635044&r1=635043&r2=635044&view=diff
==============================================================================
--- logging/log4cxx/trunk/src/test/cpp/helpers/datetimedateformattestcase.cpp (original)
+++ logging/log4cxx/trunk/src/test/cpp/helpers/datetimedateformattestcase.cpp Sat Mar 8 11:04:08 2008
@@ -185,8 +185,12 @@
_USEFAC(locale, std::time_put<logchar>)
.put(buffer, buffer, &date, fmt.c_str(), fmt.c_str() + fmt.length());
#else
- std::use_facet<std::time_put<logchar> >(locale)
- .put(buffer, buffer, buffer.fill(), &date, fmt.c_str(), fmt.c_str() + fmt.length());
+#if defined(_RWSTD_NO_TEMPLATE_ON_RETURN_TYPE)
+ const std::time_put<logchar>& facet = std::use_facet(locale, (std::time_put<logchar>*) 0);
+#else
+ const std::time_put<logchar>& facet = std::use_facet<std::time_put<logchar> >(locale);
+#endif
+ facet.put(buffer, buffer, buffer.fill(), &date, fmt.c_str(), fmt.c_str() + fmt.length());
#endif
return buffer.str();
}