2021-06-04 12:33:12 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
# include <windows.h>
|
|
|
|
# include <shellapi.h>
|
2022-10-04 23:22:35 +00:00
|
|
|
#elif defined __EMSCRIPTEN__
|
|
|
|
# include <emscripten.h>
|
2021-06-04 12:33:12 +00:00
|
|
|
#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 );
|
2022-10-04 23:22:35 +00:00
|
|
|
#elif defined __EMSCRIPTEN__
|
|
|
|
EM_ASM( { window.open( UTF8ToString( $0 ), '_blank' ) }, url );
|
2021-06-04 12:33:12 +00:00
|
|
|
#else
|
|
|
|
char buf[1024];
|
|
|
|
sprintf( buf, "xdg-open %s", url );
|
|
|
|
system( buf );
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|