Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: [OT] Abusing the C preprocessor

by Anonymous Monk
on Nov 11, 2017 at 14:05 UTC ( [id://1203183]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #define CFG_USED(type, name, stuff) \
            { .compFunc = compare_ ## type; /* */ },
    ...
    #define CFG_USE_int CFG_UNUSED
    #endif
    ...
    
  2. or download this
    static inline int _inline_cmpfunc_int(void *a, void *b)
    {
            int _a = *(int*)a, _b = *(int*)b;
            return (_a > _b) - (_a < _b);
    }
    
  3. or download this
    static foo
    compare_foo(void *a, void *b) { return _inline_cmpfunc_foo(a, b); }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (4)
As of 2024-03-28 14:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found