• arc4random, arc4random_push: use our own protos to check

XXX u_int32_t is not ISO C99, but seems to work well enough
  XXX if it fails anywhere, we'll see in the build logs
  XXX apple doesn't have the standard uint32_t and API doesn't specify it
• sys_siglist_defn: rename to sys_siglist_decl as we're really checking
  for the declaration in the headers; change wording to “check if … does
  not need to be declared” since we don't need to declare if we don't use
• scan for arc4random, arc4random_push, confstr declarations too
• sh.h: confstr declaration is no longer #ifdef __sun__; sort
This commit is contained in:
tg
2007-04-24 10:42:02 +00:00
parent 2cf5695f69
commit 1a0b51b697
3 changed files with 59 additions and 18 deletions

26
sh.h
View File

@ -8,7 +8,7 @@
/* $OpenBSD: c_test.h,v 1.4 2004/12/20 11:34:26 otto Exp $ */
/* $OpenBSD: tty.h,v 1.5 2004/12/20 11:34:26 otto Exp $ */
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.126 2007/04/23 20:37:16 tg Exp $"
#define MKSH_SH_H_ID "$MirOS: src/bin/mksh/sh.h,v 1.127 2007/04/24 10:42:02 tg Exp $"
#define MKSH_VERSION "R29 2007/04/17"
#if HAVE_SYS_PARAM_H
@ -182,21 +182,35 @@ typedef int bool;
#undef BAD /* AIX defines that somewhere */
/* OS-dependent additions */
/* OS-dependent additions (functions, variables, by OS) */
#if !HAVE_ARC4RANDOM_DECL
extern u_int32_t arc4random(void);
#endif
#if !HAVE_ARC4RANDOM_PUSH_DECL
extern void arc4random_push(int);
#endif
#if !HAVE_CONFSTR_DECL
size_t confstr(int, char *, size_t);
#endif
#if !HAVE_SETMODE
mode_t getmode(const void *, mode_t);
void *setmode(const char *);
#endif
#if !HAVE_STRCASESTR
const char *stristr(const char *, const char *);
#endif
#if !HAVE_STRLCPY
size_t strlcpy(char *, const char *, size_t);
#endif
#if defined(__sun__) && !defined(_PATH_DEFPATH) && defined(_CS_PATH)
size_t confstr(int, char *, size_t);
#if !HAVE_SYS_SIGLIST_DECL
extern const char *const sys_siglist[];
#endif
#ifdef __INTERIX
@ -205,10 +219,6 @@ extern int __cdecl seteuid(uid_t);
extern int __cdecl setegid(gid_t);
#endif
#if !HAVE_SYS_SIGLIST_DEFN
extern const char *const sys_siglist[];
#endif
/* some useful #defines */
#ifdef EXTERN
# define I__(i) = i