Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,26 @@ extern "C" {
#define Py_DEPRECATED(VERSION_UNUSED)
#endif

#if defined(__clang__)
#define Py_COMP_DIAG_PUSH _Pragma("clang diagnostic push")
#define Py_COMP_DIAG_IGNORE_DEPR_DECLS \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#define Py_COMP_DIAG_POP _Pragma("clang diagnostic pop")
#elif defined(__GNUC__) \
&& ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
#define Py_COMP_DIAG_PUSH _Pragma("GCC diagnostic push")
#define Py_COMP_DIAG_IGNORE_DEPR_DECLS \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define Py_COMP_DIAG_POP _Pragma("GCC diagnostic pop")
#elif defined(_MSC_VER)
#define Py_COMP_DIAG_PUSH __pragma(warning(push))
#define Py_COMP_DIAG_IGNORE_DEPR_DECLS __pragma(warning(disable: 4996))
#define Py_COMP_DIAG_POP __pragma(warning(pop))
#else
#define Py_COMP_DIAG_PUSH
#define Py_COMP_DIAG_IGNORE_DEPR_DECLS
#define Py_COMP_DIAG_POP
#endif

/* _Py_HOT_FUNCTION
* The hot attribute on a function is used to inform the compiler that the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add the macros ``Py_COMP_DIAG_PUSH``, ``Py_COMP_DIAG_IGNORE_DEPR_DECLS``,
and ``Py_COMP_DIAG_POP``.