Removed all #ifdef VERSION, since VERSION is necessary to set the user-agent

for the news server, so we detect any problems with VERSION at compile time.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8106 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-03-29 22:25:20 +00:00
parent 952a8ed312
commit ca651b37b3
3 changed files with 0 additions and 14 deletions

View File

@ -458,10 +458,8 @@ 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());
#ifdef VERSION
std::string uagent = (std::string)"SuperTuxKart/" + VERSION;
curl_easy_setopt(session, CURLOPT_USERAGENT, uagent.c_str());
#endif
std::string fout;
@ -493,10 +491,8 @@ 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());
#ifdef VERSION
std::string uagent = (std::string)"SuperTuxKart/" + VERSION;
curl_easy_setopt(session, CURLOPT_USERAGENT, uagent.c_str());
#endif
FILE * fout = fopen(file_manager->getAddonsFile(save_filename).c_str(),
"wb");

View File

@ -363,9 +363,7 @@ int handleCmdLinePreliminary(int argc, char **argv)
else if( !strcmp(argv[i], "--version") || !strcmp(argv[i], "-V") )
{
printf("==============================\n");
#ifdef VERSION
fprintf ( stdout, "SuperTuxKart, %s.\n", VERSION ) ;
#endif
#ifdef SVNVERSION
fprintf ( stdout, "SuperTuxKart, SVN revision number '%s'.\n", SVNVERSION ) ;
#endif

View File

@ -171,13 +171,7 @@ void History::Save()
World *world = World::getWorld();
int num_karts = world->getNumKarts();
#ifdef VERSION
fprintf(fd, "Version: %s\n", VERSION);
#elif defined(SVNVERSION)
fprintf(fd, "Version: %s\n", SVNVERSION);
#else
fprintf(fd, "Version: unknown\n");
#endif
fprintf(fd, "numkarts: %d\n", num_karts);
fprintf(fd, "numplayers: %d\n", race_manager->getNumPlayers());
fprintf(fd, "difficulty: %d\n", race_manager->getDifficulty());
@ -256,13 +250,11 @@ void History::Load()
}
else
{
#ifdef VERSION
if (strcmp(s1,VERSION))
{
fprintf(stderr, "WARNING: history is version '%s'\n",s1);
fprintf(stderr, " STK version is '%s'\n",VERSION);
}
#endif
}
if (fgets(s, 1023, fd) == NULL)