File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Misc/NEWS.d/next/Core and Builtins Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -513,6 +513,26 @@ extern "C" {
513513#define Py_DEPRECATED (VERSION_UNUSED )
514514#endif
515515
516+ #if defined(__clang__ )
517+ #define _Py_COMP_DIAG_PUSH _Pragma("clang diagnostic push")
518+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
519+ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
520+ #define _Py_COMP_DIAG_POP _Pragma("clang diagnostic pop")
521+ #elif defined(__GNUC__ ) \
522+ && ((__GNUC__ >= 5 ) || (__GNUC__ == 4 ) && (__GNUC_MINOR__ >= 6 ))
523+ #define _Py_COMP_DIAG_PUSH _Pragma("GCC diagnostic push")
524+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
525+ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
526+ #define _Py_COMP_DIAG_POP _Pragma("GCC diagnostic pop")
527+ #elif defined(_MSC_VER )
528+ #define _Py_COMP_DIAG_PUSH __pragma(warning(push))
529+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS __pragma(warning(disable: 4996))
530+ #define _Py_COMP_DIAG_POP __pragma(warning(pop))
531+ #else
532+ #define _Py_COMP_DIAG_PUSH
533+ #define _Py_COMP_DIAG_IGNORE_DEPR_DECLS
534+ #define _Py_COMP_DIAG_POP
535+ #endif
516536
517537/* _Py_HOT_FUNCTION
518538 * The hot attribute on a function is used to inform the compiler that the
Original file line number Diff line number Diff line change 1+ Add the private macros ``_Py_COMP_DIAG_PUSH ``,
2+ ``_Py_COMP_DIAG_IGNORE_DEPR_DECLS ``, and ``_Py_COMP_DIAG_POP ``.
You can’t perform that action at this time.
0 commit comments