Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool size_t_mul_overflow(size_t a, size_t b, size_t *res)
- {
- #if __SIZEOF_SIZE_T__ == 4
- return __builtin_smul_overflow((int)a, (int)b, (int *)res);
- #elif __SIZEOF_SIZE_T__ == 8
- return __builtin_smull_overflow((long)a, (long)b, (long *)res);
- #endif
- }
Add Comment
Please, Sign In to add comment