Re: sizeof(function) functionality

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oops, I forgot to give an example of usage (not that you probably need it :)

On Tuesday 8 July 2003 1:56 pm, Ben Davis wrote:
> #define DEFINE_SIZED_FUNCTION(rtype, name, params, body) \
>     rtype name params body \
>     void endof_##name(void) { }
>
> #define DECLARE_SIZED_FUNCTION(rtype, name, params) \
>     rtype name params; \
>     void endof_##name(void);

DECLARE_SIZED_FUNCTION(float, myfunc, (float x, float y))

DEFINE_SIZED_FUNCTION(float, myfunc, (float x, float y), {
    return (float)sqrt(x*x + y*y);
})

Ben


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux