According to the following links, it would be possible to implement the Pc_DEPRECATED() macro for Visual Studio:
https://mail.python.org/pipermail/python-dev/2018-May/153299.html
https://stackoverflow.com/questions/295120/c-mark-as-deprecated/295229#295229
"""
#ifdef __GNUC__
#define DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED(func) __declspec(deprecated) func
#else
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#define DEPRECATED(func) func
#endif
"""
Moreover, is Py_DEPRECATED() defined on clang which also supports the deprecated function attribute?
https://clang.llvm.org/docs/AttributeReference.html#deprecated-gnu-deprecated
Current Include/pyport.h code:
#if defined(__GNUC__) \
&& ((__GNUC__ >= 4) || (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
#else
#define Py_DEPRECATED(VERSION_UNUSED)
#endif |