-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exporting platform_impl_lib headers (#8045)
This allows consuming projects using repository overlaying to disambiguate overlapping include paths when it comes to platform_impl.h by going through envoy/external/... Addendum to #8005 Risk Level: Low Testing: N/A Signed-off-by: Otto van der Schaaf <oschaaf@we-amp.com>
- Loading branch information
Showing
6 changed files
with
80 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#pragma once | ||
|
||
#include "envoy/filesystem/filesystem.h" | ||
#include "envoy/thread/thread.h" | ||
|
||
namespace Envoy { | ||
|
||
class PlatformImpl { | ||
public: | ||
PlatformImpl(); | ||
Thread::ThreadFactory& threadFactory() { return *thread_factory_; } | ||
Filesystem::Instance& fileSystem() { return *file_system_; } | ||
|
||
private: | ||
std::unique_ptr<Thread::ThreadFactory> thread_factory_; | ||
std::unique_ptr<Filesystem::Instance> file_system_; | ||
}; | ||
|
||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include "common/common/thread_impl.h" | ||
#include "common/filesystem/filesystem_impl.h" | ||
|
||
#include "exe/platform_impl.h" | ||
|
||
namespace Envoy { | ||
|
||
PlatformImpl::PlatformImpl() | ||
: thread_factory_(std::make_unique<Thread::ThreadFactoryImplPosix>()), | ||
file_system_(std::make_unique<Filesystem::InstanceImplPosix>()) {} | ||
|
||
} // namespace Envoy |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "common/common/assert.h" | ||
#include "common/common/thread_impl.h" | ||
#include "common/filesystem/filesystem_impl.h" | ||
|
||
#include "exe/platform_impl.h" | ||
|
||
// clang-format off | ||
#include <winsock2.h> | ||
// clang-format on | ||
|
||
namespace Envoy { | ||
|
||
PlatformImpl::PlatformImpl() | ||
: thread_factory_(std::make_unique<Thread::ThreadFactoryImplWin32>()), | ||
file_system_(std::make_unique<Filesystem::InstanceImplWin32>()) { | ||
const WORD wVersionRequested = MAKEWORD(2, 2); | ||
WSADATA wsaData; | ||
const int rc = ::WSAStartup(wVersionRequested, &wsaData); | ||
RELEASE_ASSERT(rc == 0, "WSAStartup failed with error"); | ||
} | ||
|
||
~PlatformImpl() { ::WSACleanup(); } | ||
|
||
}; // namespace Envoy | ||
|
||
} // namespace Envoy |
This file was deleted.
Oops, something went wrong.