Skip to content

Commit 16cea44

Browse files
committed
fix final 3ds build failures
1 parent 4f88763 commit 16cea44

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

src/helper/console_helpers.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <switch.h>
1111
#elif defined(__3DS__)
1212
#include <3ds.h>
13+
#include <cstdlib>
1314
#endif
1415

1516
#include <fmt/format.h>
@@ -30,12 +31,12 @@ void console::debug_write(const char* text, size_t size) {
3031
#if defined(__3DS__)
3132
const auto size = url.size() >= 0x100 ? url.size() + 1 : 0x100;
3233

33-
char* buffer = malloc(size);
34+
char* buffer = reinterpret_cast<char*>(malloc(size));
3435

3536
memcpy(buffer, url.c_str(), url.size());
3637
buffer[url.size()] = '\0';
3738

38-
aptLaunchLibraryApplet(APPID_WEB, buffer, IN_OUT_BUF_SIZE, 0);
39+
aptLaunchLibraryApplet(APPID_WEB, buffer, size, 0);
3940

4041
const auto result = std::string{ buffer };
4142

src/platform/capabilities.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,16 @@ namespace {
7575
//TODO: this is dangerous, if we supply user input, so use SDL_OpenURL preferably
7676

7777
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
78-
const std::string shellCommand = "start " + url;
78+
const std::string shell_command = "start " + url;
7979
#elif defined(__APPLE__)
80-
const std::string shellCommand = "open " + url;
80+
const std::string shell_command = "open " + url;
8181
#elif defined(__linux__)
82-
const std::string shellCommand = "xdg-open " + url;
82+
const std::string shell_command = "xdg-open " + url;
8383
#else
8484
#error "Unsupported platform"
8585
#endif
8686

87-
const auto result = system(shellCommand.c_str());
87+
const auto result = system(shell_command.c_str());
8888
if (result < 0) {
8989
spdlog::error("Error in opening url: {}", get_error_from_errno());
9090
return false;

src/platform/capabilities.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ namespace utils {
5353
{static_cast<u8>(CrossPlatformAction::OPEN_SETTINGS), { 0 }},
5454
{ static_cast<u8>(CrossPlatformAction::TAB), { 0 }}
5555
};
56-
#elif defined(__CONSOLE__)
56+
#elif defined(__SWITCH__)
5757
{
5858
{ static_cast<u8>(CrossPlatformAction::OK),{ JOYCON_A } },
5959
{ static_cast<u8>(CrossPlatformAction::PAUSE), { JOYCON_PLUS }},
@@ -70,6 +70,7 @@ namespace utils {
7070
{static_cast<u8>(CrossPlatformAction::OPEN_SETTINGS), { JOYCON_Y }},
7171
{ static_cast<u8>(CrossPlatformAction::TAB), {}}, // no tab support
7272
};
73+
//TODO: support 3ds
7374
#else
7475
{
7576
{ static_cast<u8>(CrossPlatformAction::OK), { SDLK_RETURN, SDLK_SPACE }},

src/platform/console_input.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,12 @@ helper::optional<InputEvent> JoystickInput::sdl_event_to_input_event(const SDL_E
7474
}
7575
#elif defined(__3DS__)
7676

77+
//TODO: implement for 3ds
7778
helper::optional<InputEvent> JoystickInput::sdl_event_to_input_event(const SDL_Event& event) const {
79+
UNUSED(event);
7880
return helper::nullopt;
7981
}
8082

81-
//TODO: implement for 3ds
8283
#endif
8384

8485

0 commit comments

Comments
 (0)