Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by bliako (Monsignor)
on Jul 27, 2021 at 22:22 UTC ( #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? | Other CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2021-10-24 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (88 votes). Check out past polls.

    Notices?