diff options
author | Mike Barcroft <mike@FreeBSD.org> | 2001-11-15 02:05:03 +0000 |
---|---|---|
committer | Mike Barcroft <mike@FreeBSD.org> | 2001-11-15 02:05:03 +0000 |
commit | 7a4a63270ffd4cf0deae379b3ad32f57ea3c3e9d (patch) | |
tree | 65345c27494b147fb94a03b0e7ab6a7afb3725cd /include | |
parent | f209c331393ab8a2b716c21543e696a07809e512 (diff) | |
download | src-7a4a63270ffd4cf0deae379b3ad32f57ea3c3e9d.tar.gz src-7a4a63270ffd4cf0deae379b3ad32f57ea3c3e9d.zip |
o Implement imaxabs(), imaxdiv(), llabs(), lldiv().
o Update abs(3), div(3), labs(3), ldiv(3) to reflect standards
conformance and add additional references.
Reviewed by: bde, wollman
Notes
Notes:
svn path=/head/; revision=86368
Diffstat (limited to 'include')
-rw-r--r-- | include/inttypes.h | 4 | ||||
-rw-r--r-- | include/stdlib.h | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/include/inttypes.h b/include/inttypes.h index f6b19229b0a5..63871914aa9e 100644 --- a/include/inttypes.h +++ b/include/inttypes.h @@ -42,8 +42,8 @@ typedef struct { intmax_t rem; /* Remainder. */ } imaxdiv_t; -intmax_t imaxabs(intmax_t); -imaxdiv_t imaxdiv(intmax_t, intmax_t); +intmax_t imaxabs(intmax_t) __pure2; +imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2; /* XXX: The following functions are missing the restrict type qualifier. */ intmax_t strtoimax(const char *, char **, int); diff --git a/include/stdlib.h b/include/stdlib.h index c0ec98709476..3e7ce25b0237 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -68,6 +68,13 @@ typedef struct { long rem; /* remainder */ } ldiv_t; +#ifdef __LONG_LONG_SUPPORTED +typedef struct { + long long quot; + long long rem; +} lldiv_t; +#endif + #ifndef NULL #define NULL 0 #endif @@ -118,6 +125,12 @@ int wctomb __P((char *, wchar_t)); int mbtowc __P((wchar_t *, const char *, size_t)); size_t wcstombs __P((char *, const wchar_t *, size_t)); +#ifdef __LONG_LONG_SUPPORTED +long long + llabs __P((long long)) __pure2; +lldiv_t lldiv __P((long long, long long)) __pure2; +#endif + #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) extern char *_malloc_options; extern void (*_malloc_message)__P((char *p1, char *p2, char *p3, char *p4)); |