From 70d460bf32bae0f1a23f09320d6ff2b6131cdd39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Wed, 14 Aug 2019 21:46:50 -0700 Subject: [PATCH] Fixed build. --- examples/common/entry/dialog.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/examples/common/entry/dialog.cpp b/examples/common/entry/dialog.cpp index f2e2820be..bdf2f3130 100644 --- a/examples/common/entry/dialog.cpp +++ b/examples/common/entry/dialog.cpp @@ -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_* }