diff --git a/include/nuttx/lib/math32.h b/include/nuttx/lib/math32.h index acfd09749f64b..07b955b4d0dbe 100644 --- a/include/nuttx/lib/math32.h +++ b/include/nuttx/lib/math32.h @@ -260,12 +260,12 @@ extern "C" }) # define div_const(n, base) \ - ((sizeof(n) == sizeof(uint64_t)) ? div64_const(n, base) : ((n) / (base))) + ((sizeof(typeof(n)) == sizeof(uint64_t)) ? div64_const(n, base) : ((n) / (base))) # define div_const_roundup(n, base) \ - ((sizeof(n) == sizeof(uint64_t)) ? div64_const((n) + (base) - 1, base) : \ + ((sizeof(typeof(n)) == sizeof(uint64_t)) ? div64_const((n) + (base) - 1, base) : \ (((n) + (base) - 1) / (base))) # define div_const_roundnearest(n, base) \ - ((sizeof(n) == sizeof(uint64_t)) ? div64_const((n) + ((base) / 2), base) : \ + ((sizeof(typeof(n)) == sizeof(uint64_t)) ? div64_const((n) + ((base) / 2), base) : \ (((n) + ((base) / 2)) / (base))) #else # define div_const(n, base) ((n) / (base))