commit 3e9ab94d290a52ae6119e92cb8a1e9d0ff4a7423 (tree) parent feaa690dc6673073039e81c9e5d43d2a65224cfa Author: Huang Zhichao <hahv@msn.com> Date: Wed, 11 Mar 2026 15:49:37 +0800 FreeBSD libc: guard ssp headers and definitions introduced in FreeBSD 15 Diffstat:
14 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/lib/libc/include/generic-freebsd/poll.h b/lib/libc/include/generic-freebsd/poll.h @@ -109,9 +109,12 @@ typedef __sigset_t sigset_t; #endif +// zig patch: ssp/poll.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/poll.h> #endif +#endif __BEGIN_DECLS int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout); diff --git a/lib/libc/include/generic-freebsd/signal.h b/lib/libc/include/generic-freebsd/signal.h @@ -72,9 +72,12 @@ typedef __pthread_t pthread_t; #endif #endif /* __POSIX_VISIBLE || __XSI_VISIBLE */ +// zig patch: ssp/signal.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/signal.h> #endif +#endif __BEGIN_DECLS int raise(int); diff --git a/lib/libc/include/generic-freebsd/stdio.h b/lib/libc/include/generic-freebsd/stdio.h @@ -252,9 +252,12 @@ __END_DECLS #define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */ #endif /* __POSIX_VISIBLE */ +// zig patch: ssp/stdio.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/stdio.h> #endif +#endif __BEGIN_DECLS #ifdef _XLOCALE_H_ diff --git a/lib/libc/include/generic-freebsd/stdlib.h b/lib/libc/include/generic-freebsd/stdlib.h @@ -69,9 +69,12 @@ typedef struct { */ #define RAND_MAX 0x7fffffff +// zig patch: ssp/stdlib.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/stdlib.h> #endif +#endif __BEGIN_DECLS #ifdef _XLOCALE_H_ diff --git a/lib/libc/include/generic-freebsd/string.h b/lib/libc/include/generic-freebsd/string.h @@ -49,9 +49,12 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +// zig patch: ssp/string.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/string.h> #endif +#endif __BEGIN_DECLS #if __XSI_VISIBLE >= 600 || __ISO_C_VISIBLE >= 2023 diff --git a/lib/libc/include/generic-freebsd/strings.h b/lib/libc/include/generic-freebsd/strings.h @@ -37,9 +37,12 @@ typedef __size_t size_t; #define _SIZE_T_DECLARED #endif +// zig patch: ssp/strings.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/strings.h> #endif +#endif __BEGIN_DECLS #if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112 diff --git a/lib/libc/include/generic-freebsd/sys/libkern.h b/lib/libc/include/generic-freebsd/sys/libkern.h @@ -334,10 +334,13 @@ signed_extend32(uint32_t bitmap, int lsb, int width) #define FNM_IGNORECASE FNM_CASEFOLD #define FNM_FILE_NAME FNM_PATHNAME +// zig patch: ssp/ssp.h header and __ssp_real were added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_KERNEL) && __has_include(<ssp/ssp.h>) #include <ssp/ssp.h> /* __ssp_real */ #else #define __ssp_real(fun) fun #endif +#endif #endif /* !_SYS_LIBKERN_H_ */ \ No newline at end of file diff --git a/lib/libc/include/generic-freebsd/sys/poll.h b/lib/libc/include/generic-freebsd/sys/poll.h @@ -109,9 +109,12 @@ typedef __sigset_t sigset_t; #endif +// zig patch: ssp/poll.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/poll.h> #endif +#endif __BEGIN_DECLS int poll(struct pollfd _pfd[], nfds_t _nfds, int _timeout); diff --git a/lib/libc/include/generic-freebsd/sys/random.h b/lib/libc/include/generic-freebsd/sys/random.h @@ -156,9 +156,12 @@ random_harvest_direct(const void *entropy, u_int size, enum random_entropy_sourc #else /* !_KERNEL */ +// zig patch: ssp/random.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/random.h> #endif +#endif #endif /* _KERNEL */ diff --git a/lib/libc/include/generic-freebsd/sys/select.h b/lib/libc/include/generic-freebsd/sys/select.h @@ -49,11 +49,14 @@ typedef __fd_mask fd_mask; typedef __sigset_t sigset_t; #endif +// zig patch: ssp/ssp.h header and __SSP_FORTIFY_LEVEL were added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_KERNEL) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/ssp.h> #else #define __SSP_FORTIFY_LEVEL 0 #endif +#endif /* * Select uses bit masks of file descriptors in longs. These macros diff --git a/lib/libc/include/generic-freebsd/sys/socket.h b/lib/libc/include/generic-freebsd/sys/socket.h @@ -691,9 +691,12 @@ struct splice { #ifndef _KERNEL +// zig patch: ssp/socket.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/socket.h> #endif +#endif #include <sys/cdefs.h> diff --git a/lib/libc/include/generic-freebsd/sys/uio.h b/lib/libc/include/generic-freebsd/sys/uio.h @@ -101,9 +101,12 @@ int uiomove_object(struct vm_object *obj, off_t obj_size, struct uio *uio); #else /* !_KERNEL */ +// zig patch: ssp/uio.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/uio.h> #endif +#endif __BEGIN_DECLS ssize_t readv(int, const struct iovec *, int); diff --git a/lib/libc/include/generic-freebsd/unistd.h b/lib/libc/include/generic-freebsd/unistd.h @@ -37,9 +37,12 @@ #include <sys/_null.h> #include <sys/_types.h> +// zig patch: ssp/unistd.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/unistd.h> #endif +#endif #ifndef _GID_T_DECLARED typedef __gid_t gid_t; diff --git a/lib/libc/include/generic-freebsd/wchar.h b/lib/libc/include/generic-freebsd/wchar.h @@ -112,9 +112,12 @@ __BEGIN_DECLS size_t wcslen(const wchar_t *) __pure; __END_DECLS +// zig patch: ssp/wchar.h header was added in FreeBSD 15 +#if __FreeBSD_version >= 1500500 #if !defined(_STANDALONE) && defined(_FORTIFY_SOURCE) && _FORTIFY_SOURCE > 0 #include <ssp/wchar.h> #endif +#endif __BEGIN_DECLS wint_t btowc(int);