Browse Source

Update Python 2.3 for MSVC10

Rename WRITE_RESTRICTED due to a collision with windows headers.
Remove PY_UNICODE_TYPE from config header. unicodeobject.h should define this correctly.
Add special signal handling for MSVC8 and up.
msvc10
Skoader 12 years ago
parent
commit
0e154ffb4b
  1. 6
      MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/Objects/funcobject.c
  2. 2
      MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/Objects/methodobject.c
  3. 17
      MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/Python/pythonrun.c
  4. 2
      MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/Python/structmember.c
  5. 4
      MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/include/structmember.h
  6. 3
      MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/pyconfig_static/pyconfig.h

6
MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/Objects/funcobject.c

@ -153,13 +153,13 @@ PyFunction_SetClosure(PyObject *op, PyObject *closure)
static PyMemberDef func_memberlist[] = {
{"func_closure", T_OBJECT, OFF(func_closure),
RESTRICTED|READONLY},
{"func_doc", T_OBJECT, OFF(func_doc), WRITE_RESTRICTED},
{"__doc__", T_OBJECT, OFF(func_doc), WRITE_RESTRICTED},
{"func_doc", T_OBJECT, OFF(func_doc), PY_WRITE_RESTRICTED},
{"__doc__", T_OBJECT, OFF(func_doc), PY_WRITE_RESTRICTED},
{"func_globals", T_OBJECT, OFF(func_globals),
RESTRICTED|READONLY},
{"func_name", T_OBJECT, OFF(func_name), READONLY},
{"__name__", T_OBJECT, OFF(func_name), READONLY},
{"__module__", T_OBJECT, OFF(func_module), WRITE_RESTRICTED},
{"__module__", T_OBJECT, OFF(func_module), PY_WRITE_RESTRICTED},
{NULL} /* Sentinel */
};

2
MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/Objects/methodobject.c

@ -189,7 +189,7 @@ static PyGetSetDef meth_getsets [] = {
#define OFF(x) offsetof(PyCFunctionObject, x)
static PyMemberDef meth_members[] = {
{"__module__", T_OBJECT, OFF(m_module), WRITE_RESTRICTED},
{"__module__", T_OBJECT, OFF(m_module), PY_WRITE_RESTRICTED},
{NULL}
};

17
MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/Python/pythonrun.c

@ -1693,6 +1693,23 @@ PyOS_getsig(int sig)
return context.sa_handler;
#else
PyOS_sighandler_t handler;
/* Special signal handling for the secure CRT in Visual Studio 2005 */
#if defined(_MSC_VER) && _MSC_VER >= 1400
switch (sig) {
/* Only these signals are valid */
case SIGINT:
case SIGILL:
case SIGFPE:
case SIGSEGV:
case SIGTERM:
case SIGBREAK:
case SIGABRT:
break;
/* Don't call signal() with other values or it will assert */
default:
return SIG_ERR;
}
#endif /* _MSC_VER && _MSC_VER >= 1400 */
handler = signal(sig, SIG_IGN);
signal(sig, handler);
return handler;

2
MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/Python/structmember.c

@ -177,7 +177,7 @@ PyMember_SetOne(char *addr, PyMemberDef *l, PyObject *v)
PyErr_SetString(PyExc_TypeError, "readonly attribute");
return -1;
}
if ((l->flags & WRITE_RESTRICTED) && PyEval_GetRestricted()) {
if ((l->flags & PY_WRITE_RESTRICTED) && PyEval_GetRestricted()) {
PyErr_SetString(PyExc_RuntimeError, "restricted attribute");
return -1;
}

4
MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/include/structmember.h

@ -76,8 +76,8 @@ typedef struct PyMemberDef {
#define READONLY 1
#define RO READONLY /* Shorthand */
#define READ_RESTRICTED 2
#define WRITE_RESTRICTED 4
#define RESTRICTED (READ_RESTRICTED | WRITE_RESTRICTED)
#define PY_WRITE_RESTRICTED 4
#define RESTRICTED (READ_RESTRICTED | PY_WRITE_RESTRICTED)
/* Obsolete API, for binary backwards compatibility */

3
MOULOpenSourceClientPlugin/Plasma20/SDKs/XPlatform/Cypython-2.3.3/pyconfig_static/pyconfig.h

@ -414,9 +414,6 @@ Py_NO_ENABLE_SHARED to find out. Also support MS_NO_COREDLL for b/w compat */
/* Define if you want to have a Unicode type. */
#define Py_USING_UNICODE
/* Define as the integral type used for Unicode representation. */
#define PY_UNICODE_TYPE unsigned short
/* Define as the size of the unicode type. */
#define Py_UNICODE_SIZE SIZEOF_SHORT

Loading…
Cancel
Save