-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fill out functions in <inttypes.h> except [w]strto*
- Loading branch information
1 parent
ddb30b1
commit c517e8b
Showing
3 changed files
with
21 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,9 @@ add_platform_library(common-c | |
# errno.h | ||
errno.c | ||
|
||
# inttypes.h | ||
inttypes.c | ||
|
||
# setjmp.h | ||
setjmp.S | ||
|
||
|
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 <inttypes.h> | ||
|
||
intmax_t imaxabs(intmax_t j) { | ||
return __builtin_llabs(j); | ||
} | ||
|
||
imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom) { | ||
imaxdiv_t result = {numer / denom, numer % denom}; | ||
return result; | ||
} |
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