blob: 501cbc4ffebaa96d8491f5262dd0b55d3f2cd606 [file] [log] [blame]
Dan Alberta76dfbd2015-01-06 17:34:51 +00001//===----------------------- config_elast.h -------------------------------===//
2//
Chandler Carruth57b08b02019-01-19 10:56:40 +00003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Dan Alberta76dfbd2015-01-06 17:34:51 +00006//
7//===----------------------------------------------------------------------===//
8
9#ifndef _LIBCPP_CONFIG_ELAST
10#define _LIBCPP_CONFIG_ELAST
11
Saleem Abdulrasool60396562017-01-04 05:50:01 +000012#include <__config>
13
Pirama Arumuga Nainarc83bbf52018-06-28 20:16:45 +000014#if defined(_LIBCPP_MSVCRT_LIKE)
Dan Alberta76dfbd2015-01-06 17:34:51 +000015#include <stdlib.h>
16#else
17#include <errno.h>
18#endif
19
20#if defined(ELAST)
21#define _LIBCPP_ELAST ELAST
22#elif defined(_NEWLIB_VERSION)
23#define _LIBCPP_ELAST __ELASTERROR
Petr Hosek50a92302016-10-10 18:53:32 +000024#elif defined(__Fuchsia__)
25// No _LIBCPP_ELAST needed on Fuchsia
Dan Gohman3efd6e372019-05-01 16:47:30 +000026#elif defined(__wasi__)
27// No _LIBCPP_ELAST needed on WASI
Sam Clegg5029d672017-12-16 18:59:50 +000028#elif defined(__linux__) || defined(_LIBCPP_HAS_MUSL_LIBC)
Dan Alberta76dfbd2015-01-06 17:34:51 +000029#define _LIBCPP_ELAST 4095
30#elif defined(__APPLE__)
31// No _LIBCPP_ELAST needed on Apple
32#elif defined(__sun__)
33#define _LIBCPP_ELAST ESTALE
Pirama Arumuga Nainarc83bbf52018-06-28 20:16:45 +000034#elif defined(_LIBCPP_MSVCRT_LIKE)
Saleem Abdulrasool49a10e12017-01-07 05:13:32 +000035#define _LIBCPP_ELAST (_sys_nerr - 1)
Dan Alberta76dfbd2015-01-06 17:34:51 +000036#else
37// Warn here so that the person doing the libcxx port has an easier time:
JF Bastien2ca8c6b2015-02-24 01:59:38 +000038#warning ELAST for this platform not yet implemented
Dan Alberta76dfbd2015-01-06 17:34:51 +000039#endif
40
41#endif // _LIBCPP_CONFIG_ELAST