Create portability/Config.h
authorChristopher Dykes <cdykes@fb.com>
Wed, 16 Mar 2016 22:15:52 +0000 (15:15 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Wed, 16 Mar 2016 22:20:25 +0000 (15:20 -0700)
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

folly/Makefile.am
folly/Portability.h
folly/portability/Config.h [new file with mode: 0755]

index 746350bd180fac52421869cf82b6bca43d0e35a4..5428b5fa997a1b132fa9351ba18f427b9a51d2f4 100644 (file)
@@ -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 \
index 3276e44711374d681f7e9e5164b8d1a62344eef0..3df79c9a3755f427486cf4323d84749219837a58 100644 (file)
 
 #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>
diff --git a/folly/portability/Config.h b/folly/portability/Config.h
new file mode 100755 (executable)
index 0000000..a506f90
--- /dev/null
@@ -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