[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r2451 - trunk/src
From: |
David Philippi at BerliOS |
Subject: |
[Pingus-CVS] r2451 - trunk/src |
Date: |
Fri, 30 Sep 2005 15:57:37 +0200 |
Author: torangan
Date: 2005-09-30 15:57:37 +0200 (Fri, 30 Sep 2005)
New Revision: 2451
Modified:
trunk/src/pingus.hxx
trunk/src/stat_manager.cxx
trunk/src/system.cxx
Log:
applied patch for windows compatibility from Jason Green
Modified: trunk/src/pingus.hxx
===================================================================
--- trunk/src/pingus.hxx 2005-09-29 13:51:25 UTC (rev 2450)
+++ trunk/src/pingus.hxx 2005-09-30 13:57:37 UTC (rev 2451)
@@ -43,7 +43,7 @@
# include <assert.h>
#endif
-#if defined(WIN32) && defined(__GNUC__)
+#if defined(WIN32) && defined(__GNUC__) && !defined(HAVE_SSTREAM)
# define HAVE_SSTREAM
#endif
Modified: trunk/src/stat_manager.cxx
===================================================================
--- trunk/src/stat_manager.cxx 2005-09-29 13:51:25 UTC (rev 2450)
+++ trunk/src/stat_manager.cxx 2005-09-30 13:57:37 UTC (rev 2451)
@@ -65,6 +65,12 @@
void
StatManager::load(const std::string& filename)
{
+ if (!System::exist(filename))
+ {
+ // Create empty file
+ save(filename);
+ }
+
CL_InputSourceProvider_File provider(".");
CL_DomDocument doc(provider.open_source(filename), true);
Modified: trunk/src/system.cxx
===================================================================
--- trunk/src/system.cxx 2005-09-29 13:51:25 UTC (rev 2450)
+++ trunk/src/system.cxx 2005-09-30 13:57:37 UTC (rev 2451)
@@ -282,7 +282,7 @@
System::get_vardir()
{
#ifdef WIN32
- return "var\\";
+ return "var/";
#else
return "/var/games/pingus/";
#endif
@@ -292,8 +292,10 @@
System::get_tmpdir()
{
#ifdef WIN32
- // FIXME: Warning: these hardcoded values are most probably wrong!
- return "c:\\windows\\temp\\";
+ char* tmpdir = getenv("TEMP");
+ if (!tmpdir) tmpdir = getenv("TMP");
+ if (!tmpdir) return get_statdir() + "tmp/";
+ else return std::string(tmpdir);
#else
return "/tmp/";
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r2451 - trunk/src,
David Philippi at BerliOS <=