]> git.proxmox.com Git - wasi-libc.git/commitdiff
Remove more declarations for symbols that aren't defined.
authorDan Gohman <sunfish@mozilla.com>
Tue, 14 May 2019 15:36:35 +0000 (08:36 -0700)
committerDan Gohman <sunfish@mozilla.com>
Wed, 15 May 2019 19:01:17 +0000 (12:01 -0700)
expected/wasm32-wasi/predefined-macros.txt
libc-top-half/musl/include/malloc.h
libc-top-half/musl/include/stdlib.h
libc-top-half/musl/include/sys/time.h

index b5a6fc05f41ef0968f2c93a8567212197168b63e..8de7a371bbca14f1a3b7b25e3d2456e7520126b0 100644 (file)
 #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
index 25f0f2bf158d04b5e296961517b8079820289633..bc17b10762b51c270715eae77113842b61b50745 100644 (file)
@@ -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 *);
 
index d2e3526483b15bebeb1a8855fa7f6dbc3bc8f7d7..9c711e4fa40009c4e3224179b946b9aaed2e41a3 100644 (file)
@@ -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 <alloca.h>
+#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 *);
index c5cab814c0d112d493d75d1a35c98bb338195687..03c297f2b9578ebb18a4efc88a1cfc253b60c9fa 100644 (file)
@@ -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 ? \