Merge "zip_writer.cc: update powerof2 and use it unconditionally"
This commit is contained in:
commit
b86e248e8b
1 changed files with 7 additions and 3 deletions
|
|
@ -30,9 +30,13 @@
|
||||||
#include "entry_name_utils-inl.h"
|
#include "entry_name_utils-inl.h"
|
||||||
#include "zip_archive_common.h"
|
#include "zip_archive_common.h"
|
||||||
|
|
||||||
#if !defined(powerof2)
|
#undef powerof2
|
||||||
#define powerof2(x) ((((x)-1) & (x)) == 0)
|
#define powerof2(x) \
|
||||||
#endif
|
({ \
|
||||||
|
__typeof__(x) _x = (x); \
|
||||||
|
__typeof__(x) _x2; \
|
||||||
|
__builtin_add_overflow(_x, -1, &_x2) ? 1 : ((_x2 & _x) == 0); \
|
||||||
|
})
|
||||||
|
|
||||||
/* Zip compression methods we support */
|
/* Zip compression methods we support */
|
||||||
enum {
|
enum {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue