Commit 7c565bce authored by Max Kellermann's avatar Max Kellermann

Main: move two more functions down

parent d17ff18e
...@@ -559,34 +559,6 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) ...@@ -559,34 +559,6 @@ MainConfigured(const struct options &options, const ConfigData &raw_config)
instance.BeginShutdownPartitions(); 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 #ifdef ANDROID
static void static void
...@@ -640,6 +612,30 @@ Java_org_musicpd_Bridge_shutdown(JNIEnv *, jclass) ...@@ -640,6 +612,30 @@ Java_org_musicpd_Bridge_shutdown(JNIEnv *, jclass)
#else #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 int
main(int argc, char *argv[]) noexcept main(int argc, char *argv[]) noexcept
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment