summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/config/locale/gnu/time_members.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libstdc++/config/locale/gnu/time_members.h')
-rw-r--r--contrib/libstdc++/config/locale/gnu/time_members.h36
1 files changed, 18 insertions, 18 deletions
diff --git a/contrib/libstdc++/config/locale/gnu/time_members.h b/contrib/libstdc++/config/locale/gnu/time_members.h
index 2ea2410..9cb3594 100644
--- a/contrib/libstdc++/config/locale/gnu/time_members.h
+++ b/contrib/libstdc++/config/locale/gnu/time_members.h
@@ -1,6 +1,6 @@
// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -36,33 +36,33 @@
template<typename _CharT>
__timepunct<_CharT>::__timepunct(size_t __refs)
- : locale::facet(__refs)
- {
-#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
- _M_name_timepunct = _S_c_name;
-#endif
- _M_initialize_timepunct();
- }
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+ _M_name_timepunct(_S_get_c_name())
+ { _M_initialize_timepunct(); }
+
+ template<typename _CharT>
+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
+ _M_name_timepunct(_S_get_c_name())
+ { _M_initialize_timepunct(); }
template<typename _CharT>
- __timepunct<_CharT>::__timepunct(__c_locale __cloc,
- const char* __s,
+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
size_t __refs)
- : locale::facet(__refs)
+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
+ _M_name_timepunct(__s)
{
-#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
- _M_name_timepunct = new char[strlen(__s) + 1];
- strcpy(_M_name_timepunct, __s);
-#endif
+ char* __tmp = new char[std::strlen(__s) + 1];
+ std::strcpy(__tmp, __s);
+ _M_name_timepunct = __tmp;
_M_initialize_timepunct(__cloc);
}
template<typename _CharT>
__timepunct<_CharT>::~__timepunct()
{
-#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
- if (_S_c_name != _M_name_timepunct)
+ if (_M_name_timepunct != _S_get_c_name())
delete [] _M_name_timepunct;
-#endif
+ delete _M_data;
_S_destroy_c_locale(_M_c_locale_timepunct);
}
OpenPOWER on IntegriCloud