summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-11-28 10:58:14 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-11-28 13:15:39 +0100
commit40ad0e8f6c5cecc01b47763457a1d1676a1fbc76 (patch)
tree3c4991db3974fc07806658bc50ca4b6070e3a11a
parentdetabify Doxyfile (diff)
downloadcore-40ad0e8f6c5cecc01b47763457a1d1676a1fbc76.tar.gz
core-40ad0e8f6c5cecc01b47763457a1d1676a1fbc76.zip
Declare SAL_THROW as documentation-only and deprecated
...which it effectively had been already anyway. Change-Id: I6c9ae34f59e8bd44a6be38e6e719ad0a96773c1c
-rw-r--r--include/sal/types.h40
-rw-r--r--odk/docs/cpp/Doxyfile3
2 files changed, 26 insertions, 17 deletions
diff --git a/include/sal/types.h b/include/sal/types.h
index ff6bc280b591..57789142c563 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -355,26 +355,36 @@ typedef struct _sal_Sequence
#pragma pack(pop)
#endif
-/** Definition of function throw clause macros. These have been introduced
- to reduce code size by balancing out compiler bugs.
+#if defined __cplusplus
+
+/** Exception specification documentation.
- These macros are ONLY for function declarations,
- use common C++ throw statement for throwing exceptions, e.g.
- throw RuntimeException();
+ The original intent of this macro was to control whether or not actual
+ exception specifications are emitted, based on how much they impact code
+ size etc. in a specific scenario. But it ended up always being disabled
+ (except for MSVC, which effectively ignored it even though being enabled),
+ and used in ways that would make enabling it illegal (e.g., in the
+ cppu::ComponentFactoryFunc typedef, or with necessarily incomplete
+ com::sun::star::uno::RuntimeException in com/sun/star/uno/Reference.h), so
+ has officially been demoted to pure documentation now.
- SAL_THROW() should be used for all C++ functions, e.g. SAL_THROW(())
- SAL_THROW_EXTERN_C() should be used for all C functions
+ @deprecated do not use in new code.
+*/
+#define SAL_THROW(x)
+
+/** Nothrow specification for C functions.
+
+ This is a macro so it can expand to nothing in C code.
*/
-#ifdef __cplusplus
-#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__sgi)
-#define SAL_THROW( exc )
-#else /* MSVC, all other */
-#define SAL_THROW( exc ) throw exc
-#endif /* __GNUC__, __SUNPRO_CC */
#define SAL_THROW_EXTERN_C() throw ()
-#else /* ! __cplusplus */
-/* SAL_THROW() must not be used in C headers, only SAL_THROW_EXTERN_C() is defined */
+
+#else
+
+/* SAL_THROW() must not be used in C code, only SAL_THROW_EXTERN_C() is defined
+ there:
+*/
#define SAL_THROW_EXTERN_C()
+
#endif
#ifdef __cplusplus
diff --git a/odk/docs/cpp/Doxyfile b/odk/docs/cpp/Doxyfile
index f48bcdd63a2d..30346e0df020 100644
--- a/odk/docs/cpp/Doxyfile
+++ b/odk/docs/cpp/Doxyfile
@@ -36,5 +36,4 @@ PREDEFINED = \
__cplusplus \
SAL_CALL= \
SAL_DEPRECATED_INTERNAL(x)= \
- SAL_DEPRECATED(x)= \
- "SAL_THROW(x)=throw x"
+ SAL_DEPRECATED(x)=