From 5a1ec3c9ffa25c70eb0406e61e183e754b9df19d Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Thu, 20 Jan 2022 05:46:23 +0000 Subject: [PATCH] sfio: fix "SF_SYNC redefined" warning on FreeBSD FreeBSD defines an SF_SYNC macro in sys/socket.h that conflicts with sfio's SF_SYNC discipline, at best rendering it ineffective. src/lib/libast/sfio/sfhdr.h: - Temporarily undef __BSD_VISIBLE while including to hide the BSD extension with the conflicting definition. --- src/lib/libast/sfio/sfhdr.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/libast/sfio/sfhdr.h b/src/lib/libast/sfio/sfhdr.h index 5a5c94a7c..e0eaad51e 100644 --- a/src/lib/libast/sfio/sfhdr.h +++ b/src/lib/libast/sfio/sfhdr.h @@ -340,7 +340,13 @@ #endif #if _socket_peek +#if __FreeBSD__ && __BSD_VISIBLE +#undef __BSD_VISIBLE /* Hide conflicting SF_SYNC definition. [Added 2022-01-20. TODO: review periodically] */ #include +#define __BSD_VISIBLE 1 +#else +#include +#endif #endif /* to test for executable access mode of a file */