linux-mips
[Top] [All Lists]

[PATCH] MIPS: uapi/asm/siginfo.h: Fix GCC 4.1.2 compilation

To: linux-mips@linux-mips.org
Subject: [PATCH] MIPS: uapi/asm/siginfo.h: Fix GCC 4.1.2 compilation
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Sun, 28 Jul 2013 21:20:25 +0100 (BST)
Cc: Ralf Baechle <ralf@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
User-agent: Alpine 2.03 (LFD 1266 2009-07-14)
 It wasn't until GCC 4.3 I believe that the __SIZEOF_*__ predefined macros 
were added.  The change below switches <uapi/asm/siginfo.h> to the 
_MIPS_SZLONG macro so that compilation with e.g. GCC 4.1.2 succeeds.  
This is a user API header so I think this is even more important, for 
older userland support.  The change adds an unsuccessful default too, to 
catch any compiler configuration oddities.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
Ralf, please apply.

  Maciej

linux-mips-sizeof.patch
Index: linux/arch/mips/include/uapi/asm/siginfo.h
===================================================================
--- linux.orig/arch/mips/include/uapi/asm/siginfo.h
+++ linux/arch/mips/include/uapi/asm/siginfo.h
@@ -25,11 +25,12 @@ struct siginfo;
 /*
  * Careful to keep union _sifields from shifting ...
  */
-#if __SIZEOF_LONG__ == 4
+#if _MIPS_SZLONG == 32
 #define __ARCH_SI_PREAMBLE_SIZE (3 * sizeof(int))
-#endif
-#if __SIZEOF_LONG__ == 8
+#elif _MIPS_SZLONG == 64
 #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
+#else
+#error _MIPS_SZLONG neither 32 nor 64
 #endif
 
 #include <asm-generic/siginfo.h>

<Prev in Thread] Current Thread [Next in Thread>