aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar/zip.h
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2016-12-02 15:11:08 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-12-02 19:08:53 +0000
commit479e18d7b2662bfa9b49de010fcc0942d5ae2d05 (patch)
tree757a4f259b37a0f83c59ce1e5785c9c33eeda977 /third_party/ijar/zip.h
parenta9a25ed309f45d61973ed284c101ec35eed20d20 (diff)
Ijar: can be compiled with MSVC
We can now build //third_party/ijar/...:all with --cpu=x64_windows_msvc. We also have to use --output_user_root=/c/tmp or something similarly short because //third_party/zlib tickles https://github.com/bazelbuild/bazel/issues/2145 This change takes us closer to compiling Bazel with MSVC. See https://github.com/bazelbuild/bazel/issues/2107 -- PiperOrigin-RevId: 140846600 MOS_MIGRATED_REVID=140846600
Diffstat (limited to 'third_party/ijar/zip.h')
-rw-r--r--third_party/ijar/zip.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/third_party/ijar/zip.h b/third_party/ijar/zip.h
index 15b0198bb2..dfd3595ad5 100644
--- a/third_party/ijar/zip.h
+++ b/third_party/ijar/zip.h
@@ -31,14 +31,9 @@ namespace devtools_ijar {
// mode might not be set in DOS zip files.
inline bool zipattr_is_dir(u4 attr) { return (attr & 0x10) != 0; }
-// Convert a Unix file mode to a ZIP file attribute
-inline u4 mode_to_zipattr(mode_t m) {
- return (((u4) m) << 16) + ((m & S_IFDIR) != 0 ? 0x10 : 0);
-}
-
-// Convert a ZIP file attribute to a Unix file mode
-inline mode_t zipattr_to_mode(u4 attr) {
- return ((mode_t) ((attr >> 16) & 0xffff));
+// Convert a ZIP file attribute to a Unix file permission mask.
+inline mode_t zipattr_to_perm(u4 attr) {
+ return ((mode_t)((attr >> 16) & 0777));
}
//