Daniele Bartolini 10 éve
szülő
commit
974b87c828

+ 8 - 8
src/core/os.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include "config.h"
+#include "platform.h"
 #include "types.h"
 #include "vector.h"
 #include "dynamic_string.h"
@@ -14,14 +14,14 @@
 #include "temp_allocator.h"
 
 #if CROWN_PLATFORM_POSIX
-	#include <dirent.h>
-	#include <dlfcn.h>
-	#include <sys/stat.h>
-	#include <sys/time.h>
-	#include <sys/wait.h>
+	#include <dirent.h> // opendir, readdir
+	#include <dlfcn.h> // dlopen, dlclose, dlsym
+	#include <sys/stat.h> // lstat, mknod, mkdir
+	#include <sys/wait.h> // wait
 	#include <errno.h>
-	#include <time.h>
-	#include <unistd.h>
+	#include <time.h> // clock_gettime
+	#include <unistd.h> // access, unlink, rmdir, getcwd, fork, execv
+ 	#include <stdlib.h> // exit
 #elif CROWN_PLATFORM_WINDOWS
 	#include <win_headers.h>
 	#include <io.h>

+ 0 - 3
src/core/strings/dynamic_string.h

@@ -7,12 +7,9 @@
 
 #include "error.h"
 #include "memory.h"
-#include "string_utils.h"
 #include "array.h"
-#include "string_utils.h"
 #include "string_id.h"
 #include <string.h> // memmove
-#include <algorithm>
 
 namespace crown
 {

+ 0 - 1
src/core/strings/path.cpp

@@ -4,7 +4,6 @@
  */
 
 #include "path.h"
-#include "platform.h"
 #include <ctype.h> // isalpha
 #include <string.h> // strlen, strrchr
 

+ 1 - 2
src/core/strings/string_stream.h

@@ -7,7 +7,6 @@
 
 #include "array.h"
 #include "string_utils.h"
-#include <stdio.h>
 
 namespace crown
 {
@@ -104,7 +103,7 @@ namespace string_stream
 	inline StringStream& stream_printf(StringStream& s, const char* format, T& val)
 	{
 		char buf[32];
-		snprintf(buf, 32, format, val);
+		snprintf(buf, sizeof(buf), format, val);
 		return s << buf;
 	}
 } // namespace string_stream

+ 2 - 2
src/core/strings/string_utils.h

@@ -7,9 +7,9 @@
 
 #include "types.h"
 #include "error.h"
-#include "config.h"
+#include "platform.h"
 #include "macros.h"
-#include <stdio.h> // sscanf
+#include <stdio.h> // sscanf, vsnprintf
 #include <string.h>
 #include <stdarg.h>
 #include <ctype.h> // isspace

+ 1 - 1
src/core/thread/atomic_int.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include "config.h"
+#include "platform.h"
 
 #if CROWN_PLATFORM_WINDOWS
 	#include "types.h"

+ 1 - 1
src/core/thread/mutex.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include "config.h"
+#include "platform.h"
 #include "types.h"
 #include "error.h"
 #include "macros.h"

+ 1 - 1
src/core/thread/semaphore.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include "config.h"
+#include "platform.h"
 #include "error.h"
 #include "mutex.h"
 

+ 1 - 1
src/core/thread/thread.h

@@ -5,7 +5,7 @@
 
 #pragma once
 
-#include "config.h"
+#include "platform.h"
 #include "error.h"
 #include "types.h"
 #include "semaphore.h"

+ 1 - 0
src/resource/resource_loader.cpp

@@ -4,6 +4,7 @@
  */
 
 #include "resource_loader.h"
+#include "config.h"
 #include "memory.h"
 #include "resource_registry.h"
 #include "queue.h"

+ 1 - 0
src/resource/unit_resource.cpp

@@ -19,6 +19,7 @@
 #include "vector3.h"
 #include "camera.h"
 #include "unit_resource.h"
+#include <algorithm> // std::sort
 
 namespace crown
 {