From 6c4f357f37394a6197451335c490536de3f520ea Mon Sep 17 00:00:00 2001 From: Wesley Maxey Date: Thu, 9 Sep 2021 17:12:58 -0700 Subject: [PATCH] Formatting and naming fixes, add NV_IF_ELSE_TARGET for non-optional false statements --- include/nv/detail/__preprocessor | 12 ++++++------ include/nv/detail/__target_macros | 19 +++++++++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/include/nv/detail/__preprocessor b/include/nv/detail/__preprocessor index 27454ca933..94acf01bae 100644 --- a/include/nv/detail/__preprocessor +++ b/include/nv/detail/__preprocessor @@ -19,14 +19,14 @@ // _NV_REMOVE_PAREN #if defined(__cplusplus) && __cplusplus >= 201103L -#define _NV_EVAL2(...) __VA_ARGS__ -#define _NV_EVAL(...) _NV_EVAL2(__VA_ARGS__) +# define _NV_EVAL1(...) __VA_ARGS__ +# define _NV_EVAL(...) _NV_EVAL1(__VA_ARGS__) #else -#define _NV_EVAL2(x) x -#define _NV_EVAL(x) _NV_EVAL2(x) -#endif +# define _NV_EVAL1(x) x +# define _NV_EVAL(x) _NV_EVAL1(x) +#endif // defined(__cplusplus) && __cplusplus >= 201103L + #define _NV_CONCAT_EVAL1(l, r) _NV_EVAL(l ## r) -#define _NV_CONCAT_EVAL2(l, r) _NV_CONCAT_EVAL2(l, r) #define _NV_CONCAT_EVAL(l, r) _NV_CONCAT_EVAL1(l, r) #define _NV_IF_0(t, f) f diff --git a/include/nv/detail/__target_macros b/include/nv/detail/__target_macros index 45e587669e..f72f55c763 100644 --- a/include/nv/detail/__target_macros +++ b/include/nv/detail/__target_macros @@ -391,15 +391,19 @@ # define _NV_ARCH_COND_CAT1(cond) _NV_TARGET_BOOL_##cond # define _NV_ARCH_COND_CAT(cond) _NV_EVAL(_NV_ARCH_COND_CAT1(cond)) +# define _NV_TARGET_EMPTY_PARAM ; + # if defined(__cplusplus) && __cplusplus >= 201103L # define _NV_BLOCK_EXPAND(...) { _NV_REMOVE_PAREN(__VA_ARGS__) } -# define _NV_TARGET_IF(cond, t, ...) _NV_IF(_NV_ARCH_COND_CAT(cond), t, __VA_ARGS__) +# define _NV_TARGET_IF(cond, t, ...) _NV_IF( _NV_ARCH_COND_CAT(cond), t, __VA_ARGS__) # else //