mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-17 19:21:58 +02:00
Fix GCC version detection for GUINT*_SWAP_LE_BE
The #if condition as-written fails for any major >= 5 if minor < 3, e.g. GCC 14.2 and so on. Use the idiom described in the GCC docs [0] to avoid this. [0] https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html Fixes: 57878d6042366070e80a109bf113ac03abb86cfd
This commit is contained in:
parent
68388cf7f7
commit
be57844b38
@ -247,7 +247,7 @@ typedef const gchar * (*GTranslateFunc) (const gchar *str,
|
|||||||
*/
|
*/
|
||||||
#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
|
#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
|
||||||
|
|
||||||
# if __GNUC__ >= 4 && defined (__GNUC_MINOR__) && __GNUC_MINOR__ >= 3
|
# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
|
||||||
# define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((guint32) (val)))
|
# define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((guint32) (val)))
|
||||||
# define GUINT64_SWAP_LE_BE(val) ((guint64) __builtin_bswap64 ((guint64) (val)))
|
# define GUINT64_SWAP_LE_BE(val) ((guint64) __builtin_bswap64 ((guint64) (val)))
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user