Skip to content

Commit

Permalink
(libretro-common) retro_endianness.h - Get rid of warning: #warning D…
Browse files Browse the repository at this point in the history
…efining MSB_FIRST and LSB_FIRST in compile options is deprecated [-Wcpp]

 #  warning Defining MSB_FIRST and LSB_FIRST in compile options is deprecated
    ^~~~~~~
  • Loading branch information
LibretroAdmin committed Feb 21, 2023
1 parent 8eff57f commit 1f0a5f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion gfx/drivers_shader/shader_glsl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
15 changes: 8 additions & 7 deletions libretro-common/include/retro_endianness.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1f0a5f9

Please sign in to comment.