The whitespace diffs are converting from spaces to tabs.
#ifdef __wasilibc_unmodified_upstream // WASI has no processes
[_SC_CHILD_MAX] = RLIM(NPROC),
#else
#ifdef __wasilibc_unmodified_upstream // WASI has no processes
[_SC_CHILD_MAX] = RLIM(NPROC),
#else
- // Not supported on wasi.
+ // Not supported on wasi.
[_SC_CHILD_MAX] = -1,
#endif
[_SC_CLK_TCK] = 100,
[_SC_CHILD_MAX] = -1,
#endif
[_SC_CLK_TCK] = 100,
#ifdef __wasilibc_unmodified_upstream // WASI has no realtime signals
[_SC_RTSIG_MAX] = _NSIG - 1 - 31 - 3,
#else
#ifdef __wasilibc_unmodified_upstream // WASI has no realtime signals
[_SC_RTSIG_MAX] = _NSIG - 1 - 31 - 3,
#else
- // Not supported on wasi.
+ // Not supported on wasi.
[_SC_RTSIG_MAX] = -1,
#endif
#ifdef __wasilibc_unmodified_upstream // WASI has no semaphores
[_SC_RTSIG_MAX] = -1,
#endif
#ifdef __wasilibc_unmodified_upstream // WASI has no semaphores
return -1;
return lim.rlim_cur > LONG_MAX ? LONG_MAX : lim.rlim_cur;
#else
return -1;
return lim.rlim_cur > LONG_MAX ? LONG_MAX : lim.rlim_cur;
#else
- // Not supported on wasi.
+ // Not supported on wasi.
errno = EINVAL;
return -1;
#endif
errno = EINVAL;
return -1;
#endif
for (; set[i]; set[i]&=set[i]-1, cnt++);
return cnt;
#else
for (; set[i]; set[i]&=set[i]-1, cnt++);
return cnt;
#else
- // With no thread support, just say there's 1 processor.
+ // With no thread support, just say there's 1 processor.
return 1;
#endif
#ifdef __wasilibc_unmodified_upstream // WASI has no sysinfo
return 1;
#endif
#ifdef __wasilibc_unmodified_upstream // WASI has no sysinfo
-/*
- * WebAssembly doesn't have floating-point status flags, so there's no reason
- * to force evaluations.
- * */
+/* WebAssembly doesn't have floating-point status flags, so there's no reason
+ * to force evaluations. */
#define FORCE_EVAL(x) ((void)(x))
#endif
#define FORCE_EVAL(x) ((void)(x))
#endif
* variant of the C locale honoring the default locale's encoding. */
pthread_once(&default_locale_once, default_locale_init);
#else
* variant of the C locale honoring the default locale's encoding. */
pthread_once(&default_locale_once, default_locale_init);
#else
- {
- static int called;
- if (called == 0) {
- default_locale_init();
- called = 1;
- }
- }
+ {
+ static int called;
+ if (called == 0) {
+ default_locale_init();
+ called = 1;
+ }
+ }
#endif
if (!memcmp(&tmp, &default_locale, sizeof tmp)) return &default_locale;
if (!memcmp(&tmp, &default_ctype_locale, sizeof tmp))
#endif
if (!memcmp(&tmp, &default_locale, sizeof tmp)) return &default_locale;
if (!memcmp(&tmp, &default_ctype_locale, sizeof tmp))
#ifdef __wasilibc_unmodified_upstream // Implement uname with placeholders
return syscall(SYS_uname, uts);
#else
#ifdef __wasilibc_unmodified_upstream // Implement uname with placeholders
return syscall(SYS_uname, uts);
#else
- // Just fill in the fields with placeholder values.
+ // Just fill in the fields with placeholder values.
strcpy(uts->sysname, "wasi");
strcpy(uts->nodename, "(none)");
strcpy(uts->release, "0.0.0");
strcpy(uts->version, "0.0.0");
#if defined(__wasm32__)
strcpy(uts->sysname, "wasi");
strcpy(uts->nodename, "(none)");
strcpy(uts->release, "0.0.0");
strcpy(uts->version, "0.0.0");
#if defined(__wasm32__)
- strcpy(uts->machine, "wasm32");
+ strcpy(uts->machine, "wasm32");
#elif defined(__wasm64__)
#elif defined(__wasm64__)
- strcpy(uts->machine, "wasm64");
+ strcpy(uts->machine, "wasm64");
- strcpy(uts->machine, "unknown");
+ strcpy(uts->machine, "unknown");
#endif
#ifdef _GNU_SOURCE
#endif
#ifdef _GNU_SOURCE
- strcpy(uts->domainname, "(none)");
+ strcpy(uts->domainname, "(none)");
- strcpy(uts->__domainname, "(none)");
+ strcpy(uts->__domainname, "(none)");
#ifdef __wasilibc_unmodified_upstream // WASI has no syscall
__syscall(SYS_close, fd);
#else
#ifdef __wasilibc_unmodified_upstream // WASI has no syscall
__syscall(SYS_close, fd);
#else
#ifdef __wasilibc_unmodified_upstream // WASI has no dup
else if (__dup3(f2->fd, f->fd, fl&O_CLOEXEC)<0) goto fail2;
#else
#ifdef __wasilibc_unmodified_upstream // WASI has no dup
else if (__dup3(f2->fd, f->fd, fl&O_CLOEXEC)<0) goto fail2;
#else
- // WASI doesn't have dup3, but does have a way to renumber
- // an existing file descriptor.
+ // WASI doesn't have dup3, but does have a way to renumber
+ // an existing file descriptor.
- if (__wasilibc_fd_renumber(f2->fd, f->fd)<0) goto fail2;
- f2->fd = -1; /* avoid closing in fclose */
- }
+ if (__wasilibc_fd_renumber(f2->fd, f->fd)<0) goto fail2;
+ f2->fd = -1; /* avoid closing in fclose */
+ }
#endif
f->flags = (f->flags & F_PERM) | f2->flags;
#endif
f->flags = (f->flags & F_PERM) | f2->flags;
return getc_unlocked(f);
return locking_getc(f);
#else
return getc_unlocked(f);
return locking_getc(f);
#else
- // With no threads, locking is unnecessary.
+ // With no threads, locking is unnecessary.
return getc_unlocked(f);
#endif
}
return getc_unlocked(f);
#endif
}
return putc_unlocked(c, f);
return locking_putc(c, f);
#else
return putc_unlocked(c, f);
return locking_putc(c, f);
#else
- // With no threads, locking is unnecessary.
+ // With no threads, locking is unnecessary.
return putc_unlocked(c, f);
#endif
}
return putc_unlocked(c, f);
#endif
}
#if defined(__wasilibc_printscan_no_floating_point)
break; case DBL:
case LDBL:
#if defined(__wasilibc_printscan_no_floating_point)
break; case DBL:
case LDBL:
- floating_point_not_supported();
+ floating_point_not_supported();
#else
break; case DBL: arg->f = va_arg(*ap, double);
#if defined(__wasilibc_printscan_no_long_double)
#else
break; case DBL: arg->f = va_arg(*ap, double);
#if defined(__wasilibc_printscan_no_long_double)
if (xp && p<0) goto overflow;
#if defined(__wasilibc_printscan_no_long_double)
if (xp && p<0) goto overflow;
#if defined(__wasilibc_printscan_no_long_double)
- // Omit the 'L' modifier for floating-point cases.
+ // Omit the 'L' modifier for floating-point cases.
switch (t|32) {
case 'a': case 'e': case 'f': case 'g':
snprintf(charfmt, sizeof charfmt, "%%%s%s%s%s%s*.*%c",
switch (t|32) {
case 'a': case 'e': case 'f': case 'g':
snprintf(charfmt, sizeof charfmt, "%%%s%s%s%s%s*.*%c",
// WebAssembly doesn't permit signature-changing aliases, so use wrapper
// functions instead.
weak float strtof_l(const char *restrict s, char **restrict p, locale_t loc) {
// WebAssembly doesn't permit signature-changing aliases, so use wrapper
// functions instead.
weak float strtof_l(const char *restrict s, char **restrict p, locale_t loc) {
}
weak double strtod_l(const char *restrict s, char **restrict p, locale_t loc) {
}
weak double strtod_l(const char *restrict s, char **restrict p, locale_t loc) {
}
weak long double strtold_l(const char *restrict s, char **restrict p, locale_t loc) {
}
weak long double strtold_l(const char *restrict s, char **restrict p, locale_t loc) {