Remove more declarations for symbols that aren't defined.

This commit is contained in:
Dan Gohman 2019-05-14 08:36:35 -07:00
parent 24f6fe1cc8
commit 0a738e8fd6
4 changed files with 20 additions and 10 deletions

View File

@ -2013,23 +2013,13 @@
#define UTIME_OMIT (-2) #define UTIME_OMIT (-2)
#define WCHAR_MAX (0x7fffffff+L'\0') #define WCHAR_MAX (0x7fffffff+L'\0')
#define WCHAR_MIN (-1-0x7fffffff+L'\0') #define WCHAR_MIN (-1-0x7fffffff+L'\0')
#define WCOREDUMP(s) ((s) & 0x80)
#define WEOF 0xffffffffU #define WEOF 0xffffffffU
#define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
#define WIFCONTINUED(s) ((s) == 0xffff)
#define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
#define WILL 251 #define WILL 251
#define WINT_MAX UINT32_MAX #define WINT_MAX UINT32_MAX
#define WINT_MIN 0U #define WINT_MIN 0U
#define WNOHANG 1
#define WONT 252 #define WONT 252
#define WORD_BIT 32 #define WORD_BIT 32
#define WRQ 02 #define WRQ 02
#define WSTOPSIG(s) WEXITSTATUS(s)
#define WTERMSIG(s) ((s) & 0x7f)
#define WUNTRACED 2
#define W_OK 2 #define W_OK 2
#define X_OK 4 #define X_OK 4
#define YESEXPR 0x50000 #define YESEXPR 0x50000

View File

@ -19,8 +19,10 @@ void *calloc (size_t, size_t);
void *realloc (void *, size_t); void *realloc (void *, size_t);
void free (void *); void free (void *);
#endif #endif
#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */
void *valloc (size_t); void *valloc (size_t);
void *memalign(size_t, size_t); void *memalign(size_t, size_t);
#endif
size_t malloc_usable_size(void *); size_t malloc_usable_size(void *);

View File

@ -98,6 +98,7 @@ size_t __ctype_get_mb_cur_max(void);
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
|| defined(_BSD_SOURCE) || defined(_BSD_SOURCE)
#ifdef __wasilibc_unmodified_upstream /* WASI has no wait */
#define WNOHANG 1 #define WNOHANG 1
#define WUNTRACED 2 #define WUNTRACED 2
@ -107,6 +108,7 @@ size_t __ctype_get_mb_cur_max(void);
#define WIFEXITED(s) (!WTERMSIG(s)) #define WIFEXITED(s) (!WTERMSIG(s))
#define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00)
#define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu)
#endif
int posix_memalign (void **, size_t, size_t); int posix_memalign (void **, size_t, size_t);
int setenv (const char *, const char *, int); int setenv (const char *, const char *, int);
@ -150,19 +152,27 @@ void lcong48 (unsigned short [7]);
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
#include <alloca.h> #include <alloca.h>
#ifdef __wasilibc_unmodified_upstream /* WASI has no temp directories */
char *mktemp (char *); char *mktemp (char *);
int mkstemps (char *, int); int mkstemps (char *, int);
int mkostemps (char *, int, int); int mkostemps (char *, int, int);
#endif
#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */
void *valloc (size_t); void *valloc (size_t);
void *memalign(size_t, size_t); void *memalign(size_t, size_t);
int getloadavg(double *, int); int getloadavg(double *, int);
#endif
int clearenv(void); int clearenv(void);
#ifdef __wasilibc_unmodified_upstream /* WASI has no wait */
#define WCOREDUMP(s) ((s) & 0x80) #define WCOREDUMP(s) ((s) & 0x80)
#define WIFCONTINUED(s) ((s) == 0xffff) #define WIFCONTINUED(s) ((s) == 0xffff)
#endif #endif
#endif
#ifdef _GNU_SOURCE #ifdef _GNU_SOURCE
#ifdef __wasilibc_unmodified_upstream /* WASI has no pseudo-terminals */
int ptsname_r(int, char *, size_t); int ptsname_r(int, char *, size_t);
#endif
char *ecvt(double, int, int *, int *); char *ecvt(double, int, int *, int *);
char *fcvt(double, int, int *, int *); char *fcvt(double, int, int *, int *);
char *gcvt(double, int, char *); char *gcvt(double, int, char *);

View File

@ -10,6 +10,7 @@ extern "C" {
int gettimeofday (struct timeval *__restrict, void *__restrict); int gettimeofday (struct timeval *__restrict, void *__restrict);
#ifdef __wasilibc_unmodified_upstream /* WASI has no getitimer */
#define ITIMER_REAL 0 #define ITIMER_REAL 0
#define ITIMER_VIRTUAL 1 #define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2 #define ITIMER_PROF 2
@ -21,18 +22,25 @@ struct itimerval {
int getitimer (int, struct itimerval *); int getitimer (int, struct itimerval *);
int setitimer (int, const struct itimerval *__restrict, struct itimerval *__restrict); int setitimer (int, const struct itimerval *__restrict, struct itimerval *__restrict);
#endif
#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */
int utimes (const char *, const struct timeval [2]); int utimes (const char *, const struct timeval [2]);
#endif
#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
struct timezone { struct timezone {
int tz_minuteswest; int tz_minuteswest;
int tz_dsttime; int tz_dsttime;
}; };
#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */
int futimes(int, const struct timeval [2]); int futimes(int, const struct timeval [2]);
int futimesat(int, const char *, const struct timeval [2]); int futimesat(int, const char *, const struct timeval [2]);
int lutimes(const char *, const struct timeval [2]); int lutimes(const char *, const struct timeval [2]);
#endif
#ifdef __wasilibc_unmodified_upstream /* WASI has no way to set the time */
int settimeofday(const struct timeval *, const struct timezone *); int settimeofday(const struct timeval *, const struct timezone *);
int adjtime (const struct timeval *, struct timeval *); int adjtime (const struct timeval *, struct timeval *);
#endif
#define timerisset(t) ((t)->tv_sec || (t)->tv_usec) #define timerisset(t) ((t)->tv_sec || (t)->tv_usec)
#define timerclear(t) ((t)->tv_sec = (t)->tv_usec = 0) #define timerclear(t) ((t)->tv_sec = (t)->tv_usec = 0)
#define timercmp(s,t,op) ((s)->tv_sec == (t)->tv_sec ? \ #define timercmp(s,t,op) ((s)->tv_sec == (t)->tv_sec ? \