• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===----------------------- config_elast.h -------------------------------===//
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 #ifndef _LIBCPP_CONFIG_ELAST
11 #define _LIBCPP_CONFIG_ELAST
12 
13 #include <__config>
14 
15 #if defined(_LIBCPP_MSVCRT_LIKE)
16 #include <stdlib.h>
17 #else
18 #include <errno.h>
19 #endif
20 
21 #if defined(ELAST)
22 #define _LIBCPP_ELAST ELAST
23 #elif defined(_NEWLIB_VERSION)
24 #define _LIBCPP_ELAST __ELASTERROR
25 #elif defined(__Fuchsia__)
26 // No _LIBCPP_ELAST needed on Fuchsia
27 #elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC)
28 #define _LIBCPP_ELAST 4095
29 #elif defined(__APPLE__)
30 // No _LIBCPP_ELAST needed on Apple
31 #elif defined(__sun__)
32 #define _LIBCPP_ELAST ESTALE
33 #elif defined(_LIBCPP_MSVCRT_LIKE)
34 #define _LIBCPP_ELAST (_sys_nerr - 1)
35 #else
36 // Warn here so that the person doing the libcxx port has an easier time:
37 #warning ELAST for this platform not yet implemented
38 #endif
39 
40 #endif // _LIBCPP_CONFIG_ELAST
41