Skip to content

Commit 82cdc64

Browse files
committed
Also guard strstream
1 parent 620eb8d commit 82cdc64

File tree

1 file changed

+31
-24
lines changed

1 file changed

+31
-24
lines changed

libcxx/include/strstream

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -133,30 +133,33 @@ private:
133133
# include <__cxx03/strstream>
134134
#else
135135
# include <__config>
136-
# include <__ostream/basic_ostream.h>
137-
# include <istream>
138-
# include <streambuf>
139-
# include <version>
140136

141-
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
142-
# pragma GCC system_header
143-
# endif
137+
# if _LIBCPP_HAS_LOCALIZATION
144138

145-
# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) || defined(_LIBCPP_BUILDING_LIBRARY)
139+
# include <__ostream/basic_ostream.h>
140+
# include <istream>
141+
# include <streambuf>
142+
# include <version>
143+
144+
# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
145+
# pragma GCC system_header
146+
# endif
147+
148+
# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) || defined(_LIBCPP_BUILDING_LIBRARY)
146149

147150
_LIBCPP_PUSH_MACROS
148-
# include <__undef_macros>
151+
# include <__undef_macros>
149152

150153
_LIBCPP_BEGIN_NAMESPACE_STD
151154

152155
class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI strstreambuf : public streambuf {
153156
public:
154-
# ifndef _LIBCPP_CXX03_LANG
157+
# ifndef _LIBCPP_CXX03_LANG
155158
_LIBCPP_HIDE_FROM_ABI strstreambuf() : strstreambuf(0) {}
156159
explicit strstreambuf(streamsize __alsize);
157-
# else
160+
# else
158161
explicit strstreambuf(streamsize __alsize = 0);
159-
# endif
162+
# endif
160163
strstreambuf(void* (*__palloc)(size_t), void (*__pfree)(void*));
161164
strstreambuf(char* __gnext, streamsize __n, char* __pbeg = nullptr);
162165
strstreambuf(const char* __gnext, streamsize __n);
@@ -166,10 +169,10 @@ public:
166169
strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = nullptr);
167170
strstreambuf(const unsigned char* __gnext, streamsize __n);
168171

169-
# ifndef _LIBCPP_CXX03_LANG
172+
# ifndef _LIBCPP_CXX03_LANG
170173
_LIBCPP_HIDE_FROM_ABI strstreambuf(strstreambuf&& __rhs);
171174
_LIBCPP_HIDE_FROM_ABI strstreambuf& operator=(strstreambuf&& __rhs);
172-
# endif // _LIBCPP_CXX03_LANG
175+
# endif // _LIBCPP_CXX03_LANG
173176

174177
~strstreambuf() override;
175178

@@ -203,7 +206,7 @@ private:
203206
void __init(char* __gnext, streamsize __n, char* __pbeg);
204207
};
205208

206-
# ifndef _LIBCPP_CXX03_LANG
209+
# ifndef _LIBCPP_CXX03_LANG
207210

208211
inline _LIBCPP_HIDE_FROM_ABI strstreambuf::strstreambuf(strstreambuf&& __rhs)
209212
: streambuf(__rhs),
@@ -232,7 +235,7 @@ inline _LIBCPP_HIDE_FROM_ABI strstreambuf& strstreambuf::operator=(strstreambuf&
232235
return *this;
233236
}
234237

235-
# endif // _LIBCPP_CXX03_LANG
238+
# endif // _LIBCPP_CXX03_LANG
236239

237240
class _LIBCPP_DEPRECATED _LIBCPP_EXPORTED_FROM_ABI istrstream : public istream {
238241
public:
@@ -241,7 +244,7 @@ public:
241244
_LIBCPP_HIDE_FROM_ABI istrstream(const char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {}
242245
_LIBCPP_HIDE_FROM_ABI istrstream(char* __s, streamsize __n) : istream(&__sb_), __sb_(__s, __n) {}
243246

244-
# ifndef _LIBCPP_CXX03_LANG
247+
# ifndef _LIBCPP_CXX03_LANG
245248
_LIBCPP_HIDE_FROM_ABI istrstream(istrstream&& __rhs) // extension
246249
: istream(std::move(static_cast<istream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) {
247250
istream::set_rdbuf(&__sb_);
@@ -252,7 +255,7 @@ public:
252255
istream::operator=(std::move(__rhs));
253256
return *this;
254257
}
255-
# endif // _LIBCPP_CXX03_LANG
258+
# endif // _LIBCPP_CXX03_LANG
256259

257260
~istrstream() override;
258261

@@ -274,7 +277,7 @@ public:
274277
_LIBCPP_HIDE_FROM_ABI ostrstream(char* __s, int __n, ios_base::openmode __mode = ios_base::out)
275278
: ostream(&__sb_), __sb_(__s, __n, __s + (__mode & ios::app ? std::strlen(__s) : 0)) {}
276279

277-
# ifndef _LIBCPP_CXX03_LANG
280+
# ifndef _LIBCPP_CXX03_LANG
278281
_LIBCPP_HIDE_FROM_ABI ostrstream(ostrstream&& __rhs) // extension
279282
: ostream(std::move(static_cast<ostream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) {
280283
ostream::set_rdbuf(&__sb_);
@@ -285,7 +288,7 @@ public:
285288
ostream::operator=(std::move(__rhs));
286289
return *this;
287290
}
288-
# endif // _LIBCPP_CXX03_LANG
291+
# endif // _LIBCPP_CXX03_LANG
289292

290293
~ostrstream() override;
291294

@@ -316,7 +319,7 @@ public:
316319
_LIBCPP_HIDE_FROM_ABI strstream(char* __s, int __n, ios_base::openmode __mode = ios_base::in | ios_base::out)
317320
: iostream(&__sb_), __sb_(__s, __n, __s + (__mode & ios::app ? std::strlen(__s) : 0)) {}
318321

319-
# ifndef _LIBCPP_CXX03_LANG
322+
# ifndef _LIBCPP_CXX03_LANG
320323
_LIBCPP_HIDE_FROM_ABI strstream(strstream&& __rhs) // extension
321324
: iostream(std::move(static_cast<iostream&>(__rhs))), __sb_(std::move(__rhs.__sb_)) {
322325
iostream::set_rdbuf(&__sb_);
@@ -327,7 +330,7 @@ public:
327330
iostream::operator=(std::move(__rhs));
328331
return *this;
329332
}
330-
# endif // _LIBCPP_CXX03_LANG
333+
# endif // _LIBCPP_CXX03_LANG
331334

332335
~strstream() override;
333336

@@ -350,7 +353,11 @@ _LIBCPP_END_NAMESPACE_STD
350353

351354
_LIBCPP_POP_MACROS
352355

353-
# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) || defined(_LIBCPP_BUILDING_LIBRARY)
354-
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
356+
# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_STRSTREAM) ||
357+
// defined(_LIBCPP_BUILDING_LIBRARY)
358+
359+
# endif // _LIBCPP_HAS_LOCALIZATION
360+
361+
#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
355362

356363
#endif // _LIBCPP_STRSTREAM

0 commit comments

Comments
 (0)