From eab6da6adf08655248b054fd887005b61afdb5d6 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Wed, 4 Oct 2017 14:56:25 -0700 Subject: [PATCH] give folly future's exceptions default visibility Summary: Exception types should have default visibility, otherwise RTTI doesn't work right. Reviewed By: elsteveogrande Differential Revision: D5976415 fbshipit-source-id: 45dcfe3476b513aa49a6f78352318f31d381ada7 --- folly/futures/FutureException.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/folly/futures/FutureException.h b/folly/futures/FutureException.h index 2ee69c08..5d265b75 100644 --- a/folly/futures/FutureException.h +++ b/folly/futures/FutureException.h @@ -19,14 +19,16 @@ #include #include +#include + namespace folly { -class FutureException : public std::logic_error { +class FOLLY_EXPORT FutureException : public std::logic_error { public: using std::logic_error::logic_error; }; -class BrokenPromise : public FutureException { +class FOLLY_EXPORT BrokenPromise : public FutureException { public: explicit BrokenPromise(const std::string& type) : FutureException("Broken promise for type name `" + type + '`') {} @@ -34,54 +36,54 @@ class BrokenPromise : public FutureException { explicit BrokenPromise(const char* type) : BrokenPromise(std::string(type)) {} }; -class NoState : public FutureException { +class FOLLY_EXPORT NoState : public FutureException { public: NoState() : FutureException("No state") {} }; [[noreturn]] void throwNoState(); -class PromiseAlreadySatisfied : public FutureException { +class FOLLY_EXPORT PromiseAlreadySatisfied : public FutureException { public: PromiseAlreadySatisfied() : FutureException("Promise already satisfied") {} }; [[noreturn]] void throwPromiseAlreadySatisfied(); -class FutureNotReady : public FutureException { +class FOLLY_EXPORT FutureNotReady : public FutureException { public: FutureNotReady() : FutureException("Future not ready") {} }; [[noreturn]] void throwFutureNotReady(); -class FutureAlreadyRetrieved : public FutureException { +class FOLLY_EXPORT FutureAlreadyRetrieved : public FutureException { public: FutureAlreadyRetrieved() : FutureException("Future already retrieved") {} }; [[noreturn]] void throwFutureAlreadyRetrieved(); -class FutureCancellation : public FutureException { +class FOLLY_EXPORT FutureCancellation : public FutureException { public: FutureCancellation() : FutureException("Future was cancelled") {} }; -class TimedOut : public FutureException { +class FOLLY_EXPORT TimedOut : public FutureException { public: TimedOut() : FutureException("Timed out") {} }; [[noreturn]] void throwTimedOut(); -class PredicateDoesNotObtain : public FutureException { +class FOLLY_EXPORT PredicateDoesNotObtain : public FutureException { public: PredicateDoesNotObtain() : FutureException("Predicate does not obtain") {} }; [[noreturn]] void throwPredicateDoesNotObtain(); -struct NoFutureInSplitter : FutureException { +struct FOLLY_EXPORT NoFutureInSplitter : FutureException { NoFutureInSplitter() : FutureException("No Future in this FutureSplitter") {} }; -- 2.34.1