Re: [LTP] [PATCH V3 2/3] fixes for 16-bit syscalls testcases

On 09/02/2013 07:23 PM, chrubis@... 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?