Loading...
--- Libc/Libc-1583.60.2/include/stdio.h
+++ Libc/Libc-1353.100.2/include/stdio.h
@@ -64,8 +64,6 @@
#include <_stdio.h>
#ifndef UNIFDEF_DRIVERKIT
-#include <sys/_types/_seek_set.h>
-
__BEGIN_DECLS
extern FILE *__stdinp;
extern FILE *__stdoutp;
@@ -117,6 +115,16 @@
#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
#define TMP_MAX 308915776
+#ifndef SEEK_SET
+#define SEEK_SET 0 /* set file offset to offset */
+#endif
+#ifndef SEEK_CUR
+#define SEEK_CUR 1 /* set file offset to current plus offset */
+#endif
+#ifndef SEEK_END
+#define SEEK_END 2 /* set file offset to EOF plus offset */
+#endif
+
#define stdin __stdinp
#define stdout __stdoutp
#define stderr __stderrp
@@ -191,12 +199,7 @@
//End-Libc
int getc(FILE *);
int getchar(void);
-
-#if !defined(_POSIX_C_SOURCE)
-__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of gets(3), it is highly recommended that you use fgets(3) instead.")
-#endif
char *gets(char *);
-
void perror(const char *) __cold;
int printf(const char * __restrict, ...) __printflike(1, 2);
int putc(int, FILE *);
@@ -208,13 +211,7 @@
int scanf(const char * __restrict, ...) __scanflike(1, 2);
void setbuf(FILE * __restrict, char * __restrict);
int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
-
-__swift_unavailable("Use snprintf instead.")
-#if !defined(_POSIX_C_SOURCE)
-__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
-#endif
-int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3);
-
+int sprintf(char * __restrict, const char * __restrict, ...) __printflike(2, 3) __swift_unavailable("Use snprintf instead.");
int sscanf(const char * __restrict, const char * __restrict, ...) __scanflike(2, 3);
FILE *tmpfile(void);
@@ -223,16 +220,10 @@
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")
#endif
char *tmpnam(char *);
-
int ungetc(int, FILE *);
int vfprintf(FILE * __restrict, const char * __restrict, va_list) __printflike(2, 0);
int vprintf(const char * __restrict, va_list) __printflike(1, 0);
-
-__swift_unavailable("Use vsnprintf instead.")
-#if !defined(_POSIX_C_SOURCE)
-__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use vsnprintf(3) instead.")
-#endif
-int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0);
+int vsprintf(char * __restrict, const char * __restrict, va_list) __printflike(2, 0) __swift_unavailable("Use vsnprintf instead.");
__END_DECLS
@@ -244,9 +235,8 @@
#if __DARWIN_C_LEVEL >= 198808L
#define L_ctermid 1024 /* size for ctermid(); PATH_MAX */
+__BEGIN_DECLS
#include <_ctermid.h>
-
-__BEGIN_DECLS
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
FILE *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(fdopen));
@@ -269,17 +259,22 @@
/* Additional functionality provided by:
* POSIX.2-1992 C Language Binding Option
*/
+#if TARGET_OS_EMBEDDED
+#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(ios_msg)
+#else
+#define __swift_unavailable_on(osx_msg, ios_msg) __swift_unavailable(osx_msg)
+#endif
#if __DARWIN_C_LEVEL >= 199209L
__BEGIN_DECLS
-int pclose(FILE *) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
+int pclose(FILE *) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
#if defined(_DARWIN_UNLIMITED_STREAMS) || defined(_DARWIN_C_SOURCE)
-FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
+FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_3_2, __DARWIN_EXTSN(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
#else /* !_DARWIN_UNLIMITED_STREAMS && !_DARWIN_C_SOURCE */
//Begin-Libc
#ifndef LIBC_ALIAS_POPEN
//End-Libc
-FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable("Use posix_spawn APIs or NSTask instead. (On iOS, process spawning is unavailable.)");
+FILE *popen(const char *, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(popen)) __swift_unavailable_on("Use posix_spawn APIs or NSTask instead.", "Process spawning is unavailable.");
//Begin-Libc
#else /* LIBC_ALIAS_POPEN */
FILE *popen(const char *, const char *) LIBC_ALIAS(popen);
@@ -288,6 +283,8 @@
#endif /* (DARWIN_UNLIMITED_STREAMS || _DARWIN_C_SOURCE) */
__END_DECLS
#endif /* __DARWIN_C_LEVEL >= 199209L */
+
+#undef __swift_unavailable_on
/* Additional functionality provided by:
* POSIX.1c-1995,
@@ -431,11 +428,12 @@
int asprintf(char ** __restrict, const char * __restrict, ...) __printflike(2, 3);
char *ctermid_r(char *);
char *fgetln(FILE *, size_t *);
-__const char *fmtcheck(const char *, const char *) __attribute__((format_arg(2)));
+__const char *fmtcheck(const char *, const char *);
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char ** __restrict, const char * __restrict, va_list) __printflike(2, 0);
+FILE *zopen(const char *, const char *, int);
/*