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

Make semaphore.h a non-portable header

Summary: On Windows it has include order requirements.

Reviewed By: yfeldblum

Differential Revision: D5277151

fbshipit-source-id: a6cf923d78e5944ac34e885e32a7cf072f904720
parent fbcd8169
...@@ -336,6 +336,7 @@ nobase_follyinclude_HEADERS = \ ...@@ -336,6 +336,7 @@ nobase_follyinclude_HEADERS = \
portability/Memory.h \ portability/Memory.h \
portability/OpenSSL.h \ portability/OpenSSL.h \
portability/PThread.h \ portability/PThread.h \
portability/Semaphore.h \
portability/Sockets.h \ portability/Sockets.h \
portability/Stdio.h \ portability/Stdio.h \
portability/Stdlib.h \ portability/Stdlib.h \
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
#include <folly/futures/InlineExecutor.h> #include <folly/futures/InlineExecutor.h>
#include <folly/futures/Promise.h> #include <folly/futures/Promise.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/Semaphore.h>
#include <semaphore.h>
#include <vector> #include <vector>
using namespace folly; using namespace folly;
......
/*
* Copyright 2017 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
// On Windows, the include order matters, as the pthread implementation we
// support attempts to use a different definition of `mode_t` than everything
// else, so we have to make sure our definition of it is first.
#include <folly/portability/SysTypes.h>
#include <semaphore.h>
...@@ -16,13 +16,13 @@ ...@@ -16,13 +16,13 @@
#include <folly/AtomicUnorderedMap.h> #include <folly/AtomicUnorderedMap.h>
#include <semaphore.h>
#include <thread> #include <thread>
#include <unordered_map> #include <unordered_map>
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/portability/Semaphore.h>
#include <folly/test/DeterministicSchedule.h> #include <folly/test/DeterministicSchedule.h>
using namespace folly; using namespace folly;
......
...@@ -16,12 +16,12 @@ ...@@ -16,12 +16,12 @@
#include <folly/Baton.h> #include <folly/Baton.h>
#include <semaphore.h>
#include <thread> #include <thread>
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/portability/Semaphore.h>
#include <folly/test/BatonTestHelpers.h> #include <folly/test/BatonTestHelpers.h>
#include <folly/test/DeterministicSchedule.h> #include <folly/test/DeterministicSchedule.h>
......
...@@ -16,17 +16,10 @@ ...@@ -16,17 +16,10 @@
#pragma once #pragma once
// This needs to be above semaphore.h due to the windows
// libevent implementation needing mode_t to be defined,
// but defining it differently than our portability
// headers do.
#include <folly/portability/SysTypes.h>
#include <assert.h> #include <assert.h>
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <errno.h> #include <errno.h>
#include <glog/logging.h> #include <glog/logging.h>
#include <semaphore.h>
#include <atomic> #include <atomic>
#include <functional> #include <functional>
#include <mutex> #include <mutex>
...@@ -38,6 +31,7 @@ ...@@ -38,6 +31,7 @@
#include <folly/detail/AtomicUtils.h> #include <folly/detail/AtomicUtils.h>
#include <folly/detail/CacheLocality.h> #include <folly/detail/CacheLocality.h>
#include <folly/detail/Futex.h> #include <folly/detail/Futex.h>
#include <folly/portability/Semaphore.h>
namespace folly { namespace folly {
namespace test { namespace test {
......
...@@ -17,12 +17,12 @@ ...@@ -17,12 +17,12 @@
#include <folly/IndexedMemPool.h> #include <folly/IndexedMemPool.h>
#include <folly/portability/GMock.h> #include <folly/portability/GMock.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/portability/Semaphore.h>
#include <folly/portability/Unistd.h> #include <folly/portability/Unistd.h>
#include <folly/test/DeterministicSchedule.h> #include <folly/test/DeterministicSchedule.h>
#include <string> #include <string>
#include <thread> #include <thread>
#include <semaphore.h>
using namespace folly; using namespace folly;
using namespace folly::test; using namespace folly::test;
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <folly/LifoSem.h> #include <folly/LifoSem.h>
#include <semaphore.h>
#include <thread> #include <thread>
#include <folly/Benchmark.h> #include <folly/Benchmark.h>
...@@ -24,6 +23,7 @@ ...@@ -24,6 +23,7 @@
#include <folly/portability/Asm.h> #include <folly/portability/Asm.h>
#include <folly/portability/GFlags.h> #include <folly/portability/GFlags.h>
#include <folly/portability/GTest.h> #include <folly/portability/GTest.h>
#include <folly/portability/Semaphore.h>
#include <folly/test/DeterministicSchedule.h> #include <folly/test/DeterministicSchedule.h>
using namespace folly; using namespace folly;
......
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