Fixed build.

This commit is contained in:
Бранимир Караџић 2019-08-14 21:46:50 -07:00
parent 83ad581efd
commit 70d460bf32
1 changed files with 16 additions and 9 deletions

View File

@ -50,16 +50,23 @@ extern "C" void* __stdcall ShellExecuteA(void* _hwnd, void* _operation, void*
void openUrl(const bx::StringView& _url)
{
#if BX_PLATFORM_WINDOWS
ShellExecuteA(NULL, NULL, _url, NULL, NULL, false);
#else
char tmp[4096];
# if BX_PLATFORM_OSX
# define OPEN "open"
# else
# define OPEN "xdg-open"
# endif // BX_PLATFORM_OSX
bx::snprintf(tmp, BX_COUNTOF(tmp), OPEN " %.*s", _url.getLength(), _url.getPtr() );
#if BX_PLATFORM_WINDOWS
# define OPEN ""
#elif BX_PLATFORM_OSX
# define OPEN "open "
#else
# define OPEN "xdg-open "
#endif // BX_PLATFORM_OSX
bx::snprintf(tmp, BX_COUNTOF(tmp), OPEN "%.*s", _url.getLength(), _url.getPtr() );
#undef OPEN
#if BX_PLATFORM_WINDOWS
ShellExecuteA(NULL, NULL, tmp, NULL, NULL, false);
#else
system(tmp);
#endif // BX_PLATFORM_*
}