diff --git a/Core/Code/Algorithms/mitkPPArgCount.h b/Core/Code/Algorithms/mitkPPArgCount.h new file mode 100644 index 0000000000..3ae4b479ac --- /dev/null +++ b/Core/Code/Algorithms/mitkPPArgCount.h @@ -0,0 +1,38 @@ +/*========================================================================= + +Program: Medical Imaging & Interaction Toolkit +Language: C++ +Date: $Date$ +Version: $Revision$ + +Copyright (c) German Cancer Research Center, Division of Medical and +Biological Informatics. All rights reserved. +See MITKCopyright.txt or http://www.mitk.org/copyright.html for details. + +This software is distributed WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + + +#ifndef MITKPPARGCOUNT_H +#define MITKPPARGCOUNT_H + +#define MITK_PP_ARG_COUNT(...) \ + MITK_PP_ARG_COUNT_(__VA_ARGS__, MITK_PP_RSEQ_N()) + +#define MITK_PP_ARG_COUNT_(...) \ + MITK_PP_ARG_N(__VA_ARGS__) + +#define MITK_PP_ARG_N( \ + _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, \ + _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \ + _21,_22,_23,_24,_25,N,...) N + +#define MITK_PP_RSEQ_N() \ + 25,24,23,22,21,20, \ + 19,18,17,16,15,14,13,12,11,10, \ + 9,8,7,6,5,4,3,2,1,0 + +#endif // MITKPPARGCOUNT_H