]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/BrotliCompress/enc/fast_log.h
BaseTools: Update Brotli Compress to the latest one 1.0.6
[mirror_edk2.git] / BaseTools / Source / C / BrotliCompress / enc / fast_log.h
index b59ff7dbd549b453a3106bc72fd3829891dabce9..dabc45ee96b828928cf4b065ef57c265b67ffc2d 100644 (file)
 \r
 #include <math.h>\r
 \r
-#include "../common/types.h"\r
-#include "../common/port.h"\r
+#include "../common/platform.h"\r
+#include <brotli/types.h>\r
 \r
 #if defined(__cplusplus) || defined(c_plusplus)\r
 extern "C" {\r
 #endif\r
 \r
 static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) {\r
-#ifdef __GNUC__\r
+  /* TODO: generalize and move to platform.h */\r
+#if BROTLI_GNUC_HAS_BUILTIN(__builtin_clz, 3, 4, 0) || \\r
+    BROTLI_INTEL_VERSION_CHECK(16, 0, 0)\r
   return 31u ^ (uint32_t)__builtin_clz((uint32_t)n);\r
 #else\r
   uint32_t result = 0;\r