From ce5702d3c27e2a9de253ee29e02c7f494ba2a2b8 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 29 Apr 2021 10:44:09 +0200 Subject: Reshuffle code a bit Group the various SAL_THROW_EXTERN_C macro definitions more closely together, and the C++ SAL_THROW_EXTERN_C and COVERITY_NOEXCEPT_FLASE macro definitions do not need to be inside an extern "C" block. Change-Id: I8c56f5c2efd287934cc75b20e79c27769e887e24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114845 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- include/sal/types.h | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'include/sal') diff --git a/include/sal/types.h b/include/sal/types.h index 4f6f1ba0e817..7733920f20be 100644 --- a/include/sal/types.h +++ b/include/sal/types.h @@ -319,13 +319,21 @@ typedef struct _sal_Sequence #pragma pack(pop) #endif -#if defined __cplusplus +#ifdef __cplusplus +} +#endif /* __cplusplus */ /** Nothrow specification for C functions. This is a macro so it can expand to nothing in C code. */ +#if defined __cplusplus #define SAL_THROW_EXTERN_C() throw () +#else +#define SAL_THROW_EXTERN_C() +#endif + +#ifdef __cplusplus /** To markup destructors that coverity warns might throw exceptions which won't throw in practice, or where std::terminate is @@ -337,18 +345,6 @@ typedef struct _sal_Sequence # define COVERITY_NOEXCEPT_FALSE #endif -#else - -#define SAL_THROW_EXTERN_C() - -#endif - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#ifdef __cplusplus - enum __sal_NoAcquire { /** definition of a no acquire enum for ctors -- cgit