defs: add widen_to_ulong macro
This is similar to widen_to_long, but for unsigned values. * defs.h (widen_to_ulong): New macro.
This commit is contained in:
parent
d44a77ca58
commit
714d68127a
8
defs.h
8
defs.h
@ -759,6 +759,14 @@ extern unsigned current_wordsize;
|
||||
# define widen_to_long(v) ((long)(v))
|
||||
#endif
|
||||
|
||||
#if SUPPORTED_PERSONALITIES > 1 && SIZEOF_LONG > 4
|
||||
# define widen_to_ulong(v) \
|
||||
(current_wordsize == 4 ? (unsigned long) (uint32_t) (v) : \
|
||||
(unsigned long) (v))
|
||||
#else
|
||||
# define widen_to_ulong(v) ((unsigned long)(v))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Zero-extend a signed integer type to unsigned long long.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user