[libcxx] Implement locale.h to fix modules build
Summary: Because `locale.h` isn't part of the libc++ modules the class definitions it provides are exported as part of `__locale` (since it happens to be build first). This breaks `<clocale>` which exports `std::lconv` without including `<__locale>`. This patch implements `locale.h` to fix this issue, it also adds support for testing libc++ with modules. Reviewers: mclow.lists, rsmith, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26826 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@287413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
45
include/locale.h
Normal file
45
include/locale.h
Normal file
@@ -0,0 +1,45 @@
|
||||
// -*- C++ -*-
|
||||
//===---------------------------- locale.h --------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is dual licensed under the MIT and the University of Illinois Open
|
||||
// Source Licenses. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP_LOCALE_H
|
||||
#define _LIBCPP_LOCALE_H
|
||||
|
||||
/*
|
||||
locale.h synopsis
|
||||
|
||||
Macros:
|
||||
|
||||
LC_ALL
|
||||
LC_COLLATE
|
||||
LC_CTYPE
|
||||
LC_MONETARY
|
||||
LC_NUMERIC
|
||||
LC_TIME
|
||||
|
||||
Types:
|
||||
|
||||
lconv
|
||||
|
||||
Functions:
|
||||
|
||||
setlocale
|
||||
localeconv
|
||||
|
||||
*/
|
||||
|
||||
#include <__config>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
#include_next <locale.h>
|
||||
|
||||
#endif // _LIBCPP_LOCALE_H
|
||||
Reference in New Issue
Block a user