Skip to content

Commit ad9786c

Browse files
HybridDognerzhul
authored andcommittedSep 3, 2017
Add build date to minetest --version and increase readability (#6331)
1 parent 9f6d90a commit ad9786c

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed
 

‎src/config.h

-13
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55

66
#pragma once
77

8-
#define STRINGIFY(x) #x
9-
#define STR(x) STRINGIFY(x)
10-
11-
128
#if defined USE_CMAKE_CONFIG_H
139
#include "cmake_config.h"
1410
#elif defined (__ANDROID__) || defined (ANDROID)
@@ -28,12 +24,3 @@
2824
#define BUILD_TYPE "Debug"
2925
#endif
3026
#endif
31-
32-
#define BUILD_INFO "BUILD_TYPE=" BUILD_TYPE \
33-
" RUN_IN_PLACE=" STR(RUN_IN_PLACE) \
34-
" USE_GETTEXT=" STR(USE_GETTEXT) \
35-
" USE_SOUND=" STR(USE_SOUND) \
36-
" USE_CURL=" STR(USE_CURL) \
37-
" USE_FREETYPE=" STR(USE_FREETYPE) \
38-
" USE_LUAJIT=" STR(USE_LUAJIT) \
39-
" STATIC_SHAREDIR=" STR(STATIC_SHAREDIR)

‎src/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -322,11 +322,11 @@ static void print_allowed_options(const OptionList &allowed_options)
322322
static void print_version()
323323
{
324324
std::cout << PROJECT_NAME_C " " << g_version_hash
325-
<< " (" << porting::getPlatformName() << ")" << std::endl;
325+
<< " (" << porting::getPlatformName() << ")" << std::endl;
326326
#ifndef SERVER
327-
std::cout << "Using Irrlicht " << IRRLICHT_SDK_VERSION << std::endl;
327+
std::cout << "Using Irrlicht " IRRLICHT_SDK_VERSION << std::endl;
328328
#endif
329-
std::cout << "Build info: " << g_build_info << std::endl;
329+
std::cout << g_build_info << std::endl;
330330
}
331331

332332
static void list_game_ids()

‎src/version.cpp

+14-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,20 @@ with this program; if not, write to the Free Software Foundation, Inc.,
3131
#define VERSION_GITHASH VERSION_STRING
3232
#endif
3333

34+
#define STRINGIFY(x) #x
35+
#define STR(x) STRINGIFY(x)
3436

3537
const char *g_version_string = VERSION_STRING;
3638
const char *g_version_hash = VERSION_GITHASH;
37-
const char *g_build_info = "VER=" VERSION_GITHASH " " BUILD_INFO;
38-
39+
const char *g_build_info =
40+
#ifdef __STDC__
41+
"Build date: " __DATE__ " " __TIME__ "\n"
42+
#endif
43+
"BUILD_TYPE=" BUILD_TYPE "\n"
44+
"RUN_IN_PLACE=" STR(RUN_IN_PLACE) "\n"
45+
"USE_GETTEXT=" STR(USE_GETTEXT) "\n"
46+
"USE_SOUND=" STR(USE_SOUND) "\n"
47+
"USE_CURL=" STR(USE_CURL) "\n"
48+
"USE_FREETYPE=" STR(USE_FREETYPE) "\n"
49+
"USE_LUAJIT=" STR(USE_LUAJIT) "\n"
50+
"STATIC_SHAREDIR=" STR(STATIC_SHAREDIR);

0 commit comments

Comments
 (0)
Please sign in to comment.