[pypy-commit] pypy py3k: update _ctypes_test.c to 3.2

pjenvey noreply at buildbot.pypy.org
Wed Feb 13 21:25:15 CET 2013


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r61185:963663b9ae4a
Date: 2013-02-13 12:12 -0800
http://bitbucket.org/pypy/pypy/changeset/963663b9ae4a/

Log:	update _ctypes_test.c to 3.2

diff --git a/lib_pypy/_ctypes_test.c b/lib_pypy/_ctypes_test.c
--- a/lib_pypy/_ctypes_test.c
+++ b/lib_pypy/_ctypes_test.c
@@ -1,19 +1,6 @@
-/* This is a Verbatim copy of _ctypes_test.c from CPython 2.7    */
-/*****************************************************************
-  This file should be kept compatible with Python 2.3, see PEP 291.
- *****************************************************************/
-
-
+/* This is a Verbatim copy of _ctypes_test.c from CPython 3.2    */
 #include <Python.h>
 
-/*
-  Backwards compatibility:
-  Python2.2 used LONG_LONG instead of PY_LONG_LONG
-*/
-#if defined(HAVE_LONG_LONG) && !defined(PY_LONG_LONG)
-#define PY_LONG_LONG LONG_LONG
-#endif
-
 #ifdef MS_WIN32
 #include <windows.h>
 #endif
@@ -388,7 +375,7 @@
     short M: 1, N: 2, O: 3, P: 4, Q: 5, R: 6, S: 7;
 };
 
-DL_EXPORT(void) set_bitfields(struct BITS *bits, char name, int value)
+EXPORT(void) set_bitfields(struct BITS *bits, char name, int value)
 {
     switch (name) {
     case 'A': bits->A = value; break;
@@ -411,7 +398,7 @@
     }
 }
 
-DL_EXPORT(int) unpack_bitfields(struct BITS *bits, char name)
+EXPORT(int) unpack_bitfields(struct BITS *bits, char name)
 {
     switch (name) {
     case 'A': return bits->A;
@@ -610,8 +597,21 @@
 
 #endif
 
-DL_EXPORT(void)
-init_ctypes_test(void)
+
+static struct PyModuleDef _ctypes_testmodule = {
+    PyModuleDef_HEAD_INIT,
+    "_ctypes_test",
+    NULL,
+    -1,
+    module_methods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+};
+
+PyMODINIT_FUNC
+PyInit__ctypes_test(void)
 {
-    Py_InitModule("_ctypes_test", module_methods);
+    return PyModule_Create(&_ctypes_testmodule);
 }


More information about the pypy-commit mailing list