summaryrefslogtreecommitdiff
path: root/games/zhlt/files/patch-common_cmdlib.cpp
blob: 673549d32fca5f046b4bf092cd7a1b9b61861b71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- common/cmdlib.cpp.orig	2016-03-30 06:24:01 UTC
+++ common/cmdlib.cpp
@@ -13,6 +13,9 @@
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
@@ -21,6 +24,8 @@
 #endif
 #endif
 
+#include <algorithm>
+
 #define PATHSEPARATOR(c) ((c) == '\\' || (c) == '/')
 
 /*
@@ -128,7 +133,7 @@ inline void getFilePositions(char* path,
 	else
 	{ *extension_position = ptr - path; }
 
-	ptr = max(strrchr(path,'/'),strrchr(path,'\\'));
+	ptr = std::max(strrchr(path,'/'),strrchr(path,'\\'));
 	if(ptr == 0)
 	{ *directory_position = -1; }
 	else