Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Inline::C : passing parameters to functions, modifying by reference

by bliako (Monsignor)
on Jul 27, 2021 at 22:22 UTC ( [id://11135408]=note: print w/replies, xml ) Need Help??


in reply to Re: Inline::C : passing parameters to functions, modifying by reference
in thread Inline::C : passing parameters to functions, modifying by reference

... BUT!

use strict; use warnings; use Inline C => "DATA"; xyz(); __DATA__ __C__ xyz(); __DATA__ __C__ #define __XX__ unsigned __XX__ int xyz(){ printf("hhaahah\n"); return 1; }
Undefined subroutine &main::xyz called at a.pl line 8.

removing any of the underscores in __XX__ fixes the problem.

whereas this does not have a problem:

use strict; use warnings; use Inline(C => <<'EOC'); #define __XX__ unsigned __XX__ int xyz(){ printf("hhaahah\n"); return 1; } EOC xyz();

I am neat-picking because in some of my usage, a 3rd party insists on typedef a __global__ and that messes up the whole inlining. But #define GLOBAL __global__ is a workaround.

bw, bliako

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11135408]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-29 14:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found