mirror of https://github.com/encounter/SDL.git
Merge commit '0025621b8064f5c72561d5d7b7a1fbdde860c236' into main
This commit is contained in:
commit
95405d9625
|
@ -11,6 +11,16 @@
|
||||||
*/
|
*/
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
||||||
|
static void tryOpenURL(const char *url)
|
||||||
|
{
|
||||||
|
SDL_Log("Opening '%s' ...", url);
|
||||||
|
if (SDL_OpenURL(url) == 0) {
|
||||||
|
SDL_Log(" success!");
|
||||||
|
} else {
|
||||||
|
SDL_Log(" failed! %s", SDL_GetError());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -19,14 +29,12 @@ int main(int argc, char **argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 1; i < argc; i++) {
|
if (argc > 1) {
|
||||||
const char *url = argv[i];
|
for (i = 1; i < argc; i++) {
|
||||||
SDL_Log("Opening '%s' ...", url);
|
tryOpenURL(argv[i]);
|
||||||
if (SDL_OpenURL(url) == 0) {
|
|
||||||
SDL_Log(" success!");
|
|
||||||
} else {
|
|
||||||
SDL_Log(" failed! %s", SDL_GetError());
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
tryOpenURL("https://libsdl.org/");
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
Loading…
Reference in New Issue