Skip to content

Commit 5b32645

Browse files
authored
Avoid #include <sstream> when not needed (#40174)
1 parent f4d44b5 commit 5b32645

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

stdlib/public/Reflection/MetadataSource.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212

1313
#include "swift/Reflection/MetadataSource.h"
1414

15-
#include <sstream>
16-
1715
using namespace swift;
1816
using namespace reflection;
1917

stdlib/public/stubs/Stubs.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@
4242
#include <cstdio>
4343
#include <cstdlib>
4444
#include <cstring>
45+
#if defined(__CYGWIN__) || defined(__HAIKU__)
4546
#include <sstream>
47+
#endif
4648
#if defined(__OpenBSD__) || defined(__ANDROID__) || defined(__linux__) || defined(__wasi__) || defined(_WIN32)
4749
#include <locale.h>
4850
#if defined(_WIN32)
@@ -288,6 +290,7 @@ static bool swift_stringIsSignalingNaN(const char *nptr) {
288290
return false;
289291
}
290292

293+
#if defined(__CYGWIN__) || defined(__HAIKU__)
291294
// This implementation should only be used on platforms without the
292295
// relevant strto* functions, such as Cygwin or Haiku.
293296
// Note that using this currently causes test failures.
@@ -308,6 +311,7 @@ T _swift_strto(const char *nptr, char **endptr) {
308311

309312
return ParsedValue;
310313
}
314+
#endif
311315

312316
#if defined(__OpenBSD__) || defined(_WIN32) || defined(__CYGWIN__) || defined(__HAIKU__)
313317
#define NEED_SWIFT_STRTOD_L

0 commit comments

Comments
 (0)