branch: master
commit 21c540ae2a0f95988baa957b6c4969516c44ae29
Author: Kai Sterker <kai.ster...@gmail.com>
Commit: Kai Sterker <kai.ster...@gmail.com>

    FIXED compilation on Haiku with gcc 2.95
---
 configure.ac       |   48 ++++++++++++++++++++++++------------------------
 src/game.cc        |   11 +++++++++--
 src/py_callback.h  |    3 +--
 src/python_class.h |    2 +-
 src/surface.cc     |    1 +
 src/win_event.h    |    2 +-
 6 files changed, 37 insertions(+), 30 deletions(-)

diff --git a/configure.ac b/configure.ac
index 89dd1e1..a3fe0cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,6 +132,30 @@ AC_CHECK_LIB(pthread, main,
 
 AC_CHECK_LIB(z, main,,echo "Adonthell requires Zlib. Exitting...";exit 1)
 
+dnl *******************
+dnl Check for FreeType2
+dnl *******************
+
+AC_CHECK_FT2(6.0.0,
+    [LIBS="$LIBS $FT2_LIBS"],
+    AC_MSG_ERROR([*** Freetype version >= 6.0.0 not found!])
+)
+
+dnl *******************
+dnl Check for OggVorbis
+dnl *******************
+
+OGG_VORBIS=no
+XIPH_PATH_VORBIS(
+        OGG_VORBIS="yes"
+        ogg_music="enabled"
+        OGG_LIBS="$VORBISFILE_LIBS $VORBIS_LIBS"
+        OGG_DEFS="-DOGG_MUSIC"
+        OGG_CFLAGS="$VORBIS_CFLAGS",
+        AC_MSG_RESULT(Disabling OggVorbis support)
+        ogg_music="disabled"
+)
+
 dnl *************
 dnl Check for SDL
 dnl *************
@@ -166,30 +190,6 @@ case "$target" in
   ;;
 esac
 
-dnl *******************
-dnl Check for FreeType2
-dnl *******************
-
-AC_CHECK_FT2(6.0.0,
-    :,
-    AC_MSG_ERROR([*** Freetype version >= 6.0.0 not found!])
-)
-
-dnl *******************
-dnl Check for OggVorbis
-dnl *******************
-
-OGG_VORBIS=no
-XIPH_PATH_VORBIS(
-        OGG_VORBIS="yes"
-        ogg_music="enabled"
-        OGG_LIBS="$VORBISFILE_LIBS $VORBIS_LIBS"
-        OGG_DEFS="-DOGG_MUSIC"
-        OGG_CFLAGS="$VORBIS_CFLAGS",
-        AC_MSG_RESULT(Disabling OggVorbis support)
-        ogg_music="disabled"
-)
-
 dnl ****************
 dnl Check for Python
 dnl ****************
diff --git a/src/game.cc b/src/game.cc
index 6a7b7d9..ca553c4 100644
--- a/src/game.cc
+++ b/src/game.cc
@@ -68,6 +68,13 @@ string game::get_system_dir(const sys_dir_type & type)
         result = string (getenv("APPDATA")) + "/Adonthell/";
     else
        result = "./";
+#elif defined(__HAIKU__)
+    // Haiku
+    char *homeDir = getenv ("HOME");
+    if (homeDir != NULL)
+        result = string (homeDir) + "/config/settings/adonthell/";
+    else
+        result = string ("/boot/home/config/settings/adonthell/");
 #else
     // Unix
     const char* xdgEnv = type == USER_DATA ? "XDG_DATA_HOME" : 
"XDG_CONFIG_HOME";
@@ -77,7 +84,7 @@ string game::get_system_dir(const sys_dir_type & type)
     else
     {
         if (type == USER_DATA)
-           result = string (getenv ("HOME")) + "/.local/share/adonthell/";
+            result = string (getenv ("HOME")) + "/.local/share/adonthell/";
         else
             result = string (getenv ("HOME")) + "/.config/adonthell/";
     }
@@ -89,7 +96,7 @@ string game::get_system_dir(const sys_dir_type & type)
 #ifndef WIN32
         if (mkdir (result.c_str (), 0700) == -1)
 #else
-       if (mkdir (result.c_str ()) == -1)
+        if (mkdir (result.c_str ()) == -1)
 #endif
         {
             int ecd = errno;
diff --git a/src/py_callback.h b/src/py_callback.h
index 2dbe30a..dbb39b9 100644
--- a/src/py_callback.h
+++ b/src/py_callback.h
@@ -29,8 +29,7 @@
  * 
  */
 
- 
-#include <locale>
+#include <locale.h>
 #include "Python.h"
 #include "fileops.h"
 
diff --git a/src/python_class.h b/src/python_class.h
index 26dce1a..b4552bc 100644
--- a/src/python_class.h
+++ b/src/python_class.h
@@ -32,7 +32,7 @@
 #ifndef PYTHON_CLASS_H__
 #define PYTHON_CLASS_H__
 
-#include <locale>
+#include <locale.h>
 #include "Python.h"
 #include "compile.h"
 #include "eval.h"
diff --git a/src/surface.cc b/src/surface.cc
index 889adee..625c36b 100644
--- a/src/surface.cc
+++ b/src/surface.cc
@@ -29,6 +29,7 @@
 #include "surface.h"
 #include "screen.h"
 
+#include <algorithm>
 #include <iostream>
 
 using namespace std; 
diff --git a/src/win_event.h b/src/win_event.h
index 0f3df2d..becf856 100644
--- a/src/win_event.h
+++ b/src/win_event.h
@@ -19,7 +19,7 @@
 #ifndef _WIN_EVENT_H_
 #define _WIN_EVENT_H_
 
-#include <locale>
+#include <locale.h>
 #include "Python.h"
 #include <vector>
 

_______________________________________________
Adonthell-commits mailing list
Adonthell-commits@nongnu.org
https://lists.nongnu.org/mailman/listinfo/adonthell-commits

Reply via email to