From fb839a27fb8cab36b42c7e19bfd5281f98641676 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 15 Feb 2017 19:29:05 +0000 Subject: [PATCH] Include the compile-time GTK version in the build info. It's obvious to the trained eye whether GTK PuTTY was compiled against GTK2 or GTK3, but the untrained eye would probably appreciate a little help, and even the trained eye probably can't tell GTK 3.18 from 3.19 at a glance :-) --- Recipe | 12 ++++++------ misc.c | 11 +++++++++++ unix/gtkmisc.c | 6 ++++++ unix/unix.h | 5 +++++ unix/uxnogtk.c | 11 +++++++++++ 5 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 unix/uxnogtk.c diff --git a/Recipe b/Recipe index 9d011f5a..21f7971c 100644 --- a/Recipe +++ b/Recipe @@ -319,17 +319,17 @@ puttytel : [X] GTKTERM uxmisc misc ldisc settings uxsel U_BE_NOSSH + nogss gtkmain plink : [U] uxplink uxcons NONSSH UXSSH U_BE_ALL logging UXMISC uxsignal - + ux_x11 noterm + + ux_x11 noterm uxnogtk PUTTYGEN_UNIX = sshrsag sshdssg sshprime sshdes sshbn sshmd5 version + sshrand uxnoise sshsha misc sshrsa sshdss uxcons uxstore uxmisc + sshpubk sshaes sshsh256 sshsh512 IMPORT puttygen.res time tree234 - + uxgen notiming conf sshecc sshecdsag + + uxgen notiming conf sshecc sshecdsag uxnogtk puttygen : [U] cmdgen PUTTYGEN_UNIX cgtest : [UT] cgtest PUTTYGEN_UNIX -pscp : [U] pscp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC -psftp : [U] psftp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC +pscp : [U] pscp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC uxnogtk +psftp : [U] psftp uxsftp uxcons UXSSH BE_SSH SFTP wildcard UXMISC uxnogtk pageant : [X] uxpgnt uxagentc aqsync pageant sshrsa sshpubk sshdes sshbn + sshmd5 version tree234 misc sshaes sshsha sshdss sshsh256 sshsh512 @@ -345,8 +345,8 @@ puttyapp : [XT] GTKTERM uxmisc misc ldisc settings uxsel U_BE_ALL uxstore osxlaunch : [UT] osxlaunch fuzzterm : [UT] UXTERM CHARSET misc version uxmisc uxucs fuzzterm time settings - + uxstore be_none -testbn : [UT] testbn sshbn misc version conf tree234 uxmisc + + uxstore be_none uxnogtk +testbn : [UT] testbn sshbn misc version conf tree234 uxmisc uxnogtk testbn : [C] testbn sshbn misc version conf tree234 winmisc LIBS # ---------------------------------------------------------------------- diff --git a/misc.c b/misc.c index 391ea1ba..6cc81710 100644 --- a/misc.c +++ b/misc.c @@ -1183,6 +1183,17 @@ char *buildinfo(const char *newline) strbuf_catf(buf, " (_MSC_VER=%d)", (int)_MSC_VER); #endif +#ifdef BUILDINFO_GTK + { + char *gtk_buildinfo = buildinfo_gtk_version(); + if (gtk_buildinfo) { + strbuf_catf(buf, "%sCompiled against GTK version %s", + newline, gtk_buildinfo); + sfree(gtk_buildinfo); + } + } +#endif + #ifdef NO_SECURITY strbuf_catf(buf, "%sBuild option: NO_SECURITY", newline); #endif diff --git a/unix/gtkmisc.c b/unix/gtkmisc.c index 6ee68be2..23f26d07 100644 --- a/unix/gtkmisc.c +++ b/unix/gtkmisc.c @@ -200,3 +200,9 @@ void our_dialog_add_to_content_area(GtkWindow *dlg, GtkWidget *w, w, expand, fill, padding); #endif } + +char *buildinfo_gtk_version(void) +{ + return dupprintf("%d.%d.%d", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); +} diff --git a/unix/unix.h b/unix/unix.h index cf297db3..ea848d37 100644 --- a/unix/unix.h +++ b/unix/unix.h @@ -32,17 +32,22 @@ #define DEFAULT_CLIPBOARD GDK_SELECTION_CLIPBOARD /* OS X has no PRIMARY */ #define BUILDINFO_PLATFORM "OS X (GTK)" +#define BUILDINFO_GTK #elif defined NOT_X_WINDOWS #define BUILDINFO_PLATFORM "Unix (pure GTK)" +#define BUILDINFO_GTK #else #define BUILDINFO_PLATFORM "Unix (GTK + X11)" +#define BUILDINFO_GTK #endif +char *buildinfo_gtk_version(void); + struct Filename { char *path; }; diff --git a/unix/uxnogtk.c b/unix/uxnogtk.c new file mode 100644 index 00000000..c9028ebf --- /dev/null +++ b/unix/uxnogtk.c @@ -0,0 +1,11 @@ +/* + * uxnogtk.c: link into non-GUI Unix programs so that they can tell + * buildinfo about a lack of GTK. + */ + +#include "putty.h" + +char *buildinfo_gtk_version(void) +{ + return NULL; +} -- 2.45.1