From 1f0a5f9615883c979118b2412c3185d882ad47ae Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Tue, 21 Feb 2023 13:35:04 +0100 Subject: [PATCH] (libretro-common) retro_endianness.h - Get rid of warning: #warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated [-Wcpp] # warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated ^~~~~~~ --- gfx/drivers_shader/shader_glsl.c | 3 ++- libretro-common/include/retro_endianness.h | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gfx/drivers_shader/shader_glsl.c b/gfx/drivers_shader/shader_glsl.c index fafa00ea71..62928fce26 100644 --- a/gfx/drivers_shader/shader_glsl.c +++ b/gfx/drivers_shader/shader_glsl.c @@ -1586,7 +1586,8 @@ static bool gl_glsl_set_coords(void *shader_data, } #if defined(VITA) - if (uni->time >= 0) { + if (uni->time >= 0) + { float t = (sceKernelGetSystemTimeWide()) / (scePowerGetArmClockFrequency() * 1000.0); glUniform1f(uni->time, t); } diff --git a/libretro-common/include/retro_endianness.h b/libretro-common/include/retro_endianness.h index aefffef802..46984638c8 100644 --- a/libretro-common/include/retro_endianness.h +++ b/libretro-common/include/retro_endianness.h @@ -74,28 +74,29 @@ static INLINE uint64_t SWAP64(uint64_t val) } #endif - -#if defined (LSB_FIRST) || defined (MSB_FIRST) -# warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated -# undef LSB_FIRST -# undef MSB_FIRST -#endif - #ifdef _MSC_VER /* MSVC pre-defines macros depending on target arch */ #if defined (_M_IX86) || defined (_M_AMD64) || defined (_M_ARM) || defined (_M_ARM64) +#ifndef LSB_FIRST #define LSB_FIRST 1 +#endif #elif _M_PPC +#ifndef MSB_FIRST #define MSB_FIRST 1 +#endif #else /* MSVC can run on _M_ALPHA and _M_IA64 too, but they're both bi-endian; need to find what mode MSVC runs them at */ #error "unknown platform, can't determine endianness" #endif #else #if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#ifndef MSB_FIRST #define MSB_FIRST 1 +#endif #elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#ifndef LSB_FIRST #define LSB_FIRST 1 +#endif #else #error "Invalid endianness macros" #endif