File tree Expand file tree Collapse file tree 3 files changed +25
-23
lines changed Expand file tree Collapse file tree 3 files changed +25
-23
lines changed Original file line number Diff line number Diff line change @@ -635,6 +635,17 @@ template <unsigned> struct __static_assert_check {};
635
635
#define _LIBCPP_WCTYPE_IS_MASK
636
636
#endif
637
637
638
+ #if defined(ELAST)
639
+ #define _LIBCPP_ELAST ELAST
640
+ #elif defined(__linux__)
641
+ #define _LIBCPP_ELAST 4095
642
+ #elif defined(_NEWLIB_VERSION)
643
+ #define _LIBCPP_ELAST __ELASTERROR
644
+ #else
645
+ // Warn here so that the person doing the libcxx port has an easier time:
646
+ #warning This platform's ELAST hasn't been ported yet
647
+ #endif
648
+
638
649
#ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR
639
650
# define _LIBCPP_TRIVIAL_PAIR_COPY_CTOR 1
640
651
#endif
Original file line number Diff line number Diff line change 7
7
//
8
8
// ===----------------------------------------------------------------------===//
9
9
10
+ #include " __config"
10
11
#include " ios"
11
12
#include " streambuf"
12
13
#include " istream"
@@ -52,11 +53,9 @@ string
52
53
__iostream_category::message (int ev) const
53
54
{
54
55
if (ev != static_cast <int >(io_errc::stream)
55
- #ifdef ELAST
56
- && ev <= ELAST
57
- #elif defined(__linux__)
58
- && ev <= 4095
59
- #endif // ELAST
56
+ #ifdef _LIBCPP_ELAST
57
+ && ev <= _LIBCPP_ELAST
58
+ #endif // _LIBCPP_ELAST
60
59
)
61
60
return __do_message::message (ev);
62
61
return string (" unspecified iostream_category error" );
Original file line number Diff line number Diff line change 8
8
// ===----------------------------------------------------------------------===//
9
9
10
10
#define _LIBCPP_BUILDING_SYSTEM_ERROR
11
+ #include " __config"
11
12
#include " system_error"
12
13
#include " string"
13
14
#include " cstring"
@@ -65,13 +66,10 @@ __generic_error_category::name() const _NOEXCEPT
65
66
string
66
67
__generic_error_category::message (int ev) const
67
68
{
68
- #ifdef ELAST
69
- if (ev > ELAST )
69
+ #ifdef _LIBCPP_ELAST
70
+ if (ev > _LIBCPP_ELAST )
70
71
return string (" unspecified generic_category error" );
71
- #elif defined(__linux__)
72
- if (ev > 4095 )
73
- return string (" unspecified generic_category error" );
74
- #endif // ELAST
72
+ #endif // _LIBCPP_ELAST
75
73
return __do_message::message (ev);
76
74
}
77
75
@@ -100,26 +98,20 @@ __system_error_category::name() const _NOEXCEPT
100
98
string
101
99
__system_error_category::message (int ev) const
102
100
{
103
- #ifdef ELAST
104
- if (ev > ELAST)
105
- return string (" unspecified system_category error" );
106
- #elif defined(__linux__)
107
- if (ev > 4095 )
101
+ #ifdef _LIBCPP_ELAST
102
+ if (ev > _LIBCPP_ELAST)
108
103
return string (" unspecified system_category error" );
109
- #endif // ELAST
104
+ #endif // _LIBCPP_ELAST
110
105
return __do_message::message (ev);
111
106
}
112
107
113
108
error_condition
114
109
__system_error_category::default_error_condition (int ev) const _NOEXCEPT
115
110
{
116
- #ifdef ELAST
117
- if (ev > ELAST)
118
- return error_condition (ev, system_category ());
119
- #elif defined(__linux__)
120
- if (ev > 4095 )
111
+ #ifdef _LIBCPP_ELAST
112
+ if (ev > _LIBCPP_ELAST)
121
113
return error_condition (ev, system_category ());
122
- #endif // ELAST
114
+ #endif // _LIBCPP_ELAST
123
115
return error_condition (ev, generic_category ());
124
116
}
125
117
You can’t perform that action at this time.
0 commit comments