Skip to content

Commit f7a0d35

Browse files
committed
Do declare gets, tmpnam, and tmpfile, but make them deprecated.
This is for compatibility with libcxx, which expects to redeclare these symbols in namespace std.
1 parent df59090 commit f7a0d35

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

libc-top-half/musl/include/stdio.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ int putc(int, FILE *);
104104
int putchar(int);
105105

106106
char *fgets(char *__restrict, int, FILE *__restrict);
107-
#ifdef __wasilibc_unmodified_upstream
108107
#if __STDC_VERSION__ < 201112L
108+
#ifdef __wasilibc_unmodified_upstream
109109
char *gets(char *);
110+
#else
111+
char *gets(char *) __attribute__((__deprecated__("gets is not defined on WASI")));
110112
#endif
111113
#endif
112114

@@ -138,6 +140,9 @@ void setbuf(FILE *__restrict, char *__restrict);
138140
#ifdef __wasilibc_unmodified_upstream
139141
char *tmpnam(char *);
140142
FILE *tmpfile(void);
143+
#else
144+
char *tmpnam(char *) __attribute__((__deprecated__("tmpnam is not defined on WASI")));
145+
FILE *tmpfile(void) __attribute__((__deprecated__("tmpfile is not defined on WASI")));
141146
#endif
142147

143148
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \

0 commit comments

Comments
 (0)