From 7c565bce1d84358609f85d9b16580cfe0471dd95 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 29 May 2019 22:20:02 +0200 Subject: [PATCH] Main: move two more functions down --- src/Main.cxx | 52 ++++++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/src/Main.cxx b/src/Main.cxx index b690ca6ab..2b3682507 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -559,34 +559,6 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) instance.BeginShutdownPartitions(); } -#ifndef ANDROID - -static inline void -MainOrThrow(int argc, char *argv[]) -{ - struct options options; - ConfigData raw_config; - - ParseCommandLine(argc, argv, options, raw_config); - - MainConfigured(options, raw_config); -} - -int mpd_main(int argc, char *argv[]) noexcept -{ - AtScopeExit() { log_deinit(); }; - - try { - MainOrThrow(argc, argv); - return EXIT_SUCCESS; - } catch (...) { - LogError(std::current_exception()); - return EXIT_FAILURE; - } -} - -#endif /* !ANDROID */ - #ifdef ANDROID static void @@ -640,6 +612,30 @@ Java_org_musicpd_Bridge_shutdown(JNIEnv *, jclass) #else +static inline void +MainOrThrow(int argc, char *argv[]) +{ + struct options options; + ConfigData raw_config; + + ParseCommandLine(argc, argv, options, raw_config); + + MainConfigured(options, raw_config); +} + +int mpd_main(int argc, char *argv[]) noexcept +{ + AtScopeExit() { log_deinit(); }; + + try { + MainOrThrow(argc, argv); + return EXIT_SUCCESS; + } catch (...) { + LogError(std::current_exception()); + return EXIT_FAILURE; + } +} + int main(int argc, char *argv[]) noexcept {