From af5dbcc3755d005cdee04a376a11118935f3f579 Mon Sep 17 00:00:00 2001 From: Christopher Dykes Date: Fri, 9 Sep 2016 17:43:59 -0700 Subject: [PATCH] Add portability headers for GTest and GMock Summary: Both the gtest and gmock headers include `` 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 --- folly/Makefile.am | 2 ++ folly/portability/GMock.h | 25 +++++++++++++++++++++++++ folly/portability/GTest.h | 25 +++++++++++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100755 folly/portability/GMock.h create mode 100755 folly/portability/GTest.h diff --git a/folly/Makefile.am b/folly/Makefile.am index b22aae8c..f9c059bb 100644 --- a/folly/Makefile.am +++ b/folly/Makefile.am @@ -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 \ diff --git a/folly/portability/GMock.h b/folly/portability/GMock.h new file mode 100755 index 00000000..9c9c880d --- /dev/null +++ b/folly/portability/GMock.h @@ -0,0 +1,25 @@ +/* + * 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 on it's own, but we +// override all of those functions in Unistd.h :( +#include +#include + +#include diff --git a/folly/portability/GTest.h b/folly/portability/GTest.h new file mode 100755 index 00000000..18396f16 --- /dev/null +++ b/folly/portability/GTest.h @@ -0,0 +1,25 @@ +/* + * 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 on it's own, but we +// override all of those functions in Unistd.h :( +#include +#include + +#include -- 2.34.1