]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Unix buildinfo: stop saying 'GTK' in pure CLI utilities.
authorSimon Tatham <anakin@pobox.com>
Wed, 22 Feb 2017 22:10:05 +0000 (22:10 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 22 Feb 2017 22:10:05 +0000 (22:10 +0000)
Unix PSCP, PSFTP, Plink and PuTTYgen now just report their build
platform as '64-bit Unix' or '32-bit Unix', without mentioning
irrelevant details of what flavour of GTK the other tools in the suite
might have been built against.

(In particular, they now won't imply anything outright untrue if there
was no GTK present at build time at all!)

cmdgen.c
fuzzterm.c
testbn.c
unix/gtkapp.c
unix/gtkask.c
unix/gtkmain.c
unix/unix.h
unix/uxplink.c
unix/uxsftp.c

index f1cf977086512d82a516b9868756475feb0bd1ef..9d9d011ab7727fafeba728dbe05aafd64b795be4 100644 (file)
--- a/cmdgen.c
+++ b/cmdgen.c
@@ -227,6 +227,9 @@ static char *readpassphrase(const char *filename)
 
 #define DEFAULT_RSADSA_BITS 2048
 
+/* For Unix in particular, but harmless if this main() is reused elsewhere */
+const int buildinfo_gtk_relevant = FALSE;
+
 int main(int argc, char **argv)
 {
     char *infile = NULL;
index 21e7b12aa5a041ace211a6cda4315b2496a29314..15b5d63546616fab90c76e5d9f5713d6189e767c 100644 (file)
@@ -6,6 +6,9 @@
 #include "putty.h"
 #include "terminal.h"
 
+/* For Unix in particular, but harmless if this main() is reused elsewhere */
+const int buildinfo_gtk_relevant = FALSE;
+
 int main(int argc, char **argv)
 {
        char blk[512];
index 2ea4f459cd5c20661915da4244f7a18700249d7e..05f62767c5cb32bf854892d8c389f7db4e88bbec 100644 (file)
--- a/testbn.c
+++ b/testbn.c
@@ -33,6 +33,9 @@ int random_byte(void)
 
 #define fromxdigit(c) ( (c)>'9' ? ((c)&0xDF) - 'A' + 10 : (c) - '0' )
 
+/* For Unix in particular, but harmless if this main() is reused elsewhere */
+const int buildinfo_gtk_relevant = FALSE;
+
 int main(int argc, char **argv)
 {
     char *buf;
index 249be2d39269fea334b2743c1835c76854462455..8b2a794fc6291633adab7e6a230172b67a55541e 100644 (file)
@@ -127,6 +127,8 @@ https://wiki.gnome.org/Projects/GTK%2B/OSX/Bundling has some links.
 
 char *x_get_default(const char *key) { return NULL; }
 
+const int buildinfo_gtk_relevant = TRUE;
+
 #if !GTK_CHECK_VERSION(3,0,0)
 /* This front end only works in GTK 3. If that's not what we've got,
  * it's easier to just turn this program into a trivial stub by ifdef
index c2b582e9c9afe29e29a2d0befaf5c6dd3453ecca..8493807bab40df676fd00464893dca53f6ff8d75 100644 (file)
@@ -473,6 +473,8 @@ static int setup_gtk(const char *display)
     return ret;
 }
 
+const int buildinfo_gtk_relevant = TRUE;
+
 char *gtk_askpass_main(const char *display, const char *wintitle,
                        const char *prompt, int *success)
 {
index c681b93d825d174e726a6ead9e679e0001f0ca0b..c80da702ae3033078896a553d45ff5e119976af4 100644 (file)
@@ -542,6 +542,8 @@ GtkWidget *make_gtk_toplevel_window(void *frontend)
 
 extern int cfgbox(Conf *conf);
 
+const int buildinfo_gtk_relevant = TRUE;
+
 int main(int argc, char **argv)
 {
     Conf *conf;
index ea848d3744ace1499ffb514e61d19db00c2db658..7ab2ca24f229cbab0de48d9d8293c04d76b850e5 100644 (file)
 #define JUST_USE_GTK_CLIPBOARD_UTF8 /* low-level gdk_selection_* fails */
 #define DEFAULT_CLIPBOARD GDK_SELECTION_CLIPBOARD /* OS X has no PRIMARY */
 
-#define BUILDINFO_PLATFORM "OS X (GTK)"
+#define BUILDINFO_PLATFORM_GTK "OS X (GTK)"
 #define BUILDINFO_GTK
 
 #elif defined NOT_X_WINDOWS
 
-#define BUILDINFO_PLATFORM "Unix (pure GTK)"
+#define BUILDINFO_PLATFORM_GTK "Unix (pure GTK)"
 #define BUILDINFO_GTK
 
 #else
 
-#define BUILDINFO_PLATFORM "Unix (GTK + X11)"
+#define BUILDINFO_PLATFORM_GTK "Unix (GTK + X11)"
 #define BUILDINFO_GTK
 
 #endif
 
+/* BUILDINFO_PLATFORM varies its expansion between the GTK and
+ * pure-CLI utilities, so that Unix Plink, PSFTP etc don't announce
+ * themselves incongruously as having something to do with GTK. */
+#define BUILDINFO_PLATFORM_CLI "Unix"
+extern const int buildinfo_gtk_relevant;
+#define BUILDINFO_PLATFORM (buildinfo_gtk_relevant ? \
+                            BUILDINFO_PLATFORM_GTK : BUILDINFO_PLATFORM_CLI)
+
 char *buildinfo_gtk_version(void);
 
 struct Filename {
index a2607fbb9d32753479ccde2bb7c1e8b6d5eed1cc..2d4259b91abd5e80ae955c8f1047a38777f632f1 100644 (file)
@@ -607,6 +607,8 @@ void frontend_net_error_pending(void) {}
 const int share_can_be_downstream = TRUE;
 const int share_can_be_upstream = TRUE;
 
+const int buildinfo_gtk_relevant = FALSE;
+
 int main(int argc, char **argv)
 {
     int sending;
index 794cc9cbda7e0099c0794ec79a2083a1c16ed05b..56f7a13675960a806dda63c713264559f811e0af 100644 (file)
@@ -622,6 +622,8 @@ void frontend_net_error_pending(void) {}
 
 void platform_psftp_pre_conn_setup(void) {}
 
+const int buildinfo_gtk_relevant = FALSE;
+
 /*
  * Main program: do platform-specific initialisation and then call
  * psftp_main().