From: Christopher Dykes Date: Sat, 10 Sep 2016 00:43:59 +0000 (-0700) Subject: Add portability headers for GTest and GMock X-Git-Tag: v2016.09.12.00~2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=af5dbcc3755d005cdee04a376a11118935f3f579;p=folly.git 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 --- 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