blob: 91986f8c4b250a357c1992140b3d2c828c9ef467 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#ifdef _WIN32
# include <windows.h>
# include <shellapi.h>
#elif defined __EMSCRIPTEN__
# include <emscripten.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 );
#elif defined __EMSCRIPTEN__
EM_ASM( { window.open( UTF8ToString( $0 ), '_blank' ) }, url );
#else
char buf[1024];
sprintf( buf, "xdg-open %s", url );
system( buf );
#endif
}
}
|