19729cf09SDimitry Andric //===----------------------- config_elast.h -------------------------------===//
29729cf09SDimitry Andric //
39729cf09SDimitry Andric //                     The LLVM Compiler Infrastructure
49729cf09SDimitry Andric //
59729cf09SDimitry Andric // This file is dual licensed under the MIT and the University of Illinois Open
69729cf09SDimitry Andric // Source Licenses. See LICENSE.TXT for details.
79729cf09SDimitry Andric //
89729cf09SDimitry Andric //===----------------------------------------------------------------------===//
99729cf09SDimitry Andric 
109729cf09SDimitry Andric #ifndef _LIBCPP_CONFIG_ELAST
119729cf09SDimitry Andric #define _LIBCPP_CONFIG_ELAST
129729cf09SDimitry Andric 
13aed8d94eSDimitry Andric #include <__config>
14aed8d94eSDimitry Andric 
15*4ba319b5SDimitry Andric #if defined(_LIBCPP_MSVCRT_LIKE)
169729cf09SDimitry Andric #include <stdlib.h>
179729cf09SDimitry Andric #else
189729cf09SDimitry Andric #include <errno.h>
199729cf09SDimitry Andric #endif
209729cf09SDimitry Andric 
219729cf09SDimitry Andric #if defined(ELAST)
229729cf09SDimitry Andric #define _LIBCPP_ELAST ELAST
239729cf09SDimitry Andric #elif defined(_NEWLIB_VERSION)
249729cf09SDimitry Andric #define _LIBCPP_ELAST __ELASTERROR
25aed8d94eSDimitry Andric #elif defined(__Fuchsia__)
26aed8d94eSDimitry Andric // No _LIBCPP_ELAST needed on Fuchsia
27b2c7081bSDimitry Andric #elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC)
289729cf09SDimitry Andric #define _LIBCPP_ELAST 4095
299729cf09SDimitry Andric #elif defined(__APPLE__)
309729cf09SDimitry Andric // No _LIBCPP_ELAST needed on Apple
319729cf09SDimitry Andric #elif defined(__sun__)
329729cf09SDimitry Andric #define _LIBCPP_ELAST ESTALE
33*4ba319b5SDimitry Andric #elif defined(_LIBCPP_MSVCRT_LIKE)
3480779b37SDimitry Andric #define _LIBCPP_ELAST (_sys_nerr - 1)
359729cf09SDimitry Andric #else
369729cf09SDimitry Andric // Warn here so that the person doing the libcxx port has an easier time:
379729cf09SDimitry Andric #warning ELAST for this platform not yet implemented
389729cf09SDimitry Andric #endif
399729cf09SDimitry Andric 
409729cf09SDimitry Andric #endif // _LIBCPP_CONFIG_ELAST
41