Module Name:    src
Committed By:   riastradh
Date:           Mon Sep  9 18:17:14 UTC 2024

Modified Files:
        src/sys/sys: endian.h

Log Message:
sys/endian.h: Hide le32enc/be32enc/... under _NETBSD_SOURCE.

These are non-standard extensions, so they should not be exposed by,
e.g., _XOPEN_SOURCE=700.

PR standards/57807: #include <arpa/inet.h> spuriously defines
le32enc/be32enc/... under _XOPEN_SOURCE=700


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/sys/endian.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/sys/endian.h
diff -u src/sys/sys/endian.h:1.33 src/sys/sys/endian.h:1.34
--- src/sys/sys/endian.h:1.33	Mon Sep  9 15:22:50 2024
+++ src/sys/sys/endian.h	Mon Sep  9 18:17:14 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: endian.h,v 1.33 2024/09/09 15:22:50 riastradh Exp $	*/
+/*	$NetBSD: endian.h,v 1.34 2024/09/09 18:17:14 riastradh Exp $	*/
 
 /*
  * Copyright (c) 1987, 1991, 1993
@@ -192,6 +192,8 @@ __END_DECLS
  * to/from an octet stream.
  */
 
+#ifdef _NETBSD_SOURCE
+
 #if __GNUC_PREREQ__(2, 95)
 
 #define __GEN_ENDIAN_ENC(bits, endian) \
@@ -337,6 +339,8 @@ le64dec(const void *buf)
 
 #endif	/* GCC >= 2.95 */
 
+#endif	/* _NETBSD_SOURCE */
+
 #endif /* !_LOCORE */
 #endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
 #endif /* !_SYS_ENDIAN_H_ */

Reply via email to