summaryrefslogtreecommitdiff
path: root/system/musl/stdio.patch
blob: 9ddfa573866ddf429bae005b7f18a4db9306fe93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
diff --git a/include/alltypes.h.in b/include/alltypes.h.in
index 622ca01..4cc879b 100644
--- a/include/alltypes.h.in
+++ b/include/alltypes.h.in
@@ -57,6 +57,7 @@ TYPEDEF struct { unsigned __attr; } pthread_condattr_t;
 TYPEDEF struct { unsigned __attr; } pthread_barrierattr_t;
 TYPEDEF struct { unsigned __attr[2]; } pthread_rwlockattr_t;
 
+STRUCT _IO_FILE { char __x; };
 TYPEDEF struct _IO_FILE FILE;
 
 TYPEDEF struct __mbstate_t { unsigned __opaque1, __opaque2; } mbstate_t;
diff --git a/include/stdio.h b/include/stdio.h
index afadd91..3604198 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -11,6 +11,10 @@ extern "C" {
 #define __NEED___isoc_va_list
 #define __NEED_size_t
 
+#if __STDC_VERSION__ < 201112L
+#define __NEED_struct__IO_FILE
+#endif
+
 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \
  || defined(_BSD_SOURCE)
diff --git a/include/wchar.h b/include/wchar.h
index 369b1e9..88eb55b 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -14,6 +14,10 @@ extern "C" {
 #define __NEED_wint_t
 #define __NEED_mbstate_t
 
+#if __STDC_VERSION__ < 201112L
+#define __NEED_struct__IO_FILE
+#endif
+
 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 #define __NEED_locale_t
diff --git a/src/include/stdio.h b/src/include/stdio.h
index 534c690..fae3755 100644
--- a/src/include/stdio.h
+++ b/src/include/stdio.h
@@ -1,6 +1,8 @@
 #ifndef STDIO_H
 #define STDIO_H
 
+#define __DEFINED_struct__IO_FILE
+
 #include "../../include/stdio.h"
 
 #undef stdin
diff --git a/src/include/wchar.h b/src/include/wchar.h
index e69de29..79f5d0e 100644
--- a/src/include/wchar.h
+++ b/src/include/wchar.h
@@ -0,0 +1,9 @@
+#ifndef WCHAR_H
+#define WCHAR_H
+
+#define __DEFINED_struct__IO_FILE
+
+#include "../../include/wchar.h"
+
+#endif
+