On 09/02/2013 07:23 PM, [email protected] wrote:
> We can even simplify this macros. At least the innter part of SETGROUPS
> and GETGROUPS could be created by a single macro:
>
> COMPAT16_SYSCALL(setgroups, gitsetsize, list16)
>
> #define COMPAT16_SYSCALL(sys_name, ...) \
> # ifdef TST_USE_COMPAT16_SYSCALL
> # if ....
> return ltp_syscall(sys_name, ##__VA_ARGS__);
> # else
> errno = ENOSYS;
> return -1;
> # fi
> # else
> return sys_name(__VA_ARGS__);
> # endif
>
> In case that the syscall and libcall params does not match we can use
> only the part enclosed in the ifdef TST_USE_COMPAT16_SYSCALL.
Sorry, but is it possible to use #ifdef or #if inside a #define macro?
This doesn't work:
#define MYDEF(NN) \
# ifdef TST_USE_COMPAT16_SYSCALL
return NN(0);
# else
return NN(1);
# endif
MYDEF(bla)
Could you point to a working example, please?
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list