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:
Stephan Bergmann 2013-03-15 17:30:24 +01:00 committed by Colin Walters
parent 55a235d377
commit 255c65f83c

View File

@ -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__)