master
 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_GET_C_LOCALE_H
10#define _LIBCPP___LOCALE_DIR_GET_C_LOCALE_H
11
12#include <__config>
13#include <__locale_dir/locale_base_api.h>
14
15#if _LIBCPP_HAS_LOCALIZATION
16
17#  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18#    pragma GCC system_header
19#  endif
20
21_LIBCPP_BEGIN_NAMESPACE_STD
22
23// FIXME: This should really be part of the locale base API
24
25#  if defined(__APPLE__) || defined(__FreeBSD__)
26#    define _LIBCPP_GET_C_LOCALE 0
27#  elif defined(__NetBSD__)
28#    define _LIBCPP_GET_C_LOCALE LC_C_LOCALE
29#  else
30#    define _LIBCPP_GET_C_LOCALE __cloc()
31// Get the C locale object
32_LIBCPP_EXPORTED_FROM_ABI __locale::__locale_t __cloc();
33#    define __cloc_defined
34#  endif
35
36_LIBCPP_END_NAMESPACE_STD
37
38#endif // _LIBCPP_HAS_LOCALIZATION
39
40#endif // _LIBCPP___LOCALE_DIR_GET_C_LOCALE_H