diff options
Diffstat (limited to 'spice/macros.h')
-rw-r--r-- | spice/macros.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spice/macros.h b/spice/macros.h index 3538989..679d68d 100644 --- a/spice/macros.h +++ b/spice/macros.h @@ -414,4 +414,12 @@ #endif +#if SPICE_ENDIAN == SPICE_ENDIAN_LITTLE +#define SPICE_MAGIC_CONST(s) \ + ((uint32_t)((s[0]&0xffu)|((s[1]&0xffu)<<8)|((s[2]&0xff)<<16)|((s[3]&0xffu)<<24))) +#else +#define SPICE_MAGIC_CONST(s) \ + ((uint32_t)((s[3]&0xffu)|((s[2]&0xffu)<<8)|((s[1]&0xff)<<16)|((s[0]&0xffu)<<24))) +#endif + #endif /* _H_SPICE_MACROS */ |