From 302748b2f3ef481181d1a7152f0c36cbcf6340d2 Mon Sep 17 00:00:00 2001 From: Marcin Michalski Date: Sun, 22 Aug 2021 00:48:34 +0200 Subject: [PATCH] Fix opening URLs on macOS (#1159) --- src/framework/platform/unixplatform.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/framework/platform/unixplatform.cpp b/src/framework/platform/unixplatform.cpp index 0d3edc3c..6a4bcfb3 100644 --- a/src/framework/platform/unixplatform.cpp +++ b/src/framework/platform/unixplatform.cpp @@ -119,9 +119,14 @@ ticks_t Platform::getFileModificationTime(std::string file) void Platform::openUrl(std::string url) { - if(url.find("http://") == std::string::npos) + if(url.find("http://") == std::string::npos && url.find("https://") == std::string::npos) url.insert(0, "http://"); + +#if defined(__APPLE__) + system(stdext::format("open %s", url).c_str()); +#else system(stdext::format("xdg-open %s", url).c_str()); +#endif } std::string Platform::getCPUName()