Guest User

Untitled

a guest
Jul 17th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. bool size_t_mul_overflow(size_t a, size_t b, size_t *res)
  2. {
  3. #if __SIZEOF_SIZE_T__ == 4
  4. return __builtin_smul_overflow((int)a, (int)b, (int *)res);
  5. #elif __SIZEOF_SIZE_T__ == 8
  6. return __builtin_smull_overflow((long)a, (long)b, (long *)res);
  7. #endif
  8. }
Add Comment
Please, Sign In to add comment