Fixed broken compilation on linux and macs.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2346 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2008-10-17 00:05:59 +00:00
parent b1de626e3e
commit 1d259bad84

View File

@@ -18,9 +18,12 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stk_config.hpp"
#if defined(WIN32) && !defined(__CYGWIN__)
# define snprintf _snprintf
#endif
#include <stdexcept>
#include <stdio.h>
#if defined(WIN32) && !defined(__CYGWIN__)
# define snprintf _snprintf
#endif
#include "file_manager.hpp"
#include "lisp/parser.hpp"
@@ -38,30 +41,30 @@ float STKConfig::UNDEFINED = -99.9f;
*/
void STKConfig::load(const std::string &filename)
{
const lisp::Lisp* root = 0;
try
{
lisp::Parser parser;
root = parser.parse(filename);
const lisp::Lisp* const LISP = root->getLisp("config");
if(!LISP)
{
char msg[MAX_ERROR_MESSAGE_LENGTH];
snprintf(msg, sizeof(msg), "No 'config' node found.");
throw std::runtime_error(msg);
}
getAllData(LISP);
}
catch(std::exception& err)
{
fprintf(stderr, "Error while parsing KartProperties '%s':\n",
filename.c_str());
fprintf(stderr, err.what());
fprintf(stderr, "\n");
}
delete root;
const lisp::Lisp* root = 0;
try
{
lisp::Parser parser;
root = parser.parse(filename);
const lisp::Lisp* const LISP = root->getLisp("config");
if(!LISP)
{
char msg[MAX_ERROR_MESSAGE_LENGTH];
snprintf(msg, sizeof(msg), "No 'config' node found.");
throw std::runtime_error(msg);
}
getAllData(LISP);
}
catch(std::exception& err)
{
fprintf(stderr, "Error while parsing KartProperties '%s':\n",
filename.c_str());
fprintf(stderr, err.what());
fprintf(stderr, "\n");
}
delete root;
// Check that all necessary values are indeed set
// -----------------------------------------------