Ian -

Thanks for the tip.  I haven't been able to find the "right" documentation 
to
help explain how to use the gcc inline assembler (and how it relates to 
Microsoft's assembler).  However, the following code block compiles without 
any error.  I need to spend more time verifying if this code block behaves 
the same as the assembler block for the Microsoft's assembler and also add 
the #define statements that you have suggested.

regards,

- joe

Here's an excerpt from a modified API.c file (for the gcc assembler only):

        for(i = nin; i >= 0; i--) {
            switch(params[i].t) {
            case T_POINTER:
                pParam = params[i].u.pPointer;
                // printf("Call: parameter %d (P) is %s\n", i, pParam);
                {
                    __asm__ (
                             "movl %0,%%eax\n\t"
                             "pushl %%eax\n\t"
                             : : "r" (pParam)
                             : "ax"
                             );
                }
                break;
            case T_NUMBER:
                lParam = params[i].u.lNumber;
                // printf("Call: parameter %d (N) is %ld\n", i, lParam);
                {
                    __asm__ (
                             "mov %0,%%eax\n\t"
                             "push %%eax\n\t"
                             : : "r" (lParam)
                             : "ax"
                             );
                }
                break;
            }
        }
    }


On 04/27/00, ""Ian D. Stewart" <[EMAIL PROTECTED]>" wrote:
> Joseph Wayne Norton wrote:
> > 
> > Has anyone tried or know how to build the Win32::API module using
> > gcc-2.95.2-msvcrt and perl-5.6.0?  The compilation is failing at the _asm
> > block in the xs module.
> 
> What is the error message(s) you are receiving?
> 
> If it's complaining about "reference to undefined symbol '_asm'", you
> may want to check the documentation, to see what the GCC symbol for
> inline assembly is.
> 
> Assuming the symbol is '_asm_', you can then do something like:
> 
> #ifdef _WIN32_
> #ifdef MINGW32
> #define ASM _asm_
> #else
> #define ASM _asm
> #endif /* MINGW32 */
> #endif /* WIN32 */
> #ifndef ASM
> #error: Module requires Win32
> #endif /* ASM */
> 
> 
> And then, in the xs source, replace '_asm' with ASM.
> 
> 
> HTH,
> Ian
> 
> 
> -- 
> 99 little bugs in the code, 99 bugs in the code.
> Fix one bug, compile again, 100 little bugs in the code.
> 100 little bugs in the code, 100 bugs in the code.
> Fix one bug, compile again, 101 little bugs in the code...

---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to