give all folly exception types default visibility
authorEric Niebler <eniebler@fb.com>
Mon, 8 Jan 2018 23:21:57 +0000 (15:21 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 8 Jan 2018 23:36:38 +0000 (15:36 -0800)
Summary: This makes sure that whether folly is statically or dynamically linked, all folly exception types will have exactly one definition, and one set of type information.

Reviewed By: mzlee

Differential Revision: D6671431

fbshipit-source-id: 1c06826a05f87cbf9af747c9abdb5f524744d054

22 files changed:
folly/AtomicHashMap.h
folly/ExceptionWrapper.h
folly/Expected.h
folly/Format.h
folly/FormatArg.h
folly/IPAddressException.h
folly/Optional.h
folly/Poly.h
folly/Subprocess.h
folly/Try.h
folly/dynamic-inl.h
folly/executors/task_queue/BlockingQueue.h
folly/experimental/DynamicParser.h
folly/experimental/EnvUtil.h
folly/experimental/JSONSchema.cpp
folly/experimental/NestedCommandLineApp.h
folly/experimental/bser/Bser.h
folly/experimental/logging/LogConfigParser.h
folly/fibers/AtomicBatchDispatcher.h
folly/io/async/AsyncSocketException.h
folly/json.cpp
folly/synchronization/LifoSem.h

index 2243b6bef7415e07355987e0ecd383c9cc7c6ade..cfa78104b899d685b1ee84424167e600251a4a79 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 /*
  * AtomicHashMap --
  *
@@ -91,6 +90,7 @@
 #include <stdexcept>
 
 #include <folly/AtomicHashArray.h>
+#include <folly/CPortability.h>
 #include <folly/Likely.h>
 #include <folly/ThreadCachedInt.h>
 #include <folly/container/Foreach.h>
@@ -149,7 +149,7 @@ namespace folly {
 
 // Thrown when insertion fails due to running out of space for
 // submaps.
-struct AtomicHashMapFullError : std::runtime_error {
+struct FOLLY_EXPORT AtomicHashMapFullError : std::runtime_error {
   explicit AtomicHashMapFullError()
     : std::runtime_error("AtomicHashMap is full")
   {}
index ff60aa347117457aa9e123fc27850c30a398d1d7..fc0cac77529b58165c6029137d5aa7c0bc9bf012 100644 (file)
@@ -162,7 +162,7 @@ auto fold(Fn&& fn, A&& a, B&& b, Bs&&... bs) {
 //! \endcode
 class exception_wrapper final {
  private:
-  struct AnyException : std::exception {
+  struct FOLLY_EXPORT AnyException : std::exception {
     std::type_info const* typeinfo_;
     template <class T>
     /* implicit */ AnyException(T&& t) noexcept : typeinfo_(&typeid(t)) {}
index 3796336788c6686f91f07d674630e7c44083db89..9d3535f9072320fbe28482b5a6d8e76235b366cc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 /**
  * Like folly::Optional, but can store a value *or* an error.
  *
@@ -31,6 +30,7 @@
 
 #include <glog/logging.h>
 
+#include <folly/CPortability.h>
 #include <folly/CppAttributes.h>
 #include <folly/Likely.h>
 #include <folly/Optional.h>
@@ -660,7 +660,7 @@ inline expected_detail::UnexpectedTag unexpected(
 /**
  * An exception type thrown by Expected on catastrophic logic errors.
  */
-class BadExpectedAccess : public std::logic_error {
+class FOLLY_EXPORT BadExpectedAccess : public std::logic_error {
  public:
   BadExpectedAccess() : std::logic_error("bad Expected access") {}
 };
@@ -689,7 +689,7 @@ class Unexpected final : ColdClass {
    * when the user tries to access the nested value but the Expected object is
    * actually storing an error code.
    */
-  class BadExpectedAccess : public folly::BadExpectedAccess {
+  class FOLLY_EXPORT BadExpectedAccess : public folly::BadExpectedAccess {
    public:
     explicit BadExpectedAccess(Error err)
         : folly::BadExpectedAccess{}, error_(std::move(err)) {}
index 5980639bd7bbfff0bd4334ce0c3c74286b581b75..2c5f2fc3c32342f931f82339bb173c15c21621b1 100644 (file)
@@ -22,6 +22,7 @@
 #include <tuple>
 #include <type_traits>
 
+#include <folly/CPortability.h>
 #include <folly/Conv.h>
 #include <folly/FormatArg.h>
 #include <folly/Range.h>
@@ -318,7 +319,7 @@ inline std::string svformat(StringPiece fmt, Container&& container) {
  * makes the exception type small and noexcept-copyable like std::out_of_range,
  * and therefore able to fit in-situ in exception_wrapper.
  */
-class FormatKeyNotFoundException : public std::out_of_range {
+class FOLLY_EXPORT FormatKeyNotFoundException : public std::out_of_range {
  public:
   explicit FormatKeyNotFoundException(StringPiece key);
 
index df1054e1bba6b1d043196015f6102b041e947b9a..62c9705c4eedbcbb98402eabd3638c5c186d85dc 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <stdexcept>
 
+#include <folly/CPortability.h>
 #include <folly/Conv.h>
 #include <folly/Likely.h>
 #include <folly/Portability.h>
@@ -25,7 +26,7 @@
 
 namespace folly {
 
-class BadFormatArg : public std::invalid_argument {
+class FOLLY_EXPORT BadFormatArg : public std::invalid_argument {
   using invalid_argument::invalid_argument;
 };
 
index d1830ba61737ea56cdb5b8b1fdbd25e4525bc29b..0ba74621a8f766628a5a625b3ac607edd9ebcac0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 #include <exception>
 #include <string>
 #include <utility>
 
+#include <folly/CPortability.h>
 #include <folly/detail/IPAddress.h>
 
 namespace folly {
@@ -32,7 +32,7 @@ enum class IPAddressFormatError { INVALID_IP, UNSUPPORTED_ADDR_FAMILY };
 /**
  * Exception for invalid IP addresses.
  */
-class IPAddressFormatException : public std::exception {
+class FOLLY_EXPORT IPAddressFormatException : public std::exception {
  public:
   explicit IPAddressFormatException(std::string msg) noexcept
       : msg_(std::move(msg)) {}
@@ -51,7 +51,8 @@ class IPAddressFormatException : public std::exception {
   std::string msg_;
 };
 
-class InvalidAddressFamilyException : public IPAddressFormatException {
+class FOLLY_EXPORT InvalidAddressFamilyException
+    : public IPAddressFormatException {
  public:
   explicit InvalidAddressFamilyException(std::string msg) noexcept
       : IPAddressFormatException(std::move(msg)) {}
index 60ae2c735b1152ca2c883263c483b4ca229af386..8f48010fbe447ae2b5f090b734261aba1eae0fe2 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 /*
@@ -87,7 +86,7 @@ typedef int detail::NoneHelper::*None;
 
 const None none = nullptr;
 
-class OptionalEmptyException : public std::runtime_error {
+class FOLLY_EXPORT OptionalEmptyException : public std::runtime_error {
  public:
   OptionalEmptyException()
       : std::runtime_error("Empty Optional cannot be unwrapped") {}
index 5563f0a3f8a56a2813b83d2cd76a9b6ff388b81f..f2f4b9008989407c6c0c41cf7086cc234a56a563 100644 (file)
@@ -35,6 +35,7 @@
 #include <typeinfo>
 #include <utility>
 
+#include <folly/CPortability.h>
 #include <folly/CppAttributes.h>
 #include <folly/Traits.h>
 #include <folly/detail/TypeList.h>
@@ -175,7 +176,7 @@ struct PolyMembers {};
 /**
  * Exception type that is thrown on invalid access of an empty `Poly` object.
  */
-struct BadPolyAccess : std::exception {
+struct FOLLY_EXPORT BadPolyAccess : std::exception {
   BadPolyAccess() = default;
   char const* what() const noexcept override {
     return "BadPolyAccess";
@@ -186,7 +187,7 @@ struct BadPolyAccess : std::exception {
  * Exception type that is thrown when attempting to extract from a `Poly` a
  * value of the wrong type.
  */
-struct BadPolyCast : std::bad_cast {
+struct FOLLY_EXPORT BadPolyCast : std::bad_cast {
   BadPolyCast() = default;
   char const* what() const noexcept override {
     return "BadPolyCast";
index 72cf3fe05ea628023f7d6f618d82b4d18b14b179..597bb57324b800ec2f66c0821cd853fa027918a9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 /**
  * Subprocess library, modeled after Python's subprocess module
  * (http://docs.python.org/2/library/subprocess.html)
@@ -219,7 +218,7 @@ class ProcessReturnCode {
 /**
  * Base exception thrown by the Subprocess methods.
  */
-class SubprocessError : public std::runtime_error {
+class FOLLY_EXPORT SubprocessError : public std::runtime_error {
  public:
   using std::runtime_error::runtime_error;
 };
@@ -227,7 +226,7 @@ class SubprocessError : public std::runtime_error {
 /**
  * Exception thrown by *Checked methods of Subprocess.
  */
-class CalledProcessError : public SubprocessError {
+class FOLLY_EXPORT CalledProcessError : public SubprocessError {
  public:
   explicit CalledProcessError(ProcessReturnCode rc);
   ~CalledProcessError() throw() override = default;
@@ -239,7 +238,7 @@ class CalledProcessError : public SubprocessError {
 /**
  * Exception thrown if the subprocess cannot be started.
  */
-class SubprocessSpawnError : public SubprocessError {
+class FOLLY_EXPORT SubprocessSpawnError : public SubprocessError {
  public:
   SubprocessSpawnError(const char* executable, int errCode, int errnoValue);
   ~SubprocessSpawnError() throw() override = default;
index 7b97754c7d13a632220da91101c8ddd413bd1e68..61753492f25de98d5568770d26a1d532a5815067 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 #include <folly/ExceptionWrapper.h>
 
 namespace folly {
 
-class TryException : public std::logic_error {
+class FOLLY_EXPORT TryException : public std::logic_error {
  public:
   using std::logic_error::logic_error;
 };
 
-class UsingUninitializedTry : public TryException {
+class FOLLY_EXPORT UsingUninitializedTry : public TryException {
  public:
   UsingUninitializedTry() : TryException("Using uninitialized try") {}
 };
index 7b187d7c88509df00f6fafc1bcc459c58fa982fd..b82126f2c08c7dba68a6efbebf6560370971d731 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 #include <functional>
@@ -21,6 +20,7 @@
 #include <boost/iterator/iterator_adaptor.hpp>
 #include <boost/iterator/iterator_facade.hpp>
 
+#include <folly/CPortability.h>
 #include <folly/Conv.h>
 #include <folly/Format.h>
 #include <folly/Likely.h>
@@ -76,7 +76,7 @@ struct hash<::folly::dynamic> {
 
 namespace folly {
 
-struct TypeError : std::runtime_error {
+struct FOLLY_EXPORT TypeError : std::runtime_error {
   explicit TypeError(const std::string& expected, dynamic::Type actual);
   explicit TypeError(
       const std::string& expected,
index 49280954c5c112cddf682d09bde5740266110732..99147ad6443a0e18f7c43e7e1bcf9ffebc3b42e5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 #include <exception>
@@ -21,6 +20,8 @@
 
 #include <glog/logging.h>
 
+#include <folly/CPortability.h>
+
 namespace folly {
 
 // Some queue implementations (for example, LifoSemMPMCQueue or
@@ -28,7 +29,7 @@ namespace folly {
 // non-blocking (THROW) behaviors.
 enum class QueueBehaviorIfFull { THROW, BLOCK };
 
-class QueueFullException : public std::runtime_error {
+class FOLLY_EXPORT QueueFullException : public std::runtime_error {
   using std::runtime_error::runtime_error; // Inherit constructors.
 };
 
index 386eed327a9764d1033212b25fc658c2ccb4510d..57a53752ec03f4a1faadbae7bef77bf05e8d2934 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -24,6 +24,7 @@
  */
 #pragma once
 
+#include <folly/CPortability.h>
 #include <folly/ScopeGuard.h>
 #include <folly/dynamic.h>
 
@@ -194,7 +195,7 @@ std::string toPseudoJson(const folly::dynamic& d);
  * With DynamicParser::OnError::THROW, reports the first error.
  * It is forbidden to call releaseErrors() if you catch this.
  */
-struct DynamicParserParseError : public std::runtime_error {
+struct FOLLY_EXPORT DynamicParserParseError : public std::runtime_error {
   explicit DynamicParserParseError(folly::dynamic error)
     : std::runtime_error(folly::to<std::string>(
         "DynamicParserParseError: ", detail::toPseudoJson(error)
@@ -217,7 +218,7 @@ struct DynamicParserParseError : public std::runtime_error {
  * instead of reporting an error via releaseErrors().  It is unsafe to call
  * any parser methods after catching a LogicError.
  */
-struct DynamicParserLogicError : public std::logic_error {
+struct FOLLY_EXPORT DynamicParserLogicError : public std::logic_error {
   template <typename... Args>
   explicit DynamicParserLogicError(Args&&... args)
     : std::logic_error(folly::to<std::string>(std::forward<Args>(args)...)) {}
index 2d22f298860ede9ae077d318ec13e500fcb7afb1..101966f5bda25cbde61387b7a3da498372d3e077 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
-#include <folly/Memory.h>
 #include <map>
 #include <string>
 #include <unordered_map>
 #include <vector>
 
+#include <folly/CPortability.h>
+#include <folly/Memory.h>
+
 namespace folly {
 namespace experimental {
 
@@ -87,7 +88,7 @@ struct EnvironmentState {
   EnvType env_;
 };
 
-struct MalformedEnvironment : std::runtime_error {
+struct FOLLY_EXPORT MalformedEnvironment : std::runtime_error {
   using std::runtime_error::runtime_error;
 };
 } // namespace experimental
index d739fd108a90a52f3570a56c0727ccd762d20d63..5d7f5021a2494a26d66fb4848515e6153e405494 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #include <folly/experimental/JSONSchema.h>
 
 #include <boost/algorithm/string/replace.hpp>
 #include <boost/regex.hpp>
+
+#include <folly/CPortability.h>
 #include <folly/Conv.h>
 #include <folly/Memory.h>
 #include <folly/Optional.h>
@@ -33,8 +34,7 @@ namespace {
 /**
  * We throw this exception when schema validation fails.
  */
-struct SchemaError : std::runtime_error {
-
+struct FOLLY_EXPORT SchemaError : std::runtime_error {
   SchemaError(SchemaError&&) = default;
   SchemaError(const SchemaError&) = default;
 
index 2421034162ad68ce6b4fca957d47eec06703771c..a5e3d5e0a80731599bf9d662f3eec39b2b330360 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 #include <functional>
 #include <stdexcept>
 
+#include <folly/CPortability.h>
 #include <folly/experimental/ProgramOptions.h>
 
 namespace folly {
@@ -30,7 +30,7 @@ namespace folly {
  * empty; the message is only allowed when exiting with a non-zero status), and
  * return the exit code. (Other exceptions will propagate out of run())
  */
-class ProgramExit : public std::runtime_error {
+class FOLLY_EXPORT ProgramExit : public std::runtime_error {
  public:
   explicit ProgramExit(int status, const std::string& msg = std::string());
   int status() const { return status_; }
index 571a7fdef6102ad18aa3d213770036ecac2b1312..571e3f5ee4469917f32d63ece8941e401fff3c26 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 #pragma once
+#include <folly/CPortability.h>
 #include <folly/Optional.h>
 #include <folly/dynamic.h>
 #include <folly/io/IOBuf.h>
@@ -32,7 +33,7 @@
 namespace folly {
 namespace bser {
 
-class BserDecodeError : public std::runtime_error {
+class FOLLY_EXPORT BserDecodeError : public std::runtime_error {
  public:
   using std::runtime_error::runtime_error;
 };
index fae3863cd4ab0d85ac506b01742566ea0c3dfc5a..d67763194cb7772e703da4d622f68f292c806ad6 100644 (file)
@@ -17,6 +17,7 @@
 
 #include <stdexcept>
 
+#include <folly/CPortability.h>
 #include <folly/Range.h>
 #include <folly/experimental/logging/LogConfig.h>
 
@@ -34,7 +35,7 @@ namespace folly {
 
 struct dynamic;
 
-class LogConfigParseError : public std::invalid_argument {
+class FOLLY_EXPORT LogConfigParseError : public std::invalid_argument {
  public:
   using std::invalid_argument::invalid_argument;
 };
index 93f9c93b54baba4ceb3083b6b9328ab5a344f2a0..6dfddd2ae6786563e70fca1e451170991dfa1d01 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  */
 #pragma once
 
-#include <folly/Function.h>
-#include <folly/Optional.h>
-#include <folly/fibers/detail/AtomicBatchDispatcher.h>
-#include <folly/futures/Future.h>
-#include <folly/futures/Promise.h>
 #include <memory>
 #include <stdexcept>
 #include <string>
 #include <utility>
 #include <vector>
 
+#include <folly/CPortability.h>
+#include <folly/Function.h>
+#include <folly/Optional.h>
+#include <folly/fibers/detail/AtomicBatchDispatcher.h>
+#include <folly/futures/Future.h>
+#include <folly/futures/Promise.h>
+
 namespace folly {
 namespace fibers {
 
@@ -35,7 +37,7 @@ namespace fibers {
  * Examples are, multiple dispatch calls on the same token, trying to get more
  * tokens from the dispatcher after commit has been called, etc.
  */
-class ABDUsageException : public std::logic_error {
+class FOLLY_EXPORT ABDUsageException : public std::logic_error {
   using std::logic_error::logic_error;
 };
 
@@ -43,7 +45,7 @@ class ABDUsageException : public std::logic_error {
  * An exception class that gets set on the promise for dispatched tokens, when
  * the AtomicBatchDispatcher was destroyed before commit was called on it.
  */
-class ABDCommitNotCalledException : public std::runtime_error {
+class FOLLY_EXPORT ABDCommitNotCalledException : public std::runtime_error {
  public:
   ABDCommitNotCalledException()
       : std::runtime_error(
@@ -57,7 +59,7 @@ class ABDCommitNotCalledException : public std::runtime_error {
  * Only here so that the caller can distinguish the real failure cause
  * rather than these subsequently thrown exceptions.
  */
-class ABDTokenNotDispatchedException : public std::runtime_error {
+class FOLLY_EXPORT ABDTokenNotDispatchedException : public std::runtime_error {
   using std::runtime_error::runtime_error;
 };
 
index 83f95ee04aa7e07ad602ea86cd9074a33c48e0b2..1e9a114ad8584b4e5eb12d063d8209050a7be635 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 #include <stdexcept>
 #include <string>
 
+#include <folly/CPortability.h>
 #include <folly/Range.h>
 
 namespace folly {
 
-class AsyncSocketException : public std::runtime_error {
+class FOLLY_EXPORT AsyncSocketException : public std::runtime_error {
  public:
   enum AsyncSocketExceptionType {
     UNKNOWN = 0,
index db80b332a9b0c5825aa1a5f47f886f77993b11e6..a9d7af9450cbba34f13006775b8b03816f6e8ecc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #include <folly/json.h>
 
 #include <algorithm>
 
 #include <boost/algorithm/string.hpp>
 #include <boost/next_prior.hpp>
-#include <folly/Portability.h>
-#include <folly/lang/Bits.h>
 
 #include <folly/Conv.h>
+#include <folly/Portability.h>
 #include <folly/Range.h>
 #include <folly/String.h>
 #include <folly/Unicode.h>
+#include <folly/lang/Bits.h>
 #include <folly/portability/Constexpr.h>
 
 namespace folly {
@@ -187,7 +186,7 @@ struct Printer {
 
 //////////////////////////////////////////////////////////////////////
 
-struct ParseError : std::runtime_error {
+struct FOLLY_EXPORT ParseError : std::runtime_error {
   explicit ParseError(
       unsigned int line,
       std::string const& context,
index 102154cf66230257143fc9082cc86599e65b759d..c6ed69b49cb0727e6b89da6178b81fb887f9c26c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2017-present Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -13,7 +13,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 #pragma once
 
 #include <algorithm>
@@ -23,6 +22,7 @@
 #include <memory>
 #include <system_error>
 
+#include <folly/CPortability.h>
 #include <folly/CachelinePadded.h>
 #include <folly/IndexedMemPool.h>
 #include <folly/Likely.h>
@@ -90,7 +90,7 @@ typedef LifoSemImpl<> LifoSem;
 
 
 /// The exception thrown when wait()ing on an isShutdown() LifoSem
-struct ShutdownSemError : public std::runtime_error {
+struct FOLLY_EXPORT ShutdownSemError : public std::runtime_error {
   explicit ShutdownSemError(const std::string& msg);
   ~ShutdownSemError() noexcept override;
 };