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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
Index: b/system/include/libc/locale.h
===================================================================
--- a/system/include/libc/locale.h
+++ b/system/include/libc/locale.h
@@ -7,7 +7,11 @@ extern "C" {
#include <features.h>
+#ifdef __cplusplus
#define NULL 0L
+#else
+#define NULL ((void*)0)
+#endif
#define LC_CTYPE 0
#define LC_NUMERIC 1
Index: b/system/include/libc/stddef.h
===================================================================
--- a/system/include/libc/stddef.h
+++ b/system/include/libc/stddef.h
@@ -1,7 +1,11 @@
#ifndef _STDDEF_H
#define _STDDEF_H
+#ifdef __cplusplus
#define NULL 0L
+#else
+#define NULL ((void*)0)
+#endif
#define __NEED_ptrdiff_t
#define __NEED_size_t
Index: b/system/include/libc/stdio.h
===================================================================
--- a/system/include/libc/stdio.h
+++ b/system/include/libc/stdio.h
@@ -21,7 +21,11 @@ extern "C" {
#include <bits/alltypes.h>
+#ifdef __cplusplus
#define NULL 0L
+#else
+#define NULL ((void*)0)
+#endif
#undef EOF
#define EOF (-1)
Index: b/system/include/libc/stdlib.h
===================================================================
--- a/system/include/libc/stdlib.h
+++ b/system/include/libc/stdlib.h
@@ -7,7 +7,11 @@ extern "C" {
#include <features.h>
+#ifdef __cplusplus
#define NULL 0L
+#else
+#define NULL ((void*)0)
+#endif
#define __NEED_size_t
#define __NEED_wchar_t
Index: b/system/include/libc/string.h
===================================================================
--- a/system/include/libc/string.h
+++ b/system/include/libc/string.h
@@ -7,7 +7,11 @@ extern "C" {
#include <features.h>
+#ifdef __cplusplus
#define NULL 0L
+#else
+#define NULL ((void*)0)
+#endif
#define __NEED_size_t
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
Index: b/system/include/libc/time.h
===================================================================
--- a/system/include/libc/time.h
+++ b/system/include/libc/time.h
@@ -7,7 +7,11 @@ extern "C" {
#include <features.h>
+#ifdef __cplusplus
#define NULL 0L
+#else
+#define NULL ((void*)0)
+#endif
#define __NEED_size_t
#define __NEED_time_t
Index: b/system/include/libc/unistd.h
===================================================================
--- a/system/include/libc/unistd.h
+++ b/system/include/libc/unistd.h
@@ -15,7 +15,11 @@ extern "C" {
#define SEEK_CUR 1
#define SEEK_END 2
+#ifdef __cplusplus
#define NULL 0L
+#else
+#define NULL ((void*)0)
+#endif
#define __NEED_size_t
#define __NEED_ssize_t
Index: b/system/include/libc/wchar.h
===================================================================
--- a/system/include/libc/wchar.h
+++ b/system/include/libc/wchar.h
@@ -33,7 +33,11 @@ extern "C" {
#define WCHAR_MIN (-1-0x7fffffff+L'\0')
#endif
+#ifdef __cplusplus
#define NULL 0L
+#else
+#define NULL ((void*)0)
+#endif
#undef WEOF
#define WEOF 0xffffffffU
|