From: John Darrington Date: Sat, 11 Jul 2020 04:55:28 +0000 (+0200) Subject: Revert "Conditional Compilation per GCS 3.5" X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=488451780dfdccdb7361645ed7a7a2228168ba0e;p=pspp Revert "Conditional Compilation per GCS 3.5" This reverts commit 002a30f274ced97769ebc3373c493a8e5329c2bc. --- diff --git a/src/ui/gui/main.c b/src/ui/gui/main.c index ecb07f83ff..51d225765c 100644 --- a/src/ui/gui/main.c +++ b/src/ui/gui/main.c @@ -1,6 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2004, 2005, 2006, 2010, 2011, 2012, 2013, 2014, 2015, 2016, - 2020 Free Software Foundation + Copyright (C) 2004, 2005, 2006, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,12 +20,8 @@ #include #include -#include -#include #if ENABLE_RELOCATABLE && defined(__APPLE__) -static const bool apple_relocatable = true; -#else -static const bool apple_relocatable = false; +#include #endif #include "language/lexer/include-path.h" @@ -322,6 +317,7 @@ process_pre_start_arguments (int *argc, char ***argv) g_option_context_free (oc); } +#if ENABLE_RELOCATABLE && defined(__APPLE__) static void pspp_macos_setenv (const char * progname) { @@ -378,29 +374,30 @@ pspp_macos_setenv (const char * progname) } } } +#endif int main (int argc, char *argv[]) { - if (apple_relocatable) + +#if ENABLE_RELOCATABLE && defined(__APPLE__) + /* remove MacOS session identifier from the command line args */ + gint newargc = 0; + for (gint i = 0; i < argc; i++) { - /* remove MacOS session identifier from the command line args */ - gint newargc = 0; - for (gint i = 0; i < argc; i++) + if (!g_str_has_prefix (argv[i], "-psn_")) { - if (!g_str_has_prefix (argv[i], "-psn_")) - { - argv[newargc] = argv[i]; - newargc++; - } + argv[newargc] = argv[i]; + newargc++; } - if (argc > newargc) - { - argv[newargc] = NULL; /* glib expects NULL terminated array */ - argc = newargc; - } - pspp_macos_setenv (argv[0]); } + if (argc > newargc) + { + argv[newargc] = NULL; /* glib expects NULL terminated array */ + argc = newargc; + } + pspp_macos_setenv (argv[0]); +#endif set_program_name (argv[0]);