1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

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 <sys/socket.h>
  to hide the BSD extension with the conflicting definition.
This commit is contained in:
Martijn Dekker 2022-01-20 05:46:23 +00:00
parent 2c4b05b4f8
commit 5a1ec3c9ff

View file

@ -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 <sys/socket.h>
#define __BSD_VISIBLE 1
#else
#include <sys/socket.h>
#endif
#endif
/* to test for executable access mode of a file */