diff options
author | David Anderson <dvander@google.com> | 2022-01-28 14:13:56 -0800 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2022-01-28 14:18:25 -0800 |
commit | 192e910065f60f257b923b9d03cdb96648b05009 (patch) | |
tree | eb55e8154297aae5b247d9f8380d027cfef00789 | |
parent | 5ad50fd05e09eaf8bd27886bcc3ea1250c1c82e8 (diff) | |
download | extras-192e910065f60f257b923b9d03cdb96648b05009.tar.gz |
lpmake: Allow building on Windows.
Bug: 207825850
Test: mmm system/extras/partition_tools
Change-Id: I16d4bd515b5059f77d7a50e417943f56ebdf1dea
-rw-r--r-- | partition_tools/Android.bp | 5 | ||||
-rw-r--r-- | partition_tools/lpmake.cc | 9 |
2 files changed, 14 insertions, 0 deletions
diff --git a/partition_tools/Android.bp b/partition_tools/Android.bp index eb886327..c2800601 100644 --- a/partition_tools/Android.bp +++ b/partition_tools/Android.bp @@ -110,6 +110,11 @@ cc_binary_host { srcs: [ "lpmake.cc", ], + target: { + windows: { + enabled: true, + }, + }, } cc_binary_host { diff --git a/partition_tools/lpmake.cc b/partition_tools/lpmake.cc index ca9e62f9..e6c4e530 100644 --- a/partition_tools/lpmake.cc +++ b/partition_tools/lpmake.cc @@ -17,7 +17,9 @@ #include <getopt.h> #include <inttypes.h> #include <stdio.h> +#ifndef WIN32 #include <sysexits.h> +#endif #include <algorithm> #include <memory> @@ -34,6 +36,13 @@ using namespace android::fs_mgr; using android::base::Error; using android::base::Result; +#ifdef WIN32 +static constexpr int EX_OK = 0; +static constexpr int EX_USAGE = 1; +static constexpr int EX_SOFTWARE = 2; +static constexpr int EX_CANTCREAT = 3; +#endif + /* Prints program usage to |where|. */ static int usage(int /* argc */, char* argv[]) { fprintf(stderr, |