port: record initial MSVC600 compatibility layer
This commit is contained in:
+6
-4
@@ -40,10 +40,12 @@ The next errors include:
|
|||||||
- additional C99/C99-era declarations and compatibility assumptions
|
- additional C99/C99-era declarations and compatibility assumptions
|
||||||
|
|
||||||
The compatibility header now supplies the pointer-sized typedefs required by
|
The compatibility header now supplies the pointer-sized typedefs required by
|
||||||
`pyport.h`; the current first compiler diagnostics are unsupported C `inline`
|
`pyport.h`; the current first compiler diagnostics after applying the saved
|
||||||
syntax and `__declspec(deprecated)` annotations in CPython headers. The shim
|
`compat/msvc600/cpython-3.11.16-vc6-headers.patch` are VC6's inability to parse
|
||||||
resolved only the missing-header and pointer-type layer; it is intentionally not
|
`long long` declarations in `Include/longobject.h` and C99-style integer
|
||||||
presented as a complete fix.
|
literal suffixes in `Include/pythread.h`. The shim and patch resolve only the
|
||||||
|
missing-header, pointer-type, inline, and deprecation layers; they are
|
||||||
|
intentionally not presented as a complete fix.
|
||||||
|
|
||||||
## Larger blockers to plan for
|
## Larger blockers to plan for
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
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
|
||||||
@@ -31,4 +31,9 @@ typedef unsigned __int64 uint_least64_t;
|
|||||||
#define PRIx64 "I64x"
|
#define PRIx64 "I64x"
|
||||||
#define PRIX64 "I64X"
|
#define PRIX64 "I64X"
|
||||||
|
|
||||||
|
/* VC6 has __inline but does not recognize the C99 inline keyword. */
|
||||||
|
#ifndef inline
|
||||||
|
#define inline __inline
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user