Skip to content

Commit 1b3cf4c

Browse files
committed
Add missing include and don't modify locale_guard for now
1 parent aa937fe commit 1b3cf4c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

libcxx/include/__locale_dir/locale_base_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@
125125
#include <__cstddef/size_t.h>
126126
#include <__utility/forward.h>
127127
#include <string.h>
128+
#include <time.h>
128129
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
129130
# include <wctype.h>
130131
#endif

libcxx/include/__locale_dir/locale_guard.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#define _LIBCPP___LOCALE_DIR_LOCALE_GUARD_H
1111

1212
#include <__config>
13-
#include <__locale>
13+
#include <__locale> // for locale_t
1414
#include <clocale>
1515

1616
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
#if defined(_LIBCPP_MSVCRT_LIKE)
2323
struct __locale_guard {
24-
__locale_guard(__locale::__locale_t __l) : __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {
24+
__locale_guard(locale_t __l) : __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {
2525
// Setting the locale can be expensive even when the locale given is
2626
// already the current locale, so do an explicit check to see if the
2727
// current locale is already the one we want.
@@ -59,14 +59,14 @@ struct __locale_guard {
5959
};
6060
#else
6161
struct __locale_guard {
62-
_LIBCPP_HIDE_FROM_ABI __locale_guard(__locale::__locale_t& __loc) : __old_loc_(__locale::__uselocale(__loc)) {}
62+
_LIBCPP_HIDE_FROM_ABI __locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
6363

6464
_LIBCPP_HIDE_FROM_ABI ~__locale_guard() {
6565
if (__old_loc_)
66-
__locale::__uselocale(__old_loc_);
66+
uselocale(__old_loc_);
6767
}
6868

69-
__locale::__locale_t __old_loc_;
69+
locale_t __old_loc_;
7070

7171
__locale_guard(__locale_guard const&) = delete;
7272
__locale_guard& operator=(__locale_guard const&) = delete;

0 commit comments

Comments
 (0)