xref: /aosp_15_r20/external/libcxx/src/include/config_elast.h (revision 58b9f456b02922dfdb1fad8a988d5fd8765ecb80)
1*58b9f456SAndroid Build Coastguard Worker //===----------------------- config_elast.h -------------------------------===//
2*58b9f456SAndroid Build Coastguard Worker //
3*58b9f456SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*58b9f456SAndroid Build Coastguard Worker //
5*58b9f456SAndroid Build Coastguard Worker // This file is dual licensed under the MIT and the University of Illinois Open
6*58b9f456SAndroid Build Coastguard Worker // Source Licenses. See LICENSE.TXT for details.
7*58b9f456SAndroid Build Coastguard Worker //
8*58b9f456SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*58b9f456SAndroid Build Coastguard Worker 
10*58b9f456SAndroid Build Coastguard Worker #ifndef _LIBCPP_CONFIG_ELAST
11*58b9f456SAndroid Build Coastguard Worker #define _LIBCPP_CONFIG_ELAST
12*58b9f456SAndroid Build Coastguard Worker 
13*58b9f456SAndroid Build Coastguard Worker #include <__config>
14*58b9f456SAndroid Build Coastguard Worker 
15*58b9f456SAndroid Build Coastguard Worker #if defined(_LIBCPP_MSVCRT_LIKE)
16*58b9f456SAndroid Build Coastguard Worker #include <stdlib.h>
17*58b9f456SAndroid Build Coastguard Worker #else
18*58b9f456SAndroid Build Coastguard Worker #include <errno.h>
19*58b9f456SAndroid Build Coastguard Worker #endif
20*58b9f456SAndroid Build Coastguard Worker 
21*58b9f456SAndroid Build Coastguard Worker #if defined(ELAST)
22*58b9f456SAndroid Build Coastguard Worker #define _LIBCPP_ELAST ELAST
23*58b9f456SAndroid Build Coastguard Worker #elif defined(_NEWLIB_VERSION)
24*58b9f456SAndroid Build Coastguard Worker #define _LIBCPP_ELAST __ELASTERROR
25*58b9f456SAndroid Build Coastguard Worker #elif defined(__Fuchsia__)
26*58b9f456SAndroid Build Coastguard Worker // No _LIBCPP_ELAST needed on Fuchsia
27*58b9f456SAndroid Build Coastguard Worker #elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC)
28*58b9f456SAndroid Build Coastguard Worker #define _LIBCPP_ELAST 4095
29*58b9f456SAndroid Build Coastguard Worker #elif defined(__APPLE__)
30*58b9f456SAndroid Build Coastguard Worker // No _LIBCPP_ELAST needed on Apple
31*58b9f456SAndroid Build Coastguard Worker #elif defined(__sun__)
32*58b9f456SAndroid Build Coastguard Worker #define _LIBCPP_ELAST ESTALE
33*58b9f456SAndroid Build Coastguard Worker #elif defined(_LIBCPP_MSVCRT_LIKE)
34*58b9f456SAndroid Build Coastguard Worker #define _LIBCPP_ELAST (_sys_nerr - 1)
35*58b9f456SAndroid Build Coastguard Worker #else
36*58b9f456SAndroid Build Coastguard Worker // Warn here so that the person doing the libcxx port has an easier time:
37*58b9f456SAndroid Build Coastguard Worker #warning ELAST for this platform not yet implemented
38*58b9f456SAndroid Build Coastguard Worker #endif
39*58b9f456SAndroid Build Coastguard Worker 
40*58b9f456SAndroid Build Coastguard Worker #endif // _LIBCPP_CONFIG_ELAST
41