diff options
author | bde <bde@FreeBSD.org> | 2001-11-28 19:52:25 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2001-11-28 19:52:25 +0000 |
commit | cc3f58540b1641eac1fee1909acc683118792c06 (patch) | |
tree | 0df6ffeda7b89e87701c920e3c9e8779089cad36 /include | |
parent | 5ede7a3e25680029d8ae5518ff9a6f1a1542a512 (diff) | |
download | FreeBSD-src-cc3f58540b1641eac1fee1909acc683118792c06.zip FreeBSD-src-cc3f58540b1641eac1fee1909acc683118792c06.tar.gz |
Fixed namespace pollution and/or breakage of K&R and C90 support related to
the following functions in the following commits:
- atoll() in revs 1.23-1.25
- llabs() and lldiv() in revs 1.22
- strtoq() and strtouq() in revs 1.18
C99 functions must not be declared in C90/POSIX.1-1990 sections, and
"long long" must not be exposed to compilers that don't support it.
Fixed style bugs (mainly misindentation and disorder) related the
following functions in the following commits:
- atoll() in revs 1.23-1.25
- getprogname() in rev.1.21
- sranddev() in revs 1.19-1.20
- strtoq() and strtouq() in rev.1.13
- user_from_uid() in rev.1.1
Breakage of K&R and C90 support used to be avoided by conditializing the
"long long"s for strtoq() and strtouq() on __STRICT_ANSI__, but the
conditionals should have gone away in rev.1.13 when the "long long"s went
away (the problem was moved to the places that declare quad_t and u_quad_t).
Diffstat (limited to 'include')
-rw-r--r-- | include/stdlib.h | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/include/stdlib.h b/include/stdlib.h index 9b236c9..24f32ba 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -68,12 +68,14 @@ typedef struct { long rem; /* remainder */ } ldiv_t; +#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) #ifdef __LONG_LONG_SUPPORTED typedef struct { long long quot; long long rem; } lldiv_t; #endif +#endif #ifndef NULL #define NULL 0 @@ -94,8 +96,10 @@ int atexit __P((void (*)(void))); double atof __P((const char *)); int atoi __P((const char *)); long atol __P((const char *)); +#ifdef __LONG_LONG_SUPPORTED long long - atoll __P((const char *)); + atoll __P((const char *)); +#endif void *bsearch __P((const void *, const void *, size_t, size_t, int (*)(const void *, const void *))); void *calloc __P((size_t, size_t)); @@ -113,12 +117,8 @@ void *realloc __P((void *, size_t)); void srand __P((unsigned)); double strtod __P((const char *, char **)); long strtol __P((const char *, char **, int)); -long long - strtoll __P((const char *, char **, int)); unsigned long strtoul __P((const char *, char **, int)); -unsigned long long - strtoull __P((const char *, char **, int)); int system __P((const char *)); int mblen __P((const char *, size_t)); @@ -127,12 +127,6 @@ 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)); @@ -173,12 +167,17 @@ int daemon __P((int, int)); char *devname __P((int, int)); int getloadavg __P((double [], int)); const char * - getprogname __P((void)); + getprogname __P((void)); char *group_from_gid __P((unsigned long, int)); int heapsort __P((void *, size_t, size_t, int (*)(const void *, const void *))); char *initstate __P((unsigned long, char *, long)); +#ifdef __LONG_LONG_SUPPORTED +long long + llabs __P((long long)) __pure2; +lldiv_t lldiv __P((long long, long long)) __pure2; +#endif int mergesort __P((void *, size_t, size_t, int (*)(const void *, const void *))); int radixsort __P((const unsigned char **, int, const unsigned char *, @@ -191,16 +190,22 @@ void *reallocf __P((void *, size_t)); char *realpath __P((const char *, char resolved_path[])); void setprogname __P((const char *)); char *setstate __P((char *)); -void srandom __P((unsigned long)); void sranddev __P((void)); +void srandom __P((unsigned long)); void srandomdev __P((void)); -char *user_from_uid __P((unsigned long, int)); -#ifndef __STRICT_ANSI__ +#ifdef __LONG_LONG_SUPPORTED +long long + strtoll __P((const char *, char **, int)); +#endif __int64_t strtoq __P((const char *, char **, int)); +#ifdef __LONG_LONG_SUPPORTED +unsigned long long + strtoull __P((const char *, char **, int)); +#endif __uint64_t strtouq __P((const char *, char **, int)); -#endif void unsetenv __P((const char *)); +char *user_from_uid __P((unsigned long, int)); #endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ __END_DECLS |