Browse Source

add missing includes and defines for linux compilation

fix a warning with string cast
Carsten Teibes 10 years ago
parent
commit
0551ac927e
4 changed files with 6 additions and 3 deletions
  1. 1
    0
      src/Menu.cpp
  2. 1
    0
      src/SkeletalModel.cpp
  3. 1
    0
      src/World.cpp
  4. 3
    3
      src/utils/strings.cpp

+ 1
- 0
src/Menu.cpp View File

7
 
7
 
8
 #include <assert.h>
8
 #include <assert.h>
9
 #include <dirent.h>
9
 #include <dirent.h>
10
+#include <cctype>
10
 
11
 
11
 #ifdef __APPLE__
12
 #ifdef __APPLE__
12
 #include <OpenGL/gl.h>
13
 #include <OpenGL/gl.h>

+ 1
- 0
src/SkeletalModel.cpp View File

6
  * \author xythobuz
6
  * \author xythobuz
7
  */
7
  */
8
 
8
 
9
+#include <cstddef>
9
 #include "SkeletalModel.h"
10
 #include "SkeletalModel.h"
10
 
11
 
11
 SkeletalModel::SkeletalModel() {
12
 SkeletalModel::SkeletalModel() {

+ 1
- 0
src/World.cpp View File

5
  * \author Mongoose
5
  * \author Mongoose
6
  */
6
  */
7
 
7
 
8
+#include <cstdio>
8
 #include <math.h>
9
 #include <math.h>
9
 #include <assert.h>
10
 #include <assert.h>
10
 
11
 

+ 3
- 3
src/utils/strings.cpp View File

11
 #include <string.h>
11
 #include <string.h>
12
 #include <assert.h>
12
 #include <assert.h>
13
 
13
 
14
-#if defined(unix) || defined(__APPLE__)
14
+#if defined(unix) || defined(__APPLE__) || defined(__linux__)
15
 #include <wordexp.h>
15
 #include <wordexp.h>
16
 #endif
16
 #endif
17
 
17
 
31
 }
31
 }
32
 
32
 
33
 char *stringReplace(const char *s, const char *search, const char *replace) {
33
 char *stringReplace(const char *s, const char *search, const char *replace) {
34
-    char *tmp = strstr(s, search);
34
+    char *tmp = strstr((char *)s, search);
35
     if (tmp == NULL)
35
     if (tmp == NULL)
36
         return NULL;
36
         return NULL;
37
     size_t offset = tmp - s;
37
     size_t offset = tmp - s;
130
     assert(path[0] != '\0');
130
     assert(path[0] != '\0');
131
 
131
 
132
     if (path[0] == '~') {
132
     if (path[0] == '~') {
133
-#if defined(unix) || defined(__APPLE__)
133
+#if defined(unix) || defined(__APPLE__) || defined(__linux__)
134
 
134
 
135
 #ifdef __APPLE__
135
 #ifdef __APPLE__
136
         // Workaround for Mac OS X. See:
136
         // Workaround for Mac OS X. See:

Loading…
Cancel
Save