diff options
| author | 2015-04-03 12:08:26 -0700 | |
|---|---|---|
| committer | 2015-04-03 12:33:02 -0700 | |
| commit | ca2fc353c2b07e24e297fdc8426c7abd601d908b (patch) | |
| tree | 2f9242af3558209ac265fb7d2d1164652f78d8de /tools/aapt2/Main.cpp | |
| parent | 7e3a19ac85d30abade971d8d0a948b4599d97c9e (diff) | |
Fix windows build of AAPT2
Change-Id: Ib8e1a4322510b582e9600a08d3118842c9abc73c
Diffstat (limited to 'tools/aapt2/Main.cpp')
| -rw-r--r-- | tools/aapt2/Main.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp index f4e80c552c7b..cfc5874cdd7f 100644 --- a/tools/aapt2/Main.cpp +++ b/tools/aapt2/Main.cpp @@ -171,6 +171,9 @@ bool loadBinaryResourceTable(std::shared_ptr<ResourceTable> table, const Source& } bool loadResTable(android::ResTable* table, const Source& source) { + // For NO_ERROR (which on Windows is a MACRO). + using namespace android; + std::ifstream ifs(source.path, std::ifstream::in | std::ifstream::binary); if (!ifs) { Logger::error(source) << strerror(errno) << std::endl; @@ -187,7 +190,7 @@ bool loadResTable(android::ResTable* table, const Source& source) { char* buf = new char[dataSize]; ifs.read(buf, dataSize); - bool result = table->add(buf, dataSize, -1, true) == android::NO_ERROR; + bool result = table->add(buf, dataSize, -1, true) == NO_ERROR; delete [] buf; return result; @@ -426,6 +429,8 @@ struct AaptOptions { }; bool compileAndroidManifest(std::shared_ptr<Resolver> resolver, const AaptOptions& options) { + using namespace android; + Source outSource = options.output; appendPath(&outSource.path, "AndroidManifest.xml"); @@ -456,8 +461,8 @@ bool compileAndroidManifest(std::shared_ptr<Resolver> resolver, const AaptOption p += b.size; } - android::ResXMLTree tree; - if (tree.setTo(data.get(), outBuffer.size()) != android::NO_ERROR) { + ResXMLTree tree; + if (tree.setTo(data.get(), outBuffer.size()) != NO_ERROR) { return false; } |