[pypy-dev] Request to make `makedev`, `major` and `minor` macros

John Zhang John.Zhang at anu.edu.au
Tue Dec 6 02:20:41 EST 2016


Forgot the attachment, sorry!

------------------------------------------------------
John Zhang
Research Assistant
Programming Languages, Design & Implementation Division
Computer Systems Group
ANU College of Engineering & Computer Science
108 North Rd
The Australian National University
Acton ACT 2601
john.zhang at anu.edu.au<mailto:john.zhang at anu.edu.au>





On 6 Dec. 2016, at 18:18, John Zhang <john.zhang at anu.edu.au<mailto:john.zhang at anu.edu.au>> wrote:

Hi all (Armin?),
I would like to request making the definitions of `rpython.rlib.rposix.c_makedev/c_major/c_minor` include explicit macro functions, i.e., passing `macro=_MACRO_ON_POSIX` to the `rffi.llexternal` function.
These functions are macros on both Linux and macOS (the comment above the code acknowledges this fact). Without explicitly saying they are macros, these functions can’t be called using rffi. The attached patch also adds another test in test_rposix.py, which exposes the problem.
The reason that they don’t currently affect the existing PyPy is because PyPy compiles to C anyway. But I’m working on another backend (Mu Micro VM), so I’d appreciate the ability to call these external functions from shared libraries directly. I think the macro wrapper generation is a great idea and its existing work is something that I can try to incorporate in my backend.
I would appreciate someone can patch the change (it’s a bit tricky on my end using git-remote-hg. :P ).
Regards,
John Zhang
------------------------------------------------------
John Zhang
Research Assistant
Programming Languages, Design & Implementation Division
Computer Systems Group
ANU College of Engineering & Computer Science
108 North Rd
The Australian National University
Acton ACT 2601
john.zhang at anu.edu.au<mailto:john.zhang at anu.edu.au>






-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20161206/bd184591/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: makedev_macro.patch
Type: application/octet-stream
Size: 1314 bytes
Desc: makedev_macro.patch
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20161206/bd184591/attachment-0001.obj>


More information about the pypy-dev mailing list