mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
gmacros: Ensure GUINT32/64_SWAP_LE_BE macros parenthesize arguments
Like all macros, we need to parenthesize arguments to ensure the order of operations is correct. See the mail thread starting at <http://lists.fedoraproject.org/pipermail/devel/2013-March/180302.html> "GCC produced wrong code in gvfs-1.14.2-3.fc18.x86_64" for how this caused trouble with GVFS (which in turn caused trouble with LibreOffice, where running "soffice sftp://.../.../test.odt" to access an .odt file via GVFS failed to properly type-detect that file as a Writer document and produced bogus error messages about the file being broken). https://bugzilla.gnome.org/show_bug.cgi?id=695925
This commit is contained in:
parent
55a235d377
commit
255c65f83c
@ -183,8 +183,8 @@ typedef const gchar * (*GTranslateFunc) (const gchar *str,
|
||||
#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
|
||||
|
||||
# if __GNUC__ >= 4 && defined (__GNUC_MINOR__) && __GNUC_MINOR__ >= 3
|
||||
# define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((gint32) val))
|
||||
# define GUINT64_SWAP_LE_BE(val) ((guint64) __builtin_bswap64 ((gint64) val))
|
||||
# define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((gint32) (val)))
|
||||
# define GUINT64_SWAP_LE_BE(val) ((guint64) __builtin_bswap64 ((gint64) (val)))
|
||||
# endif
|
||||
|
||||
# if defined (__i386__)
|
||||
|
Loading…
Reference in New Issue
Block a user