string/endian.h: Restore the __USE_MISC conditionals

Message ID 20191002182038.29299-1-alistair.francis@wdc.com
State New, archived
Headers

Commit Message

Alistair Francis Oct. 2, 2019, 6:20 p.m. UTC
  Commit 69fd157a3 "time: Add padding for the timespec if required"
caused a breakage in the glibc tests as the endian.h include file was
kept in the networking headers while the __USE_MISC #ifdefs had been
removed. This resulted in namespace violations in the networking
headers.

This patche restores the __USE_MISC conditionals in endian.h to fix the
test failures.

	* string/endian.h: Restore the __USE_MISC conditionals.
---
 string/endian.h | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
  

Comments

Joseph Myers Oct. 2, 2019, 7:28 p.m. UTC | #1
On Wed, 2 Oct 2019, Alistair Francis wrote:

> Commit 69fd157a3 "time: Add padding for the timespec if required"
> caused a breakage in the glibc tests as the endian.h include file was
> kept in the networking headers while the __USE_MISC #ifdefs had been
> removed. This resulted in namespace violations in the networking
> headers.
> 
> This patche restores the __USE_MISC conditionals in endian.h to fix the
> test failures.
> 
> 	* string/endian.h: Restore the __USE_MISC conditionals.

OK, please commit.
  

Patch

diff --git a/string/endian.h b/string/endian.h
index 0eb534e434b..1a9fe3c97e7 100644
--- a/string/endian.h
+++ b/string/endian.h
@@ -23,12 +23,14 @@ 
 /* Get the definitions of __*_ENDIAN, __BYTE_ORDER, and __FLOAT_WORD_ORDER.  */
 #include <bits/endian.h>
 
-#define LITTLE_ENDIAN	__LITTLE_ENDIAN
-#define BIG_ENDIAN	__BIG_ENDIAN
-#define PDP_ENDIAN	__PDP_ENDIAN
-#define BYTE_ORDER	__BYTE_ORDER
+#ifdef __USE_MISC
+# define LITTLE_ENDIAN	__LITTLE_ENDIAN
+# define BIG_ENDIAN	__BIG_ENDIAN
+# define PDP_ENDIAN	__PDP_ENDIAN
+# define BYTE_ORDER	__BYTE_ORDER
+#endif
 
-#ifndef __ASSEMBLER__
+#if defined __USE_MISC && !defined __ASSEMBLER__
 /* Conversion interfaces.  */
 # include <bits/byteswap.h>
 # include <bits/uintn-identity.h>