Skip to content

Commit 587167e

Browse files
committedAug 9, 2014
Move #includes from version.h to version.cpp
1 parent 15f3713 commit 587167e

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed
 

Diff for: ‎src/client.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2196,8 +2196,8 @@ void Client::sendReady()
21962196
writeU8(os,VERSION_PATCH_ORIG);
21972197
writeU8(os,0);
21982198

2199-
writeU16(os,strlen(CMAKE_VERSION_GITHASH));
2200-
os.write(CMAKE_VERSION_GITHASH,strlen(CMAKE_VERSION_GITHASH));
2199+
writeU16(os,strlen(minetest_version_hash));
2200+
os.write(minetest_version_hash,strlen(minetest_version_hash));
22012201

22022202
// Make data buffer
22032203
std::string s = os.str();

Diff for: ‎src/version.cpp

+15-4
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,27 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2020
#include "version.h"
2121
#include "config.h"
2222

23-
const char *minetest_version_simple = CMAKE_VERSION_STRING;
24-
const char *minetest_version_hash = CMAKE_VERSION_GITHASH;
23+
#ifdef __ANDROID__
24+
#include "android_version.h"
25+
#elif defined(USE_CMAKE_CONFIG_H)
26+
#include "cmake_config_githash.h"
27+
#endif
28+
29+
#ifdef CMAKE_VERSION_GITHASH
30+
#define VERSION_GITHASH CMAKE_VERSION_GITHASH
31+
#else
32+
#define VERSION_GITHASH VERSION_STRING
33+
#endif
34+
35+
const char *minetest_version_simple = VERSION_STRING;
36+
const char *minetest_version_hash = VERSION_GITHASH;
2537

2638
#ifdef USE_CMAKE_CONFIG_H
2739
const char *minetest_build_info =
28-
"VER=" CMAKE_VERSION_GITHASH " " CMAKE_BUILD_INFO;
40+
"VER=" VERSION_GITHASH " " CMAKE_BUILD_INFO;
2941
#elif defined(ANDROID)
3042
const char *minetest_build_info = "android jni";
3143
#else
3244
const char *minetest_build_info = "non-cmake";
33-
3445
#endif
3546

Diff for: ‎src/version.h

-7
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
2020
#ifndef VERSION_HEADER
2121
#define VERSION_HEADER
2222

23-
#include "config.h"
24-
#ifdef __ANDROID__
25-
#include "android_version.h"
26-
#else
27-
#include "cmake_config_githash.h"
28-
#endif
29-
3023
extern const char *minetest_version_simple;
3124
extern const char *minetest_version_hash;
3225
extern const char *minetest_build_info;

0 commit comments

Comments
 (0)
Please sign in to comment.