den-run-ai / ctypesgen

Automatically exported from code.google.com/p/ctypesgen
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Enhancement: Support 'bool' #19

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It would be most excellent if you would support 'bool' return and argument 
types, as ctypes has a c_bool: 
http://docs.python.org/library/ctypes.html#ctypes.c_bool.

Currently, in my library, I am losing my functions with this type:
Error: <input>:16: Syntax error at 'bool'

Original issue reported on code.google.com by natetas...@gmail.com on 13 Jul 2011 at 3:49

GoogleCodeExporter commented 9 years ago
This is my patch for boolean support for ctypesgen. Please note that the actual 
parser (parsetab.py) should still be generated from cgrammar.py.

Note that I first submitted this as part of the patch for issue #43, but got a 
recommendation to create separate patches for separate functionality (I agree).

I also added a test for the bool type.

Original comment by ronald.b...@gmail.com on 18 Jul 2013 at 10:22

Attachments:

GoogleCodeExporter commented 9 years ago
I fixed my patch for the bool type so that it conforms to section 7.16 of the C 
spec (as far as I understand now), i.e. the bool keyword is _Bool, and the 
macro definitions from <stdbool.h> (or any custom macros) are required to make 
the bool 'keyword' work.

Original comment by ronald.b...@gmail.com on 19 Jul 2013 at 9:08

Attachments:

GoogleCodeExporter commented 9 years ago
Changes look good but the test for this new feature is failing on my machine. 
Following up with Ronald via email.

Original comment by clac...@gmail.com on 20 Aug 2013 at 4:55

GoogleCodeExporter commented 9 years ago
New patch that includes parsetab.py, which is generated from cgrammar.py.

Original comment by ronald.b...@gmail.com on 20 Aug 2013 at 6:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed in r149. Thanks for the patch!

Original comment by clac...@gmail.com on 21 Aug 2013 at 4:05