Move OpenWebpage() to a separate source file.

This commit is contained in:
Bartosz Taudul
2021-06-04 14:33:12 +02:00
parent 86510c48e0
commit 39cf98f98c
5 changed files with 60 additions and 31 deletions

29
server/TracyWeb.cpp Normal file
View File

@@ -0,0 +1,29 @@
#ifdef _WIN32
# include <windows.h>
# include <shellapi.h>
#else
# include <stdio.h>
# include <stdlib.h>
#endif
#include "TracyWeb.hpp"
namespace tracy
{
void OpenWebpage( const char* url )
{
#ifdef _WIN32
ShellExecuteA( nullptr, nullptr, url, nullptr, nullptr, 0 );
#elif defined __APPLE__
char buf[1024];
sprintf( buf, "open %s", url );
system( buf );
#else
char buf[1024];
sprintf( buf, "xdg-open %s", url );
system( buf );
#endif
}
}