diff --git a/src/addons/network_http.cpp b/src/addons/network_http.cpp index ebf49d379..6ee37caab 100644 --- a/src/addons/network_http.cpp +++ b/src/addons/network_http.cpp @@ -454,7 +454,7 @@ bool NetworkHttp::conditionFulfilled(const std::string &cond) if(cond[0]=="stkversion") { int news_version = versionToInt(cond[2]); - int stk_version = versionToInt(VERSION); + int stk_version = versionToInt(STK_VERSION); if(cond[1]=="=") { if(news_version!=stk_version) return false; @@ -574,7 +574,7 @@ std::string NetworkHttp::downloadToStrInternal(std::string url) std::string full_url = (std::string)UserConfigParams::m_server_addons + "/" + url; curl_easy_setopt(session, CURLOPT_URL, full_url.c_str()); - std::string uagent = (std::string)"SuperTuxKart/" + VERSION; + std::string uagent = (std::string)"SuperTuxKart/" + STK_VERSION; curl_easy_setopt(session, CURLOPT_USERAGENT, uagent.c_str()); std::string fout; @@ -607,7 +607,7 @@ bool NetworkHttp::downloadFileInternal(const std::string &file, std::string full_url = (std::string)UserConfigParams::m_server_addons + "/" + file; curl_easy_setopt(session, CURLOPT_URL, full_url.c_str()); - std::string uagent = (std::string)"SuperTuxKart/" + VERSION; + std::string uagent = (std::string)"SuperTuxKart/" + STK_VERSION; curl_easy_setopt(session, CURLOPT_USERAGENT, uagent.c_str()); FILE * fout = fopen(file_manager->getAddonsFile(save_filename).c_str(), "wb"); diff --git a/src/main.cpp b/src/main.cpp index df7bd3c16..e5af0748a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -364,12 +364,9 @@ int handleCmdLinePreliminary(int argc, char **argv) else if( !strcmp(argv[i], "--version") || !strcmp(argv[i], "-V") ) { printf("==============================\n"); - fprintf ( stdout, "SuperTuxKart, %s.\n", VERSION ) ; + fprintf ( stdout, "SuperTuxKart, %s.\n", STK_VERSION ) ; #ifdef SVNVERSION fprintf ( stdout, "SuperTuxKart, SVN revision number '%s'.\n", SVNVERSION ) ; -#endif -#if !defined(VERSION) && !defined(SVNVERSION) - fprintf ( stdout, "SuperTuxKart, unknown version\n" ) ; #endif printf("==============================\n"); exit(0); diff --git a/src/race/history.cpp b/src/race/history.cpp index 64624f036..1ab411177 100644 --- a/src/race/history.cpp +++ b/src/race/history.cpp @@ -172,7 +172,7 @@ void History::Save() World *world = World::getWorld(); int num_karts = world->getNumKarts(); - fprintf(fd, "Version: %s\n", VERSION); + fprintf(fd, "Version: %s\n", STK_VERSION); fprintf(fd, "numkarts: %d\n", num_karts); fprintf(fd, "numplayers: %d\n", race_manager->getNumPlayers()); fprintf(fd, "difficulty: %d\n", race_manager->getDifficulty()); @@ -251,10 +251,10 @@ void History::Load() } else { - if (strcmp(s1,VERSION)) + if (strcmp(s1,STK_VERSION)) { fprintf(stderr, "WARNING: history is version '%s'\n",s1); - fprintf(stderr, " STK version is '%s'\n",VERSION); + fprintf(stderr, " STK version is '%s'\n",STK_VERSION); } } diff --git a/src/utils/constants.cpp b/src/utils/constants.cpp index 6b248dca2..ca21ccd99 100644 --- a/src/utils/constants.cpp +++ b/src/utils/constants.cpp @@ -26,4 +26,4 @@ static const char* endianness_test_ptr = (const char*)&endianness_test; // in little-endian, byte 0 will be 0. in big endian, byte 0 will be 1 bool IS_LITTLE_ENDIAN = (endianness_test_ptr[0] == 0); -const char* VERSION = "svn"; +const char* STK_VERSION = "svn"; diff --git a/src/utils/constants.hpp b/src/utils/constants.hpp index 587cc2e4a..ef36614a5 100644 --- a/src/utils/constants.hpp +++ b/src/utils/constants.hpp @@ -53,6 +53,6 @@ extern bool IS_LITTLE_ENDIAN; #define DEFAULT_GROUP_NAME "standard" -extern char* VERSION; +extern char* STK_VERSION; #endif