瀏覽代碼

Fixed build.

Бранимир Караџић 6 年之前
父節點
當前提交
70d460bf32
共有 1 個文件被更改,包括 15 次插入8 次删除
  1. 15 8
      examples/common/entry/dialog.cpp

+ 15 - 8
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)
 void openUrl(const bx::StringView& _url)
 {
 {
+	char tmp[4096];
+
 #if BX_PLATFORM_WINDOWS
 #if BX_PLATFORM_WINDOWS
-	ShellExecuteA(NULL, NULL, _url, NULL, NULL, false);
+#	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
 #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() );
 	system(tmp);
 	system(tmp);
 #endif // BX_PLATFORM_*
 #endif // BX_PLATFORM_*
 }
 }