8eda4b88f0
v1.9 Structs with variable-sized arrays as their last field: now we track the length of the array after ffi.new() is called, just like we always tracked the length of ffi.new("int[]", 42). This lets us detect out-of-range accesses to array items. This also lets us display a better repr(), and have the total size returned by ffi.sizeof() and ffi.buffer(). Previously both functions would return a result based on the size of the declared structure type, with an assumed empty array. (Thanks andrew for starting this refactoring.) Add support in cdef()/set_source() for unspecified-length arrays in typedefs: typedef int foo_t[...];. It was already supported for global variables or structure fields. I turned in v1.8 a warning from cffi/model.py into an error: 'enum xxx' has no values explicitly defined: refusing to guess which integer type it is meant to be (unsigned/signed, int/long). Now Iâm turning it back to a warning again; it seems that guessing that the enum has size int is a 99%-safe bet. (But not 100%, so it stays as a warning.) Fix leaks in the code handling FILE * arguments. In CPython 3 there is a remaining issue that is hard to fix: if you pass a Python file object to a FILE * argument, then os.dup() is used and the new file descriptor is only closed when the GC reclaims the Python file objectâand not at the earlier time when you call close(), which only closes the original file descriptor. If this is an issue, you should avoid this automatic convertion of Python file objects: instead, explicitly manipulate file descriptors and call fdopen() from C (...via cffi).
25 lines
738 B
Makefile
25 lines
738 B
Makefile
# $NetBSD: Makefile,v 1.23 2016/11/14 14:31:18 wiz Exp $
|
|
|
|
DISTNAME= cffi-1.9.1
|
|
PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
|
|
CATEGORIES= devel
|
|
MASTER_SITES= ${MASTER_SITE_PYPI:=c/cffi/}
|
|
|
|
MAINTAINER= pkgsrc-users@NetBSD.org
|
|
HOMEPAGE= https://pypi.python.org/pypi/cffi/
|
|
COMMENT= Foreign Function Interface for Python calling C code
|
|
LICENSE= mit
|
|
|
|
USE_TOOLS+= pkg-config
|
|
|
|
DEPENDS+= ${PYPKGPREFIX}-cparser-[0-9]*:../../devel/py-cparser
|
|
|
|
NOT_PAX_MPROTECT_SAFE= ${PYSITELIB}/_cffi_backend.so
|
|
|
|
# tests don't run on MPROTECT enabled systems, and I haven't found
|
|
# the magic to fix that, so workaround:
|
|
# sysctl -w security.pax.mprotect.global=0
|
|
|
|
.include "../../devel/libffi/buildlink3.mk"
|
|
.include "../../lang/python/egg.mk"
|
|
.include "../../mk/bsd.pkg.mk"
|