Module Name: src
Committed By: christos
Date: Thu Mar 12 15:28:16 UTC 2015
Modified Files:
src/sys/sys: bswap.h
Log Message:
Remove __OPTIMIZE__ requirement to expand the byte swap macros. Back in
2006 this change was reverted because some of the arch-specific libraries
were broken, and this was hiding this fact. Now, we have code like
static const struct in_addr inmask32 = {.s_addr = INADDR_BROADCAST};
which breaks gcc when compiling without optimization since it does not see
that the expression is constant.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/sys/bswap.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/bswap.h
diff -u src/sys/sys/bswap.h:1.18 src/sys/sys/bswap.h:1.19
--- src/sys/sys/bswap.h:1.18 Thu Feb 26 10:01:53 2015
+++ src/sys/sys/bswap.h Thu Mar 12 11:28:16 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: bswap.h,v 1.18 2015/02/26 15:01:53 joerg Exp $ */
+/* $NetBSD: bswap.h,v 1.19 2015/03/12 15:28:16 christos Exp $ */
/* Written by Manuel Bouyer. Public domain */
@@ -22,7 +22,7 @@ uint32_t bswap32(uint32_t) __RENAME(__bs
uint64_t bswap64(uint64_t) __constfunc;
__END_DECLS
-#if defined(__GNUC__) && defined(__OPTIMIZE__) && !defined(__lint__)
+#if defined(__GNUC__) && !defined(__lint__)
/* machine/byte_swap.h might have defined inline versions */
#ifndef __BYTE_SWAP_U64_VARIABLE
@@ -72,7 +72,7 @@ __END_DECLS
__CAST(uint16_t, __builtin_constant_p((x)) ? \
__byte_swap_u16_constant(x) : __BYTE_SWAP_U16_VARIABLE(x))
-#endif /* __GNUC__ && __OPTIMIZE__ */
+#endif /* __GNUC__ && !__lint__ */
#endif /* !_LOCORE */
#endif /* !_SYS_BSWAP_H_ */