This is one part of many of a locale refactor. See http://reviews.llvm.org/D17146 for an idea of where this is going. For the locale refactor, the locale management functions (newlocale, freelocale, uselocale) are needed in a separate header from the various _l functions. This is because some platforms implement the _l functions in terms of a locale switcher RAII helper, and the locale switcher RAII helper needs the locale management functions. This patch helps pave the way by getting all the functions in the right files, so that later diffs aren't completely horrible. The "do-nothing" / "nop" locale functions are also useful on their own for other lightweight platforms. Putting these nop implementations in support/xlocale should enable code sharing. Unfortunately, I have no access to a newlib system to build and test with, so this change has been made blind. Reviewed: http://reviews.llvm.org/D17382 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@261231 91177308-0d34-0410-b5e6-96231b3b80d8
35 lines
795 B
C
35 lines
795 B
C
//===----------------------------------------------------------------------===//
|
|
//
|
|
// 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_SUPPORT_NEWLIB_XLOCALE_H
|
|
#define _LIBCPP_SUPPORT_NEWLIB_XLOCALE_H
|
|
|
|
#if defined(_NEWLIB_VERSION)
|
|
|
|
#include <cstdlib>
|
|
#include <clocale>
|
|
#include <cwctype>
|
|
#include <ctype.h>
|
|
#include <support/xlocale/__nop_locale_mgmt.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// Share implementation with Android's Bionic
|
|
#include <support/xlocale/xlocale.h>
|
|
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
#endif
|
|
|
|
#endif // _NEWLIB_VERSION
|
|
|
|
#endif
|