File indexing completed on 2024-06-23 05:08:44

0001 /*
0002     SPDX-FileCopyrightText: 2019-2022 Volker Krause <vkrause@kde.org>
0003     SPDX-License-Identifier: LGPL-2.0-or-later
0004 */
0005 
0006 #ifndef KANDROIDEXTRAS_JNIPP_H
0007 #define KANDROIDEXTRAS_JNIPP_H
0008 
0009 /** @file jnipp.h
0010  *  Preprocessor macro implementation details.
0011  */
0012 
0013 ///@cond internal
0014 
0015 // determine how many elements are in __VA_ARGS__
0016 #define JNI_PP_NARG(...) JNI_PP_NARG_(__VA_ARGS__ __VA_OPT__(,) JNI_PP_RSEQ_N())
0017 #define JNI_PP_NARG_(...) JNI_PP_ARG_N(__VA_ARGS__)
0018 #define JNI_PP_ARG_N(_1, _2, _3, _4, _5, _6, _7, N, ...) N
0019 #define JNI_PP_RSEQ_N() 7, 6, 5, 4, 3, 2, 1, 0
0020 
0021 // preprocessor-level token concat
0022 #define JNI_PP_CONCAT(arg1, arg2) JNI_PP_CONCAT1(arg1, arg2)
0023 #define JNI_PP_CONCAT1(arg1, arg2) JNI_PP_CONCAT2(arg1, arg2)
0024 #define JNI_PP_CONCAT2(arg1, arg2) arg1##arg2
0025 
0026 ///@endcond
0027 
0028 #endif // KANDROIDEXTRAS_JNIPP_H