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

Collapse All | Expand All

(-)Python-2.5.orig/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 = {}
(-)Python-2.5.1.orig/Modules/_ctypes/callbacks.c (+6 lines)
Lines 273-283 Link Here
273
		PyErr_NoMemory();
273
		PyErr_NoMemory();
274
		return NULL;
274
		return NULL;
275
	}
275
	}
276
#if FFI_CLOSURES
276
	p->pcl = MallocClosure();
277
	p->pcl = MallocClosure();
277
	if (p->pcl == NULL) {
278
	if (p->pcl == NULL) {
278
		PyErr_NoMemory();
279
		PyErr_NoMemory();
279
		goto error;
280
		goto error;
280
	}
281
	}
282
#endif
281
283
282
	for (i = 0; i < nArgs; ++i) {
284
	for (i = 0; i < nArgs; ++i) {
283
		PyObject *cnv = PySequence_GetItem(converters, i);
285
		PyObject *cnv = PySequence_GetItem(converters, i);
Lines 315-326 Link Here
315
			     "ffi_prep_cif failed with %d", result);
317
			     "ffi_prep_cif failed with %d", result);
316
		goto error;
318
		goto error;
317
	}
319
	}
320
#if FFI_CLOSURES
318
	result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
321
	result = ffi_prep_closure(p->pcl, &p->cif, closure_fcn, p);
319
	if (result != FFI_OK) {
322
	if (result != FFI_OK) {
320
		PyErr_Format(PyExc_RuntimeError,
323
		PyErr_Format(PyExc_RuntimeError,
321
			     "ffi_prep_closure failed with %d", result);
324
			     "ffi_prep_closure failed with %d", result);
322
		goto error;
325
		goto error;
323
	}
326
	}
327
#endif
324
328
325
	p->converters = converters;
329
	p->converters = converters;
326
	p->callable = callable;
330
	p->callable = callable;
Lines 328-335 Link Here
328
332
329
  error:
333
  error:
330
	if (p) {
334
	if (p) {
335
#if FFI_CLOSURES
331
		if (p->pcl)
336
		if (p->pcl)
332
			FreeClosure(p->pcl);
337
			FreeClosure(p->pcl);
338
#endif
333
		PyMem_Free(p);
339
		PyMem_Free(p);
334
	}
340
	}
335
	return NULL;
341
	return NULL;
(-)Python-2.5.1.orig/Modules/_ctypes/_ctypes.c (+2 lines)
Lines 3419-3425 Link Here
3419
	Py_CLEAR(self->paramflags);
3419
	Py_CLEAR(self->paramflags);
3420
3420
3421
	if (self->thunk) {
3421
	if (self->thunk) {
3422
#if FFI_CLOSURES
3422
		FreeClosure(self->thunk->pcl);
3423
		FreeClosure(self->thunk->pcl);
3424
#endif
3423
		PyMem_Free(self->thunk);
3425
		PyMem_Free(self->thunk);
3424
		self->thunk = NULL;
3426
		self->thunk = NULL;
3425
	}
3427
	}
(-)Python-2.5.1.orig/Modules/_ctypes/ctypes.h (+2 lines)
Lines 68-74 Link Here
68
};
68
};
69
69
70
typedef struct {
70
typedef struct {
71
#if FFI_CLOSURES
71
	ffi_closure *pcl; /* the C callable */
72
	ffi_closure *pcl; /* the C callable */
73
#endif
72
	ffi_cif cif;
74
	ffi_cif cif;
73
	PyObject *converters;
75
	PyObject *converters;
74
	PyObject *callable;
76
	PyObject *callable;
(-)Python-2.5.1.orig/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

Return to bug 268887