Commit 75765b5c authored by Alexander Zhavnerchik's avatar Alexander Zhavnerchik Committed by Facebook Github Bot

folly::settings do not inline settings definition

Summary:
If FOLLY_SETTING_DEFINE(...) is put into .cpp file right now you will get linker error about undefined references.

According to http://en.cppreference.com/w/cpp/language/inline
  2) The definition of an inline function or variable (since C++17) must be present in the translation unit where it is accessed (not necessarily before the point of access).

Hence the linker error. This diff fixes that.

Reviewed By: alikhtarov, mnv104

Differential Revision: D7567469

fbshipit-source-id: 02049e4881e50c414aeb506745e02eed1256daad
parent 7be9cf6a
...@@ -122,7 +122,7 @@ class Setting { ...@@ -122,7 +122,7 @@ class Setting {
*/ */
#define FOLLY_SETTING_DEFINE(_project, _name, _Type, _def, _desc) \ #define FOLLY_SETTING_DEFINE(_project, _name, _Type, _def, _desc) \
/* Meyers singleton to avoid SIOF */ \ /* Meyers singleton to avoid SIOF */ \
inline folly::settings::detail::Setting<_Type>& \ folly::settings::detail::Setting<_Type>& \
FOLLY_SETTINGS_FUNC__##_project##_##_name() { \ FOLLY_SETTINGS_FUNC__##_project##_##_name() { \
static folly::Indestructible<folly::settings::detail::Setting<_Type>> \ static folly::Indestructible<folly::settings::detail::Setting<_Type>> \
setting( \ setting( \
......
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