From c043b57dbbb0ea03d46d3bbd30a8d8eb30cc957e Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Mon, 27 Jul 2026 13:53:39 -0700 Subject: [PATCH] platform.h: Define OSL_DEPRECATED_EXTERNAL Similar to OSL_DEPRECATED, but for things where we want it to look deprecated externally, but still need to use it internally for now and don't want the warnings when building OSL itself. Signed-off-by: Larry Gritz --- src/doc/Doxyfile | 2 ++ src/include/OSL/platform.h | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/src/doc/Doxyfile b/src/doc/Doxyfile index cb8e50f0d8..07d3c983db 100644 --- a/src/doc/Doxyfile +++ b/src/doc/Doxyfile @@ -2167,12 +2167,14 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \ OSL_CONSTEXPR14=constexpr \ OSL_CONSTEXPR17=constexpr \ OSL_CONSTEXPR20=constexpr \ + OSL_CONSTEXPR23=constexpr \ OSL_INLINE_CONSTEXPR="inline constexpr" \ OSL_PURE_FUNC= \ OSL_CONST_FUNC= \ OSL_MAYBE_UNUSED= \ OSL_NODISCARD=[[nodiscard]] \ OSL_DEPRECATED:=[[deprecated]] \ + OSL_DEPRECATED_EXTERNAL:=[[deprecated]] \ OSL_FORMAT_DEPRECATED:= \ OSL_ERRORHANDLER_PRINTF_DEPRECATED:= \ OSL_FORCEINLINE=inline \ diff --git a/src/include/OSL/platform.h b/src/include/OSL/platform.h index 2b5e55385d..9f65456233 100644 --- a/src/include/OSL/platform.h +++ b/src/include/OSL/platform.h @@ -427,6 +427,15 @@ // [[deprecated(msg)]] instead. #define OSL_DEPRECATED(msg) [[deprecated(msg)]] +// OSL_DEPRECATED_EXTERNAL marks things deprecated for downstream apps, but +// still is allowed for internal use. Generally, this is used when we want to +// deprecate for users but can't quite extract it internally yet. +#ifndef OSL_INTERNAL +# define OSL_DEPRECATED_EXTERNAL(msg) [[deprecated(msg)]] +#else +# define OSL_DEPRECATED_EXTERNAL(msg) +#endif + // OSL_FALLTHROUGH at the end of a `case` label's statements documents that // the switch statement case is intentionally falling through to the code for