Re: compiler requires explicit cast?
horace <[email protected]> Wed, 1 Jul 2009 11:36:33 +0200
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
--===============2021898727== Content-Type: multipart/alternative; boundary=0016e6d37661aa15d5046da1a85b --0016e6d37661aa15d5046da1a85b Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On Wed, Jul 1, 2009 at 2:42 AM, Greg Ewing <[email protected]>wrote: > horace wrote: > > i got it to compile by manually replacing this: >> >> __pyx_t_2 = PyInt_FromLong(((long)LoadIcon(((void *)((long)__pyx_t_3)), >> ((char *)1)))); >> >> with this: >> >> __pyx_t_2 = PyInt_FromLong(((long)LoadIcon(((HINSTANCE)((long)__pyx_t_3)), >> ((char *)1)))); >> > > If the above two lines of C code aren't equivalent, then > HINSTANCE must be getting defined as something different > from void * from the C compiler's point of view. > > At this point, if I were using gcc I would run it with > -M to find out what HINSTANCE is getting expanded into. > Not sure how to do that in a Windows environment, though. i wasn't able to find any different HINSTANCE definition than void * but it could be that i missed the right one. it's really hard to find something like that on windows. maybe i will look for some tool which allows regular expressions for searching. i will also try to find out if i can do something like -M with the visual c++ compiler. thanks! > > BTW, it appears that you're actually using Cython, not Pyrex, > because > > cdef HMODULE h = GetModuleHandle(<char *>0) > > is not valid Pyrex code. You may want to ask about this > on the Cython list. The code that Pyrex generates for > what you posted earlier is quite different (although it > probably wouldn't work any better in this situation). yes, i am using cython. i think i read somewhere that cython questions can or should also be asked on the pyrex list but i will look for the cython list next time. sorry! > -- > Greg > --0016e6d37661aa15d5046da1a85b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <br><br><div class=3D"gmail_quote">On Wed, Jul 1, 2009 at 2:42 AM, Greg Ewi= ng <span dir=3D"ltr"><<a href=3D"mailto:[email protected]">gre= [email protected]</a>></span> wrote:<br><blockquote class=3D"gmai= l_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0p= t 0pt 0.8ex; padding-left: 1ex;"> <div class=3D"im">horace wrote:<br> <br> <blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, = 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> i got it to compile by manually replacing this:<br> <br> __pyx_t_2 =3D PyInt_FromLong(((long)LoadIcon(((void *)((long)__pyx_t_3)), (= (char *)1))));<br> <br> with this:<br> <br> __pyx_t_2 =3D PyInt_FromLong(((long)LoadIcon(((HINSTANCE)((long)__pyx_t_3))= , ((char *)1))));<br> </blockquote> <br></div> If the above two lines of C code aren't equivalent, then<br> HINSTANCE must be getting defined as something different<br> from void * from the C compiler's point of view.<br> <br> At this point, if I were using gcc I would run it with<br> -M to find out what HINSTANCE is getting expanded into.<br> Not sure how to do that in a Windows environment, though.</blockquote><div>= <br><br><br>i wasn't able to find any different HINSTANCE definition th= an void * but it could be that i missed the right one. it's really hard= to find something like that on windows. maybe i will look for some tool wh= ich allows regular expressions for searching. i will also try to find out i= f i can do something like -M with the visual c++ compiler. thanks!<br> <br><br><br></div><blockquote class=3D"gmail_quote" style=3D"border-left: 1= px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"= ><br> <br> BTW, it appears that you're actually using Cython, not Pyrex,<br> because<div class=3D"im"><br> <br> =A0cdef HMODULE h =3D GetModuleHandle(<char *>0)<br> <br></div> is not valid Pyrex code. You may want to ask about this<br> on the Cython list. The code that Pyrex generates for<br> what you posted earlier is quite different (although it<br> probably wouldn't work any better in this situation).</blockquote><div>= <br><br><br>yes, i am using cython. i think i read somewhere that cython qu= estions can or should also be asked on the pyrex list but i will look for t= he cython list next time. sorry!<br> <br><br><br></div><blockquote class=3D"gmail_quote" style=3D"border-left: 1= px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"= ><br> -- <br><font color=3D"#888888"> Greg<br> </font></blockquote></div><br> --0016e6d37661aa15d5046da1a85b-- --===============2021898727== Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline _______________________________________________ Pyrex mailing list [email protected] http://lists.copyleft.no/mailman/listinfo/pyrex --===============2021898727==--