[pypy-commit] pypy stdlib-2.7.13: copy this file from 2.7.13
arigo
pypy.commits at gmail.com
Sun Dec 18 11:52:40 EST 2016
Author: Armin Rigo <arigo at tunes.org>
Branch: stdlib-2.7.13
Changeset: r89151:52963ea7f4bf
Date: 2016-12-18 17:36 +0100
http://bitbucket.org/pypy/pypy/changeset/52963ea7f4bf/
Log: copy this file from 2.7.13
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,13 +1,9 @@
/* 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.
- *****************************************************************/
-
#include <Python.h>
/*
- Backwards compatibility:
+ Backwards compatibility, no longer strictly required:
Python2.2 used LONG_LONG instead of PY_LONG_LONG
*/
#if defined(HAVE_LONG_LONG) && !defined(PY_LONG_LONG)
@@ -40,6 +36,24 @@
return func(a*a, b*b, c*c, d*d, e*e);
}
+/*
+ * This structure should be the same as in test_callbacks.py and the
+ * method test_callback_large_struct. See issues 17310 and 20160: the
+ * structure must be larger than 8 bytes long.
+ */
+
+typedef struct {
+ unsigned long first;
+ unsigned long second;
+ unsigned long third;
+} Test;
+
+EXPORT(void)
+_testfunc_cbk_large_struct(Test in, void (*func)(Test))
+{
+ func(in);
+}
+
EXPORT(void)testfunc_array(int values[4])
{
printf("testfunc_array %d %d %d %d\n",
More information about the pypy-commit
mailing list