"Fossies" - the Fresh Open Source Software Archive

Member "qt-everywhere-src-6.3.1/qtwebengine/src/3rdparty/chromium/base/third_party/cityhash/patches/0001-bswap-clang.patch" (8 Jun 2022, 610 Bytes) of package /linux/misc/qt-everywhere-src-6.3.1.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Diff source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 diff --git a/base/third_party/cityhash/city.cc b/base/third_party/cityhash/city.cc
    2 index b0d2294aabb3..2ab3db20f4fa 100644
    3 --- a/base/third_party/cityhash/city.cc
    4 +++ b/base/third_party/cityhash/city.cc
    5 @@ -35,7 +35,14 @@
    6  using std::make_pair;
    7  using std::pair;
    8  
    9 -#ifdef _MSC_VER
   10 +#if defined(__clang__)
   11 +
   12 +// Use builtins where possible. On Windows for instance, this may prevent a
   13 +// function call instead of emitting a single instruction.
   14 +#define bswap_32(x) __builtin_bswap32(x)
   15 +#define bswap_64(x) __builtin_bswap64(x)
   16 +
   17 +#elif _MSC_VER
   18  
   19  #include <stdlib.h>
   20  #define bswap_32(x) _byteswap_ulong(x)