Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed Jul 25, 2024
1 parent eed11cc commit 5ef6c95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,10 @@
#if __has_builtin(__builtin_mul_overflow)
#define MUL_SIZE_OVERFLOW(a, b, c) __builtin_mul_overflow(a, b, c)
#else
/* Note: (floor(x) < b) == (x < b) */
/*
* Note: (floor(x) < b) == (x < b) where
* x is a real number and b is an integer.
*/
#define MUL_SIZE_OVERFLOW(a, b, c) \
(a != 0 && (SIZE_MAX / a < b) ? 1 : (*c = a * b, 0))
#endif
Expand Down

0 comments on commit 5ef6c95

Please sign in to comment.