authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-03-13 04:07:26+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-03-13 04:07:26+01:00
log26f2749c1e843176c821bd9d5f527585ba43843f
treeb21fe830a40f2c8cccf509a873598fd1f67fac63
parent627f03af9d90e0ac33834b4dd04a3a0adc9bbcef
parent3e9ab94d290a52ae6119e92cb8a1e9d0ff4a7423

Merge pull request 'FreeBSD libc: guard ssp headers and definitions introduced in FreeBSD 15' (#31457) from kid/zig:fbsd-libc-guard into master

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31457 Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>

26 files changed, 114 insertions(+), 0 deletions(-)

lib/libc/include/generic-freebsd/poll.h+3
...@@ -109,9 +109,12 @@ typedef __sigset_t sigset_t;...@@ -109,9 +109,12 @@ typedef __sigset_t sigset_t;
109109
110#endif110#endif
111111
112// zig patch: ssp/poll.h header was added in FreeBSD 15
113#if __FreeBSD_version >= 1500500
112#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0114#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
113#include <ssp/poll.h>115#include <ssp/poll.h>
114#endif116#endif
117#endif
115118
116__BEGIN_DECLS119__BEGIN_DECLS
117int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);120int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
lib/libc/include/generic-freebsd/signal.h+3
...@@ -72,9 +72,12 @@ typedef __pthread_t pthread_t;...@@ -72,9 +72,12 @@ typedef __pthread_t pthread_t;
72#endif72#endif
73#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */73#endif /* __POSIX_VISIBLE || __XSI_VISIBLE */
7474
75// zig patch: ssp/signal.h header was added in FreeBSD 15
76#if __FreeBSD_version >= 1500500
75#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 077#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
76#include <ssp/signal.h>78#include <ssp/signal.h>
77#endif79#endif
80#endif
7881
79__BEGIN_DECLS82__BEGIN_DECLS
80int raise(int);83int raise(int);
lib/libc/include/generic-freebsd/ssp/poll.h+6
...@@ -24,6 +24,12 @@...@@ -24,6 +24,12 @@
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.25 * POSSIBILITY OF SUCH DAMAGE.
26 */26 */
27
28// zig patch: ssp/poll.h header was added in FreeBSD 15
29#if __FreeBSD_version < 1500500
30 #error "ssp/poll.h did not exist before FreeBSD 15"
31#endif /* error for FreeBSD before 15 */
32
27#ifndef _SSP_POLL_H_33#ifndef _SSP_POLL_H_
28#define _SSP_POLL_H_34#define _SSP_POLL_H_
2935
lib/libc/include/generic-freebsd/ssp/random.h+6
...@@ -24,6 +24,12 @@...@@ -24,6 +24,12 @@
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.25 * POSSIBILITY OF SUCH DAMAGE.
26 */26 */
27
28// zig patch: ssp/random.h header was added in FreeBSD 15
29#if __FreeBSD_version < 1500500
30 #error "ssp/random.h did not exist before FreeBSD 15"
31#endif /* error for FreeBSD before 15 */
32
27#ifndef _SSP_RANDOM_H_33#ifndef _SSP_RANDOM_H_
28#define _SSP_RANDOM_H_34#define _SSP_RANDOM_H_
2935
lib/libc/include/generic-freebsd/ssp/signal.h+6
...@@ -24,6 +24,12 @@...@@ -24,6 +24,12 @@
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.25 * POSSIBILITY OF SUCH DAMAGE.
26 */26 */
27
28// zig patch: ssp/signal.h header was added in FreeBSD 15
29#if __FreeBSD_version < 1500500
30 #error "ssp/signal.h did not exist before FreeBSD 15"
31#endif /* error for FreeBSD before 15 */
32
27#ifndef _SSP_SIGNAL_H_33#ifndef _SSP_SIGNAL_H_
28#define _SSP_SIGNAL_H_34#define _SSP_SIGNAL_H_
2935
lib/libc/include/generic-freebsd/ssp/socket.h+6
...@@ -24,6 +24,12 @@...@@ -24,6 +24,12 @@
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.25 * POSSIBILITY OF SUCH DAMAGE.
26 */26 */
27
28// zig patch: ssp/socket.h header was added in FreeBSD 15
29#if __FreeBSD_version < 1500500
30 #error "ssp/socket.h did not exist before FreeBSD 15"
31#endif /* error for FreeBSD before 15 */
32
27#ifndef _SSP_SOCKET_H_33#ifndef _SSP_SOCKET_H_
28#define _SSP_SOCKET_H_34#define _SSP_SOCKET_H_
2935
lib/libc/include/generic-freebsd/ssp/ssp.h+6
...@@ -31,6 +31,12 @@...@@ -31,6 +31,12 @@
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.32 * POSSIBILITY OF SUCH DAMAGE.
33 */33 */
34
35// zig patch: ssp/ssp.h header was added in FreeBSD 15
36#if __FreeBSD_version < 1500500
37 #error "ssp/ssp.h did not exist before FreeBSD 15"
38#endif /* error for FreeBSD before 15 */
39
34#ifndef _SSP_SSP_H_40#ifndef _SSP_SSP_H_
35#define _SSP_SSP_H_41#define _SSP_SSP_H_
3642
lib/libc/include/generic-freebsd/ssp/stdio.h+6
...@@ -31,6 +31,12 @@...@@ -31,6 +31,12 @@
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.32 * POSSIBILITY OF SUCH DAMAGE.
33 */33 */
34
35// zig patch: ssp/stdio.h header was added in FreeBSD 15
36#if __FreeBSD_version < 1500500
37 #error "ssp/stdio.h did not exist before FreeBSD 15"
38#endif /* error for FreeBSD before 15 */
39
34#ifndef _SSP_STDIO_H_40#ifndef _SSP_STDIO_H_
35#define _SSP_STDIO_H_41#define _SSP_STDIO_H_
3642
lib/libc/include/generic-freebsd/ssp/stdlib.h+6
...@@ -24,6 +24,12 @@...@@ -24,6 +24,12 @@
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.25 * POSSIBILITY OF SUCH DAMAGE.
26 */26 */
27
28// zig patch: ssp/stdlib.h header was added in FreeBSD 15
29#if __FreeBSD_version < 1500500
30 #error "ssp/stdlib.h did not exist before FreeBSD 15"
31#endif /* error for FreeBSD before 15 */
32
27#ifndef _SSP_STDLIB_H_33#ifndef _SSP_STDLIB_H_
28#define _SSP_STDLIB_H_34#define _SSP_STDLIB_H_
2935
lib/libc/include/generic-freebsd/ssp/string.h+6
...@@ -31,6 +31,12 @@...@@ -31,6 +31,12 @@
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.32 * POSSIBILITY OF SUCH DAMAGE.
33 */33 */
34
35// zig patch: ssp/string.h header was added in FreeBSD 15
36#if __FreeBSD_version < 1500500
37 #error "ssp/string.h did not exist before FreeBSD 15"
38#endif /* error for FreeBSD before 15 */
39
34#ifndef _SSP_STRING_H_40#ifndef _SSP_STRING_H_
35#define _SSP_STRING_H_41#define _SSP_STRING_H_
3642
lib/libc/include/generic-freebsd/ssp/strings.h+6
...@@ -31,6 +31,12 @@...@@ -31,6 +31,12 @@
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.32 * POSSIBILITY OF SUCH DAMAGE.
33 */33 */
34
35// zig patch: ssp/strings.h header was added in FreeBSD 15
36#if __FreeBSD_version < 1500500
37 #error "ssp/strings.h did not exist before FreeBSD 15"
38#endif /* error for FreeBSD before 15 */
39
34#ifndef _SSP_STRINGS_H_40#ifndef _SSP_STRINGS_H_
35#define _SSP_STRINGS_H_41#define _SSP_STRINGS_H_
3642
lib/libc/include/generic-freebsd/ssp/uio.h+6
...@@ -24,6 +24,12 @@...@@ -24,6 +24,12 @@
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.25 * POSSIBILITY OF SUCH DAMAGE.
26 */26 */
27
28// zig patch: ssp/uio.h header was added in FreeBSD 15
29#if __FreeBSD_version < 1500500
30 #error "ssp/uio.h did not exist before FreeBSD 15"
31#endif /* error for FreeBSD before 15 */
32
27#ifndef _SSP_UIO_H_33#ifndef _SSP_UIO_H_
28#define _SSP_UIO_H_34#define _SSP_UIO_H_
2935
lib/libc/include/generic-freebsd/ssp/unistd.h+6
...@@ -31,6 +31,12 @@...@@ -31,6 +31,12 @@
31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.32 * POSSIBILITY OF SUCH DAMAGE.
33 */33 */
34
35// zig patch: ssp/unistd.h header was added in FreeBSD 15
36#if __FreeBSD_version < 1500500
37 #error "ssp/unistd.h did not exist before FreeBSD 15"
38#endif /* error for FreeBSD before 15 */
39
34#ifndef _SSP_UNISTD_H_40#ifndef _SSP_UNISTD_H_
35#define _SSP_UNISTD_H_41#define _SSP_UNISTD_H_
3642
lib/libc/include/generic-freebsd/ssp/wchar.h+6
...@@ -24,6 +24,12 @@...@@ -24,6 +24,12 @@
24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.25 * POSSIBILITY OF SUCH DAMAGE.
26 */26 */
27
28// zig patch: ssp/wchar.h header was added in FreeBSD 15
29#if __FreeBSD_version < 1500500
30 #error "ssp/wchar.h did not exist before FreeBSD 15"
31#endif /* error for FreeBSD before 15 */
32
27#ifndef _SSP_WCHAR_H_33#ifndef _SSP_WCHAR_H_
28#define _SSP_WCHAR_H_34#define _SSP_WCHAR_H_
2935
lib/libc/include/generic-freebsd/stdio.h+3
...@@ -252,9 +252,12 @@ __END_DECLS...@@ -252,9 +252,12 @@ __END_DECLS
252#define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */252#define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */
253#endif /* __POSIX_VISIBLE */253#endif /* __POSIX_VISIBLE */
254254
255// zig patch: ssp/stdio.h header was added in FreeBSD 15
256#if __FreeBSD_version >= 1500500
255#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0257#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
256#include <ssp/stdio.h>258#include <ssp/stdio.h>
257#endif259#endif
260#endif
258261
259__BEGIN_DECLS262__BEGIN_DECLS
260#ifdef _XLOCALE_H_263#ifdef _XLOCALE_H_
lib/libc/include/generic-freebsd/stdlib.h+3
...@@ -69,9 +69,12 @@ typedef struct {...@@ -69,9 +69,12 @@ typedef struct {
69 */69 */
70#define RAND_MAX 0x7fffffff70#define RAND_MAX 0x7fffffff
7171
72// zig patch: ssp/stdlib.h header was added in FreeBSD 15
73#if __FreeBSD_version >= 1500500
72#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 074#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
73#include <ssp/stdlib.h>75#include <ssp/stdlib.h>
74#endif76#endif
77#endif
7578
76__BEGIN_DECLS79__BEGIN_DECLS
77#ifdef _XLOCALE_H_80#ifdef _XLOCALE_H_
lib/libc/include/generic-freebsd/string.h+3
...@@ -49,9 +49,12 @@ typedef __size_t size_t;...@@ -49,9 +49,12 @@ typedef __size_t size_t;
49#define _SIZE_T_DECLARED49#define _SIZE_T_DECLARED
50#endif50#endif
5151
52// zig patch: ssp/string.h header was added in FreeBSD 15
53#if __FreeBSD_version >= 1500500
52#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 054#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
53#include <ssp/string.h>55#include <ssp/string.h>
54#endif56#endif
57#endif
5558
56__BEGIN_DECLS59__BEGIN_DECLS
57#if __XSI_VISIBLE >= 600 || __ISO_C_VISIBLE >= 202360#if __XSI_VISIBLE >= 600 || __ISO_C_VISIBLE >= 2023
lib/libc/include/generic-freebsd/strings.h+3
...@@ -37,9 +37,12 @@ typedef __size_t size_t;...@@ -37,9 +37,12 @@ typedef __size_t size_t;
37#define _SIZE_T_DECLARED37#define _SIZE_T_DECLARED
38#endif38#endif
3939
40// zig patch: ssp/strings.h header was added in FreeBSD 15
41#if __FreeBSD_version >= 1500500
40#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 042#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
41#include <ssp/strings.h>43#include <ssp/strings.h>
42#endif44#endif
45#endif
4346
44__BEGIN_DECLS47__BEGIN_DECLS
45#if __BSD_VISIBLE || __POSIX_VISIBLE <= 20011248#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
lib/libc/include/generic-freebsd/sys/libkern.h+3
...@@ -334,10 +334,13 @@ signed_extend32(uint32_t bitmap, int lsb, int width)...@@ -334,10 +334,13 @@ signed_extend32(uint32_t bitmap, int lsb, int width)
334#define FNM_IGNORECASE FNM_CASEFOLD334#define FNM_IGNORECASE FNM_CASEFOLD
335#define FNM_FILE_NAME FNM_PATHNAME335#define FNM_FILE_NAME FNM_PATHNAME
336336
337// zig patch: ssp/ssp.h header and __ssp_real were added in FreeBSD 15
338#if __FreeBSD_version >= 1500500
337#if !defined(_KERNEL) && __has_include(<ssp/ssp.h>)339#if !defined(_KERNEL) && __has_include(<ssp/ssp.h>)
338#include <ssp/ssp.h> /* __ssp_real */340#include <ssp/ssp.h> /* __ssp_real */
339#else341#else
340#define __ssp_real(fun) fun342#define __ssp_real(fun) fun
341#endif343#endif
344#endif
342345
343#endif /* !_SYS_LIBKERN_H_ */346#endif /* !_SYS_LIBKERN_H_ */
\ No newline at end of file
lib/libc/include/generic-freebsd/sys/poll.h+3
...@@ -109,9 +109,12 @@ typedef __sigset_t sigset_t;...@@ -109,9 +109,12 @@ typedef __sigset_t sigset_t;
109109
110#endif110#endif
111111
112// zig patch: ssp/poll.h header was added in FreeBSD 15
113#if __FreeBSD_version >= 1500500
112#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0114#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
113#include <ssp/poll.h>115#include <ssp/poll.h>
114#endif116#endif
117#endif
115118
116__BEGIN_DECLS119__BEGIN_DECLS
117int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);120int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout);
lib/libc/include/generic-freebsd/sys/random.h+3
...@@ -156,9 +156,12 @@ random_harvest_direct(const void *entropy, u_int size, enum random_entropy_sourc...@@ -156,9 +156,12 @@ random_harvest_direct(const void *entropy, u_int size, enum random_entropy_sourc
156156
157#else /* !_KERNEL */157#else /* !_KERNEL */
158158
159// zig patch: ssp/random.h header was added in FreeBSD 15
160#if __FreeBSD_version >= 1500500
159#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0161#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
160#include <ssp/random.h>162#include <ssp/random.h>
161#endif163#endif
164#endif
162165
163#endif /* _KERNEL */166#endif /* _KERNEL */
164167
lib/libc/include/generic-freebsd/sys/select.h+3
...@@ -49,11 +49,14 @@ typedef __fd_mask fd_mask;...@@ -49,11 +49,14 @@ typedef __fd_mask fd_mask;
49typedef __sigset_t sigset_t;49typedef __sigset_t sigset_t;
50#endif50#endif
5151
52// zig patch: ssp/ssp.h header and __SSP_FORTIFY_LEVEL were added in FreeBSD 15
53#if __FreeBSD_version >= 1500500
52#if !defined(_KERNEL) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 054#if !defined(_KERNEL) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
53#include <ssp/ssp.h>55#include <ssp/ssp.h>
54#else56#else
55#define __SSP_FORTIFY_LEVEL 057#define __SSP_FORTIFY_LEVEL 0
56#endif58#endif
59#endif
5760
58/*61/*
59 * Select uses bit masks of file descriptors in longs. These macros62 * Select uses bit masks of file descriptors in longs. These macros
lib/libc/include/generic-freebsd/sys/socket.h+3
...@@ -691,9 +691,12 @@ struct splice {...@@ -691,9 +691,12 @@ struct splice {
691691
692#ifndef _KERNEL692#ifndef _KERNEL
693693
694// zig patch: ssp/socket.h header was added in FreeBSD 15
695#if __FreeBSD_version >= 1500500
694#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0696#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
695#include <ssp/socket.h>697#include <ssp/socket.h>
696#endif698#endif
699#endif
697700
698#include <sys/cdefs.h>701#include <sys/cdefs.h>
699702
lib/libc/include/generic-freebsd/sys/uio.h+3
...@@ -101,9 +101,12 @@ int uiomove_object(struct vm_object *obj, off_t obj_size, struct uio *uio);...@@ -101,9 +101,12 @@ int uiomove_object(struct vm_object *obj, off_t obj_size, struct uio *uio);
101101
102#else /* !_KERNEL */102#else /* !_KERNEL */
103103
104// zig patch: ssp/uio.h header was added in FreeBSD 15
105#if __FreeBSD_version >= 1500500
104#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0106#if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
105#include <ssp/uio.h>107#include <ssp/uio.h>
106#endif108#endif
109#endif
107110
108__BEGIN_DECLS111__BEGIN_DECLS
109ssize_t readv(int, const struct iovec *, int);112ssize_t readv(int, const struct iovec *, int);
lib/libc/include/generic-freebsd/unistd.h+3
...@@ -37,9 +37,12 @@...@@ -37,9 +37,12 @@
37#include <sys/_null.h>37#include <sys/_null.h>
38#include <sys/_types.h>38#include <sys/_types.h>
3939
40// zig patch: ssp/unistd.h header was added in FreeBSD 15
41#if __FreeBSD_version >= 1500500
40#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 042#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
41#include <ssp/unistd.h>43#include <ssp/unistd.h>
42#endif44#endif
45#endif
4346
44#ifndef _GID_T_DECLARED47#ifndef _GID_T_DECLARED
45typedef __gid_t gid_t;48typedef __gid_t gid_t;
lib/libc/include/generic-freebsd/wchar.h+3
...@@ -112,9 +112,12 @@ __BEGIN_DECLS...@@ -112,9 +112,12 @@ __BEGIN_DECLS
112size_t wcslen(const wchar_t *) __pure;112size_t wcslen(const wchar_t *) __pure;
113__END_DECLS113__END_DECLS
114114
115// zig patch: ssp/wchar.h header was added in FreeBSD 15
116#if __FreeBSD_version >= 1500500
115#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0117#if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0
116#include <ssp/wchar.h>118#include <ssp/wchar.h>
117#endif119#endif
120#endif
118121
119__BEGIN_DECLS122__BEGIN_DECLS
120wint_t btowc(int);123wint_t btowc(int);