diff options
author | 2016-12-02 15:11:08 +0000 | |
---|---|---|
committer | 2016-12-02 19:08:53 +0000 | |
commit | 479e18d7b2662bfa9b49de010fcc0942d5ae2d05 (patch) | |
tree | 757a4f259b37a0f83c59ce1e5785c9c33eeda977 /third_party/ijar/zip_main.cc | |
parent | a9a25ed309f45d61973ed284c101ec35eed20d20 (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_main.cc')
-rw-r--r-- | third_party/ijar/zip_main.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/third_party/ijar/zip_main.cc b/third_party/ijar/zip_main.cc index 74853dc757..13bcc69e8f 100644 --- a/third_party/ijar/zip_main.cc +++ b/third_party/ijar/zip_main.cc @@ -96,9 +96,8 @@ void concat_path(char* out, const size_t size, void UnzipProcessor::Process(const char* filename, const u4 attr, const u1* data, const size_t size) { - mode_t mode = zipattr_to_mode(attr); - mode_t perm = mode & 0777; - bool isdir = (mode & S_IFDIR) != 0; + mode_t perm = zipattr_to_perm(attr); + bool isdir = zipattr_is_dir(attr); if (attr == 0) { // Fallback when the external attribute is not set. isdir = filename[strlen(filename)-1] == '/'; @@ -164,9 +163,7 @@ int extract(char *zipfile, char* exdir, char **files, bool verbose, // add a file to the zip int add_file(std::unique_ptr<ZipBuilder> const &builder, char *file, char *zip_path, bool flatten, bool verbose, bool compress) { - Stat file_stat; - file_stat.total_size = 0; - file_stat.file_mode = 0666; + Stat file_stat = {0, 0666, false}; if (file != NULL) { if (!stat_file(file, &file_stat)) { return -1; @@ -204,7 +201,7 @@ int add_file(std::unique_ptr<ZipBuilder> const &builder, char *file, printf("%c %o %s\n", isdir ? 'd' : 'f', perm, path); } - u1 *buffer = builder->NewFile(path, mode_to_zipattr(file_stat.file_mode)); + u1 *buffer = builder->NewFile(path, stat_to_zipattr(file_stat)); if (isdir || file_stat.total_size == 0) { builder->FinishFile(0); } else { |