Skip to content

Commit 9cd70c6

Browse files
committed
Use a variadic macro for CPPSORT_ASSUME
1 parent bfdfc99 commit 9cd70c6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/cpp-sort/detail/config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@
102102
#if defined(CPPSORT_ENABLE_AUDITS)
103103
# define CPPSORT_ASSUME(...) CPPSORT_ASSERT(__VA_ARGS__)
104104
#elif defined(__GNUC__)
105-
# define CPPSORT_ASSUME(expression) do { if (!(expression)) __builtin_unreachable(); } while(0)
105+
# define CPPSORT_ASSUME(...) do { if (!(__VA_ARGS__)) __builtin_unreachable(); } while(0)
106106
#elif defined(__clang__)
107-
# define CPPSORT_ASSUME(expression) __builtin_assume(expression)
107+
# define CPPSORT_ASSUME(...) __builtin_assume(__VA_ARGS__)
108108
#elif defined(_MSC_VER)
109-
# define CPPSORT_ASSUME(expression) __assume(expression)
109+
# define CPPSORT_ASSUME(...) __assume(__VA_ARGS__)
110110
#else
111-
# define CPPSORT_ASSUME(cond) ((void)0)
111+
# define CPPSORT_ASSUME(...) ((void)0)
112112
#endif
113113

114114
////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)