Skip to content

Commit

Permalink
Create portability/Config.h
Browse files Browse the repository at this point in the history
Summary: Because including the root portability header just to get a couple of defines to be able to enable things is a waste. In addition, it would be nice if the config defines are never needed outside of the portability headers.

Reviewed By: yfeldblum

Differential Revision: D3059651

fb-gh-sync-id: 1cb9910d850ea015616a598808556b4815b3fb74
shipit-source-id: 1cb9910d850ea015616a598808556b4815b3fb74
  • Loading branch information
Orvid authored and Facebook Github Bot 3 committed Mar 16, 2016
1 parent 946d061 commit d9e0b59
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
1 change: 1 addition & 0 deletions folly/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ nobase_follyinclude_HEADERS = \
Padded.h \
PicoSpinLock.h \
Portability.h \
portability/Config.h \
portability/Constexpr.h \
portability/Environment.h \
portability/GFlags.h \
Expand Down
8 changes: 1 addition & 7 deletions folly/Portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@

#include <cstddef>

#ifndef FOLLY_NO_CONFIG
#include <folly/folly-config.h>
#endif

#ifdef FOLLY_PLATFORM_CONFIG
#include FOLLY_PLATFORM_CONFIG
#endif
#include <folly/portability/Config.h>

#if FOLLY_HAVE_FEATURES_H
#include <features.h>
Expand Down
25 changes: 25 additions & 0 deletions folly/portability/Config.h
Original file line number Diff line number Diff line change
@@ -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

#ifndef FOLLY_NO_CONFIG
#include <folly/folly-config.h>
#endif

#ifdef FOLLY_PLATFORM_CONFIG
#include FOLLY_PLATFORM_CONFIG
#endif

0 comments on commit d9e0b59

Please sign in to comment.