X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FScopeGuard.h;h=0e2ac6d1b621ba11999bcc6de3114747802e6f76;hb=76663af23df01607f74c00c449852f71e5d3f771;hp=3822e4d130d777f81edb060d5df583ee4bc21581;hpb=321359e0cb441c65748427e2ef49b162340bbe04;p=folly.git diff --git a/folly/ScopeGuard.h b/folly/ScopeGuard.h index 3822e4d1..0e2ac6d1 100644 --- a/folly/ScopeGuard.h +++ b/folly/ScopeGuard.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef FOLLY_SCOPEGUARD_H_ -#define FOLLY_SCOPEGUARD_H_ +#pragma once #include #include @@ -173,7 +172,8 @@ typedef ScopeGuardImplBase&& ScopeGuard; namespace detail { #if defined(FOLLY_EXCEPTION_COUNT_USE_CXA_GET_GLOBALS) || \ - defined(FOLLY_EXCEPTION_COUNT_USE_GETPTD) + defined(FOLLY_EXCEPTION_COUNT_USE_GETPTD) || \ + defined(FOLLY_EXCEPTION_COUNT_USE_STD) /** * ScopeGuard used for executing a function when leaving the current scope @@ -265,7 +265,8 @@ operator+(detail::ScopeGuardOnExit, FunctionType&& fn) { = ::folly::detail::ScopeGuardOnExit() + [&]() noexcept #if defined(FOLLY_EXCEPTION_COUNT_USE_CXA_GET_GLOBALS) || \ - defined(FOLLY_EXCEPTION_COUNT_USE_GETPTD) + defined(FOLLY_EXCEPTION_COUNT_USE_GETPTD) || \ + defined(FOLLY_EXCEPTION_COUNT_USE_STD) #define SCOPE_FAIL \ auto FB_ANONYMOUS_VARIABLE(SCOPE_FAIL_STATE) \ = ::folly::detail::ScopeGuardOnFail() + [&]() noexcept @@ -274,5 +275,3 @@ operator+(detail::ScopeGuardOnExit, FunctionType&& fn) { auto FB_ANONYMOUS_VARIABLE(SCOPE_SUCCESS_STATE) \ = ::folly::detail::ScopeGuardOnSuccess() + [&]() #endif // native uncaught_exception() supported - -#endif // FOLLY_SCOPEGUARD_H_