Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 269098 | Differences between
and this patch

Collapse All | Expand All

(-)setup.py (-4 / +4 lines)
Lines 1321-1336 Link Here
1321
                                         ffi_configfile):
1329
                                         ffi_configfile):
1322
                from distutils.dir_util import mkpath
1330
                from distutils.dir_util import mkpath
1323
                mkpath(ffi_builddir)
1331
                mkpath(ffi_builddir)
1324
                config_args = []
1332
                config_args = ['--host=%s' % os.environ["CHOST"], ]
1325
1333
1326
                # Pass empty CFLAGS because we'll just append the resulting
1334
                # Pass empty CFLAGS because we'll just append the resulting
1327
                # CFLAGS to Python's; -g or -O2 is to be avoided.
1335
                # CFLAGS to Python's; -g or -O2 is to be avoided.
1328
                cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \
1336
                cmd = "(cd %s && autoconf -W cross) && (cd %s && env CFLAGS='' '%s/configure' %s)" \
1329
                      % (ffi_builddir, ffi_srcdir, " ".join(config_args))
1337
                      % (ffi_srcdir, ffi_builddir, ffi_srcdir, " ".join(config_args))
1330
1338
1331
                res = os.system(cmd)
1339
                res = os.system(cmd)
1332
                if res or not os.path.exists(ffi_configfile):
1340
                if res or not os.path.exists(ffi_configfile):
1333
                    print "Failed to configure _ctypes module"
1341
                    print "Failed to configure _ctypes module, ret %d or missing %s"% (res, ffi_configfile, )
1334
                    return False
1342
                    return False
1335
1343
1336
            fficonfig = {}
1344
            fficonfig = {}
(-)Modules/_ctypes/malloc_closure.c (+2 lines)
Lines 27-33 Link Here
27
/******************************************************************/
27
/******************************************************************/
28
28
29
typedef union _tagITEM {
29
typedef union _tagITEM {
30
#if FFI_CLOSURES
30
	ffi_closure closure;
31
	ffi_closure closure;
32
#endif
31
	union _tagITEM *next;
33
	union _tagITEM *next;
32
} ITEM;
34
} ITEM;
33
35
(-)Modules/_ctypes/callbacks.c (-2 / +6 lines)
Lines 20-27 Link Here
20
	Py_XDECREF(self->converters);
20
	Py_XDECREF(self->converters);
21
	Py_XDECREF(self->callable);
21
	Py_XDECREF(self->callable);
22
	Py_XDECREF(self->restype);
22
	Py_XDECREF(self->restype);
23
#if FFI_CLOSURES
23
	if (self->pcl)
24
	if (self->pcl)
24
		FreeClosure(self->pcl);
25
		FreeClosure(self->pcl);
26
#endif
25
	PyObject_Del(self);
27
	PyObject_Del(self);
26
}
28
}
27
29
Lines 365-376 Link Here
365
367
366
	assert(CThunk_CheckExact(p));
368
	assert(CThunk_CheckExact(p));
367
369
370
#if FFI_CLOSURES
368
	p->pcl = MallocClosure();
371
	p->pcl = MallocClosure();
369
	if (p->pcl == NULL) {
372
	if (p->pcl == NULL) {
370
		PyErr_NoMemory();
373
		PyErr_NoMemory();
371
		goto error;
374
		goto error;
372
	}
375
	}
373
376
#endif
374
	for (i = 0; i < nArgs; ++i) {
377
	for (i = 0; i < nArgs; ++i) {
375
		PyObject *cnv = PySequence_GetItem(converters, i);
378
		PyObject *cnv = PySequence_GetItem(converters, i);
376
		if (cnv == NULL)
379
		if (cnv == NULL)
Lines 409-421 Link Here
409
			     "ffi_prep_cif failed with %d", result);
412
			     "ffi_prep_cif failed with %d", result);
410
		goto error;
413
		goto error;
411
	}
414
	}
415
#if FFI_CLOSURES
412
	result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
416
	result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
413
	if (result != FFI_OK) {
417
	if (result != FFI_OK) {
414
		PyErr_Format(PyExc_RuntimeError,
418
		PyErr_Format(PyExc_RuntimeError,
415
			     "ffi_prep_closure failed with %d", result);
419
			     "ffi_prep_closure failed with %d", result);
416
		goto error;
420
		goto error;
417
	}
421
	}
418
422
#endif
419
	Py_INCREF(converters);
423
	Py_INCREF(converters);
420
	p->converters = converters;
424
	p->converters = converters;
421
	Py_INCREF(callable);
425
	Py_INCREF(callable);
(-)Modules/_ctypes/ctypes.h (+2 lines)
Lines 69-75 Link Here
69
69
70
typedef struct {
70
typedef struct {
71
	PyObject_VAR_HEAD
71
	PyObject_VAR_HEAD
72
#if FFI_CLOSURES
72
	ffi_closure *pcl; /* the C callable */
73
	ffi_closure *pcl; /* the C callable */
74
#endif
73
	ffi_cif cif;
75
	ffi_cif cif;
74
	PyObject *converters;
76
	PyObject *converters;
75
	PyObject *callable;
77
	PyObject *callable;

Return to bug 269098