From: Dan Gohman Date: Tue, 14 May 2019 15:36:35 +0000 (-0700) Subject: Remove more declarations for symbols that aren't defined. X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=0a738e8fd61e0b8bc1b6d49015e3ca406e2bb934;p=wasi-libc.git Remove more declarations for symbols that aren't defined. --- diff --git a/expected/wasm32-wasi/predefined-macros.txt b/expected/wasm32-wasi/predefined-macros.txt index b5a6fc0..8de7a37 100644 --- a/expected/wasm32-wasi/predefined-macros.txt +++ b/expected/wasm32-wasi/predefined-macros.txt @@ -2013,23 +2013,13 @@ #define UTIME_OMIT (-2) #define WCHAR_MAX (0x7fffffff+L'\0') #define WCHAR_MIN (-1-0x7fffffff+L'\0') -#define WCOREDUMP(s) ((s) & 0x80) #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 WINT_MAX UINT32_MAX #define WINT_MIN 0U -#define WNOHANG 1 #define WONT 252 #define WORD_BIT 32 #define WRQ 02 -#define WSTOPSIG(s) WEXITSTATUS(s) -#define WTERMSIG(s) ((s) & 0x7f) -#define WUNTRACED 2 #define W_OK 2 #define X_OK 4 #define YESEXPR 0x50000 diff --git a/libc-top-half/musl/include/malloc.h b/libc-top-half/musl/include/malloc.h index 25f0f2b..bc17b10 100644 --- a/libc-top-half/musl/include/malloc.h +++ b/libc-top-half/musl/include/malloc.h @@ -19,8 +19,10 @@ void *calloc (size_t, size_t); void *realloc (void *, size_t); void free (void *); #endif +#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */ void *valloc (size_t); void *memalign(size_t, size_t); +#endif size_t malloc_usable_size(void *); diff --git a/libc-top-half/musl/include/stdlib.h b/libc-top-half/musl/include/stdlib.h index d2e3526..9c711e4 100644 --- a/libc-top-half/musl/include/stdlib.h +++ b/libc-top-half/musl/include/stdlib.h @@ -98,6 +98,7 @@ size_t __ctype_get_mb_cur_max(void); || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ || defined(_BSD_SOURCE) +#ifdef __wasilibc_unmodified_upstream /* WASI has no wait */ #define WNOHANG 1 #define WUNTRACED 2 @@ -107,6 +108,7 @@ size_t __ctype_get_mb_cur_max(void); #define WIFEXITED(s) (!WTERMSIG(s)) #define WIFSTOPPED(s) ((short)((((s)&0xffff)*0x10001)>>8) > 0x7f00) #define WIFSIGNALED(s) (((s)&0xffff)-1U < 0xffu) +#endif int posix_memalign (void **, size_t, size_t); int setenv (const char *, const char *, int); @@ -150,19 +152,27 @@ void lcong48 (unsigned short [7]); #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) #include +#ifdef __wasilibc_unmodified_upstream /* WASI has no temp directories */ char *mktemp (char *); int mkstemps (char *, int); int mkostemps (char *, int, int); +#endif +#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */ void *valloc (size_t); void *memalign(size_t, size_t); int getloadavg(double *, int); +#endif int clearenv(void); +#ifdef __wasilibc_unmodified_upstream /* WASI has no wait */ #define WCOREDUMP(s) ((s) & 0x80) #define WIFCONTINUED(s) ((s) == 0xffff) #endif +#endif #ifdef _GNU_SOURCE +#ifdef __wasilibc_unmodified_upstream /* WASI has no pseudo-terminals */ int ptsname_r(int, char *, size_t); +#endif char *ecvt(double, int, int *, int *); char *fcvt(double, int, int *, int *); char *gcvt(double, int, char *); diff --git a/libc-top-half/musl/include/sys/time.h b/libc-top-half/musl/include/sys/time.h index c5cab81..03c297f 100644 --- a/libc-top-half/musl/include/sys/time.h +++ b/libc-top-half/musl/include/sys/time.h @@ -10,6 +10,7 @@ extern "C" { int gettimeofday (struct timeval *__restrict, void *__restrict); +#ifdef __wasilibc_unmodified_upstream /* WASI has no getitimer */ #define ITIMER_REAL 0 #define ITIMER_VIRTUAL 1 #define ITIMER_PROF 2 @@ -21,18 +22,25 @@ struct itimerval { int getitimer (int, struct itimerval *); 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]); +#endif #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) struct timezone { int tz_minuteswest; int tz_dsttime; }; +#ifdef __wasilibc_unmodified_upstream /* WASI libc doesn't build the legacy functions */ int futimes(int, const struct timeval [2]); int futimesat(int, 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 adjtime (const struct timeval *, struct timeval *); +#endif #define timerisset(t) ((t)->tv_sec || (t)->tv_usec) #define timerclear(t) ((t)->tv_sec = (t)->tv_usec = 0) #define timercmp(s,t,op) ((s)->tv_sec == (t)->tv_sec ? \