Skip to content
  • Lioncash's avatar
    common/swap: Simplify swap function ifdefs · 9cb4b7be
    Lioncash authored
    Including every OS' own built-in byte swapping functions is kind of
    undesirable, since it adds yet another build path to ensure compilation
    succeeds on.
    
    Given we only support clang, GCC, and MSVC for the time being, we can
    utilize their built-in functions directly instead of going through the
    OS's API functions.
    
    This shrinks the overall code down to just
    
    if (msvc)
      use msvc's functions
    else if (clang or gcc)
      use clang/gcc's builtins
    else
      use the slow path
    9cb4b7be
Loading