1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <clocale> 11 12 #include <clocale> 13 #include <type_traits> 14 15 #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS 16 17 #ifndef LC_ALL 18 #error LC_ALL not defined 19 #endif 20 21 #ifndef LC_COLLATE 22 #error LC_COLLATE not defined 23 #endif 24 25 #ifndef LC_CTYPE 26 #error LC_CTYPE not defined 27 #endif 28 29 #ifndef LC_MONETARY 30 #error LC_MONETARY not defined 31 #endif 32 33 #ifndef LC_NUMERIC 34 #error LC_NUMERIC not defined 35 #endif 36 37 #ifndef LC_TIME 38 #error LC_TIME not defined 39 #endif 40 41 #endif // !_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS 42 43 #ifndef NULL 44 #error NULL not defined 45 #endif 46 main()47int main() 48 { 49 std::lconv lc; 50 ((void)lc); // Prevent unused warning 51 #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS 52 static_assert((std::is_same<decltype(std::setlocale(0, "")), char*>::value), ""); 53 #endif 54 static_assert((std::is_same<decltype(std::localeconv()), std::lconv*>::value), ""); 55 } 56