Skip to content

Avoid #include <sstream> when not needed #40174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions stdlib/public/Reflection/MetadataSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

#include "swift/Reflection/MetadataSource.h"

#include <sstream>

using namespace swift;
using namespace reflection;

Expand Down
4 changes: 4 additions & 0 deletions stdlib/public/stubs/Stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
#if defined(__CYGWIN__) || defined(__HAIKU__)
#include <sstream>
#endif
#if defined(__OpenBSD__) || defined(__ANDROID__) || defined(__linux__) || defined(__wasi__) || defined(_WIN32)
#include <locale.h>
#if defined(_WIN32)
Expand Down Expand Up @@ -288,6 +290,7 @@ static bool swift_stringIsSignalingNaN(const char *nptr) {
return false;
}

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

return ParsedValue;
}
#endif

#if defined(__OpenBSD__) || defined(_WIN32) || defined(__CYGWIN__) || defined(__HAIKU__)
#define NEED_SWIFT_STRTOD_L
Expand Down