diff options
| author | Edward Thomson <ethomson@microsoft.com> | 2015-02-12 17:36:48 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@microsoft.com> | 2015-02-13 09:28:09 -0500 |
| commit | 16942c6fdaddb819b71b72e53aa4aa691e3c0053 (patch) | |
| tree | 05a719c0753521789eff1ebc4c4c284d80afb696 /src/common.h | |
| parent | 8aab36a3010372edec71e8c765d4ecfd848c09b6 (diff) | |
| download | libgit2-16942c6fdaddb819b71b72e53aa4aa691e3c0053.tar.gz | |
integer overflow: use compiler intrinsics if supported
gcc and clang support __builtin_add_overflow, use it whenever
possible, falling back to our naive routines.
Diffstat (limited to 'src/common.h')
| -rw-r--r-- | src/common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h index 8d1e89064..98109ae3a 100644 --- a/src/common.h +++ b/src/common.h @@ -17,6 +17,11 @@ # define GIT_INLINE(type) static inline type #endif +/** Support for gcc/clang __has_builtin intrinsic */ +#ifndef __has_builtin +# define __has_builtin(x) 0 +#endif + #include <assert.h> #include <errno.h> #include <limits.h> |
