From cba0858ccd74ba983f92d6b7dfc41c2a2d3bf398 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 14 Jul 2015 11:33:50 +0200 Subject: Fix for recent optimization commit in endian switch Pre-4.8 GCC had a bug which lead to non-exposed __builtin_bswap16() symbol. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52624 for details. --- source/blender/blenlib/BLI_endian_switch_inline.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenlib/BLI_endian_switch_inline.h') diff --git a/source/blender/blenlib/BLI_endian_switch_inline.h b/source/blender/blenlib/BLI_endian_switch_inline.h index 9c4e819399a..280503e9b93 100644 --- a/source/blender/blenlib/BLI_endian_switch_inline.h +++ b/source/blender/blenlib/BLI_endian_switch_inline.h @@ -42,7 +42,7 @@ BLI_INLINE void BLI_endian_switch_int16(short *val) } BLI_INLINE void BLI_endian_switch_uint16(unsigned short *val) { -#ifdef __GNUC__ +#if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 408)) /* gcc4.8+ only */ *val = __builtin_bswap16(*val); #else unsigned short tval = *val; -- cgit v1.2.3