Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f1e95e0 authored by Nick Kralevich's avatar Nick Kralevich Committed by android-build-merger
Browse files

Merge "zip_writer.cc: update powerof2 and use it unconditionally" am: b86e248e am: 0fd9adf7

am: 707d0b6d

Change-Id: Iac67cf33d1bd51920cd06741f9e39ab3ccabf3b8
parents 2a1fb093 707d0b6d
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -30,9 +30,13 @@
#include "entry_name_utils-inl.h"
#include "zip_archive_common.h"

#if !defined(powerof2)
#define powerof2(x) ((((x)-1) & (x)) == 0)
#endif
#undef powerof2
#define powerof2(x)                                               \
  ({                                                              \
    __typeof__(x) _x = (x);                                       \
    __typeof__(x) _x2;                                            \
    __builtin_add_overflow(_x, -1, &_x2) ? 1 : ((_x2 & _x) == 0); \
  })

/* Zip compression methods we support */
enum {