forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add strtoimax() compatibility function.
Since systems that omit strtoumax() will likely omit strtomax() too, and likewise for strtoull() and strtoll(), we arrange for the make variables NO_STRTOUMAX and NO_STRTOULL to cover both the signed and unsigned functions, and define compatibility implementations for them. Signed-off-by: Nick Alcock <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
- Loading branch information
1 parent
f696543
commit e3eed7f
Showing
2 changed files
with
13 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "../git-compat-util.h" | ||
|
||
intmax_t gitstrtoimax (const char *nptr, char **endptr, int base) | ||
{ | ||
#if defined(NO_STRTOULL) | ||
return strtol(nptr, endptr, base); | ||
#else | ||
return strtoll(nptr, endptr, base); | ||
#endif | ||
} |