summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin2015-03-11 09:26:11 +0000
committersin2015-03-11 09:26:11 +0000
commit8604f138c55ab4904a2fd9b7edce2b688c70e6c0 (patch)
treeb3cc05536f3b7be32faa9dd75d0babbf5fcdbdc5
parent1fbf7a3a5e9c02cf992848002cfb88c3c7cc0212 (diff)
Add ifdef guards for C++ code
-rw-r--r--include/poll.h8
-rw-r--r--include/stdio.h8
-rw-r--r--include/stdlib.h8
-rw-r--r--include/string.h8
-rw-r--r--include/strings.h8
-rw-r--r--include/sys/select.h8
-rw-r--r--include/sys/socket.h8
-rw-r--r--include/unistd.h8
-rw-r--r--include/wchar.h8
9 files changed, 72 insertions, 0 deletions
diff --git a/include/poll.h b/include/poll.h
index 2f06045..ac79695 100644
--- a/include/poll.h
+++ b/include/poll.h
@@ -5,6 +5,10 @@
5 5
6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
7 7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
8static inline __attribute__ ((always_inline)) 12static inline __attribute__ ((always_inline))
9int 13int
10__fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout) 14__fortify_poll(struct pollfd *fds, nfds_t nfds, int timeout)
@@ -38,6 +42,10 @@ __fortify_ppoll(struct pollfd *fds, nfds_t nfds,
38#define ppoll(fds, nfds, timeout, mask) __fortify_ppoll(fds, nfds, timeout, mask) 42#define ppoll(fds, nfds, timeout, mask) __fortify_ppoll(fds, nfds, timeout, mask)
39#endif 43#endif
40 44
45#ifdef __cplusplus
46}
47#endif
48
41#endif 49#endif
42 50
43#endif 51#endif
diff --git a/include/stdio.h b/include/stdio.h
index b1ccc75..ab9b00f 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -5,6 +5,10 @@
5 5
6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
7 7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
8static inline __attribute__ ((always_inline)) 12static inline __attribute__ ((always_inline))
9char * 13char *
10__fortify_fgets(char *s, int n, FILE *fp) 14__fortify_fgets(char *s, int n, FILE *fp)
@@ -104,6 +108,10 @@ __fortify_vsnprintf(char *s, size_t n, const char *fmt, __builtin_va_list ap)
104 r; \ 108 r; \
105}) 109})
106 110
111#ifdef __cplusplus
112}
113#endif
114
107#endif 115#endif
108 116
109#endif 117#endif
diff --git a/include/stdlib.h b/include/stdlib.h
index 35bff81..312555c 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -9,6 +9,10 @@
9 9
10#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 10#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
11 11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
12#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE) 16#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
13static inline __attribute__ ((always_inline)) 17static inline __attribute__ ((always_inline))
14char * 18char *
@@ -32,6 +36,10 @@ __fortify_realpath(const char *path, char *resolved)
32#define realpath(path, resolved) __fortify_realpath(path, resolved) 36#define realpath(path, resolved) __fortify_realpath(path, resolved)
33#endif 37#endif
34 38
39#ifdef __cplusplus
40}
41#endif
42
35#endif 43#endif
36 44
37#endif 45#endif
diff --git a/include/string.h b/include/string.h
index 9f7d462..2f513ca 100644
--- a/include/string.h
+++ b/include/string.h
@@ -5,6 +5,10 @@
5 5
6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
7 7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
8static inline __attribute__ ((always_inline)) 12static inline __attribute__ ((always_inline))
9void * 13void *
10__fortify_memcpy(void *dest, const void *src, size_t n) 14__fortify_memcpy(void *dest, const void *src, size_t n)
@@ -186,6 +190,10 @@ __fortify_strlcpy(char *dest, const char *src, size_t n)
186#define strlcpy(dest, src, n) __fortify_strlcpy(dest, src, n) 190#define strlcpy(dest, src, n) __fortify_strlcpy(dest, src, n)
187#endif 191#endif
188 192
193#ifdef __cplusplus
194}
195#endif
196
189#endif 197#endif
190 198
191#endif 199#endif
diff --git a/include/strings.h b/include/strings.h
index 943b565..0862b58 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -5,6 +5,10 @@
5 5
6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
7 7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
8#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \ 12#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) || defined(_POSIX_SOURCE) \
9 || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \ 13 || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE+0 < 200809L) \
10 || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700) 14 || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE+0 < 700)
@@ -36,6 +40,10 @@ __fortify_bzero(void *src, size_t n)
36#define bzero(src, n) __fortify_bzero(src, n) 40#define bzero(src, n) __fortify_bzero(src, n)
37#endif 41#endif
38 42
43#ifdef __cplusplus
44}
45#endif
46
39#endif 47#endif
40 48
41#endif 49#endif
diff --git a/include/sys/select.h b/include/sys/select.h
index 9101b51..50bdb6a 100644
--- a/include/sys/select.h
+++ b/include/sys/select.h
@@ -5,6 +5,10 @@
5 5
6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
7 7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
8static inline __attribute__ ((always_inline)) 12static inline __attribute__ ((always_inline))
9int 13int
10__fortify_FD_CLR(int fd, fd_set *set) 14__fortify_FD_CLR(int fd, fd_set *set)
@@ -32,6 +36,10 @@ __fortify_FD_SET(int fd, fd_set *set)
32#undef FD_SET 36#undef FD_SET
33#define FD_SET(fd, set) __fortify_FD_SET(fd, set) 37#define FD_SET(fd, set) __fortify_FD_SET(fd, set)
34 38
39#ifdef __cplusplus
40}
41#endif
42
35#endif 43#endif
36 44
37#endif 45#endif
diff --git a/include/sys/socket.h b/include/sys/socket.h
index 7044f65..fc7381a 100644
--- a/include/sys/socket.h
+++ b/include/sys/socket.h
@@ -5,6 +5,10 @@
5 5
6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
7 7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
8static inline __attribute__ ((always_inline)) 12static inline __attribute__ ((always_inline))
9ssize_t 13ssize_t
10__fortify_recv(int sockfd, void *buf, size_t n, int flags) 14__fortify_recv(int sockfd, void *buf, size_t n, int flags)
@@ -60,6 +64,10 @@ __fortify_sendto(int sockfd, const void *buf, size_t n, int flags,
60#undef sendto 64#undef sendto
61#define sendto(sockfd, buf, n, flags, sa, salen) __fortify_sendto(sockfd, buf, n, flags, sa, salen) 65#define sendto(sockfd, buf, n, flags, sa, salen) __fortify_sendto(sockfd, buf, n, flags, sa, salen)
62 66
67#ifdef __cplusplus
68}
69#endif
70
63#endif 71#endif
64 72
65#endif 73#endif
diff --git a/include/unistd.h b/include/unistd.h
index 6b502b5..2403db1 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -5,6 +5,10 @@
5 5
6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 6#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
7 7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
8static inline __attribute__ ((always_inline)) 12static inline __attribute__ ((always_inline))
9size_t 13size_t
10__fortify_confstr(int name, char *buf, size_t len) 14__fortify_confstr(int name, char *buf, size_t len)
@@ -168,6 +172,10 @@ __fortify_write(int fd, const void *buf, size_t n)
168#undef write 172#undef write
169#define write(fd, buf, n) __fortify_write(fd, buf, n) 173#define write(fd, buf, n) __fortify_write(fd, buf, n)
170 174
175#ifdef __cplusplus
176}
177#endif
178
171#endif 179#endif
172 180
173#endif 181#endif
diff --git a/include/wchar.h b/include/wchar.h
index ca9840a..8a72e35 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -6,6 +6,10 @@
6 6
7#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0 7#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 && defined(__OPTIMIZE__) && __OPTIMIZE__ > 0
8 8
9#ifdef __cplusplus
10extern "C" {
11#endif
12
9static inline __attribute__ ((always_inline)) 13static inline __attribute__ ((always_inline))
10wchar_t * 14wchar_t *
11__fortify_fgetws(wchar_t *s, int n, FILE *fp) 15__fortify_fgetws(wchar_t *s, int n, FILE *fp)
@@ -249,6 +253,10 @@ __fortify_wmemset(wchar_t *s, wchar_t c, size_t n)
249#undef wmemset 253#undef wmemset
250#define wmemset(s, c, n) __fortify_wmemset(s, c, n) 254#define wmemset(s, c, n) __fortify_wmemset(s, c, n)
251 255
256#ifdef __cplusplus
257}
258#endif
259
252#endif 260#endif
253 261
254#endif 262#endif