Skip to content

Commit

Permalink
Remove windows includes in gtest and gmock
Browse files Browse the repository at this point in the history
Summary: Remove windows includes in folly/portability/gtest.h and folly/portability/gmock.h because they are no longer needed now that windows UCRT declares its own posix functions.

Reviewed By: ilvokhin

Differential Revision: D66841402

fbshipit-source-id: cff160cbac70865d6cb5adeeb253a1afa5fa08cb
  • Loading branch information
skrueger authored and facebook-github-bot committed Dec 13, 2024
1 parent da769b6 commit c50468f
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <folly/experimental/io/FsUtil.h>
#include <folly/portability/GTest.h>
#include <folly/portability/Sockets.h>
#include <folly/portability/Unistd.h>
#include <folly/test/TestUtils.h>

#include <folly/experimental/io/AsyncBase.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <folly/init/Init.h>
#include <folly/memory/Malloc.h>
#include <folly/portability/GTest.h>
#include <folly/portability/SysTypes.h>

#if defined(FOLLY_USE_JEMALLOC) && (!defined(FOLLY_SANITIZE) || !FOLLY_SANITIZE)
#include <jemalloc/jemalloc.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <folly/portability/Fcntl.h>
#include <folly/portability/GTest.h>
#include <folly/portability/Sockets.h>
#include <folly/portability/Unistd.h>
#include <folly/portability/Windows.h>

namespace folly {
Expand Down
16 changes: 0 additions & 16 deletions third-party/folly/src/folly/portability/GMock.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,4 @@

#pragma once

// These _must_ be included before gmock.h, because
// it tries to include <io.h> on it's own, but we
// override all of those functions in Unistd.h :(
#include <folly/portability/Unistd.h>
#include <folly/portability/Windows.h>

#include <folly/Portability.h>

// Disable a couple of warnings due to GMock exporting classes
// that derive from stdlib classes which aren't explicitly exported.
FOLLY_PUSH_WARNING
FOLLY_MSVC_DISABLE_WARNING(4251)
FOLLY_MSVC_DISABLE_WARNING(4275)
// IWYU pragma: begin_exports
#include <gmock/gmock.h>
// IWYU pragma: end_exports
FOLLY_POP_WARNING
16 changes: 0 additions & 16 deletions third-party/folly/src/folly/portability/GTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,4 @@

#pragma once

// These _must_ be included before gtest.h, because
// it tries to include <io.h> on it's own, but we
// override all of those functions in Unistd.h :(
#include <folly/portability/Unistd.h>
#include <folly/portability/Windows.h>

#include <folly/Portability.h>

// Disable a couple of warnings due to GTest exporting classes
// that derive from stdlib classes which aren't explicitly exported.
FOLLY_PUSH_WARNING
FOLLY_MSVC_DISABLE_WARNING(4251)
FOLLY_MSVC_DISABLE_WARNING(4275)
// IWYU pragma: begin_exports
#include <gtest/gtest.h>
// IWYU pragma: end_exports
FOLLY_POP_WARNING
1 change: 1 addition & 0 deletions third-party/folly/src/folly/test/IteratorsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <folly/container/Array.h>
#include <folly/portability/GTest.h>
#include <folly/portability/SysTypes.h>

using namespace folly::detail;

Expand Down
1 change: 1 addition & 0 deletions third-party/folly/src/folly/test/MemcpyTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <folly/FollyMemcpy.h>
#include <folly/Portability.h>
#include <folly/portability/GTest.h>
#include <folly/portability/SysTypes.h>

namespace {

Expand Down
1 change: 1 addition & 0 deletions third-party/folly/src/folly/testing/test/TestUtilTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <folly/portability/Fcntl.h>
#include <folly/portability/GTest.h>
#include <folly/portability/Stdlib.h>
#include <folly/portability/Unistd.h>

using namespace folly;
using namespace folly::test;
Expand Down

0 comments on commit c50468f

Please sign in to comment.