Author: Amaury Forgeot d'Arc <amaur...@gmail.com> Branch: Changeset: r47095:517b88c3b7d5 Date: 2011-09-06 02:02 +0200 http://bitbucket.org/pypy/pypy/changeset/517b88c3b7d5/
Log: Fix translation diff --git a/pypy/module/pwd/interp_pwd.py b/pypy/module/pwd/interp_pwd.py --- a/pypy/module/pwd/interp_pwd.py +++ b/pypy/module/pwd/interp_pwd.py @@ -4,10 +4,12 @@ from pypy.interpreter.gateway import interp2app, unwrap_spec from pypy.interpreter.error import OperationError, operationerrfmt +eci = ExternalCompilationInfo( + includes=['pwd.h'] + ) + class CConfig: - _compilation_info_ = ExternalCompilationInfo( - includes=['pwd.h'] - ) + _compilation_info_ = eci uid_t = rffi_platform.SimpleType("uid_t") @@ -26,11 +28,14 @@ passwd_p = lltype.Ptr(config['passwd']) uid_t = config['uid_t'] -c_getpwuid = rffi.llexternal("getpwuid", [uid_t], passwd_p) -c_getpwnam = rffi.llexternal("getpwnam", [rffi.CCHARP], passwd_p) -c_setpwent = rffi.llexternal("setpwent", [], lltype.Void) -c_getpwent = rffi.llexternal("getpwent", [], passwd_p) -c_endpwent = rffi.llexternal("endpwent", [], lltype.Void) +def external(name, args, result, **kwargs): + return rffi.llexternal(name, args, result, compilation_info=eci, **kwargs) + +c_getpwuid = external("getpwuid", [uid_t], passwd_p) +c_getpwnam = external("getpwnam", [rffi.CCHARP], passwd_p) +c_setpwent = external("setpwent", [], lltype.Void) +c_getpwent = external("getpwent", [], passwd_p) +c_endpwent = external("endpwent", [], lltype.Void) def make_struct_passwd(space, pw): w_passwd_struct = space.getattr(space.getbuiltinmodule('pwd'), _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit