Files
Python3-Win9x/compat/msvc600/cpython-3.11.16-vc6-headers.patch
T

35 lines
1.3 KiB
Diff

diff --git a/Include/pyport.h b/Include/pyport.h
index b3b8b6f..4da45ef 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -334,9 +334,12 @@ extern "C" {
#if defined(__GNUC__) \
&& ((__GNUC__ >= 4) || (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
-#elif defined(_MSC_VER)
+#elif defined(_MSC_VER) && _MSC_VER >= 1300
#define Py_DEPRECATED(VERSION) __declspec(deprecated( \
"deprecated in " #VERSION))
+#elif defined(_MSC_VER)
+/* Visual C++ 6.0 has no supported deprecation declaration syntax. */
+#define Py_DEPRECATED(VERSION_UNUSED)
#else
#define Py_DEPRECATED(VERSION_UNUSED)
#endif
@@ -352,10 +355,14 @@ extern "C" {
#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)
+#elif defined(_MSC_VER) && _MSC_VER >= 1300
#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))
+#elif defined(_MSC_VER)
+#define _Py_COMP_DIAG_PUSH
+#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS
+#define _Py_COMP_DIAG_POP
#else
#define _Py_COMP_DIAG_PUSH
#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS