Skip to content

Commit

Permalink
Switch gflags to portability/GFlags.h
Browse files Browse the repository at this point in the history
Summary:
There are two places that still includes gflags/gflags.h:
portability/GFlags.h and futures/exercises/Koan.h. Also removing
gflags entirely from a couple of places which never reference it at
all.

Reviewed By: yfeldblum

Differential Revision: D3203187

fb-gh-sync-id: e7725fbf2c4b3c475c0035e1b0e8c6e1227f277f
fbshipit-source-id: e7725fbf2c4b3c475c0035e1b0e8c6e1227f277f
  • Loading branch information
mzlee authored and Facebook Github Bot 5 committed May 5, 2016
1 parent 2d96948 commit 4598dd7
Show file tree
Hide file tree
Showing 51 changed files with 154 additions and 138 deletions.
2 changes: 1 addition & 1 deletion folly/MemoryMapping.cpp
Expand Up @@ -21,6 +21,7 @@
#include <utility>

#include <folly/Format.h>
#include <folly/portability/GFlags.h>
#include <folly/portability/SysMman.h>

#ifdef __linux__
Expand All @@ -30,7 +31,6 @@
#include <fcntl.h>
#include <sys/types.h>
#include <system_error>
#include <gflags/gflags.h>

DEFINE_int64(mlock_chunk_size, 1 << 20, // 1MB
"Maximum bytes to mlock/munlock/munmap at once "
Expand Down
2 changes: 1 addition & 1 deletion folly/build/GenerateFingerprintTables.cpp
Expand Up @@ -24,9 +24,9 @@
#include <string>

#include <glog/logging.h>
#include <gflags/gflags.h>

#include <folly/Format.h>
#include <folly/portability/GFlags.h>

#include <folly/detail/FingerprintPolynomial.h>

Expand Down
3 changes: 2 additions & 1 deletion folly/experimental/ProgramOptions.cpp
Expand Up @@ -20,10 +20,11 @@
#include <unordered_set>

#include <boost/version.hpp>
#include <gflags/gflags.h>
#include <glog/logging.h>

#include <folly/Conv.h>
#include <folly/Portability.h>
#include <folly/portability/GFlags.h>

namespace po = ::boost::program_options;

Expand Down
3 changes: 2 additions & 1 deletion folly/experimental/ProgramOptions.h
Expand Up @@ -17,8 +17,9 @@
#pragma once

#include <boost/program_options.hpp>

#include <folly/Optional.h>
#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>

namespace folly {

Expand Down
Expand Up @@ -18,11 +18,11 @@
#include <thread>
#include <vector>

#include <gflags/gflags.h>
#include <glog/logging.h>

#include <folly/Benchmark.h>
#include <folly/experimental/exception_tracer/ExceptionTracer.h>
#include <folly/portability/GFlags.h>

void recurse(int level) {
if (level == 0) {
Expand Down
3 changes: 1 addition & 2 deletions folly/experimental/io/HugePageUtil.cpp
Expand Up @@ -25,15 +25,14 @@
#include <stdexcept>
#include <system_error>

#include <gflags/gflags.h>

#include <folly/File.h>
#include <folly/Format.h>
#include <folly/MemoryMapping.h>
#include <folly/Portability.h>
#include <folly/Range.h>
#include <folly/ScopeGuard.h>
#include <folly/experimental/io/HugePages.h>
#include <folly/portability/GFlags.h>

DEFINE_bool(cp, false, "Copy file");

Expand Down
3 changes: 2 additions & 1 deletion folly/experimental/symbolizer/ElfUtil.cpp
Expand Up @@ -19,9 +19,10 @@

#include <stdio.h>

#include <gflags/gflags.h>
#include <glog/logging.h>

#include <folly/portability/GFlags.h>

using namespace folly;
using namespace folly::symbolizer;

Expand Down
2 changes: 1 addition & 1 deletion folly/experimental/symbolizer/test/DwarfBenchmark.cpp
Expand Up @@ -16,7 +16,7 @@

#include <folly/Benchmark.h>
#include <folly/experimental/symbolizer/Dwarf.h>
#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>

void dummy() {}

Expand Down
1 change: 0 additions & 1 deletion folly/experimental/test/LockFreeRingBufferTest.cpp
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include <gflags/gflags.h>
#include <gtest/gtest.h>
#include <iostream>
#include <thread>
Expand Down
2 changes: 1 addition & 1 deletion folly/experimental/test/NestedCommandLineAppTestHelper.cpp
Expand Up @@ -15,7 +15,7 @@
*/

#include <folly/experimental/NestedCommandLineApp.h>
#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>

DEFINE_int32(global_foo, 42, "Global foo");

Expand Down
9 changes: 5 additions & 4 deletions folly/experimental/test/ReadMostlySharedPtrBenchmark.cpp
Expand Up @@ -15,14 +15,15 @@
*/
/* -*- Mode: C++; tab-width: 2; c-basic-offset: 2; indent-tabs-mode: nil -*- */

#include <thread>
#include <folly/experimental/ReadMostlySharedPtr.h>

#include <iostream>
#include <thread>

#include <folly/Benchmark.h>
#include <folly/Memory.h>
#include <gflags/gflags.h>

#include <folly/experimental/RCURefCount.h>
#include <folly/experimental/ReadMostlySharedPtr.h>
#include <folly/portability/GFlags.h>

template <template<typename> class MainPtr,
template<typename> class WeakPtr,
Expand Down
17 changes: 9 additions & 8 deletions folly/experimental/test/StringKeyedTest.cpp
Expand Up @@ -15,19 +15,20 @@
*/
// Copyright 2013-present Facebook. All Rights Reserved.

#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>

#include <string>
#include <list>

#include <folly/Range.h>
#include <folly/experimental/StringKeyedMap.h>
#include <folly/experimental/StringKeyedSet.h>
#include <folly/experimental/StringKeyedUnorderedMap.h>
#include <folly/experimental/StringKeyedUnorderedSet.h>

#include <list>
#include <string>

#include <glog/logging.h>
#include <gtest/gtest.h>

#include <folly/Range.h>
#include <folly/portability/GFlags.h>

using folly::StringKeyedMap;
using folly::StringKeyedSetBase;
using folly::StringKeyedUnorderedMap;
Expand Down
8 changes: 5 additions & 3 deletions folly/init/Init.cpp
Expand Up @@ -13,12 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <folly/init/Init.h>
#include <folly/Singleton.h>
#include <folly/experimental/symbolizer/SignalHandler.h>

#include <glog/logging.h>
#include <gflags/gflags.h>

#include <folly/Singleton.h>
#include <folly/experimental/symbolizer/SignalHandler.h>
#include <folly/portability/GFlags.h>

namespace folly {

Expand Down
3 changes: 1 addition & 2 deletions folly/io/async/test/EventBaseBenchmark.cpp
Expand Up @@ -16,8 +16,7 @@

#include <folly/Benchmark.h>
#include <folly/io/async/EventBase.h>

#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>

using namespace folly;

Expand Down
8 changes: 4 additions & 4 deletions folly/io/test/IOBufQueueTest.cpp
Expand Up @@ -15,15 +15,15 @@
*/

#include <folly/io/IOBufQueue.h>
#include <folly/Range.h>

#include <gflags/gflags.h>
#include <gtest/gtest.h>

#include <iostream>
#include <stdexcept>
#include <string.h>

#include <gtest/gtest.h>

#include <folly/Range.h>

using folly::IOBuf;
using folly::IOBufQueue;
using folly::StringPiece;
Expand Down
5 changes: 2 additions & 3 deletions folly/io/test/IOBufTest.cpp
Expand Up @@ -17,15 +17,14 @@
#include <folly/io/IOBuf.h>
#include <folly/io/TypedIOBuf.h>

#include <gflags/gflags.h>
#include <cstddef>

#include <boost/random.hpp>
#include <gtest/gtest.h>

#include <folly/Malloc.h>
#include <folly/Range.h>

#include <cstddef>

using folly::fbstring;
using folly::fbvector;
using folly::IOBuf;
Expand Down
7 changes: 3 additions & 4 deletions folly/io/test/NetworkBenchmark.cpp
Expand Up @@ -14,13 +14,12 @@
* limitations under the License.
*/

#include <folly/io/IOBuf.h>
#include <vector>

#include <gflags/gflags.h>
#include <folly/Benchmark.h>
#include <folly/io/Cursor.h>

#include <vector>
#include <folly/io/IOBuf.h>
#include <folly/portability/GFlags.h>

using folly::IOBuf;
using std::unique_ptr;
Expand Down
3 changes: 1 addition & 2 deletions folly/io/test/RecordIOTest.cpp
Expand Up @@ -18,10 +18,8 @@

#include <sys/types.h>
#include <unistd.h>

#include <random>

#include <gflags/gflags.h>
#include <glog/logging.h>
#include <gtest/gtest.h>

Expand All @@ -30,6 +28,7 @@
#include <folly/Random.h>
#include <folly/experimental/TestUtil.h>
#include <folly/io/IOBufQueue.h>
#include <folly/portability/GFlags.h>

DEFINE_int32(random_seed, folly::randomNumberSeed(), "random seed");

Expand Down
8 changes: 5 additions & 3 deletions folly/portability/GFlags.h
Expand Up @@ -16,9 +16,9 @@

#pragma once

#if FOLLY_HAVE_LIBGFLAGS
#include <gflags/gflags.h>
#else
#include <folly/portability/Config.h>

#if defined(FOLLY_HAVE_LIBGFLAGS) && (FOLLY_HAVE_LIBGFLAGS == 0)
// glog/logging.h is dependent on this implementation detail
// being defined otherwise it undefines all of this -_-....
//
Expand Down Expand Up @@ -58,4 +58,6 @@
FOLLY_DEFINE_FLAG(unsigned long long, U64, _name, _default)
#define DEFINE_string(_name, _default, _description) \
FOLLY_DEFINE_FLAG(std::string, S, _name, _default)
#else
#include <gflags/gflags.h>
#endif
2 changes: 1 addition & 1 deletion folly/test/AsciiCaseInsensitiveTest.cpp
Expand Up @@ -16,7 +16,7 @@

#include <folly/Range.h>

#include <gflags/gflags.h>
#include <folly/portability/GFlags.h>
#include <gtest/gtest.h>
#include <algorithm>

Expand Down
12 changes: 8 additions & 4 deletions folly/test/AtomicUnorderedMapTest.cpp
Expand Up @@ -13,14 +13,18 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include <folly/AtomicUnorderedMap.h>
#include <folly/test/DeterministicSchedule.h>
#include <thread>

#include <semaphore.h>
#include <gflags/gflags.h>
#include <thread>
#include <unordered_map>

#include <gtest/gtest.h>

#include <folly/Benchmark.h>
#include <unordered_map>
#include <folly/portability/GFlags.h>
#include <folly/test/DeterministicSchedule.h>

using namespace folly;
using namespace folly::test;
Expand Down
11 changes: 7 additions & 4 deletions folly/test/BatonBenchmark.cpp
Expand Up @@ -15,13 +15,16 @@
*/

#include <folly/Baton.h>

#include <semaphore.h>
#include <thread>

#include <gtest/gtest.h>

#include <folly/Benchmark.h>
#include <folly/portability/GFlags.h>
#include <folly/test/BatonTestHelpers.h>
#include <folly/test/DeterministicSchedule.h>
#include <thread>
#include <semaphore.h>
#include <gflags/gflags.h>
#include <gtest/gtest.h>

using namespace folly;
using namespace folly::test;
Expand Down
5 changes: 3 additions & 2 deletions folly/test/BitIteratorTest.cpp
Expand Up @@ -15,15 +15,16 @@
*/

#include <folly/Bits.h>
#include <folly/Benchmark.h>

#include <algorithm>
#include <type_traits>
#include <limits>
#include <vector>

#include <gtest/gtest.h>

#include <gflags/gflags.h>
#include <folly/Benchmark.h>
#include <folly/portability/GFlags.h>

using namespace folly;
using namespace folly::bititerator_detail;
Expand Down
4 changes: 3 additions & 1 deletion folly/test/ChecksumTest.cpp
Expand Up @@ -15,11 +15,13 @@
*/

#include <folly/Checksum.h>
#include <gflags/gflags.h>

#include <gtest/gtest.h>

#include <folly/Benchmark.h>
#include <folly/Hash.h>
#include <folly/detail/ChecksumDetail.h>
#include <folly/portability/GFlags.h>

namespace {
const unsigned int BUFFER_SIZE = 512 * 1024 * sizeof(uint64_t);
Expand Down
5 changes: 2 additions & 3 deletions folly/test/ConcurrentSkipListBenchmark.cpp
Expand Up @@ -20,13 +20,12 @@
#include <set>
#include <thread>

#include <gflags/gflags.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/ConcurrentSkipList.h>
#include <folly/Hash.h>
#include <folly/RWSpinLock.h>

#include <folly/portability/GFlags.h>
#include <glog/logging.h>

DEFINE_int32(num_threads, 12, "num concurrent threads to test");

Expand Down

0 comments on commit 4598dd7

Please sign in to comment.