From: <so...@wo...> - 2001-01-09 07:08:26
|
Found this <3a5957ad.2151874001@judy> in comp.lang.perl.modules: == BEGIN forwarded message == From: ru...@sb... (Reini Urban) Newsgroups: comp.lang.perl.modules Subject: Re: xs trouble on Win32 (building Win32::API) Date: Mon, 08 Jan 2001 06:54:30 GMT Soren Andersen wrote: >I am trying to compile the module Win32::API (http://dada.perl.it/) on WinNT4 >sp6 using MinGW - gcc-2.95.2.1 and having a rough go of it with the xs code. >So, this _asm critter seems to be the first problem to tackle. Nobody that I >know of has built this mod using something else. >Anybody (perhaps familiar with xs and Win32/MSVC++) got any insights? inline _asm statements are not supported with egcs, so you will not be lucky. you'll have to rewrite that particular function to the gcc supported _asm() syntax, which is different to MSVC. I started porting the similar Win32::GUI to gcc, but this will need some time. try this for the beginning, but I'm not sure how to do corect inline assembler in GNUC. abstr-cb.S: .text .align 4 .globl _AbstractCallback _AbstractCallback: popl %eax ret gcc -c abstr-cb.S and link it to the others. this fails for me: void AbstractCallback() { int self; #ifdef _MSC_VER _asm { pop eax mov dword ptr self, eax } #else __asm__ ("popl %eax movl dword ptr self, %eax" : "=ld" (self) /* output */ : /* no input */ ) #endif printf("AbstractCallback: got eax=%ld\n", self); } -- Reini Urban http://xarch.tu-graz.ac.at/autocad/news/faq/autolisp.html == END forwarded message == I add this to the discussion. Thanks again to all the great fellows who responded on this List. I wish I could confidently say "Oh yeah, I am going to tackle this one and make this port work", but I cannot do so with any expectation that it will happen soon. I simply don't have an endless supply of spare time to work on it, and believe me when I say it takes me ages to accomplish even relatively small breakthroughs. At least we've clearly identified the problem. What would seem to me to be a great idea would be to have a place where such porting challenges could be made known to a cross-disciplinary population of progammers (dada and I are basically Perl guys -- I for sure know what my first love is ..) who could collaborate (as has started happening very encouragingly on this List) on such efforts. One Perl module doesn't seem like it is really enough of a grabber to base an entire Sourceforge project page around, for example, but some kind of central node to which we would hope talented and ambitious hackers would be drawn, might be a good step. I guess I could really see this turning into a suggestion for a Perl-specific section of MinGW project materials. Feedback? soren andersen |