----- Original Message ----- 
From: "Foo Ji-Haw"

> It complains of 'error C2275: 'ULONG' : illegal use of this type as an
> expression'
>
> Is that a MSVC issue, or more to do with inline.pm?

It's an MSVC issue - that "illegal use", while definitely an "illegal use"
in terms of the original C standard, is quite legal in terms of recent  C
standards - but Microsoft compilers don't fully support those standards.

No problems with this script using the MinGW (gcc) compiler:

#!perl -w
use Inline C => <<'EOC';

void greet() {
     printf("Hello World\n");
     int i = 17;
     printf("%d\n", i);
}


EOC
greet();
__END__

But with Microsoft compilers you'll get that error.
MS compilers insist that declarations come first - and that declarations
can't come after anything that is not a declaration. 'apiVersion = 0x30000;'
is an assignment, not a decalaration - so you can't make a declaration after
it. It's ok to  assign and declare at the same time - this should be ok:

void foo() {
        int i;
       unsigned long x = 1345;
       double d;
       printf("Foo rulez\n");
}


>
> To be honest, I have no idea what FAR PASCAL means too. I'm trying very
> very hard to port some old sample codes into Perl (the C++ Guy left).
>

Just remove 'FAR PASCAL' altogether - I don't think it will matter.  Google
turned up a few statements along the lines "FAR PASCAL is used only for the
16-bit OS/2 environment" - though I couldn't actually find anything that
said that's the *only* time you'll ever use 'FAR PASCAL'.

Cheers,
Rob

_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to