Skip to content

Commit 30b7247

Browse files
committed
Add another definition of Py_DEPRECATED using the [[deprecated]] attribute
1 parent 49cc2f8 commit 30b7247

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Include/pyport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,8 @@ extern "C" {
282282
#elif defined(_MSC_VER)
283283
#define Py_DEPRECATED(VERSION) __declspec(deprecated( \
284284
"deprecated in " #VERSION))
285+
#elif __STDC_VERSION__ >= 202311L || __cplusplus >= 201402L
286+
#define Py_DEPRECATED(VERSION) [[deprecated("Deprecated in "#VERSION)]]
285287
#else
286288
#define Py_DEPRECATED(VERSION_UNUSED)
287289
#endif

0 commit comments

Comments
 (0)