1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Unix buildinfo: stop saying 'GTK' in pure CLI utilities.

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!)
This commit is contained in:
Simon Tatham 2017-02-22 22:10:05 +00:00
parent 51732faeb9
commit 3f29d939ee
9 changed files with 30 additions and 3 deletions

View File

@ -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;

View 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];

View File

@ -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;

View 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

View 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)
{

View 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;

View File

@ -31,21 +31,29 @@
#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 {

View 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;

View 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().