libsdl-org / SDL-1.2

Simple Directmedia Layer, 1.2 branch ... ***DEPRECATED***, please use https://github.com/libsdl-org/SDL for new projects!
https://libsdl.org
GNU Lesser General Public License v2.1
98 stars 81 forks source link

Backport SDL_endian.h changes from SDL2 #852

Closed ccawley2011 closed 2 years ago

sezero commented 2 years ago
  1. the SDL2 version of SDL_endian.h just now received two commits, i.e. especially aarch64 parts of this commit is unwanted.

  2. The clang-cl-specific _m_prefetch parts are possibly not needed

Even with those, the merge has little to offer - I'd like to keep this one out (and yes I myself was first tempted at a very similar merge but then quit.) @icculus, @slouken: My vote is not to merge. Comments?

ccawley2011 commented 2 years ago

I dropped the bits you mentioned, but this PR still offers improvements since __builtin_bswap16, __builtin_bswap32 and __builtin_bswap64 is now used on all architectures when available, not just AArch64.

sezero commented 2 years ago

I dropped the bits you mentioned, but this PR still offers improvements since __builtin_bswap16, __builtin_bswap32 and __builtin_bswap64 is now used on all architectures when available, not just AArch64.

@icculus, @slouken: Comments?

If we are to merge it though, I'd suggest keeping _SDL_HAS_BUILTIN macro private to SDL_endian.h and undefine it at the end among others (i.e. see sdl12-compat which does that.)

icculus commented 2 years ago

I'm fine with whatever for 1.2. Do whatever you think is best here.

slouken commented 2 years ago

SDL 1.2 is deprecated and we're only merging critical fixes. Please devote any 1.2 energy to improving sdl12-compat, which is planned to replace SDL 1.2 on various platforms.