Skip to content

Commit

Permalink
ABOUT: Further changes to version display
Browse files Browse the repository at this point in the history
  • Loading branch information
deurk committed Apr 16, 2020
1 parent 4a65118 commit 3803d55
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 35 deletions.
27 changes: 5 additions & 22 deletions src/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@

#include "qwsvdef.h"

/*
=======================
VersionString
======================
*/
char *VersionString (void)
{
return VERSION_NUMBER " (build " GIT_COMMIT ")";
}

/*
=======================
VersionStringFull
Expand All @@ -47,19 +37,12 @@ char *VersionStringFull (void)
static char str[256];

if (!str[0]) {
snprintf(str, sizeof(str), SERVER_NAME " " VERSION_NUMBER " (" QW_PLATFORM " build " GIT_COMMIT ")");
if (GIT_COMMIT) {
snprintf(str, sizeof(str), SERVER_NAME " " VERSION_NUMBER);
} else {
snprintf(str, sizeof(str), SERVER_NAME " " VERSION_NUMBER " (build " GIT_COMMIT "/" QW_PLATFORM_SHORT ")");
}
}

return str;
}

/*
=======================
Version_f
======================
*/
void Version_f (void)
{
Con_Printf ("%s\n%s\nHome page: %s\n", VersionStringFull(), BUILD_DATE, HOMEPAGE_URL);
}

2 changes: 1 addition & 1 deletion src/sv_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3799,7 +3799,7 @@ void Host_Init (int argc, char **argv, int default_memsize)

Con_Printf ("%4.1f megabyte heap\n", (float)hunk_size / (1024 * 1024));
Con_Printf ("QuakeWorld Initialized\n");
Version_f();
Con_Printf (VersionStringFull());

Cbuf_InsertText ("exec server.cfg\n");

Expand Down
22 changes: 10 additions & 12 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,39 +25,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#if defined(_WIN32)
#define QW_PLATFORM "Windows"
#define QW_PLATFORM_SHORT "(w)"
#define QW_PLATFORM_SHORT "w"

#elif defined(__FreeBSD__)
#define QW_PLATFORM "FreeBSD"
#define QW_PLATFORM_SHORT "(f)"
#define QW_PLATFORM_SHORT "f"

#elif defined(__OpenBSD__)
#define QW_PLATFORM "OpenBSD"
#define QW_PLATFORM_SHORT "(o)"
#define QW_PLATFORM_SHORT "o"

#elif defined(__NetBSD__)
#define QW_PLATFORM "NetBSD"
#define QW_PLATFORM_SHORT "(n)"
#define QW_PLATFORM_SHORT "n"

#elif defined(__DragonFly__)
#define QW_PLATFORM "DragonFly"
#define QW_PLATFORM_SHORT "(d)"
#define QW_PLATFORM_SHORT "d"

#elif defined(__linux__)
#define QW_PLATFORM "Linux"
#define QW_PLATFORM_SHORT "(l)"
#define QW_PLATFORM_SHORT "l"

#elif defined(__sun__)
#define QW_PLATFORM "SunOS"
#define QW_PLATFORM_SHORT "(s)"
#define QW_PLATFORM_SHORT "s"

#elif defined(__APPLE__)
#define QW_PLATFORM "MacOS"
#define QW_PLATFORM_SHORT "(m)"
#define QW_PLATFORM_SHORT "m"

#else
#define QW_PLATFORM "Unknown"
#define QW_PLATFORM_SHORT "(u)"
#define QW_PLATFORM_SHORT "u"
#endif


Expand All @@ -67,14 +67,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SERVER_NAME "MVDSV"
#define HOMEPAGE_URL "https://github.com/deurk/mvdsv"
#define BUILD_DATE __DATE__ ", " __TIME__
#define GIT_COMMIT "unknown"
#define GIT_COMMIT ""


#define QWDTOOLS_NAME "QWDtools"

char *VersionString (void);
char *VersionStringFull (void);
void Version_f (void);

#endif /* !__VERSION_H__ */

0 comments on commit 3803d55

Please sign in to comment.