Branimir Karadžić 8 years ago
parent
commit
451e30b55b
3 changed files with 20 additions and 23 deletions
  1. 0 3
      include/bx/os.h
  2. 20 0
      src/filepath.cpp
  3. 0 20
      src/os.cpp

+ 0 - 3
include/bx/os.h

@@ -51,9 +51,6 @@ namespace bx
 	///
 	///
 	int chdir(const char* _path);
 	int chdir(const char* _path);
 
 
-	///
-	char* pwd(char* _buffer, uint32_t _size);
-
 	///
 	///
 	void* exec(const char* const* _argv);
 	void* exec(const char* const* _argv);
 
 

+ 20 - 0
src/filepath.cpp

@@ -8,6 +8,12 @@
 #include <bx/os.h>
 #include <bx/os.h>
 #include <bx/readerwriter.h>
 #include <bx/readerwriter.h>
 
 
+#if BX_CRT_MSVC
+#	include <direct.h> // _getcwd
+#else
+#	include <unistd.h> // getcwd
+#endif // BX_CRT_MSVC
+
 #if BX_PLATFORM_WINDOWS
 #if BX_PLATFORM_WINDOWS
 extern "C" __declspec(dllimport) unsigned long __stdcall GetTempPathA(unsigned long _max, char* _ptr);
 extern "C" __declspec(dllimport) unsigned long __stdcall GetTempPathA(unsigned long _max, char* _ptr);
 #endif // BX_PLATFORM_WINDOWS
 #endif // BX_PLATFORM_WINDOWS
@@ -161,6 +167,20 @@ namespace bx
 		return false;
 		return false;
 	}
 	}
 
 
+	static char* pwd(char* _buffer, uint32_t _size)
+	{
+#if BX_PLATFORM_PS4     \
+ || BX_PLATFORM_XBOXONE \
+ || BX_PLATFORM_WINRT
+		BX_UNUSED(_buffer, _size);
+		return NULL;
+#elif BX_CRT_MSVC
+		return ::_getcwd(_buffer, (int)_size);
+#else
+		return ::getcwd(_buffer, _size);
+#endif // BX_COMPILER_
+	}
+
 	static bool getCurrentPath(char* _out, uint32_t* _inOutSize)
 	static bool getCurrentPath(char* _out, uint32_t* _inOutSize)
 	{
 	{
 		uint32_t len = *_inOutSize;
 		uint32_t len = *_inOutSize;

+ 0 - 20
src/os.cpp

@@ -56,12 +56,6 @@
 #	endif // BX_PLATFORM_ANDROID
 #	endif // BX_PLATFORM_ANDROID
 #endif // BX_PLATFORM_
 #endif // BX_PLATFORM_
 
 
-#if BX_CRT_MSVC
-#	include <direct.h> // _getcwd
-#else
-#	include <unistd.h> // getcwd
-#endif // BX_CRT_MSVC
-
 namespace bx
 namespace bx
 {
 {
 
 
@@ -287,20 +281,6 @@ namespace bx
 #endif // BX_COMPILER_
 #endif // BX_COMPILER_
 	}
 	}
 
 
-	char* pwd(char* _buffer, uint32_t _size)
-	{
-#if BX_PLATFORM_PS4     \
- || BX_PLATFORM_XBOXONE \
- || BX_PLATFORM_WINRT
-		BX_UNUSED(_buffer, _size);
-		return NULL;
-#elif BX_CRT_MSVC
-		return ::_getcwd(_buffer, (int)_size);
-#else
-		return ::getcwd(_buffer, _size);
-#endif // BX_COMPILER_
-	}
-
 	void* exec(const char* const* _argv)
 	void* exec(const char* const* _argv)
 	{
 	{
 #if BX_PLATFORM_LINUX \
 #if BX_PLATFORM_LINUX \