diff mbox

longlong: fix sh -Wundef builds

Message ID 20160107221811.GG25548@vapier.lan
State New
Headers show

Commit Message

Mike Frysinger Jan. 7, 2016, 10:18 p.m. UTC
On 08 Jan 2016 06:54, Oleg Endo wrote:
> On Jan 8, 2016, at 4:39 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> > This file fails when building for SuperH as it assumes __SHMEDIA__ is
> > always defined.  Update the code to check if it's defined.
> 
> This is OK for trunk.  Thanks for spotting it.

i had checked only the first case previously (as i don't have sh5
systems), but there's a logic error in the second i fixed before
committing.  this is what i merged:
-mike

Comments

Oleg Endo Jan. 7, 2016, 11:37 p.m. UTC | #1
On Jan 8, 2016, at 7:18 AM, Mike Frysinger <vapier@gentoo.org> wrote:

> On 08 Jan 2016 06:54, Oleg Endo wrote:
>> On Jan 8, 2016, at 4:39 AM, Mike Frysinger <vapier@gentoo.org> wrote:
>>> This file fails when building for SuperH as it assumes __SHMEDIA__ is
>>> always defined.  Update the code to check if it's defined.
>> 
>> This is OK for trunk.  Thanks for spotting it.
> 
> i had checked only the first case previously (as i don't have sh5
> systems), but there's a logic error in the second i fixed before
> committing.  this is what i merged:

SH5 has been obsoleted.  There are no known SH5 systems.  So it's fine if it just fixes some build issues.

Cheers,
Oleg

> --- include/longlong.h    (revision 232142)
> +++ include/longlong.h    (working copy)
> @@ -1086,7 +1086,7 @@ extern UDItype __umulsidi3 (USItype, USI
>   } while (0)
> #endif
> 
> -#if defined(__sh__) && !__SHMEDIA__ && W_TYPE_SIZE == 32
> +#if defined(__sh__) && (!defined (__SHMEDIA__) || !__SHMEDIA__) && W_TYPE_SIZE == 32
> #ifndef __sh1__
> #define umul_ppmm(w1, w0, u, v) \
>   __asm__ (                                \
> @@ -1159,7 +1159,7 @@ extern UDItype __umulsidi3 (USItype, USI
> 
> #endif /* __sh__ */
> 
> -#if defined (__SH5__) && __SHMEDIA__ && W_TYPE_SIZE == 32
> +#if defined (__SH5__) && defined (__SHMEDIA__) && __SHMEDIA__ && W_TYPE_SIZE == 32
> #define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
> #define count_leading_zeros(count, x) \
>   do                                    \
> -mike
diff mbox

Patch

--- include/longlong.h	(revision 232142)
+++ include/longlong.h	(working copy)
@@ -1086,7 +1086,7 @@  extern UDItype __umulsidi3 (USItype, USI
   } while (0)
 #endif
 
-#if defined(__sh__) && !__SHMEDIA__ && W_TYPE_SIZE == 32
+#if defined(__sh__) && (!defined (__SHMEDIA__) || !__SHMEDIA__) && W_TYPE_SIZE == 32
 #ifndef __sh1__
 #define umul_ppmm(w1, w0, u, v) \
   __asm__ (								\
@@ -1159,7 +1159,7 @@  extern UDItype __umulsidi3 (USItype, USI
 
 #endif /* __sh__ */
 
-#if defined (__SH5__) && __SHMEDIA__ && W_TYPE_SIZE == 32
+#if defined (__SH5__) && defined (__SHMEDIA__) && __SHMEDIA__ && W_TYPE_SIZE == 32
 #define __umulsidi3(u,v) ((UDItype)(USItype)u*(USItype)v)
 #define count_leading_zeros(count, x) \
   do									\