Skip to content

Commit

Permalink
minor os/2 stuff merged from the bitwiseworks' fork
Browse files Browse the repository at this point in the history
  • Loading branch information
sezero committed Jul 28, 2023
1 parent 3845fd3 commit 38a5aed
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cmake/sdlplatform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ macro(SDL_DetectCMakePlatform)
set(SDL_CMAKE_PLATFORM HAIKU)
elseif(NINTENDO_3DS)
set(SDL_CMAKE_PLATFORM N3DS)
elseif(OS2)
set(SDL_CMAKE_PLATFORM OS2)
endif()
if(SDL_CMAKE_PLATFORM)
set(${SDL_CMAKE_PLATFORM} TRUE)
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -28247,7 +28247,7 @@ fi
enable_hidapi_libusb=yes
require_hidapi_libusb=yes
;;
*-*-os2* )
*-*-os2* )
enable_hidapi_libusb=yes
;;
esac
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3614,7 +3614,7 @@ CheckHIDAPI()
enable_hidapi_libusb=yes
require_hidapi_libusb=yes
;;
*-*-os2* )
*-*-os2* )
enable_hidapi_libusb=yes
;;
esac
Expand Down
8 changes: 6 additions & 2 deletions src/joystick/os2/SDL_os2joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,14 @@ static int joyGetEnv(struct _joycfg * joydata)
char tempnumber[5]; /* Temporary place to put numeric texts */

joyenv = SDL_getenv("SDL_OS2_JOYSTICK");
if (joyenv == NULL) return 0;
if (joyenv == NULL) {
return 0;
}

/* Joystick Environment is defined! */
while (*joyenv == ' ' && *joyenv != 0) joyenv++; /* jump spaces... */
while (*joyenv == ' ' && *joyenv != 0) {
joyenv++; /* jump spaces... */
}

/* If the string name starts with '... get if fully */
if (*joyenv == '\'') {
Expand Down
2 changes: 2 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,8 @@ elseif(WINDOWS)
elseif(HAVE_X11)
add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativex11.c testutils.c)
target_link_libraries(testnative X11)
elseif(OS2)
add_sdl_test_executable(testnative NEEDS_RESOURCES testnative.c testnativeos2.c testutils.c)
endif()

add_sdl_test_executable(testoverlay2 NEEDS_RESOURCES testoverlay2.c testyuv_cvt.c testutils.c)
Expand Down

0 comments on commit 38a5aed

Please sign in to comment.