Commit af5dbcc3 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Add portability headers for GTest and GMock

Summary:
Both the gtest and gmock headers include `<io.h>` on Windows, which conflicts with how the portability headers include it, so a specific include order is required before either of those headers can be included. As that's brittle and messy, create a pair of portability headers for them instead, so that those can be included instead.

This only adds the headers. The switch to using them will be done in a later pair of diffs.

Reviewed By: mzlee

Differential Revision: D3837221

fbshipit-source-id: 82a273485cdd4536f1153d958c171bfe3ec32e0b
parent dbd70eed
......@@ -279,6 +279,8 @@ nobase_follyinclude_HEADERS = \
portability/Event.h \
portability/Fcntl.h \
portability/GFlags.h \
portability/GMock.h \
portability/GTest.h \
portability/IOVec.h \
portability/Libgen.h \
portability/Malloc.h \
......
/*
* Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#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 <gmock/gmock.h>
/*
* Copyright 2016 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#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 <gtest/gtest.h>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment