Commit 97be4580 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

GetProcessPath mac bug

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@66747 954022d7-b5bf-4e40-9824-e11837661b57
parent d784fcf3
...@@ -21,6 +21,10 @@ ...@@ -21,6 +21,10 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
#ifdef _MAC
#include <mach-o/dyld.h>
#endif
#ifndef MAX_PATH #ifndef MAX_PATH
#define MAX_PATH 1024 #define MAX_PATH 1024
#endif #endif
...@@ -1075,10 +1079,10 @@ namespace NSFile ...@@ -1075,10 +1079,10 @@ namespace NSFile
if (readlink ("/proc/self/exe", buf, NS_FILE_MAX_PATH) <= 0) if (readlink ("/proc/self/exe", buf, NS_FILE_MAX_PATH) <= 0)
{ {
#ifdef _MAC #ifdef _MAC
getcwd(buf, sizeof(buf)); uint32_t _size = NS_FILE_MAX_PATH;
_NSGetExecutablePath(buf, &_size);
std::string sUTF8(buf); std::string sUTF8(buf);
std::wstring sRet = CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sUTF8.c_str(), sUTF8.length()); std::wstring sRet = CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)sUTF8.c_str(), sUTF8.length());
sRet += L"/executable_path"; // поправить потом!!! (дописал чтобы работал метод GetProcessDirectory())
return sRet; return sRet;
#endif #endif
return L""; return L"";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment