Skip to content

Commit b6d9046

Browse files
committed
libcxx: Fix locale-related compilation errors on NetBSD.
llvm/llvm-project#143055
1 parent 98cf81d commit b6d9046

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

lib/libcxx/include/__locale_dir/locale_base_api.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@
115115
# include <__locale_dir/support/apple.h>
116116
#elif defined(__FreeBSD__)
117117
# include <__locale_dir/support/freebsd.h>
118+
#elif defined(__NetBSD__)
119+
# include <__locale_dir/support/netbsd.h>
118120
#elif defined(_LIBCPP_MSVCRT_LIKE)
119121
# include <__locale_dir/support/windows.h>
120122
#elif defined(__Fuchsia__)

lib/libcxx/include/__locale_dir/support/apple.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# pragma GCC system_header
1616
#endif
1717

18+
#include <xlocale.h>
19+
1820
#include <__locale_dir/support/bsd_like.h>
1921

2022
#endif // _LIBCPP___LOCALE_DIR_SUPPORT_APPLE_H

lib/libcxx/include/__locale_dir/support/bsd_like.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
# include <wctype.h>
2525
#endif
2626

27-
#include <xlocale.h>
28-
2927
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
3028
# pragma GCC system_header
3129
#endif

lib/libcxx/include/__locale_dir/support/freebsd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# pragma GCC system_header
1616
#endif
1717

18+
#include <xlocale.h>
19+
1820
#include <__locale_dir/support/bsd_like.h>
1921

2022
#endif // _LIBCPP___LOCALE_DIR_SUPPORT_FREEBSD_H
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//===-----------------------------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
9+
#ifndef _LIBCPP___LOCALE_DIR_SUPPORT_NETBSD_H
10+
#define _LIBCPP___LOCALE_DIR_SUPPORT_NETBSD_H
11+
12+
#include <__config>
13+
14+
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
15+
# pragma GCC system_header
16+
#endif
17+
18+
#include <__locale_dir/support/bsd_like.h>
19+
20+
#endif // _LIBCPP___LOCALE_DIR_SUPPORT_NETBSD_H

0 commit comments

Comments
 (0)