xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
va_args_comma.h
Go to the documentation of this file.
1
3#pragma once
4
5#if !defined(__VA_ARGS_COMMA__)
6# define __VA_ARGS_COMMA__(...) __GET_VA_ARGS_COMMA_ARG__( , __VA_ARGS__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__,)
7# define __GET_VA_ARGS_COMMA_ARG__(start, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, end,...) end
8# define __COMMA__ ,
9#endif
10
11// To use with 0 argument, we need to force zero variadic macro on other compiler than gcc :
12//
13// clang : add_compile_options(-Wno-gnu-zero-variadic-macro-arguments) : Work
14// msvc : add_compile_options(/wd5105 /Zc:preprocessor) : Not work !!!!!!
15// Not working well with windows specific include... error on some macro like _VARIANT_BOOL... with bad definition...
16// See https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview?view=msvc-160
17//
18// #if !defined(__VA_ARGS_COMMA__)
19//# define __VA_ARGS_COMMA__(...) __GET_VA_ARGS_COMMA_ARG__( , ##__VA_ARGS__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__, __COMMA__,)
20//# define __GET_VA_ARGS_COMMA_ARG__(start, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16, end,...) end
21//# define __COMMA__ ,
22//#endif