Turn #error into exceptions
authorAndroid Tools Maintainers <android-tools-devel@lists.alioth.debian.org>
Sat, 28 May 2022 11:13:51 +0000 (12:13 +0100)
committerRoger Shimizu <rosh@debian.org>
Sat, 28 May 2022 11:13:51 +0000 (12:13 +0100)
Forwarded: not-needed

So the library can be built on non-Linux platforms too, although can't
guarauntee its functionality regarding that piece of code.

Gbp-Pq: Topic system/core
Gbp-Pq: Name throw-exception-on-unknown-os.patch

system/core/base/file.cpp

index 33daea21354e6a77ced518fdec504c59014b775f..f5077fe49544c97e5ef71e073930aaf423e4be6f 100644 (file)
@@ -461,7 +461,8 @@ std::string GetExecutablePath() {
   path[PATH_MAX - 1] = 0;
   return path;
 #else
-#error unknown OS
+#include <stdexcept>
+  throw std::runtime_error(std::string("Unknown OS!"));
 #endif
 }