ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ctypes-users
ctypes-users
Re: [ctypes-users] Since I don't seem to be getting time to do the rest of the work any time soon
by Thomas Heller other posts by this author
Nov 28 2006 1:09PM messages near this date
Re: [ctypes-users] Since I don't seem to be getting time to do the rest of the work any time soon | Re: [ctypes-users] Since I don't seem to be getting time to do the rest of the work any time soon
Mike C. Fletcher schrieb:
>  Thomas Heller wrote:
>  ...
> >   The patch contains these ctypes definitions:
> >
> > +	"long double": "c_double", # XXX check for correctness!
> > +	"complex long double": "c_double", # XXX check for correctness!
> > +	"complex double": "c_double", # XXX check for correctness!
> > +	"complex float": "c_float", # XXX check for correctness!
> >
> >
> > They are not correct (except the first one, maybe, on Windows where
> > sizeof(long double) == sizeof(double) == 8.
> >
> > Do we need support for "long double"?  This is not implemented in ctypes.
> > Worse: The 'complex ...' types are C99, I assume.  Does OpenGL use them?
> >   
>  One of the libraries I was wrapping (GLX? GLE?) defined them and since 
>  they were considered fundamental types they were causing the whole 
>  generator to fail (IIRC).  It's probably not critical to support them, 
>  but they at least shouldn't cause a failure in the generator.  Not sure 
>  what to do when we encounter one if they aren't supported, maybe just 
>  abort the whole function?  The complex types are probably from 
>  quaternion code somewhere, which is one of the few places complex 
>  numbers show up in 3d graphics, btw.

Mike,

I guess it would be better to 'fail the generator' instead of
generating wrong definitions for 'long double' and 'complex ...'
which can only cause subtle problems later when they are used.

If they are really needed by some code, the only possibility I see
now is to define them as Structure subclasses somehow.

ctypeslib.codegenerator.ctypes_names is a simple dictionary, so it can
be monkey-patched from the outside.  Is that sufficient for you, or
do we need another refactoring to customize this?

Thanks,
Thomas


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
ctypes-users mailing list
ctypes-users@[...].net
https://lists.sourceforge.net/lists/listinfo/ctypes-users
Thread:
Mike C. Fletcher
Thomas Heller
Mike C. Fletcher
Thomas Heller
Thomas Heller
Mike C. Fletcher

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved