Compare commits
65
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
15ead9a40d | ||
|
|
7ebfaa0ea2 | ||
|
|
5f4ddebf76 | ||
|
|
0f8858cf2d | ||
|
|
98abc15769 | ||
|
|
746d74b140 | ||
|
|
7d9595b14f | ||
|
|
63d259edf0 | ||
|
|
fcd0c9843e | ||
|
|
74b3959e04 | ||
|
|
a5df48514e | ||
|
|
78d5fbf398 | ||
|
|
5d66429cc3 | ||
|
|
2ca041d294 | ||
|
|
b3f19b14d7 | ||
|
|
a85cf62c12 | ||
|
|
5be746acbc | ||
|
|
2abefb1c16 | ||
|
|
6fc17b0e2b | ||
|
|
1f7ec57d3b | ||
|
|
36eb4845b5 | ||
|
|
d5ba5bb05f | ||
|
|
cc016b0046 | ||
|
|
8c3fd5aec2 | ||
|
|
24d145f4b6 | ||
|
|
145ad48c0e | ||
|
|
fd495bb57c | ||
|
|
d58fa94ee9 | ||
|
|
d691010686 | ||
|
|
b93a8a86ab | ||
|
|
536f625bde | ||
|
|
1e18dc594e | ||
|
|
cc4973ea45 | ||
|
|
8114bd9108 | ||
|
|
495fca1517 | ||
|
|
7d80e20883 | ||
|
|
f3847c157a | ||
|
|
b576e29d9b | ||
|
|
c7ad8e5431 | ||
|
|
9c8ee3a154 | ||
|
|
d710e0be27 | ||
|
|
b8d1f852db | ||
|
|
e9ab663c43 | ||
|
|
c8d1de1a9b | ||
|
|
bf8c9cd6bf | ||
|
|
8a5ba43d00 | ||
|
|
c25a49c406 | ||
|
|
d46fdfa3ee | ||
|
|
787d339282 | ||
|
|
874f6feab4 | ||
|
|
1df4dce78f | ||
|
|
cc58a09c09 | ||
|
|
ae72cd57b5 | ||
|
|
8f858d7908 | ||
|
|
5bfdb6e02f | ||
|
|
739d3ec189 | ||
|
|
2319b2635b | ||
|
|
bda161d22b | ||
|
|
dbfd47e77d | ||
|
|
dbb6cd02aa | ||
|
|
841263c9d6 | ||
|
|
2ccb311cb7 | ||
|
|
e0a345702d | ||
|
|
9fba36511f | ||
|
|
45fb778fe5 |
No files matched your search
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0...3.5)
|
||||||
project(ci_utils C CXX)
|
project(ci_utils C CXX)
|
||||||
|
|
||||||
set(txt "CC=${CMAKE_C_COMPILER}
|
set(txt "CC=${CMAKE_C_COMPILER}
|
||||||
|
|||||||
@@ -1,19 +1,23 @@
|
|||||||
name: Build (VM Actions)
|
name: Build (C/P Actions)
|
||||||
|
|
||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
freebsd:
|
freebsd:
|
||||||
runs-on: macos-12
|
runs-on: ubuntu-latest
|
||||||
name: FreeBSD
|
name: FreeBSD
|
||||||
|
timeout-minutes: 30
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: vmactions/freebsd-vm@v0
|
uses: cross-platform-actions/action@v0.19.1
|
||||||
with:
|
with:
|
||||||
usesh: true
|
operating_system: freebsd
|
||||||
prepare: |
|
version: '13.2'
|
||||||
pkg install -y \
|
shell: bash
|
||||||
|
run: |
|
||||||
|
sudo pkg update
|
||||||
|
sudo pkg install -y \
|
||||||
gmake \
|
gmake \
|
||||||
pkgconf \
|
pkgconf \
|
||||||
libXcursor \
|
libXcursor \
|
||||||
@@ -33,17 +37,15 @@ jobs:
|
|||||||
libinotify \
|
libinotify \
|
||||||
alsa-lib \
|
alsa-lib \
|
||||||
jackit \
|
jackit \
|
||||||
nas \
|
|
||||||
pipewire \
|
pipewire \
|
||||||
pulseaudio \
|
pulseaudio \
|
||||||
sndio \
|
sndio \
|
||||||
dbus \
|
dbus \
|
||||||
zh-fcitx \
|
zh-fcitx \
|
||||||
ibus \
|
ibus \
|
||||||
libsamplerate \
|
|
||||||
libudev-devd
|
libudev-devd
|
||||||
|
|
||||||
run: |
|
|
||||||
mkdir build_autotools
|
mkdir build_autotools
|
||||||
(cd build_autotools && CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ../configure)
|
export CPPFLAGS="-I/usr/local/include"
|
||||||
|
export LDFLAGS="-L/usr/local/lib"
|
||||||
|
(cd build_autotools && ../configure --disable-static)
|
||||||
gmake -C build_autotools -j`sysctl -n hw.ncpu` V=1
|
gmake -C build_autotools -j`sysctl -n hw.ncpu` V=1
|
||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: mymindstorm/setup-emsdk@v12
|
- uses: mymindstorm/setup-emsdk@v12
|
||||||
with:
|
with:
|
||||||
version: 2.0.32
|
version: 3.1.35
|
||||||
- name: Install ninja
|
- name: Install ninja
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get -y update
|
sudo apt-get -y update
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
${{ matrix.platform.source_cmd }}
|
${{ matrix.platform.source_cmd }}
|
||||||
set -eu
|
set -eu
|
||||||
export SDL_TESTS_QUICK=1
|
export SDL_TESTS_QUICK=1
|
||||||
ctest -VV --test-dir build/
|
ctest -VV --test-dir build/ -j2
|
||||||
if test "${{ runner.os }}" = "Linux"; then
|
if test "${{ runner.os }}" = "Linux"; then
|
||||||
# This should show us the SDL_REVISION
|
# This should show us the SDL_REVISION
|
||||||
strings build/libSDL2-2.0.so.0 | grep SDL-
|
strings build/libSDL2-2.0.so.0 | grep SDL-
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ jobs:
|
|||||||
os.makedirs(builddir)
|
os.makedirs(builddir)
|
||||||
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
||||||
f.write(textwrap.dedent(f"""\
|
f.write(textwrap.dedent(f"""\
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0...3.5)
|
||||||
project(sdl_user)
|
project(sdl_user)
|
||||||
add_subdirectory("{ srcdir }" SDL)
|
add_subdirectory("{ srcdir }" SDL)
|
||||||
"""))
|
"""))
|
||||||
@@ -53,7 +53,7 @@ jobs:
|
|||||||
if: "! contains(matrix.platform.name, 'ARM')"
|
if: "! contains(matrix.platform.name, 'ARM')"
|
||||||
run: |
|
run: |
|
||||||
$env:SDL_TESTS_QUICK=1
|
$env:SDL_TESTS_QUICK=1
|
||||||
ctest -VV --test-dir build/ -C Release
|
ctest -VV --test-dir build/ -C Release -j2
|
||||||
- name: Install (CMake)
|
- name: Install (CMake)
|
||||||
run: |
|
run: |
|
||||||
echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
|
echo "SDL2_DIR=$Env:GITHUB_WORKSPACE/prefix" >> $Env:GITHUB_ENV
|
||||||
|
|||||||
+41
-5
@@ -2,6 +2,9 @@ if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
|
|||||||
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \"cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there")
|
message(FATAL_ERROR "Prevented in-tree build. Please create a build directory outside of the SDL source code and run \"cmake -S ${CMAKE_SOURCE_DIR} -B .\" from there")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# MSVC runtime library flags are selected by an abstraction.
|
||||||
|
set(CMAKE_POLICY_DEFAULT_CMP0091 NEW)
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0.0...3.5)
|
cmake_minimum_required(VERSION 3.0.0...3.5)
|
||||||
project(SDL2 C CXX)
|
project(SDL2 C CXX)
|
||||||
|
|
||||||
@@ -84,7 +87,7 @@ endif()
|
|||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
set(SDL_MAJOR_VERSION 2)
|
set(SDL_MAJOR_VERSION 2)
|
||||||
set(SDL_MINOR_VERSION 28)
|
set(SDL_MINOR_VERSION 28)
|
||||||
set(SDL_MICRO_VERSION 2)
|
set(SDL_MICRO_VERSION 5)
|
||||||
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
set(SDL_VERSION "${SDL_MAJOR_VERSION}.${SDL_MINOR_VERSION}.${SDL_MICRO_VERSION}")
|
||||||
|
|
||||||
# Set defaults preventing destination file conflicts
|
# Set defaults preventing destination file conflicts
|
||||||
@@ -224,11 +227,13 @@ elseif(MSVC_VERSION GREATER 1400) # VisualStudio 8.0+
|
|||||||
elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$")
|
elseif(CMAKE_C_COMPILER_ID MATCHES "^Intel$")
|
||||||
set(OPT_DEF_ASM TRUE)
|
set(OPT_DEF_ASM TRUE)
|
||||||
set(USE_INTELCC TRUE)
|
set(USE_INTELCC TRUE)
|
||||||
|
elseif(CMAKE_C_COMPILER_ID MATCHES "QCC")
|
||||||
|
set(USE_QCC TRUE)
|
||||||
else()
|
else()
|
||||||
set(OPT_DEF_ASM FALSE)
|
set(OPT_DEF_ASM FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
|
||||||
set(OPT_DEF_GCC_ATOMICS ON)
|
set(OPT_DEF_GCC_ATOMICS ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -253,6 +258,9 @@ endif()
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
option(SDL_FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
|
option(SDL_FORCE_STATIC_VCRT "Force /MT for static VC runtimes" OFF)
|
||||||
if(SDL_FORCE_STATIC_VCRT)
|
if(SDL_FORCE_STATIC_VCRT)
|
||||||
|
if(NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||||
|
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||||
|
endif()
|
||||||
foreach(flag_var
|
foreach(flag_var
|
||||||
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
|
||||||
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO)
|
||||||
@@ -563,7 +571,7 @@ if(NOT SDL_FOREGROUNDING_SIGNAL STREQUAL "OFF")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compiler option evaluation
|
# Compiler option evaluation
|
||||||
if(USE_GCC OR USE_CLANG OR USE_INTELCC)
|
if(USE_GCC OR USE_CLANG OR USE_INTELCC OR USE_QCC)
|
||||||
# Check for -Wall first, so later things can override pieces of it.
|
# Check for -Wall first, so later things can override pieces of it.
|
||||||
# Note: clang-cl treats -Wall as -Weverything (which is very loud),
|
# Note: clang-cl treats -Wall as -Weverything (which is very loud),
|
||||||
# /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough.
|
# /W3 as -Wall, and /W4 as -Wall -Wextra. So: /W3 is enough.
|
||||||
@@ -1422,6 +1430,12 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||||||
file(GLOB AIX_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/paudio/*.c)
|
file(GLOB AIX_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/paudio/*.c)
|
||||||
list(APPEND SOURCE_FILES ${AIX_AUDIO_SOURCES})
|
list(APPEND SOURCE_FILES ${AIX_AUDIO_SOURCES})
|
||||||
set(HAVE_SDL_AUDIO TRUE)
|
set(HAVE_SDL_AUDIO TRUE)
|
||||||
|
elseif(QNX)
|
||||||
|
set(SDL_AUDIO_DRIVER_QSA 1)
|
||||||
|
file(GLOB QSA_AUDIO_SOURCES ${SDL2_SOURCE_DIR}/src/audio/qsa/*.c)
|
||||||
|
list(APPEND SOURCE_FILES ${QSA_AUDIO_SOURCES})
|
||||||
|
list(APPEND EXTRA_LIBS asound)
|
||||||
|
set(HAVE_SDL_AUDIO TRUE)
|
||||||
endif()
|
endif()
|
||||||
CheckOSS()
|
CheckOSS()
|
||||||
CheckALSA()
|
CheckALSA()
|
||||||
@@ -1453,6 +1467,7 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||||||
set(SDL_VIDEO_VULKAN 1)
|
set(SDL_VIDEO_VULKAN 1)
|
||||||
set(HAVE_VULKAN TRUE)
|
set(HAVE_VULKAN TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
CheckQNXScreen()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
@@ -1703,6 +1718,13 @@ elseif(UNIX AND NOT APPLE AND NOT RISCOS AND NOT HAIKU)
|
|||||||
set(HAVE_RPATH TRUE)
|
set(HAVE_RPATH TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(QNX)
|
||||||
|
# QNX's *printf() family generates a SIGSEGV if NULL is passed for a string
|
||||||
|
# specifier (on purpose), but SDL expects "(null)". Use the built-in
|
||||||
|
# implementation.
|
||||||
|
set(HAVE_VSNPRINTF 0)
|
||||||
|
set(USE_POSIX_SPAWN 1)
|
||||||
|
endif()
|
||||||
elseif(WINDOWS)
|
elseif(WINDOWS)
|
||||||
find_program(WINDRES windres)
|
find_program(WINDRES windres)
|
||||||
|
|
||||||
@@ -3061,9 +3083,17 @@ else()
|
|||||||
set(sdl_static_libname "SDL2")
|
set(sdl_static_libname "SDL2")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
# CMAKE_PREFIX_PATH and CMAKE_INSTALL_FULL_BINDIR can be a non-absolute path
|
||||||
|
# when a master-project does e.g. `set(CMAKE_INSTALL_PREFIX "libs/SDL2" CACHE PATH "prefix" FORCE)`.
|
||||||
|
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_PREFIX}")
|
||||||
|
endif()
|
||||||
|
if(NOT IS_ABSOLUTE "${CMAKE_INSTALL_FULL_BINDIR}")
|
||||||
|
set(CMAKE_INSTALL_FULL_BINDIR "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_FULL_BINDIR}")
|
||||||
|
endif()
|
||||||
file(RELATIVE_PATH bin_prefix_relpath "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_PREFIX}")
|
file(RELATIVE_PATH bin_prefix_relpath "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
|
set(prefix ${CMAKE_INSTALL_PREFIX})
|
||||||
set(exec_prefix "\${prefix}")
|
set(exec_prefix "\${prefix}")
|
||||||
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
||||||
set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}")
|
set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}")
|
||||||
@@ -3182,7 +3212,7 @@ if (SDL_ASAN)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4)
|
if(SDL_CCACHE AND NOT CMAKE_VERSION VERSION_LESS 3.4)
|
||||||
cmake_minimum_required(VERSION 3.4)
|
cmake_minimum_required(VERSION 3.4...3.5)
|
||||||
find_program(CCACHE_BINARY ccache)
|
find_program(CCACHE_BINARY ccache)
|
||||||
if(CCACHE_BINARY)
|
if(CCACHE_BINARY)
|
||||||
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})
|
set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_BINARY})
|
||||||
@@ -3307,6 +3337,12 @@ if(ANDROID)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
cmake_push_check_state(RESET)
|
||||||
|
check_c_compiler_flag(-fobjc-arc COMPILER_SUPPORTS_FOBJC_ARC)
|
||||||
|
cmake_pop_check_state()
|
||||||
|
if(NOT COMPILER_SUPPORTS_FOBJC_ARC)
|
||||||
|
message(FATAL_ERROR "Compiler does not support -fobjc-arc: this is required on Apple platforms")
|
||||||
|
endif()
|
||||||
target_compile_options(sdl-build-options INTERFACE "-fobjc-arc")
|
target_compile_options(sdl-build-options INTERFACE "-fobjc-arc")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@
|
|||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 28
|
MINOR_VERSION = 28
|
||||||
MICRO_VERSION = 2
|
MICRO_VERSION = 5
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
DESCRIPTION = Simple DirectMedia Layer 2
|
DESCRIPTION = Simple DirectMedia Layer 2
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
LIBNAME = SDL2
|
LIBNAME = SDL2
|
||||||
MAJOR_VERSION = 2
|
MAJOR_VERSION = 2
|
||||||
MINOR_VERSION = 28
|
MINOR_VERSION = 28
|
||||||
MICRO_VERSION = 2
|
MICRO_VERSION = 5
|
||||||
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
VERSION = $(MAJOR_VERSION).$(MINOR_VERSION).$(MICRO_VERSION)
|
||||||
|
|
||||||
LIBHOME = .
|
LIBHOME = .
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# SDL2 CMake configuration file:
|
# SDL2 CMake configuration file:
|
||||||
# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC
|
# This file is meant to be placed in a cmake subfolder of SDL2-devel-2.x.y-VC
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0...3.5)
|
||||||
|
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
set_package_properties(SDL2 PROPERTIES
|
set_package_properties(SDL2 PROPERTIES
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>FMWK</string>
|
<string>FMWK</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>2.28.2</string>
|
<string>2.28.5</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>SDLX</string>
|
<string>SDLX</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>2.28.2</string>
|
<string>2.28.5</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
@@ -9529,7 +9529,7 @@
|
|||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
DEPLOYMENT_POSTPROCESSING = YES;
|
DEPLOYMENT_POSTPROCESSING = YES;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2801.2.0;
|
DYLIB_CURRENT_VERSION = 2801.5.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_ALTIVEC_EXTENSIONS = YES;
|
GCC_ALTIVEC_EXTENSIONS = YES;
|
||||||
@@ -9570,7 +9570,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.28.2;
|
MARKETING_VERSION = 2.28.5;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
@@ -9614,7 +9614,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2801.2.0;
|
DYLIB_CURRENT_VERSION = 2801.5.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
ENABLE_TESTABILITY = YES;
|
ENABLE_TESTABILITY = YES;
|
||||||
@@ -9656,7 +9656,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
CLANG_LINK_OBJC_RUNTIME = NO;
|
CLANG_LINK_OBJC_RUNTIME = NO;
|
||||||
MARKETING_VERSION = 2.28.2;
|
MARKETING_VERSION = 2.28.5;
|
||||||
OTHER_LDFLAGS = "-liconv";
|
OTHER_LDFLAGS = "-liconv";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@@ -9863,7 +9863,7 @@
|
|||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2801.2.0;
|
DYLIB_CURRENT_VERSION = 2801.5.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
GCC_DYNAMIC_NO_PIC = NO;
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
@@ -9915,7 +9915,7 @@
|
|||||||
DEFINES_MODULE = YES;
|
DEFINES_MODULE = YES;
|
||||||
DEVELOPMENT_TEAM = "";
|
DEVELOPMENT_TEAM = "";
|
||||||
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
DYLIB_COMPATIBILITY_VERSION = 2801.0.0;
|
||||||
DYLIB_CURRENT_VERSION = 2801.2.0;
|
DYLIB_CURRENT_VERSION = 2801.5.0;
|
||||||
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
DYLIB_INSTALL_NAME_BASE = "@rpath";
|
||||||
ENABLE_NS_ASSERTIONS = NO;
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
Title SDL 2.28.2
|
Title SDL 2.28.5
|
||||||
Version 1
|
Version 1
|
||||||
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
Description SDL Library for Mac OS X (http://www.libsdl.org)
|
||||||
DefaultLocation /Library/Frameworks
|
DefaultLocation /Library/Frameworks
|
||||||
|
|||||||
@@ -8,22 +8,22 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 31
|
if (buildAsApplication) {
|
||||||
|
namespace "org.libsdl.app"
|
||||||
|
}
|
||||||
|
compileSdkVersion 34
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
if (buildAsApplication) {
|
minSdkVersion 19
|
||||||
applicationId "org.libsdl.app"
|
targetSdkVersion 34
|
||||||
}
|
|
||||||
minSdkVersion 16
|
|
||||||
targetSdkVersion 31
|
|
||||||
versionCode 1
|
versionCode 1
|
||||||
versionName "1.0"
|
versionName "1.0"
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
ndkBuild {
|
ndkBuild {
|
||||||
arguments "APP_PLATFORM=android-16"
|
arguments "APP_PLATFORM=android-19"
|
||||||
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
}
|
}
|
||||||
// cmake {
|
// cmake {
|
||||||
// arguments "-DANDROID_APP_PLATFORM=android-16", "-DANDROID_STL=c++_static"
|
// arguments "-DANDROID_APP_PLATFORM=android-19", "-DANDROID_STL=c++_static"
|
||||||
// // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
// // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
||||||
// abiFilters 'arm64-v8a'
|
// abiFilters 'arm64-v8a'
|
||||||
// }
|
// }
|
||||||
@@ -53,10 +53,10 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
lintOptions {
|
lint {
|
||||||
abortOnError false
|
abortOnError false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buildAsLibrary) {
|
if (buildAsLibrary) {
|
||||||
libraryVariants.all { variant ->
|
libraryVariants.all { variant ->
|
||||||
variant.outputs.each { output ->
|
variant.outputs.each { output ->
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
com.gamemaker.game
|
com.gamemaker.game
|
||||||
-->
|
-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="org.libsdl.app"
|
|
||||||
android:versionCode="1"
|
android:versionCode="1"
|
||||||
android:versionName="1.0"
|
android:versionName="1.0"
|
||||||
android:installLocation="auto">
|
android:installLocation="auto">
|
||||||
|
|||||||
@@ -273,6 +273,7 @@ public class HIDDeviceManager {
|
|||||||
final int XB1_IFACE_SUBCLASS = 71;
|
final int XB1_IFACE_SUBCLASS = 71;
|
||||||
final int XB1_IFACE_PROTOCOL = 208;
|
final int XB1_IFACE_PROTOCOL = 208;
|
||||||
final int[] SUPPORTED_VENDORS = {
|
final int[] SUPPORTED_VENDORS = {
|
||||||
|
0x03f0, // HP
|
||||||
0x044f, // Thrustmaster
|
0x044f, // Thrustmaster
|
||||||
0x045e, // Microsoft
|
0x045e, // Microsoft
|
||||||
0x0738, // Mad Catz
|
0x0738, // Mad Catz
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
private static final String TAG = "SDL";
|
private static final String TAG = "SDL";
|
||||||
private static final int SDL_MAJOR_VERSION = 2;
|
private static final int SDL_MAJOR_VERSION = 2;
|
||||||
private static final int SDL_MINOR_VERSION = 28;
|
private static final int SDL_MINOR_VERSION = 28;
|
||||||
private static final int SDL_MICRO_VERSION = 2;
|
private static final int SDL_MICRO_VERSION = 5;
|
||||||
/*
|
/*
|
||||||
// Display InputType.SOURCE/CLASS of events and devices
|
// Display InputType.SOURCE/CLASS of events and devices
|
||||||
//
|
//
|
||||||
@@ -1345,23 +1345,6 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((source & InputDevice.SOURCE_KEYBOARD) == InputDevice.SOURCE_KEYBOARD) {
|
|
||||||
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
|
||||||
if (isTextInputEvent(event)) {
|
|
||||||
if (ic != null) {
|
|
||||||
ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
|
||||||
} else {
|
|
||||||
SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onNativeKeyDown(keyCode);
|
|
||||||
return true;
|
|
||||||
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
|
||||||
onNativeKeyUp(keyCode);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
|
if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
|
||||||
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
|
// on some devices key events are sent for mouse BUTTON_BACK/FORWARD presses
|
||||||
// they are ignored here because sending them as mouse input to SDL is messy
|
// they are ignored here because sending them as mouse input to SDL is messy
|
||||||
@@ -1376,6 +1359,21 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (event.getAction() == KeyEvent.ACTION_DOWN) {
|
||||||
|
if (isTextInputEvent(event)) {
|
||||||
|
if (ic != null) {
|
||||||
|
ic.commitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
||||||
|
} else {
|
||||||
|
SDLInputConnection.nativeCommitText(String.valueOf((char) event.getUnicodeChar()), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onNativeKeyDown(keyCode);
|
||||||
|
return true;
|
||||||
|
} else if (event.getAction() == KeyEvent.ACTION_UP) {
|
||||||
|
onNativeKeyUp(keyCode);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ buildscript {
|
|||||||
google()
|
google()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.3'
|
classpath 'com.android.tools.build:gradle:8.1.1'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#Thu Nov 11 18:20:34 PST 2021
|
#Thu Nov 11 18:20:34 PST 2021
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
Vendored
+52
-13
@@ -1,10 +1,10 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Attempt to guess a canonical system name.
|
# Attempt to guess a canonical system name.
|
||||||
# Copyright 1992-2022 Free Software Foundation, Inc.
|
# Copyright 1992-2023 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||||
|
|
||||||
timestamp='2022-05-25'
|
timestamp='2023-08-22'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# This file is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by
|
# under the terms of the GNU General Public License as published by
|
||||||
@@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
|
|||||||
usage="\
|
usage="\
|
||||||
Usage: $0 [OPTION]
|
Usage: $0 [OPTION]
|
||||||
|
|
||||||
Output the configuration name of the system \`$me' is run on.
|
Output the configuration name of the system '$me' is run on.
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
-h, --help print this help, then exit
|
-h, --help print this help, then exit
|
||||||
@@ -60,13 +60,13 @@ version="\
|
|||||||
GNU config.guess ($timestamp)
|
GNU config.guess ($timestamp)
|
||||||
|
|
||||||
Originally written by Per Bothner.
|
Originally written by Per Bothner.
|
||||||
Copyright 1992-2022 Free Software Foundation, Inc.
|
Copyright 1992-2023 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
|
|
||||||
help="
|
help="
|
||||||
Try \`$me --help' for more information."
|
Try '$me --help' for more information."
|
||||||
|
|
||||||
# Parse command line
|
# Parse command line
|
||||||
while test $# -gt 0 ; do
|
while test $# -gt 0 ; do
|
||||||
@@ -102,8 +102,8 @@ GUESS=
|
|||||||
# temporary files to be created and, as you can see below, it is a
|
# temporary files to be created and, as you can see below, it is a
|
||||||
# headache to deal with in a portable fashion.
|
# headache to deal with in a portable fashion.
|
||||||
|
|
||||||
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
|
# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
|
||||||
# use `HOST_CC' if defined, but it is deprecated.
|
# use 'HOST_CC' if defined, but it is deprecated.
|
||||||
|
|
||||||
# Portable tmp directory creation inspired by the Autoconf team.
|
# Portable tmp directory creation inspired by the Autoconf team.
|
||||||
|
|
||||||
@@ -155,6 +155,9 @@ Linux|GNU|GNU/*)
|
|||||||
|
|
||||||
set_cc_for_build
|
set_cc_for_build
|
||||||
cat <<-EOF > "$dummy.c"
|
cat <<-EOF > "$dummy.c"
|
||||||
|
#if defined(__ANDROID__)
|
||||||
|
LIBC=android
|
||||||
|
#else
|
||||||
#include <features.h>
|
#include <features.h>
|
||||||
#if defined(__UCLIBC__)
|
#if defined(__UCLIBC__)
|
||||||
LIBC=uclibc
|
LIBC=uclibc
|
||||||
@@ -169,6 +172,7 @@ Linux|GNU|GNU/*)
|
|||||||
LIBC=musl
|
LIBC=musl
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
EOF
|
EOF
|
||||||
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
|
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
|
||||||
eval "$cc_set_libc"
|
eval "$cc_set_libc"
|
||||||
@@ -459,7 +463,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
|
|||||||
UNAME_RELEASE=`uname -v`
|
UNAME_RELEASE=`uname -v`
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
# Japanese Language versions have a version number like '4.1.3-JL'.
|
||||||
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
|
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
|
||||||
GUESS=sparc-sun-sunos$SUN_REL
|
GUESS=sparc-sun-sunos$SUN_REL
|
||||||
;;
|
;;
|
||||||
@@ -904,7 +908,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*:FreeBSD:*:*)
|
*:FreeBSD:*:*)
|
||||||
UNAME_PROCESSOR=`/usr/bin/uname -p`
|
UNAME_PROCESSOR=`uname -p`
|
||||||
case $UNAME_PROCESSOR in
|
case $UNAME_PROCESSOR in
|
||||||
amd64)
|
amd64)
|
||||||
UNAME_PROCESSOR=x86_64 ;;
|
UNAME_PROCESSOR=x86_64 ;;
|
||||||
@@ -966,11 +970,37 @@ EOF
|
|||||||
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
|
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
|
||||||
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
|
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
|
||||||
;;
|
;;
|
||||||
|
x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
|
||||||
|
GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
|
||||||
|
;;
|
||||||
|
*:[Mm]anagarm:*:*)
|
||||||
|
GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
|
||||||
|
;;
|
||||||
*:Minix:*:*)
|
*:Minix:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-minix
|
GUESS=$UNAME_MACHINE-unknown-minix
|
||||||
;;
|
;;
|
||||||
aarch64:Linux:*:*)
|
aarch64:Linux:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
set_cc_for_build
|
||||||
|
CPU=$UNAME_MACHINE
|
||||||
|
LIBCABI=$LIBC
|
||||||
|
if test "$CC_FOR_BUILD" != no_compiler_found; then
|
||||||
|
ABI=64
|
||||||
|
sed 's/^ //' << EOF > "$dummy.c"
|
||||||
|
#ifdef __ARM_EABI__
|
||||||
|
#ifdef __ARM_PCS_VFP
|
||||||
|
ABI=eabihf
|
||||||
|
#else
|
||||||
|
ABI=eabi
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
EOF
|
||||||
|
cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
|
||||||
|
eval "$cc_set_abi"
|
||||||
|
case $ABI in
|
||||||
|
eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
GUESS=$CPU-unknown-linux-$LIBCABI
|
||||||
;;
|
;;
|
||||||
aarch64_be:Linux:*:*)
|
aarch64_be:Linux:*:*)
|
||||||
UNAME_MACHINE=aarch64_be
|
UNAME_MACHINE=aarch64_be
|
||||||
@@ -1036,7 +1066,16 @@ EOF
|
|||||||
k1om:Linux:*:*)
|
k1om:Linux:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||||
;;
|
;;
|
||||||
loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
|
kvx:Linux:*:*)
|
||||||
|
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||||
|
;;
|
||||||
|
kvx:cos:*:*)
|
||||||
|
GUESS=$UNAME_MACHINE-unknown-cos
|
||||||
|
;;
|
||||||
|
kvx:mbr:*:*)
|
||||||
|
GUESS=$UNAME_MACHINE-unknown-mbr
|
||||||
|
;;
|
||||||
|
loongarch32:Linux:*:* | loongarch64:Linux:*:*)
|
||||||
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
|
||||||
;;
|
;;
|
||||||
m32r*:Linux:*:*)
|
m32r*:Linux:*:*)
|
||||||
@@ -1191,7 +1230,7 @@ EOF
|
|||||||
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
|
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
|
||||||
;;
|
;;
|
||||||
i*86:OS/2:*:*)
|
i*86:OS/2:*:*)
|
||||||
# If we were able to find `uname', then EMX Unix compatibility
|
# If we were able to find 'uname', then EMX Unix compatibility
|
||||||
# is probably installed.
|
# is probably installed.
|
||||||
GUESS=$UNAME_MACHINE-pc-os2-emx
|
GUESS=$UNAME_MACHINE-pc-os2-emx
|
||||||
;;
|
;;
|
||||||
@@ -1332,7 +1371,7 @@ EOF
|
|||||||
GUESS=ns32k-sni-sysv
|
GUESS=ns32k-sni-sysv
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
|
PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
|
||||||
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
# says <Richard.M.Bartel@ccMail.Census.GOV>
|
||||||
GUESS=i586-unisys-sysv4
|
GUESS=i586-unisys-sysv4
|
||||||
;;
|
;;
|
||||||
|
|||||||
Vendored
+146
-76
@@ -1,10 +1,10 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# Configuration validation subroutine script.
|
# Configuration validation subroutine script.
|
||||||
# Copyright 1992-2022 Free Software Foundation, Inc.
|
# Copyright 1992-2023 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
# shellcheck disable=SC2006,SC2268 # see below for rationale
|
||||||
|
|
||||||
timestamp='2022-01-03'
|
timestamp='2023-09-19'
|
||||||
|
|
||||||
# This file is free software; you can redistribute it and/or modify it
|
# This file is free software; you can redistribute it and/or modify it
|
||||||
# under the terms of the GNU General Public License as published by
|
# under the terms of the GNU General Public License as published by
|
||||||
@@ -76,13 +76,13 @@ Report bugs and patches to <config-patches@gnu.org>."
|
|||||||
version="\
|
version="\
|
||||||
GNU config.sub ($timestamp)
|
GNU config.sub ($timestamp)
|
||||||
|
|
||||||
Copyright 1992-2022 Free Software Foundation, Inc.
|
Copyright 1992-2023 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This is free software; see the source for copying conditions. There is NO
|
This is free software; see the source for copying conditions. There is NO
|
||||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||||
|
|
||||||
help="
|
help="
|
||||||
Try \`$me --help' for more information."
|
Try '$me --help' for more information."
|
||||||
|
|
||||||
# Parse command line
|
# Parse command line
|
||||||
while test $# -gt 0 ; do
|
while test $# -gt 0 ; do
|
||||||
@@ -130,7 +130,7 @@ IFS=$saved_IFS
|
|||||||
# Separate into logical components for further validation
|
# Separate into logical components for further validation
|
||||||
case $1 in
|
case $1 in
|
||||||
*-*-*-*-*)
|
*-*-*-*-*)
|
||||||
echo Invalid configuration \`"$1"\': more than four components >&2
|
echo "Invalid configuration '$1': more than four components" >&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
*-*-*-*)
|
*-*-*-*)
|
||||||
@@ -145,7 +145,8 @@ case $1 in
|
|||||||
nto-qnx* | linux-* | uclinux-uclibc* \
|
nto-qnx* | linux-* | uclinux-uclibc* \
|
||||||
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
|
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
|
||||||
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
|
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
|
||||||
| storm-chaos* | os2-emx* | rtmk-nova*)
|
| storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
|
||||||
|
| windows-* )
|
||||||
basic_machine=$field1
|
basic_machine=$field1
|
||||||
basic_os=$maybe_os
|
basic_os=$maybe_os
|
||||||
;;
|
;;
|
||||||
@@ -943,7 +944,7 @@ $basic_machine
|
|||||||
EOF
|
EOF
|
||||||
IFS=$saved_IFS
|
IFS=$saved_IFS
|
||||||
;;
|
;;
|
||||||
# We use `pc' rather than `unknown'
|
# We use 'pc' rather than 'unknown'
|
||||||
# because (1) that's what they normally are, and
|
# because (1) that's what they normally are, and
|
||||||
# (2) the word "unknown" tends to confuse beginning users.
|
# (2) the word "unknown" tends to confuse beginning users.
|
||||||
i*86 | x86_64)
|
i*86 | x86_64)
|
||||||
@@ -1180,7 +1181,7 @@ case $cpu-$vendor in
|
|||||||
case $cpu in
|
case $cpu in
|
||||||
1750a | 580 \
|
1750a | 580 \
|
||||||
| a29k \
|
| a29k \
|
||||||
| aarch64 | aarch64_be \
|
| aarch64 | aarch64_be | aarch64c | arm64ec \
|
||||||
| abacus \
|
| abacus \
|
||||||
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
|
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
|
||||||
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
|
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
|
||||||
@@ -1199,45 +1200,23 @@ case $cpu-$vendor in
|
|||||||
| d10v | d30v | dlx | dsp16xx \
|
| d10v | d30v | dlx | dsp16xx \
|
||||||
| e2k | elxsi | epiphany \
|
| e2k | elxsi | epiphany \
|
||||||
| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
|
| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
|
||||||
|
| javascript \
|
||||||
| h8300 | h8500 \
|
| h8300 | h8500 \
|
||||||
| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
|
||||||
| hexagon \
|
| hexagon \
|
||||||
| i370 | i*86 | i860 | i960 | ia16 | ia64 \
|
| i370 | i*86 | i860 | i960 | ia16 | ia64 \
|
||||||
| ip2k | iq2000 \
|
| ip2k | iq2000 \
|
||||||
| k1om \
|
| k1om \
|
||||||
|
| kvx \
|
||||||
| le32 | le64 \
|
| le32 | le64 \
|
||||||
| lm32 \
|
| lm32 \
|
||||||
| loongarch32 | loongarch64 | loongarchx32 \
|
| loongarch32 | loongarch64 \
|
||||||
| m32c | m32r | m32rle \
|
| m32c | m32r | m32rle \
|
||||||
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
|
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
|
||||||
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
|
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
|
||||||
| m88110 | m88k | maxq | mb | mcore | mep | metag \
|
| m88110 | m88k | maxq | mb | mcore | mep | metag \
|
||||||
| microblaze | microblazeel \
|
| microblaze | microblazeel \
|
||||||
| mips | mipsbe | mipseb | mipsel | mipsle \
|
| mips* \
|
||||||
| mips16 \
|
|
||||||
| mips64 | mips64eb | mips64el \
|
|
||||||
| mips64octeon | mips64octeonel \
|
|
||||||
| mips64orion | mips64orionel \
|
|
||||||
| mips64r5900 | mips64r5900el \
|
|
||||||
| mips64vr | mips64vrel \
|
|
||||||
| mips64vr4100 | mips64vr4100el \
|
|
||||||
| mips64vr4300 | mips64vr4300el \
|
|
||||||
| mips64vr5000 | mips64vr5000el \
|
|
||||||
| mips64vr5900 | mips64vr5900el \
|
|
||||||
| mipsisa32 | mipsisa32el \
|
|
||||||
| mipsisa32r2 | mipsisa32r2el \
|
|
||||||
| mipsisa32r3 | mipsisa32r3el \
|
|
||||||
| mipsisa32r5 | mipsisa32r5el \
|
|
||||||
| mipsisa32r6 | mipsisa32r6el \
|
|
||||||
| mipsisa64 | mipsisa64el \
|
|
||||||
| mipsisa64r2 | mipsisa64r2el \
|
|
||||||
| mipsisa64r3 | mipsisa64r3el \
|
|
||||||
| mipsisa64r5 | mipsisa64r5el \
|
|
||||||
| mipsisa64r6 | mipsisa64r6el \
|
|
||||||
| mipsisa64sb1 | mipsisa64sb1el \
|
|
||||||
| mipsisa64sr71k | mipsisa64sr71kel \
|
|
||||||
| mipsr5900 | mipsr5900el \
|
|
||||||
| mipstx39 | mipstx39el \
|
|
||||||
| mmix \
|
| mmix \
|
||||||
| mn10200 | mn10300 \
|
| mn10200 | mn10300 \
|
||||||
| moxie \
|
| moxie \
|
||||||
@@ -1285,7 +1264,7 @@ case $cpu-$vendor in
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
|
echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1306,11 +1285,12 @@ esac
|
|||||||
|
|
||||||
# Decode manufacturer-specific aliases for certain operating systems.
|
# Decode manufacturer-specific aliases for certain operating systems.
|
||||||
|
|
||||||
if test x$basic_os != x
|
if test x"$basic_os" != x
|
||||||
then
|
then
|
||||||
|
|
||||||
# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
|
# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
|
||||||
# set os.
|
# set os.
|
||||||
|
obj=
|
||||||
case $basic_os in
|
case $basic_os in
|
||||||
gnu/linux*)
|
gnu/linux*)
|
||||||
kernel=linux
|
kernel=linux
|
||||||
@@ -1341,6 +1321,10 @@ EOF
|
|||||||
kernel=linux
|
kernel=linux
|
||||||
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
|
os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
|
||||||
;;
|
;;
|
||||||
|
managarm*)
|
||||||
|
kernel=managarm
|
||||||
|
os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
kernel=
|
kernel=
|
||||||
os=$basic_os
|
os=$basic_os
|
||||||
@@ -1506,10 +1490,16 @@ case $os in
|
|||||||
os=eabi
|
os=eabi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
aout* | coff* | elf* | pe*)
|
||||||
|
# These are machine code file formats, not OSes
|
||||||
|
obj=$os
|
||||||
|
os=
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
# No normalization, but not necessarily accepted, that comes below.
|
# No normalization, but not necessarily accepted, that comes below.
|
||||||
;;
|
;;
|
||||||
@@ -1528,12 +1518,15 @@ else
|
|||||||
# system, and we'll never get to this point.
|
# system, and we'll never get to this point.
|
||||||
|
|
||||||
kernel=
|
kernel=
|
||||||
|
obj=
|
||||||
case $cpu-$vendor in
|
case $cpu-$vendor in
|
||||||
score-*)
|
score-*)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
spu-*)
|
spu-*)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
*-acorn)
|
*-acorn)
|
||||||
os=riscix1.2
|
os=riscix1.2
|
||||||
@@ -1543,28 +1536,35 @@ case $cpu-$vendor in
|
|||||||
os=gnu
|
os=gnu
|
||||||
;;
|
;;
|
||||||
arm*-semi)
|
arm*-semi)
|
||||||
os=aout
|
os=
|
||||||
|
obj=aout
|
||||||
;;
|
;;
|
||||||
c4x-* | tic4x-*)
|
c4x-* | tic4x-*)
|
||||||
os=coff
|
os=
|
||||||
|
obj=coff
|
||||||
;;
|
;;
|
||||||
c8051-*)
|
c8051-*)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
clipper-intergraph)
|
clipper-intergraph)
|
||||||
os=clix
|
os=clix
|
||||||
;;
|
;;
|
||||||
hexagon-*)
|
hexagon-*)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
tic54x-*)
|
tic54x-*)
|
||||||
os=coff
|
os=
|
||||||
|
obj=coff
|
||||||
;;
|
;;
|
||||||
tic55x-*)
|
tic55x-*)
|
||||||
os=coff
|
os=
|
||||||
|
obj=coff
|
||||||
;;
|
;;
|
||||||
tic6x-*)
|
tic6x-*)
|
||||||
os=coff
|
os=
|
||||||
|
obj=coff
|
||||||
;;
|
;;
|
||||||
# This must come before the *-dec entry.
|
# This must come before the *-dec entry.
|
||||||
pdp10-*)
|
pdp10-*)
|
||||||
@@ -1586,19 +1586,24 @@ case $cpu-$vendor in
|
|||||||
os=sunos3
|
os=sunos3
|
||||||
;;
|
;;
|
||||||
m68*-cisco)
|
m68*-cisco)
|
||||||
os=aout
|
os=
|
||||||
|
obj=aout
|
||||||
;;
|
;;
|
||||||
mep-*)
|
mep-*)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
mips*-cisco)
|
mips*-cisco)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
mips*-*)
|
mips*-*)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
or32-*)
|
or32-*)
|
||||||
os=coff
|
os=
|
||||||
|
obj=coff
|
||||||
;;
|
;;
|
||||||
*-tti) # must be before sparc entry or we get the wrong os.
|
*-tti) # must be before sparc entry or we get the wrong os.
|
||||||
os=sysv3
|
os=sysv3
|
||||||
@@ -1607,7 +1612,8 @@ case $cpu-$vendor in
|
|||||||
os=sunos4.1.1
|
os=sunos4.1.1
|
||||||
;;
|
;;
|
||||||
pru-*)
|
pru-*)
|
||||||
os=elf
|
os=
|
||||||
|
obj=elf
|
||||||
;;
|
;;
|
||||||
*-be)
|
*-be)
|
||||||
os=beos
|
os=beos
|
||||||
@@ -1688,10 +1694,12 @@ case $cpu-$vendor in
|
|||||||
os=uxpv
|
os=uxpv
|
||||||
;;
|
;;
|
||||||
*-rom68k)
|
*-rom68k)
|
||||||
os=coff
|
os=
|
||||||
|
obj=coff
|
||||||
;;
|
;;
|
||||||
*-*bug)
|
*-*bug)
|
||||||
os=coff
|
os=
|
||||||
|
obj=coff
|
||||||
;;
|
;;
|
||||||
*-apple)
|
*-apple)
|
||||||
os=macos
|
os=macos
|
||||||
@@ -1709,7 +1717,8 @@ esac
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Now, validate our (potentially fixed-up) OS.
|
# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).
|
||||||
|
|
||||||
case $os in
|
case $os in
|
||||||
# Sometimes we do "kernel-libc", so those need to count as OSes.
|
# Sometimes we do "kernel-libc", so those need to count as OSes.
|
||||||
musl* | newlib* | relibc* | uclibc*)
|
musl* | newlib* | relibc* | uclibc*)
|
||||||
@@ -1720,6 +1729,9 @@ case $os in
|
|||||||
# VxWorks passes extra cpu info in the 4th filed.
|
# VxWorks passes extra cpu info in the 4th filed.
|
||||||
simlinux | simwindows | spe)
|
simlinux | simwindows | spe)
|
||||||
;;
|
;;
|
||||||
|
# See `case $cpu-$os` validation below
|
||||||
|
ghcjs)
|
||||||
|
;;
|
||||||
# Now accept the basic system types.
|
# Now accept the basic system types.
|
||||||
# The portable systems comes first.
|
# The portable systems comes first.
|
||||||
# Each alternative MUST end in a * to match a version number.
|
# Each alternative MUST end in a * to match a version number.
|
||||||
@@ -1728,7 +1740,7 @@ case $os in
|
|||||||
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
|
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
|
||||||
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
|
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
|
||||||
| hiux* | abug | nacl* | netware* | windows* \
|
| hiux* | abug | nacl* | netware* | windows* \
|
||||||
| os9* | macos* | osx* | ios* \
|
| os9* | macos* | osx* | ios* | tvos* | watchos* \
|
||||||
| mpw* | magic* | mmixware* | mon960* | lnews* \
|
| mpw* | magic* | mmixware* | mon960* | lnews* \
|
||||||
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
|
| amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
|
||||||
| aos* | aros* | cloudabi* | sortix* | twizzler* \
|
| aos* | aros* | cloudabi* | sortix* | twizzler* \
|
||||||
@@ -1737,11 +1749,11 @@ case $os in
|
|||||||
| mirbsd* | netbsd* | dicos* | openedition* | ose* \
|
| mirbsd* | netbsd* | dicos* | openedition* | ose* \
|
||||||
| bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
|
| bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
|
||||||
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
|
| ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
|
||||||
| bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
|
| bosx* | nextstep* | cxux* | oabi* \
|
||||||
| ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
|
| ptx* | ecoff* | winnt* | domain* | vsta* \
|
||||||
| udi* | lites* | ieee* | go32* | aux* | hcos* \
|
| udi* | lites* | ieee* | go32* | aux* | hcos* \
|
||||||
| chorusrdb* | cegcc* | glidix* | serenity* \
|
| chorusrdb* | cegcc* | glidix* | serenity* \
|
||||||
| cygwin* | msys* | pe* | moss* | proelf* | rtems* \
|
| cygwin* | msys* | moss* | proelf* | rtems* \
|
||||||
| midipix* | mingw32* | mingw64* | mint* \
|
| midipix* | mingw32* | mingw64* | mint* \
|
||||||
| uxpv* | beos* | mpeix* | udk* | moxiebox* \
|
| uxpv* | beos* | mpeix* | udk* | moxiebox* \
|
||||||
| interix* | uwin* | mks* | rhapsody* | darwin* \
|
| interix* | uwin* | mks* | rhapsody* | darwin* \
|
||||||
@@ -1754,7 +1766,7 @@ case $os in
|
|||||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||||
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||||
| fiwix* )
|
| fiwix* | mlibc* | cos* | mbr* )
|
||||||
;;
|
;;
|
||||||
# This one is extra strict with allowed versions
|
# This one is extra strict with allowed versions
|
||||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
||||||
@@ -1762,41 +1774,99 @@ case $os in
|
|||||||
;;
|
;;
|
||||||
none)
|
none)
|
||||||
;;
|
;;
|
||||||
|
kernel* | msvc* )
|
||||||
|
# Restricted further below
|
||||||
|
;;
|
||||||
|
'')
|
||||||
|
if test x"$obj" = x
|
||||||
|
then
|
||||||
|
echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
|
||||||
|
fi
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
|
echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $obj in
|
||||||
|
aout* | coff* | elf* | pe*)
|
||||||
|
;;
|
||||||
|
'')
|
||||||
|
# empty is fine
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Here we handle the constraint that a (synthetic) cpu and os are
|
||||||
|
# valid only in combination with each other and nowhere else.
|
||||||
|
case $cpu-$os in
|
||||||
|
# The "javascript-unknown-ghcjs" triple is used by GHC; we
|
||||||
|
# accept it here in order to tolerate that, but reject any
|
||||||
|
# variations.
|
||||||
|
javascript-ghcjs)
|
||||||
|
;;
|
||||||
|
javascript-* | *-ghcjs)
|
||||||
|
echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# As a final step for OS-related things, validate the OS-kernel combination
|
# As a final step for OS-related things, validate the OS-kernel combination
|
||||||
# (given a valid OS), if there is a kernel.
|
# (given a valid OS), if there is a kernel.
|
||||||
case $kernel-$os in
|
case $kernel-$os-$obj in
|
||||||
linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \
|
linux-gnu*- | linux-dietlibc*- | linux-android*- | linux-newlib*- \
|
||||||
| linux-musl* | linux-relibc* | linux-uclibc* )
|
| linux-musl*- | linux-relibc*- | linux-uclibc*- | linux-mlibc*- )
|
||||||
;;
|
;;
|
||||||
uclinux-uclibc* )
|
uclinux-uclibc*- )
|
||||||
;;
|
;;
|
||||||
-dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* )
|
managarm-mlibc*- | managarm-kernel*- )
|
||||||
|
;;
|
||||||
|
windows*-msvc*-)
|
||||||
|
;;
|
||||||
|
-dietlibc*- | -newlib*- | -musl*- | -relibc*- | -uclibc*- | -mlibc*- )
|
||||||
# These are just libc implementations, not actual OSes, and thus
|
# These are just libc implementations, not actual OSes, and thus
|
||||||
# require a kernel.
|
# require a kernel.
|
||||||
echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
|
echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
kfreebsd*-gnu* | kopensolaris*-gnu*)
|
-kernel*- )
|
||||||
|
echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
vxworks-simlinux | vxworks-simwindows | vxworks-spe)
|
*-kernel*- )
|
||||||
|
echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
nto-qnx*)
|
*-msvc*- )
|
||||||
|
echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
os2-emx)
|
kfreebsd*-gnu*- | kopensolaris*-gnu*-)
|
||||||
;;
|
;;
|
||||||
*-eabi* | *-gnueabi*)
|
vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
|
||||||
;;
|
;;
|
||||||
-*)
|
nto-qnx*-)
|
||||||
|
;;
|
||||||
|
os2-emx-)
|
||||||
|
;;
|
||||||
|
*-eabi*- | *-gnueabi*-)
|
||||||
|
;;
|
||||||
|
none--*)
|
||||||
|
# None (no kernel, i.e. freestanding / bare metal),
|
||||||
|
# can be paired with an machine code file format
|
||||||
|
;;
|
||||||
|
-*-)
|
||||||
# Blank kernel with real OS is always fine.
|
# Blank kernel with real OS is always fine.
|
||||||
;;
|
;;
|
||||||
*-*)
|
--*)
|
||||||
echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
|
# Blank kernel and OS with real machine code file format is always fine.
|
||||||
|
;;
|
||||||
|
*-*-*)
|
||||||
|
echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -1879,7 +1949,7 @@ case $vendor in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "$cpu-$vendor-${kernel:+$kernel-}$os"
|
echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
|
||||||
exit
|
exit
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
|
|||||||
@@ -905,6 +905,22 @@ macro(CheckOpenGLES)
|
|||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
# Requires:
|
||||||
|
# - EGL
|
||||||
|
macro(CheckQNXScreen)
|
||||||
|
if(QNX AND HAVE_OPENGL_EGL)
|
||||||
|
check_c_source_compiles("
|
||||||
|
#include <screen/screen.h>
|
||||||
|
int main (int argc, char** argv) { return 0; }" HAVE_QNX_SCREEN)
|
||||||
|
if(HAVE_QNX_SCREEN)
|
||||||
|
set(SDL_VIDEO_DRIVER_QNX 1)
|
||||||
|
file(GLOB QNX_VIDEO_SOURCES ${SDL2_SOURCE_DIR}/src/video/qnx/*.c)
|
||||||
|
list(APPEND SOURCE_FILES ${QNX_VIDEO_SOURCES})
|
||||||
|
list(APPEND EXTRA_LIBS screen EGL)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
# Requires:
|
# Requires:
|
||||||
# - nada
|
# - nada
|
||||||
# Optional:
|
# Optional:
|
||||||
@@ -955,6 +971,8 @@ macro(CheckPTHREAD)
|
|||||||
elseif(EMSCRIPTEN)
|
elseif(EMSCRIPTEN)
|
||||||
set(PTHREAD_CFLAGS "-D_REENTRANT -pthread")
|
set(PTHREAD_CFLAGS "-D_REENTRANT -pthread")
|
||||||
set(PTHREAD_LDFLAGS "-pthread")
|
set(PTHREAD_LDFLAGS "-pthread")
|
||||||
|
elseif(QNX)
|
||||||
|
# pthread support is baked in
|
||||||
else()
|
else()
|
||||||
set(PTHREAD_CFLAGS "-D_REENTRANT")
|
set(PTHREAD_CFLAGS "-D_REENTRANT")
|
||||||
set(PTHREAD_LDFLAGS "-lpthread")
|
set(PTHREAD_LDFLAGS "-lpthread")
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ macro(SDL_DetectCMakePlatform)
|
|||||||
set(SDL_CMAKE_PLATFORM AIX)
|
set(SDL_CMAKE_PLATFORM AIX)
|
||||||
elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*")
|
elseif(CMAKE_SYSTEM_NAME MATCHES "Minix.*")
|
||||||
set(SDL_CMAKE_PLATFORM MINIX)
|
set(SDL_CMAKE_PLATFORM MINIX)
|
||||||
|
elseif(CMAKE_SYSTEM_NAME MATCHES "QNX")
|
||||||
|
set(SDL_CMAKE_PLATFORM QNX)
|
||||||
endif()
|
endif()
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
|
if(CMAKE_SYSTEM_NAME MATCHES ".*Darwin.*")
|
||||||
|
|||||||
@@ -3507,7 +3507,7 @@ orig_CFLAGS="$CFLAGS"
|
|||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
SDL_MAJOR_VERSION=2
|
SDL_MAJOR_VERSION=2
|
||||||
SDL_MINOR_VERSION=28
|
SDL_MINOR_VERSION=28
|
||||||
SDL_MICRO_VERSION=2
|
SDL_MICRO_VERSION=5
|
||||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||||
|
|
||||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ dnl Set various version strings - taken gratefully from the GTk sources
|
|||||||
# See docs/release_checklist.md
|
# See docs/release_checklist.md
|
||||||
SDL_MAJOR_VERSION=2
|
SDL_MAJOR_VERSION=2
|
||||||
SDL_MINOR_VERSION=28
|
SDL_MINOR_VERSION=28
|
||||||
SDL_MICRO_VERSION=2
|
SDL_MICRO_VERSION=5
|
||||||
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
SDL_VERSION=$SDL_MAJOR_VERSION.$SDL_MINOR_VERSION.$SDL_MICRO_VERSION
|
||||||
|
|
||||||
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
SDL_BINARY_AGE=`expr $SDL_MINOR_VERSION \* 100 + $SDL_MICRO_VERSION`
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ supported, but you can use the "android-project-ant" directory as a template.
|
|||||||
Requirements
|
Requirements
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
Android SDK (version 31 or later)
|
Android SDK (version 34 or later)
|
||||||
https://developer.android.com/sdk/index.html
|
https://developer.android.com/sdk/index.html
|
||||||
|
|
||||||
Android NDK r15c or later
|
Android NDK r15c or later
|
||||||
https://developer.android.com/tools/sdk/ndk/index.html
|
https://developer.android.com/tools/sdk/ndk/index.html
|
||||||
|
|
||||||
Minimum API level supported by SDL: 16 (Android 4.1)
|
Minimum API level supported by SDL: 19 (Android 4.4)
|
||||||
|
|
||||||
|
|
||||||
How the port works
|
How the port works
|
||||||
@@ -431,13 +431,13 @@ The Tegra Graphics Debugger is available from NVidia here:
|
|||||||
https://developer.nvidia.com/tegra-graphics-debugger
|
https://developer.nvidia.com/tegra-graphics-debugger
|
||||||
|
|
||||||
|
|
||||||
Why is API level 16 the minimum required?
|
Why is API level 19 the minimum required?
|
||||||
================================================================================
|
================================================================================
|
||||||
|
|
||||||
The latest NDK toolchain doesn't support targeting earlier than API level 16.
|
The latest NDK toolchain doesn't support targeting earlier than API level 19.
|
||||||
As of this writing, according to https://developer.android.com/about/dashboards/index.html
|
As of this writing, according to https://www.composables.com/tools/distribution-chart
|
||||||
about 99% of the Android devices accessing Google Play support API level 16 or
|
about 99.7% of the Android devices accessing Google Play support API level 19 or
|
||||||
higher (January 2018).
|
higher (August 2023).
|
||||||
|
|
||||||
|
|
||||||
A note regarding the use of the "dirty rectangles" rendering technique
|
A note regarding the use of the "dirty rectangles" rendering technique
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ SDL can be included in your project in 2 major ways:
|
|||||||
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
|
The following CMake script supports both, depending on the value of `MYGAME_VENDORED`.
|
||||||
|
|
||||||
```cmake
|
```cmake
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.5)
|
||||||
project(mygame)
|
project(mygame)
|
||||||
|
|
||||||
# Create an option to switch between a system sdl library and a vendored sdl library
|
# Create an option to switch between a system sdl library and a vendored sdl library
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ for some Javascript code to steal for this approach.
|
|||||||
|
|
||||||
## Building SDL/emscripten
|
## Building SDL/emscripten
|
||||||
|
|
||||||
SDL currently requires at least Emscripten 2.0.32 to build. Newer versions
|
SDL currently requires at least Emscripten 3.1.35 to build. Newer versions
|
||||||
are likely to work, as well.
|
are likely to work, as well.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ assert can have unique static variables associated with it.
|
|||||||
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
#define SDL_TriggerBreakpoint() __builtin_debugtrap()
|
||||||
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
#elif ( (!defined(__NACL__)) && ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__))) )
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
|
||||||
|
#elif (defined(__GNUC__) || defined(__clang__)) && defined(__riscv)
|
||||||
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "ebreak\n\t" )
|
||||||
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
#elif ( defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__)) ) /* this might work on other ARM targets, but this is a known quantity... */
|
||||||
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
#define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "brk #22\n\t" )
|
||||||
#elif defined(__APPLE__) && defined(__arm__)
|
#elif defined(__APPLE__) && defined(__arm__)
|
||||||
|
|||||||
@@ -262,6 +262,8 @@
|
|||||||
#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
|
#cmakedefine HAVE_XINPUT_GAMEPAD_EX @HAVE_XINPUT_GAMEPAD_EX@
|
||||||
#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
|
#cmakedefine HAVE_XINPUT_STATE_EX @HAVE_XINPUT_STATE_EX@
|
||||||
|
|
||||||
|
#cmakedefine USE_POSIX_SPAWN @USE_POSIX_SPAWN@
|
||||||
|
|
||||||
/* SDL internal assertion support */
|
/* SDL internal assertion support */
|
||||||
#if @SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED@
|
#if @SDL_DEFAULT_ASSERT_LEVEL_CONFIGURED@
|
||||||
#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
|
#cmakedefine SDL_DEFAULT_ASSERT_LEVEL @SDL_DEFAULT_ASSERT_LEVEL@
|
||||||
|
|||||||
@@ -1474,6 +1474,17 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
|
#define SDL_HINT_RENDER_VSYNC "SDL_RENDER_VSYNC"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief A variable controlling whether the Metal render driver select low power device over default one
|
||||||
|
*
|
||||||
|
* This variable can be set to the following values:
|
||||||
|
* "0" - Use the prefered OS device
|
||||||
|
* "1" - Select a low power one
|
||||||
|
*
|
||||||
|
* By default the prefered OS device is used.
|
||||||
|
*/
|
||||||
|
#define SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE "SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS
|
* \brief A variable controlling if VSYNC is automatically disable if doesn't reach the enough FPS
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1890,7 +1890,7 @@ extern DECLSPEC void *SDLCALL SDL_RenderGetMetalLayer(SDL_Renderer * renderer);
|
|||||||
* Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give
|
* Note that as of SDL 2.0.18, this will return NULL if Metal refuses to give
|
||||||
* SDL a drawable to render to, which might happen if the window is
|
* SDL a drawable to render to, which might happen if the window is
|
||||||
* hidden/minimized/offscreen. This doesn't apply to command encoders for
|
* hidden/minimized/offscreen. This doesn't apply to command encoders for
|
||||||
* render targets, just the window's backbacker. Check your return values!
|
* render targets, just the window's backbuffer. Check your return values!
|
||||||
*
|
*
|
||||||
* \param renderer The renderer to query
|
* \param renderer The renderer to query
|
||||||
* \returns an `id<MTLRenderCommandEncoder>` on success, or NULL if the
|
* \returns an `id<MTLRenderCommandEncoder>` on success, or NULL if the
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ typedef struct SDL_version
|
|||||||
*/
|
*/
|
||||||
#define SDL_MAJOR_VERSION 2
|
#define SDL_MAJOR_VERSION 2
|
||||||
#define SDL_MINOR_VERSION 28
|
#define SDL_MINOR_VERSION 28
|
||||||
#define SDL_PATCHLEVEL 2
|
#define SDL_PATCHLEVEL 5
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Macro to determine SDL version program was compiled against.
|
* Macro to determine SDL version program was compiled against.
|
||||||
|
|||||||
+10
-2
@@ -42,7 +42,15 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__EMSCRIPTEN__)
|
#if defined(__EMSCRIPTEN__)
|
||||||
#include <emscripten.h>
|
#include <emscripten.h>
|
||||||
|
/* older Emscriptens don't have this, but we need to for wasm64 compatibility. */
|
||||||
|
#ifndef MAIN_THREAD_EM_ASM_PTR
|
||||||
|
#ifdef __wasm64__
|
||||||
|
#error You need to upgrade your Emscripten compiler to support wasm64
|
||||||
|
#else
|
||||||
|
#define MAIN_THREAD_EM_ASM_PTR MAIN_THREAD_EM_ASM_INT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The size of the stack buffer to use for rendering assert messages. */
|
/* The size of the stack buffer to use for rendering assert messages. */
|
||||||
@@ -251,7 +259,7 @@ static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data,
|
|||||||
for (;;) {
|
for (;;) {
|
||||||
SDL_bool okay = SDL_TRUE;
|
SDL_bool okay = SDL_TRUE;
|
||||||
/* *INDENT-OFF* */ /* clang-format off */
|
/* *INDENT-OFF* */ /* clang-format off */
|
||||||
char *buf = (char *) EM_ASM_INT({
|
char *buf = (char *) MAIN_THREAD_EM_ASM_PTR({
|
||||||
var str =
|
var str =
|
||||||
UTF8ToString($0) + '\n\n' +
|
UTF8ToString($0) + '\n\n' +
|
||||||
'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :';
|
'Abort/Retry/Ignore/AlwaysIgnore? [ariA] :';
|
||||||
|
|||||||
@@ -300,12 +300,12 @@ static void ARTS_Deinitialize(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static SDL_bool ARTS_Init(SDL_AudioDriverImpl * impl)
|
static SDL_bool ARTS_Init(SDL_AudioDriverImpl *impl)
|
||||||
{
|
{
|
||||||
if (LoadARTSLibrary() < 0) {
|
if (LoadARTSLibrary() < 0) {
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
} else {
|
} else {
|
||||||
if (SDL_NAME(arts_init) () != NULL) {
|
if (SDL_NAME(arts_init) () != 0) {
|
||||||
UnloadARTSLibrary();
|
UnloadARTSLibrary();
|
||||||
SDL_SetError("ARTS: arts_init failed (no audio server?)");
|
SDL_SetError("ARTS: arts_init failed (no audio server?)");
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
|
|||||||
@@ -197,6 +197,8 @@ static void EMSCRIPTENAUDIO_CloseDevice(_THIS)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EM_JS_DEPS(sdlaudio, "$autoResumeAudioContext,$dynCall");
|
||||||
|
|
||||||
static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname)
|
static int EMSCRIPTENAUDIO_OpenDevice(_THIS, const char *devname)
|
||||||
{
|
{
|
||||||
SDL_AudioFormat test_format;
|
SDL_AudioFormat test_format;
|
||||||
|
|||||||
@@ -233,6 +233,7 @@ static Uint8 *QSA_GetDeviceBuf(_THIS)
|
|||||||
static void QSA_CloseDevice(_THIS)
|
static void QSA_CloseDevice(_THIS)
|
||||||
{
|
{
|
||||||
if (this->hidden->audio_handle != NULL) {
|
if (this->hidden->audio_handle != NULL) {
|
||||||
|
#if _NTO_VERSION < 710
|
||||||
if (!this->iscapture) {
|
if (!this->iscapture) {
|
||||||
/* Finish playing available samples */
|
/* Finish playing available samples */
|
||||||
snd_pcm_plugin_flush(this->hidden->audio_handle,
|
snd_pcm_plugin_flush(this->hidden->audio_handle,
|
||||||
@@ -242,6 +243,7 @@ static void QSA_CloseDevice(_THIS)
|
|||||||
snd_pcm_plugin_flush(this->hidden->audio_handle,
|
snd_pcm_plugin_flush(this->hidden->audio_handle,
|
||||||
SND_PCM_CHANNEL_CAPTURE);
|
SND_PCM_CHANNEL_CAPTURE);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
snd_pcm_close(this->hidden->audio_handle);
|
snd_pcm_close(this->hidden->audio_handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1939,12 +1939,12 @@ int Android_JNI_FileOpen(SDL_RWops *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (asset_manager == NULL) {
|
if (asset_manager == NULL) {
|
||||||
return -1;
|
return SDL_SetError("Couldn't create asset manager");
|
||||||
}
|
}
|
||||||
|
|
||||||
asset = AAssetManager_open(asset_manager, fileName, AASSET_MODE_UNKNOWN);
|
asset = AAssetManager_open(asset_manager, fileName, AASSET_MODE_UNKNOWN);
|
||||||
if (asset == NULL) {
|
if (asset == NULL) {
|
||||||
return -1;
|
return SDL_SetError("Couldn't open asset '%s'", fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->hidden.androidio.asset = (void *)asset;
|
ctx->hidden.androidio.asset = (void *)asset;
|
||||||
|
|||||||
@@ -711,6 +711,7 @@ static int is_xboxone(unsigned short vendor_id, const struct libusb_interface_de
|
|||||||
static const int XB1_IFACE_SUBCLASS = 71;
|
static const int XB1_IFACE_SUBCLASS = 71;
|
||||||
static const int XB1_IFACE_PROTOCOL = 208;
|
static const int XB1_IFACE_PROTOCOL = 208;
|
||||||
static const int SUPPORTED_VENDORS[] = {
|
static const int SUPPORTED_VENDORS[] = {
|
||||||
|
0x03f0, /* HP */
|
||||||
0x044f, /* Thrustmaster */
|
0x044f, /* Thrustmaster */
|
||||||
0x045e, /* Microsoft */
|
0x045e, /* Microsoft */
|
||||||
0x0738, /* Mad Catz */
|
0x0738, /* Mad Catz */
|
||||||
|
|||||||
@@ -884,9 +884,9 @@ int HID_API_EXPORT hid_get_feature_report(hid_device *dev, unsigned char *data,
|
|||||||
unsigned char report = data[0];
|
unsigned char report = data[0];
|
||||||
|
|
||||||
res = ioctl(dev->device_handle, HIDIOCGFEATURE(length), data);
|
res = ioctl(dev->device_handle, HIDIOCGFEATURE(length), data);
|
||||||
if (res < 0)
|
if (res < 0) {
|
||||||
perror("ioctl (GFEATURE)");
|
/* perror("ioctl (GFEATURE)"); */
|
||||||
else if (dev->needs_ble_hack) {
|
} else if (dev->needs_ble_hack) {
|
||||||
/* Versions of BlueZ before 5.56 don't include the report in the data,
|
/* Versions of BlueZ before 5.56 don't include the report in the data,
|
||||||
* and versions of BlueZ >= 5.56 include 2 copies of the report.
|
* and versions of BlueZ >= 5.56 include 2 copies of the report.
|
||||||
* We'll fix it so that there is a single copy of the report in both cases
|
* We'll fix it so that there is a single copy of the report in both cases
|
||||||
|
|||||||
@@ -134,9 +134,7 @@ static const char *s_ControllerMappings[] = {
|
|||||||
"03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,",
|
"03000000b80500000610000000000000,Elecom Gamepad,a:b2,b:b3,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b1,",
|
||||||
"03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
"03000000852100000201000000000000,FF-GP1,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||||
"030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,",
|
"030000000d0f00002700000000000000,FIGHTING STICK V3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,lefttrigger:b6,rightshoulder:b5,righttrigger:b7,start:b9,x:b0,y:b3,",
|
||||||
"03000000151900004000000000000000,Flydigi Vader 2,a:b27,b:b26,back:b19,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b6,leftshoulder:b23,leftstick:b17,lefttrigger:b21,leftx:a0,lefty:a1,misc1:b15,paddle1:b11,paddle2:b10,paddle3:b13,paddle4:b12,rightshoulder:b22,rightstick:b16,righttrigger:b20,rightx:a3,righty:a4,start:b18,x:b25,y:b24,", /* Bluetooth */
|
"03000000790000000600000000000000,G-Shark GS-GP702,crc:8e4f,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
|
||||||
"03000000b40400001124000000000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b14,paddle1:b4,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b2,y:b3,", /* Dongle */
|
|
||||||
"03000000b40400001224000000000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:b8,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:b9,rightx:a3,righty:a4,start:b11,x:b3,y:b4,", /* Wired */
|
|
||||||
"030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
"030000008f0e00000d31000000000000,GAMEPAD 3 TURBO,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||||
"03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,",
|
"03000000300f00000b01000000000000,GGE909 Recoil Pad,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a3,righty:a2,start:b9,x:b3,y:b0,",
|
||||||
"03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
|
"03000000790000002201000000000000,Game Controller for PC,a:b2,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b3,y:b0,",
|
||||||
@@ -416,9 +414,6 @@ static const char *s_ControllerMappings[] = {
|
|||||||
"03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,",
|
"03000000a306000022f6000001030000,Cyborg V.3 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:+a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:-a3,rightx:a2,righty:a4,start:b9,x:b0,y:b3,",
|
||||||
"030000000d0f00008400000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
"030000000d0f00008400000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||||
"030000000d0f00008500000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
"030000000d0f00008500000000010000,Fighting Commander,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||||
"03000000151900004000000001000000,Flydigi Vader 2,a:b14,b:b15,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b0,y:b1,", /* Bluetooth */
|
|
||||||
"03000000b40400001124000001040000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Dongle */
|
|
||||||
"03000000b40400001224000003030000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Wired */
|
|
||||||
"03000000ac0500001a06000002020000,GameSir-T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,",
|
"03000000ac0500001a06000002020000,GameSir-T3 2.02,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b15,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,",
|
||||||
"0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
"0500000047532047616d657061640000,GameStop Gamepad,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
||||||
"03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
"03000000c01100000140000000010000,GameStop PS4 Fun Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||||
@@ -610,9 +605,6 @@ static const char *s_ControllerMappings[] = {
|
|||||||
"050000004c050000f20d000000010000,DualSense Edge Wireless Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
"050000004c050000f20d000000010000,DualSense Edge Wireless Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:a4,rightx:a2,righty:a5,start:b9,x:b0,y:b3,",
|
||||||
"030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
"030000006f0e00003001000001010000,EA Sports PS3 Controller,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,",
|
||||||
"03000000790000001100000010010000,Elecom Gamepad,crc:e86c,a:b2,b:b3,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b0,y:b1,",
|
"03000000790000001100000010010000,Elecom Gamepad,crc:e86c,a:b2,b:b3,back:b6,dpdown:+a1,dpleft:-a0,dpright:+a0,dpup:-a1,leftshoulder:b4,rightshoulder:b5,start:b7,x:b0,y:b1,",
|
||||||
"03000000b40400001124000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Dongle */
|
|
||||||
"03000000b40400001224000011010000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b2,paddle1:b16,paddle2:b17,paddle3:b14,paddle4:b15,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Wired */
|
|
||||||
"05000000151900004000000001000000,Flydigi Vader 2,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b21,leftshoulder:b6,leftstick:b12,lefttrigger:a5,leftx:a0,lefty:a1,misc1:b14,paddle1:b2,paddle2:b5,paddle3:b16,paddle4:b17,rightshoulder:b7,rightstick:b13,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,", /* Bluetooth */
|
|
||||||
"0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
|
"0300000079000000d418000000010000,GPD Win 2 Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,",
|
||||||
"0500000047532067616d657061640000,GS Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
"0500000047532067616d657061640000,GS Gamepad,a:b0,b:b1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b8,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b2,y:b3,",
|
||||||
"03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,",
|
"03000000341a000005f7000010010000,GameCube {HuiJia USB box},a:b1,b:b2,dpdown:b14,dpleft:b15,dpright:b13,dpup:b12,lefttrigger:a3,leftx:a0,lefty:a1,rightshoulder:b7,righttrigger:a4,rightx:a5,righty:a2,start:b9,x:b0,y:b3,",
|
||||||
@@ -910,7 +902,6 @@ static const char *s_ControllerMappings[] = {
|
|||||||
"05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
"05000000c82d000018900000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||||
"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b0,b:b1,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b0,b:b1,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b2,y:b3,hint:SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||||
"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
"05000000c82d000030320000ffff0f00,8BitDo Zero 2,a:b1,b:b0,back:b4,leftshoulder:b9,leftx:a0,lefty:a1,rightshoulder:b10,start:b6,x:b3,y:b2,hint:!SDL_GAMECONTROLLER_USE_BUTTON_LABELS:=1,",
|
||||||
"05000000b404000011240000dfff3f00,Flydigi Vader 2,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a4,leftx:a0,lefty:a1,paddle1:b17,paddle2:b18,rightshoulder:b10,rightstick:b8,righttrigger:a5,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
|
||||||
"05000000d6020000e5890000dfff3f80,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a3,rightx:a4,righty:a5,start:b6,x:b2,y:b3,",
|
"05000000d6020000e5890000dfff3f80,GPD XD Plus,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a3,rightx:a4,righty:a5,start:b6,x:b2,y:b3,",
|
||||||
"0500000031366332860c44aadfff0f00,GS Gamepad,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
"0500000031366332860c44aadfff0f00,GS Gamepad,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:b15,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:b16,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
||||||
"05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
"05000000bc20000000550000ffff3f00,GameSir G3w,a:b0,b:b1,back:b4,dpdown:b12,dpleft:b13,dpright:b14,dpup:b11,leftshoulder:b9,leftstick:b7,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b10,rightstick:b8,righttrigger:a4,rightx:a2,righty:a3,start:b6,x:b2,y:b3,",
|
||||||
|
|||||||
@@ -2479,8 +2479,11 @@ static SDL_bool SDL_IsJoystickProductWheel(Uint32 vidpid)
|
|||||||
MAKE_VIDPID(0x046d, 0xc262), /* Logitech G920 (active mode) */
|
MAKE_VIDPID(0x046d, 0xc262), /* Logitech G920 (active mode) */
|
||||||
MAKE_VIDPID(0x046d, 0xc268), /* Logitech PRO Racing Wheel (PC mode) */
|
MAKE_VIDPID(0x046d, 0xc268), /* Logitech PRO Racing Wheel (PC mode) */
|
||||||
MAKE_VIDPID(0x046d, 0xc269), /* Logitech PRO Racing Wheel (PS4/PS5 mode) */
|
MAKE_VIDPID(0x046d, 0xc269), /* Logitech PRO Racing Wheel (PS4/PS5 mode) */
|
||||||
|
MAKE_VIDPID(0x046d, 0xc272), /* Logitech PRO Racing Wheel for Xbox (PC mode) */
|
||||||
MAKE_VIDPID(0x046d, 0xc26d), /* Logitech G923 (Xbox) */
|
MAKE_VIDPID(0x046d, 0xc26d), /* Logitech G923 (Xbox) */
|
||||||
MAKE_VIDPID(0x046d, 0xc26e), /* Logitech G923 */
|
MAKE_VIDPID(0x046d, 0xc26e), /* Logitech G923 */
|
||||||
|
MAKE_VIDPID(0x046d, 0xc266), /* Logitech G923 for Playstation 4 and PC (PC mode) */
|
||||||
|
MAKE_VIDPID(0x046d, 0xc267), /* Logitech G923 for Playstation 4 and PC (PS4 mode)*/
|
||||||
MAKE_VIDPID(0x046d, 0xca03), /* Logitech Momo Racing */
|
MAKE_VIDPID(0x046d, 0xca03), /* Logitech Momo Racing */
|
||||||
MAKE_VIDPID(0x044f, 0xb65d), /* Thrustmaster Wheel FFB */
|
MAKE_VIDPID(0x044f, 0xb65d), /* Thrustmaster Wheel FFB */
|
||||||
MAKE_VIDPID(0x044f, 0xb66d), /* Thrustmaster Wheel FFB */
|
MAKE_VIDPID(0x044f, 0xb66d), /* Thrustmaster Wheel FFB */
|
||||||
@@ -2492,7 +2495,22 @@ static SDL_bool SDL_IsJoystickProductWheel(Uint32 vidpid)
|
|||||||
MAKE_VIDPID(0x044f, 0xb65e), /* Thrustmaster T500RS */
|
MAKE_VIDPID(0x044f, 0xb65e), /* Thrustmaster T500RS */
|
||||||
MAKE_VIDPID(0x044f, 0xb664), /* Thrustmaster TX (initial mode) */
|
MAKE_VIDPID(0x044f, 0xb664), /* Thrustmaster TX (initial mode) */
|
||||||
MAKE_VIDPID(0x044f, 0xb669), /* Thrustmaster TX (active mode) */
|
MAKE_VIDPID(0x044f, 0xb669), /* Thrustmaster TX (active mode) */
|
||||||
|
MAKE_VIDPID(0x0483, 0x0522), /* Simagic Wheelbase (including M10, Alpha Mini, Alpha, Alpha U) */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0001), /* Fanatec ClubSport Wheel Base V2 */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0004), /* Fanatec ClubSport Wheel Base V2.5 */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0005), /* Fanatec CSL Elite Wheel Base+ (PS4) */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0006), /* Fanatec Podium Wheel Base DD1 */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0007), /* Fanatec Podium Wheel Base DD2 */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0011), /* Fanatec Forza Motorsport (CSR Wheel / CSR Elite Wheel) */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0020), /* Fanatec generic wheel / CSL DD / GT DD Pro */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0197), /* Fanatec Porsche Wheel (Turbo / GT3 RS / Turbo S / GT3 V2 / GT2) */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x038e), /* Fanatec ClubSport Wheel Base V1 */
|
||||||
|
MAKE_VIDPID(0x0eb7, 0x0e03), /* Fanatec CSL Elite Wheel Base */
|
||||||
MAKE_VIDPID(0x11ff, 0x0511), /* DragonRise Inc. Wired Wheel (initial mode) (also known as PXN V900 (PS3), Superdrive SV-750, or a Genesis Seaborg 400) */
|
MAKE_VIDPID(0x11ff, 0x0511), /* DragonRise Inc. Wired Wheel (initial mode) (also known as PXN V900 (PS3), Superdrive SV-750, or a Genesis Seaborg 400) */
|
||||||
|
MAKE_VIDPID(0x2433, 0xf300), /* Asetek SimSports Invicta Wheelbase */
|
||||||
|
MAKE_VIDPID(0x2433, 0xf301), /* Asetek SimSports Forte Wheelbase */
|
||||||
|
MAKE_VIDPID(0x2433, 0xf303), /* Asetek SimSports La Prima Wheelbase */
|
||||||
|
MAKE_VIDPID(0x2433, 0xf306), /* Asetek SimSports Tony Kannan Wheelbase */
|
||||||
};
|
};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@@ -294,6 +294,7 @@ static const ControllerDescription_t arrControllers[] = {
|
|||||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafd ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 3
|
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafd ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 3
|
||||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafe ), k_eControllerType_XBox360Controller, NULL }, // Rock Candy Gamepad for Xbox 360
|
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafe ), k_eControllerType_XBox360Controller, NULL }, // Rock Candy Gamepad for Xbox 360
|
||||||
|
|
||||||
|
{ MAKE_CONTROLLER_ID( 0x03f0, 0x0495 ), k_eControllerType_XBoxOneController, NULL }, // HP HyperX Clutch Gladiate
|
||||||
{ MAKE_CONTROLLER_ID( 0x044f, 0xd012 ), k_eControllerType_XBoxOneController, NULL }, // ThrustMaster eSwap PRO Controller Xbox
|
{ MAKE_CONTROLLER_ID( 0x044f, 0xd012 ), k_eControllerType_XBoxOneController, NULL }, // ThrustMaster eSwap PRO Controller Xbox
|
||||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02d1 ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad
|
{ MAKE_CONTROLLER_ID( 0x045e, 0x02d1 ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad
|
||||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02dd ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad (Firmware 2015)
|
{ MAKE_CONTROLLER_ID( 0x045e, 0x02dd ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad (Firmware 2015)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ typedef struct
|
|||||||
Uint8 rgucAccelX[2]; /* 21 */
|
Uint8 rgucAccelX[2]; /* 21 */
|
||||||
Uint8 rgucAccelY[2]; /* 23 */
|
Uint8 rgucAccelY[2]; /* 23 */
|
||||||
Uint8 rgucAccelZ[2]; /* 25 */
|
Uint8 rgucAccelZ[2]; /* 25 */
|
||||||
Uint8 rgucSensorTimestamp[4]; /* 27 - 32 bit little endian */
|
Uint8 rgucSensorTimestamp[4]; /* 27 - 16/32 bit little endian */
|
||||||
|
|
||||||
} PS5StatePacketCommon_t;
|
} PS5StatePacketCommon_t;
|
||||||
|
|
||||||
@@ -154,7 +154,9 @@ typedef struct
|
|||||||
Uint8 rgucAccelX[2]; /* 21 */
|
Uint8 rgucAccelX[2]; /* 21 */
|
||||||
Uint8 rgucAccelY[2]; /* 23 */
|
Uint8 rgucAccelY[2]; /* 23 */
|
||||||
Uint8 rgucAccelZ[2]; /* 25 */
|
Uint8 rgucAccelZ[2]; /* 25 */
|
||||||
Uint8 rgucSensorTimestamp[4]; /* 27 - 32 bit little endian */
|
Uint8 rgucSensorTimestamp[2]; /* 27 - 16 bit little endian */
|
||||||
|
Uint8 ucBatteryLevel; /* 29 */
|
||||||
|
Uint8 ucUnknown; /* 30 */
|
||||||
Uint8 ucTouchpadCounter1; /* 31 - high bit clear + counter */
|
Uint8 ucTouchpadCounter1; /* 31 - high bit clear + counter */
|
||||||
Uint8 rgucTouchpadData1[3]; /* 32 - X/Y, 12 bits per axis */
|
Uint8 rgucTouchpadData1[3]; /* 32 - X/Y, 12 bits per axis */
|
||||||
Uint8 ucTouchpadCounter2; /* 35 - high bit clear + counter */
|
Uint8 ucTouchpadCounter2; /* 35 - high bit clear + counter */
|
||||||
@@ -486,6 +488,7 @@ static SDL_bool HIDAPI_DriverPS5_InitDevice(SDL_HIDAPI_Device *device)
|
|||||||
/* The Razer Wolverine V2 Pro doesn't respond to the detection protocol, but has a touchpad and sensors, but no vibration */
|
/* The Razer Wolverine V2 Pro doesn't respond to the detection protocol, but has a touchpad and sensors, but no vibration */
|
||||||
ctx->sensors_supported = SDL_TRUE;
|
ctx->sensors_supported = SDL_TRUE;
|
||||||
ctx->touchpad_supported = SDL_TRUE;
|
ctx->touchpad_supported = SDL_TRUE;
|
||||||
|
ctx->use_alternate_report = SDL_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported || ctx->playerled_supported);
|
ctx->effects_supported = (ctx->lightbar_supported || ctx->vibration_supported || ctx->playerled_supported);
|
||||||
@@ -720,7 +723,7 @@ static void HIDAPI_DriverPS5_CheckPendingLEDReset(SDL_HIDAPI_Device *device)
|
|||||||
SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context;
|
SDL_DriverPS5_Context *ctx = (SDL_DriverPS5_Context *)device->context;
|
||||||
SDL_bool led_reset_complete = SDL_FALSE;
|
SDL_bool led_reset_complete = SDL_FALSE;
|
||||||
|
|
||||||
if (ctx->sensors_supported) {
|
if (ctx->enhanced_mode && ctx->sensors_supported && !ctx->use_alternate_report) {
|
||||||
const PS5StatePacketCommon_t *packet = &ctx->last_state.state;
|
const PS5StatePacketCommon_t *packet = &ctx->last_state.state;
|
||||||
|
|
||||||
/* Check the timer to make sure the Bluetooth connection LED animation is complete */
|
/* Check the timer to make sure the Bluetooth connection LED animation is complete */
|
||||||
@@ -1228,30 +1231,56 @@ static void HIDAPI_DriverPS5_HandleStatePacketCommon(SDL_Joystick *joystick, SDL
|
|||||||
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
|
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_RIGHTY, axis);
|
||||||
|
|
||||||
if (ctx->report_sensors) {
|
if (ctx->report_sensors) {
|
||||||
Uint32 timestamp;
|
|
||||||
Uint64 timestamp_us;
|
|
||||||
float data[3];
|
float data[3];
|
||||||
|
Uint64 timestamp_us;
|
||||||
|
|
||||||
timestamp = LOAD32(packet->rgucSensorTimestamp[0],
|
if (ctx->use_alternate_report) {
|
||||||
packet->rgucSensorTimestamp[1],
|
/* 16-bit timestamp */
|
||||||
packet->rgucSensorTimestamp[2],
|
Uint16 timestamp;
|
||||||
packet->rgucSensorTimestamp[3]);
|
|
||||||
if (ctx->timestamp) {
|
|
||||||
Uint32 delta;
|
|
||||||
|
|
||||||
if (ctx->last_timestamp > timestamp) {
|
timestamp = LOAD16(packet->rgucSensorTimestamp[0],
|
||||||
delta = (SDL_MAX_UINT32 - ctx->last_timestamp + timestamp + 1);
|
packet->rgucSensorTimestamp[1]);
|
||||||
|
if (ctx->timestamp) {
|
||||||
|
Uint16 delta;
|
||||||
|
|
||||||
|
if (ctx->last_timestamp > timestamp) {
|
||||||
|
delta = (SDL_MAX_UINT16 - ctx->last_timestamp + timestamp + 1);
|
||||||
|
} else {
|
||||||
|
delta = (timestamp - ctx->last_timestamp);
|
||||||
|
}
|
||||||
|
ctx->timestamp += delta;
|
||||||
} else {
|
} else {
|
||||||
delta = (timestamp - ctx->last_timestamp);
|
ctx->timestamp = timestamp;
|
||||||
}
|
}
|
||||||
ctx->timestamp += delta;
|
ctx->last_timestamp = timestamp;
|
||||||
} else {
|
|
||||||
ctx->timestamp = timestamp;
|
|
||||||
}
|
|
||||||
ctx->last_timestamp = timestamp;
|
|
||||||
|
|
||||||
/* Sensor timestamp is in 0.33us units */
|
/* Sensor timestamp is in 1us units */
|
||||||
timestamp_us = ctx->timestamp / 3;
|
timestamp_us = ctx->timestamp;
|
||||||
|
} else {
|
||||||
|
/* 32-bit timestamp */
|
||||||
|
Uint32 timestamp;
|
||||||
|
|
||||||
|
timestamp = LOAD32(packet->rgucSensorTimestamp[0],
|
||||||
|
packet->rgucSensorTimestamp[1],
|
||||||
|
packet->rgucSensorTimestamp[2],
|
||||||
|
packet->rgucSensorTimestamp[3]);
|
||||||
|
if (ctx->timestamp) {
|
||||||
|
Uint32 delta;
|
||||||
|
|
||||||
|
if (ctx->last_timestamp > timestamp) {
|
||||||
|
delta = (SDL_MAX_UINT32 - ctx->last_timestamp + timestamp + 1);
|
||||||
|
} else {
|
||||||
|
delta = (timestamp - ctx->last_timestamp);
|
||||||
|
}
|
||||||
|
ctx->timestamp += delta;
|
||||||
|
} else {
|
||||||
|
ctx->timestamp = timestamp;
|
||||||
|
}
|
||||||
|
ctx->last_timestamp = timestamp;
|
||||||
|
|
||||||
|
/* Sensor timestamp is in 0.33us units */
|
||||||
|
timestamp_us = ctx->timestamp / 3;
|
||||||
|
}
|
||||||
|
|
||||||
data[0] = HIDAPI_DriverPS5_ApplyCalibrationData(ctx, 0, LOAD16(packet->rgucGyroX[0], packet->rgucGyroX[1]));
|
data[0] = HIDAPI_DriverPS5_ApplyCalibrationData(ctx, 0, LOAD16(packet->rgucGyroX[0], packet->rgucGyroX[1]));
|
||||||
data[1] = HIDAPI_DriverPS5_ApplyCalibrationData(ctx, 1, LOAD16(packet->rgucGyroY[0], packet->rgucGyroY[1]));
|
data[1] = HIDAPI_DriverPS5_ApplyCalibrationData(ctx, 1, LOAD16(packet->rgucGyroY[0], packet->rgucGyroY[1]));
|
||||||
|
|||||||
@@ -265,6 +265,7 @@ static SDL_GameControllerType SDL_GetJoystickGameControllerProtocol(const char *
|
|||||||
interface_protocol == XBONE_IFACE_PROTOCOL) {
|
interface_protocol == XBONE_IFACE_PROTOCOL) {
|
||||||
|
|
||||||
static const int SUPPORTED_VENDORS[] = {
|
static const int SUPPORTED_VENDORS[] = {
|
||||||
|
0x03f0, /* HP */
|
||||||
0x044f, /* Thrustmaster */
|
0x044f, /* Thrustmaster */
|
||||||
0x045e, /* Microsoft */
|
0x045e, /* Microsoft */
|
||||||
0x0738, /* Mad Catz */
|
0x0738, /* Mad Catz */
|
||||||
@@ -1436,6 +1437,12 @@ static int HIDAPI_JoystickOpen(SDL_Joystick *joystick, int device_index)
|
|||||||
device->updating = SDL_FALSE;
|
device->updating = SDL_FALSE;
|
||||||
SDL_UnlockMutex(device->dev_lock);
|
SDL_UnlockMutex(device->dev_lock);
|
||||||
|
|
||||||
|
/* UpdateDevice() may have called HIDAPI_JoystickDisconnected() if the device went away */
|
||||||
|
if (device->num_joysticks == 0) {
|
||||||
|
SDL_free(hwdata);
|
||||||
|
return SDL_SetError("HIDAPI device disconnected while opening");
|
||||||
|
}
|
||||||
|
|
||||||
if (!device->driver->OpenJoystick(device, joystick)) {
|
if (!device->driver->OpenJoystick(device, joystick)) {
|
||||||
/* The open failed, mark this device as disconnected and update devices */
|
/* The open failed, mark this device as disconnected and update devices */
|
||||||
HIDAPI_JoystickDisconnected(device, joystickID);
|
HIDAPI_JoystickDisconnected(device, joystickID);
|
||||||
|
|||||||
@@ -1041,7 +1041,7 @@ static void ConfigJoystick(SDL_Joystick *joystick, int fd)
|
|||||||
}
|
}
|
||||||
for (i = 0; i < ABS_MAX; ++i) {
|
for (i = 0; i < ABS_MAX; ++i) {
|
||||||
/* Skip digital hats */
|
/* Skip digital hats */
|
||||||
if (joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) {
|
if (i >= ABS_HAT0X && i <= ABS_HAT3Y && joystick->hwdata->has_hat[(i - ABS_HAT0X) / 2]) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (test_bit(i, absbit)) {
|
if (test_bit(i, absbit)) {
|
||||||
@@ -1752,11 +1752,11 @@ static SDL_bool LINUX_JoystickGetGamepadMapping(int device_index, SDL_GamepadMap
|
|||||||
/* We temporarily open the device to check how it's configured. Make
|
/* We temporarily open the device to check how it's configured. Make
|
||||||
a fake SDL_Joystick object to do so. */
|
a fake SDL_Joystick object to do so. */
|
||||||
joystick = (SDL_Joystick *)SDL_calloc(sizeof(*joystick), 1);
|
joystick = (SDL_Joystick *)SDL_calloc(sizeof(*joystick), 1);
|
||||||
joystick->magic = &SDL_joystick_magic;
|
|
||||||
if (joystick == NULL) {
|
if (joystick == NULL) {
|
||||||
SDL_OutOfMemory();
|
SDL_OutOfMemory();
|
||||||
return SDL_FALSE;
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
|
joystick->magic = &SDL_joystick_magic;
|
||||||
SDL_memcpy(&joystick->guid, &item->guid, sizeof(item->guid));
|
SDL_memcpy(&joystick->guid, &item->guid, sizeof(item->guid));
|
||||||
|
|
||||||
joystick->hwdata = (struct joystick_hwdata *)
|
joystick->hwdata = (struct joystick_hwdata *)
|
||||||
|
|||||||
+538
-504
File diff suppressed because it is too large.
Load diff
@@ -22,6 +22,7 @@ standard_guid_pattern = re.compile(r'^([0-9a-fA-F]{4})([0-9a-fA-F]{2})([0-9a-fA-
|
|||||||
invalid_controllers = (
|
invalid_controllers = (
|
||||||
('0079', '0006', '0000'), # DragonRise Inc. Generic USB Joystick
|
('0079', '0006', '0000'), # DragonRise Inc. Generic USB Joystick
|
||||||
('0079', '0006', '6120'), # DragonRise Inc. Generic USB Joystick
|
('0079', '0006', '6120'), # DragonRise Inc. Generic USB Joystick
|
||||||
|
('04b4', '2412', 'c529'), # Flydigi Vader 2, Vader 2 Pro, Apex 2, Apex 3
|
||||||
('16c0', '05e1', '0000'), # Xinmotek Controller
|
('16c0', '05e1', '0000'), # Xinmotek Controller
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
|||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,28,2,0
|
FILEVERSION 2,28,5,0
|
||||||
PRODUCTVERSION 2,28,2,0
|
PRODUCTVERSION 2,28,5,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
FILEFLAGS 0x0L
|
FILEFLAGS 0x0L
|
||||||
FILEOS 0x40004L
|
FILEOS 0x40004L
|
||||||
@@ -23,12 +23,12 @@ BEGIN
|
|||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "\0"
|
VALUE "CompanyName", "\0"
|
||||||
VALUE "FileDescription", "SDL\0"
|
VALUE "FileDescription", "SDL\0"
|
||||||
VALUE "FileVersion", "2, 28, 2, 0\0"
|
VALUE "FileVersion", "2, 28, 5, 0\0"
|
||||||
VALUE "InternalName", "SDL\0"
|
VALUE "InternalName", "SDL\0"
|
||||||
VALUE "LegalCopyright", "Copyright (C) 2023 Sam Lantinga\0"
|
VALUE "LegalCopyright", "Copyright (C) 2023 Sam Lantinga\0"
|
||||||
VALUE "OriginalFilename", "SDL2.dll\0"
|
VALUE "OriginalFilename", "SDL2.dll\0"
|
||||||
VALUE "ProductName", "Simple DirectMedia Layer\0"
|
VALUE "ProductName", "Simple DirectMedia Layer\0"
|
||||||
VALUE "ProductVersion", "2, 28, 2, 0\0"
|
VALUE "ProductVersion", "2, 28, 5, 0\0"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|||||||
@@ -23,13 +23,11 @@
|
|||||||
|
|
||||||
#include <emscripten/emscripten.h>
|
#include <emscripten/emscripten.h>
|
||||||
|
|
||||||
|
EM_JS_DEPS(sdlsysurl, "$UTF8ToString");
|
||||||
|
|
||||||
int SDL_SYS_OpenURL(const char *url)
|
int SDL_SYS_OpenURL(const char *url)
|
||||||
{
|
{
|
||||||
EM_ASM({
|
EM_ASM(window.open(UTF8ToString($0), "_blank"), url);
|
||||||
window.open(UTF8ToString($0), "_blank");
|
|
||||||
},
|
|
||||||
url);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,18 @@ int SDL_SYS_OpenURL(const char *url)
|
|||||||
{
|
{
|
||||||
const pid_t pid1 = fork();
|
const pid_t pid1 = fork();
|
||||||
if (pid1 == 0) { /* child process */
|
if (pid1 == 0) { /* child process */
|
||||||
|
#ifdef USE_POSIX_SPAWN
|
||||||
|
pid_t pid2;
|
||||||
|
const char *args[] = { "xdg-open", url, NULL };
|
||||||
|
/* Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam */
|
||||||
|
unsetenv("LD_PRELOAD");
|
||||||
|
if (posix_spawnp(&pid2, args[0], NULL, NULL, (char **)args, environ) == 0) {
|
||||||
|
/* Child process doesn't wait for possibly-blocking grandchild. */
|
||||||
|
_exit(EXIT_SUCCESS);
|
||||||
|
} else {
|
||||||
|
_exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
#else
|
||||||
pid_t pid2;
|
pid_t pid2;
|
||||||
/* Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam */
|
/* Clear LD_PRELOAD so Chrome opens correctly when this application is launched by Steam */
|
||||||
unsetenv("LD_PRELOAD");
|
unsetenv("LD_PRELOAD");
|
||||||
@@ -46,6 +58,7 @@ int SDL_SYS_OpenURL(const char *url)
|
|||||||
/* Child process doesn't wait for possibly-blocking grandchild. */
|
/* Child process doesn't wait for possibly-blocking grandchild. */
|
||||||
_exit(EXIT_SUCCESS);
|
_exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
#endif /* USE_POSIX_SPAWN */
|
||||||
} else if (pid1 < 0) {
|
} else if (pid1 < 0) {
|
||||||
return SDL_SetError("fork() failed: %s", strerror(errno));
|
return SDL_SetError("fork() failed: %s", strerror(errno));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2481,7 +2481,7 @@ int SDL_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
|
|||||||
int retval;
|
int retval;
|
||||||
CHECK_RENDERER_MAGIC(renderer, -1)
|
CHECK_RENDERER_MAGIC(renderer, -1)
|
||||||
|
|
||||||
if (rect && rect->w > 0 && rect->h > 0) {
|
if (rect && rect->w >= 0 && rect->h >= 0) {
|
||||||
renderer->clipping_enabled = SDL_TRUE;
|
renderer->clipping_enabled = SDL_TRUE;
|
||||||
renderer->clip_rect.x = (double)rect->x * renderer->scale.x;
|
renderer->clip_rect.x = (double)rect->x * renderer->scale.x;
|
||||||
renderer->clip_rect.y = (double)rect->y * renderer->scale.y;
|
renderer->clip_rect.y = (double)rect->y * renderer->scale.y;
|
||||||
|
|||||||
@@ -1654,8 +1654,22 @@ static SDL_Renderer *METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// !!! FIXME: MTLCopyAllDevices() can find other GPUs on macOS...
|
#ifdef __MACOSX__
|
||||||
mtldevice = MTLCreateSystemDefaultDevice();
|
if (SDL_GetHintBoolean(SDL_HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE, SDL_TRUE)) {
|
||||||
|
NSArray<id<MTLDevice>> *devices = MTLCopyAllDevices();
|
||||||
|
|
||||||
|
for (id<MTLDevice> device in devices) {
|
||||||
|
if (device.isLowPower) {
|
||||||
|
mtldevice = device;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (mtldevice == nil) {
|
||||||
|
mtldevice = MTLCreateSystemDefaultDevice();
|
||||||
|
}
|
||||||
|
|
||||||
if (mtldevice == nil) {
|
if (mtldevice == nil) {
|
||||||
SDL_free(renderer);
|
SDL_free(renderer);
|
||||||
|
|||||||
@@ -789,15 +789,20 @@ static void SDL_BlitTriangle_Slow(SDL_BlitInfo *info,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) {
|
||||||
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
|
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
||||||
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
|
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
|
||||||
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
|
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
|
||||||
dstA = 0xFF;
|
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
|
||||||
|
dstA = 0xFF;
|
||||||
|
} else {
|
||||||
|
/* SDL_PIXELFORMAT_ARGB2101010 */
|
||||||
|
dstpixel = *((Uint32 *) (dst));
|
||||||
|
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* SDL_PIXELFORMAT_ARGB2101010 */
|
/* don't care */
|
||||||
dstpixel = *((Uint32 *)(dst));
|
dstR = dstG = dstB = dstA = 0;
|
||||||
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_uniform) {
|
if (!is_uniform) {
|
||||||
|
|||||||
+6
-10
@@ -795,17 +795,13 @@ char *SDL_iconv_string(const char *tocode, const char *fromcode, const char *inb
|
|||||||
size_t outbytesleft;
|
size_t outbytesleft;
|
||||||
size_t retCode = 0;
|
size_t retCode = 0;
|
||||||
|
|
||||||
cd = SDL_iconv_open(tocode, fromcode);
|
if (tocode == NULL || !*tocode) {
|
||||||
if (cd == (SDL_iconv_t)-1) {
|
tocode = "UTF-8";
|
||||||
/* See if we can recover here (fixes iconv on Solaris 11) */
|
|
||||||
if (tocode == NULL || !*tocode) {
|
|
||||||
tocode = "UTF-8";
|
|
||||||
}
|
|
||||||
if (fromcode == NULL || !*fromcode) {
|
|
||||||
fromcode = "UTF-8";
|
|
||||||
}
|
|
||||||
cd = SDL_iconv_open(tocode, fromcode);
|
|
||||||
}
|
}
|
||||||
|
if (fromcode == NULL || !*fromcode) {
|
||||||
|
fromcode = "UTF-8";
|
||||||
|
}
|
||||||
|
cd = SDL_iconv_open(tocode, fromcode);
|
||||||
if (cd == (SDL_iconv_t)-1) {
|
if (cd == (SDL_iconv_t)-1) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
+74
-1
@@ -1114,6 +1114,39 @@ int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
|
|||||||
return vsscanf(text, fmt, ap);
|
return vsscanf(text, fmt, ap);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
static SDL_bool CharacterMatchesSet(char c, const char *set, size_t set_len)
|
||||||
|
{
|
||||||
|
SDL_bool invert = SDL_FALSE;
|
||||||
|
SDL_bool result = SDL_FALSE;
|
||||||
|
|
||||||
|
if (*set == '^') {
|
||||||
|
invert = SDL_TRUE;
|
||||||
|
++set;
|
||||||
|
--set_len;
|
||||||
|
}
|
||||||
|
while (set_len > 0 && !result) {
|
||||||
|
if (set_len >= 3 && set[1] == '-') {
|
||||||
|
char low_char = SDL_min(set[0], set[2]);
|
||||||
|
char high_char = SDL_max(set[0], set[2]);
|
||||||
|
if (c >= low_char && c <= high_char) {
|
||||||
|
result = SDL_TRUE;
|
||||||
|
}
|
||||||
|
set += 3;
|
||||||
|
set_len -= 3;
|
||||||
|
} else {
|
||||||
|
if (c == *set) {
|
||||||
|
result = SDL_TRUE;
|
||||||
|
}
|
||||||
|
++set;
|
||||||
|
--set_len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (invert) {
|
||||||
|
result = result ? SDL_FALSE : SDL_TRUE;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/* NOLINTNEXTLINE(readability-non-const-parameter) */
|
/* NOLINTNEXTLINE(readability-non-const-parameter) */
|
||||||
int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
|
int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
|
||||||
{
|
{
|
||||||
@@ -1190,7 +1223,9 @@ int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
|
|||||||
suppress = SDL_TRUE;
|
suppress = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
if (inttype > DO_SHORT) {
|
if (inttype == DO_INT) {
|
||||||
|
inttype = DO_SHORT;
|
||||||
|
} else if (inttype > DO_SHORT) {
|
||||||
++inttype;
|
++inttype;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1385,6 +1420,44 @@ int SDL_vsscanf(const char *text, const char *fmt, va_list ap)
|
|||||||
}
|
}
|
||||||
done = SDL_TRUE;
|
done = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
case '[':
|
||||||
|
{
|
||||||
|
const char *set = fmt + 1;
|
||||||
|
while (*fmt && *fmt != ']') {
|
||||||
|
++fmt;
|
||||||
|
}
|
||||||
|
if (*fmt) {
|
||||||
|
size_t set_len = (fmt - set);
|
||||||
|
if (suppress) {
|
||||||
|
while (CharacterMatchesSet(*text, set, set_len)) {
|
||||||
|
++text;
|
||||||
|
if (count) {
|
||||||
|
if (--count == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
SDL_bool had_match = SDL_FALSE;
|
||||||
|
char *valuep = va_arg(ap, char *);
|
||||||
|
while (CharacterMatchesSet(*text, set, set_len)) {
|
||||||
|
had_match = SDL_TRUE;
|
||||||
|
*valuep++ = *text++;
|
||||||
|
if (count) {
|
||||||
|
if (--count == 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*valuep = '\0';
|
||||||
|
if (had_match) {
|
||||||
|
++retval;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
done = SDL_TRUE;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
done = SDL_TRUE;
|
done = SDL_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -36,6 +36,25 @@
|
|||||||
/* Counter for _CompareSurface calls; used for filename creation when comparisons fail */
|
/* Counter for _CompareSurface calls; used for filename creation when comparisons fail */
|
||||||
static int _CompareSurfaceCount = 0;
|
static int _CompareSurfaceCount = 0;
|
||||||
|
|
||||||
|
static Uint32
|
||||||
|
GetPixel(Uint8 *p, size_t bytes_per_pixel)
|
||||||
|
{
|
||||||
|
Uint32 ret = 0;
|
||||||
|
|
||||||
|
SDL_assert(bytes_per_pixel <= sizeof(ret));
|
||||||
|
|
||||||
|
/* Fill the appropriate number of least-significant bytes of ret,
|
||||||
|
* leaving the most-significant bytes set to zero, so that ret can
|
||||||
|
* be decoded with SDL_GetRGBA afterwards. */
|
||||||
|
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
||||||
|
SDL_memcpy(((Uint8 *) &ret) + (sizeof(ret) - bytes_per_pixel), p, bytes_per_pixel);
|
||||||
|
#else
|
||||||
|
SDL_memcpy(&ret, p, bytes_per_pixel);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* Compare surfaces */
|
/* Compare surfaces */
|
||||||
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
|
int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error)
|
||||||
{
|
{
|
||||||
@@ -74,11 +93,14 @@ int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface,
|
|||||||
/* Compare image - should be same format. */
|
/* Compare image - should be same format. */
|
||||||
for (j = 0; j < surface->h; j++) {
|
for (j = 0; j < surface->h; j++) {
|
||||||
for (i = 0; i < surface->w; i++) {
|
for (i = 0; i < surface->w; i++) {
|
||||||
|
Uint32 pixel;
|
||||||
p = (Uint8 *)surface->pixels + j * surface->pitch + i * bpp;
|
p = (Uint8 *)surface->pixels + j * surface->pitch + i * bpp;
|
||||||
p_reference = (Uint8 *)referenceSurface->pixels + j * referenceSurface->pitch + i * bpp_reference;
|
p_reference = (Uint8 *)referenceSurface->pixels + j * referenceSurface->pitch + i * bpp_reference;
|
||||||
|
|
||||||
SDL_GetRGBA(*(Uint32 *)p, surface->format, &R, &G, &B, &A);
|
pixel = GetPixel(p, bpp);
|
||||||
SDL_GetRGBA(*(Uint32 *)p_reference, referenceSurface->format, &Rd, &Gd, &Bd, &Ad);
|
SDL_GetRGBA(pixel, surface->format, &R, &G, &B, &A);
|
||||||
|
pixel = GetPixel(p_reference, bpp_reference);
|
||||||
|
SDL_GetRGBA(pixel, referenceSurface->format, &Rd, &Gd, &Bd, &Ad);
|
||||||
|
|
||||||
dist = 0;
|
dist = 0;
|
||||||
dist += (R - Rd) * (R - Rd);
|
dist += (R - Rd) * (R - Rd);
|
||||||
|
|||||||
@@ -471,7 +471,9 @@ char *SDLTest_RandomAsciiStringWithMaximumLength(int maxLength)
|
|||||||
}
|
}
|
||||||
|
|
||||||
size = (SDLTest_RandomUint32() % (maxLength + 1));
|
size = (SDLTest_RandomUint32() % (maxLength + 1));
|
||||||
|
if (size == 0) {
|
||||||
|
size = 1;
|
||||||
|
}
|
||||||
return SDLTest_RandomAsciiStringOfSize(size);
|
return SDLTest_RandomAsciiStringOfSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,15 +106,20 @@ void SDL_Blit_Slow(SDL_BlitInfo *info)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
if ((flags & (SDL_COPY_BLEND | SDL_COPY_ADD | SDL_COPY_MOD | SDL_COPY_MUL))) {
|
||||||
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
|
if (FORMAT_HAS_ALPHA(dstfmt_val)) {
|
||||||
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
|
DISEMBLE_RGBA(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB, dstA);
|
||||||
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
|
} else if (FORMAT_HAS_NO_ALPHA(dstfmt_val)) {
|
||||||
dstA = 0xFF;
|
DISEMBLE_RGB(dst, dstbpp, dst_fmt, dstpixel, dstR, dstG, dstB);
|
||||||
|
dstA = 0xFF;
|
||||||
|
} else {
|
||||||
|
/* SDL_PIXELFORMAT_ARGB2101010 */
|
||||||
|
dstpixel = *((Uint32 *) (dst));
|
||||||
|
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* SDL_PIXELFORMAT_ARGB2101010 */
|
/* don't care */
|
||||||
dstpixel = *((Uint32 *)(dst));
|
dstR = dstG = dstB = dstA = 0;
|
||||||
RGBA_FROM_ARGB2101010(dstpixel, dstR, dstG, dstB, dstA);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & SDL_COPY_MODULATE_COLOR) {
|
if (flags & SDL_COPY_MODULATE_COLOR) {
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ static void android_egl_context_restore(SDL_Window *window)
|
|||||||
if (window) {
|
if (window) {
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
|
||||||
|
SDL_GL_MakeCurrent(window, NULL);
|
||||||
if (SDL_GL_MakeCurrent(window, (SDL_GLContext)data->egl_context) < 0) {
|
if (SDL_GL_MakeCurrent(window, (SDL_GLContext)data->egl_context) < 0) {
|
||||||
/* The context is no longer valid, create a new one */
|
/* The context is no longer valid, create a new one */
|
||||||
data->egl_context = (EGLContext)SDL_GL_CreateContext(window);
|
data->egl_context = (EGLContext)SDL_GL_CreateContext(window);
|
||||||
|
|||||||
@@ -31,6 +31,15 @@
|
|||||||
|
|
||||||
#include "../../events/SDL_mouse_c.h"
|
#include "../../events/SDL_mouse_c.h"
|
||||||
|
|
||||||
|
/* older Emscriptens don't have this, but we need to for wasm64 compatibility. */
|
||||||
|
#ifndef MAIN_THREAD_EM_ASM_PTR
|
||||||
|
#ifdef __wasm64__
|
||||||
|
#error You need to upgrade your Emscripten compiler to support wasm64
|
||||||
|
#else
|
||||||
|
#define MAIN_THREAD_EM_ASM_PTR MAIN_THREAD_EM_ASM_INT
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
static SDL_Cursor *Emscripten_CreateCursorFromString(const char *cursor_str, SDL_bool is_custom)
|
static SDL_Cursor *Emscripten_CreateCursorFromString(const char *cursor_str, SDL_bool is_custom)
|
||||||
{
|
{
|
||||||
SDL_Cursor *cursor;
|
SDL_Cursor *cursor;
|
||||||
@@ -60,6 +69,8 @@ static SDL_Cursor *Emscripten_CreateDefaultCursor()
|
|||||||
return Emscripten_CreateCursorFromString("default", SDL_FALSE);
|
return Emscripten_CreateCursorFromString("default", SDL_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EM_JS_DEPS(sdlmouse, "$stringToUTF8,$UTF8ToString");
|
||||||
|
|
||||||
static SDL_Cursor *Emscripten_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y)
|
static SDL_Cursor *Emscripten_CreateCursor(SDL_Surface *surface, int hot_x, int hot_y)
|
||||||
{
|
{
|
||||||
const char *cursor_url = NULL;
|
const char *cursor_url = NULL;
|
||||||
@@ -72,7 +83,7 @@ static SDL_Cursor *Emscripten_CreateCursor(SDL_Surface *surface, int hot_x, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* *INDENT-OFF* */ /* clang-format off */
|
/* *INDENT-OFF* */ /* clang-format off */
|
||||||
cursor_url = (const char *)MAIN_THREAD_EM_ASM_INT({
|
cursor_url = (const char *)MAIN_THREAD_EM_ASM_PTR({
|
||||||
var w = $0;
|
var w = $0;
|
||||||
var h = $1;
|
var h = $1;
|
||||||
var hot_x = $2;
|
var hot_x = $2;
|
||||||
|
|||||||
@@ -37,34 +37,30 @@ typedef struct
|
|||||||
const char *libname;
|
const char *libname;
|
||||||
} waylanddynlib;
|
} waylanddynlib;
|
||||||
|
|
||||||
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
|
|
||||||
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL NULL
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
|
|
||||||
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR NULL
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
|
|
||||||
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON NULL
|
|
||||||
#endif
|
|
||||||
#ifndef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
|
|
||||||
#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR NULL
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static waylanddynlib waylandlibs[] = {
|
static waylanddynlib waylandlibs[] = {
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC },
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC },
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL },
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL },
|
||||||
|
#endif
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR },
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR },
|
||||||
|
#endif
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON },
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON },
|
||||||
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR }
|
#endif
|
||||||
|
#ifdef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR
|
||||||
|
{ NULL, SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_LIBDECOR },
|
||||||
|
#endif
|
||||||
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool required)
|
static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool required)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
void *fn = NULL;
|
void *fn = NULL;
|
||||||
for (i = 0; i < SDL_TABLESIZE(waylandlibs); i++) {
|
waylanddynlib *dynlib;
|
||||||
if (waylandlibs[i].lib != NULL) {
|
for (dynlib = waylandlibs; dynlib->libname; dynlib++) {
|
||||||
fn = SDL_LoadFunction(waylandlibs[i].lib, fnname);
|
if (dynlib->lib != NULL) {
|
||||||
|
fn = SDL_LoadFunction(dynlib->lib, fnname);
|
||||||
if (fn != NULL) {
|
if (fn != NULL) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -72,10 +68,11 @@ static void *WAYLAND_GetSym(const char *fnname, int *pHasModule, SDL_bool requir
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if DEBUG_DYNAMIC_WAYLAND
|
#if DEBUG_DYNAMIC_WAYLAND
|
||||||
if (fn != NULL)
|
if (fn != NULL) {
|
||||||
SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, waylandlibs[i].libname, fn);
|
SDL_Log("WAYLAND: Found '%s' in %s (%p)\n", fnname, dynlib->libname, fn);
|
||||||
else
|
} else {
|
||||||
SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!\n", fnname);
|
SDL_Log("WAYLAND: Symbol '%s' NOT FOUND!\n", fnname);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (fn == NULL && required) {
|
if (fn == NULL && required) {
|
||||||
|
|||||||
@@ -2534,6 +2534,10 @@ static void lock_pointer_to_window(SDL_Window *window,
|
|||||||
SDL_VideoData *d = input->display;
|
SDL_VideoData *d = input->display;
|
||||||
struct zwp_locked_pointer_v1 *locked_pointer;
|
struct zwp_locked_pointer_v1 *locked_pointer;
|
||||||
|
|
||||||
|
if (!d->pointer_constraints || !input->pointer) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (w->locked_pointer) {
|
if (w->locked_pointer) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2621,8 +2625,10 @@ int Wayland_input_unlock_pointer(struct SDL_WaylandInput *input)
|
|||||||
w->locked_pointer = NULL;
|
w->locked_pointer = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
zwp_relative_pointer_v1_destroy(input->relative_pointer);
|
if (input->relative_pointer) {
|
||||||
input->relative_pointer = NULL;
|
zwp_relative_pointer_v1_destroy(input->relative_pointer);
|
||||||
|
input->relative_pointer = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
d->relative_mouse_mode = 0;
|
d->relative_mouse_mode = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1322,21 +1322,15 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window)
|
|||||||
/* Create the shell surface and map the toplevel/popup */
|
/* Create the shell surface and map the toplevel/popup */
|
||||||
#ifdef HAVE_LIBDECOR_H
|
#ifdef HAVE_LIBDECOR_H
|
||||||
if (data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) {
|
if (data->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) {
|
||||||
if (data->shell_surface.libdecor.frame) {
|
data->shell_surface.libdecor.frame = libdecor_decorate(c->shell.libdecor,
|
||||||
/* If the frame already exists, just set the visibility. */
|
data->surface,
|
||||||
libdecor_frame_set_visibility(data->shell_surface.libdecor.frame, true);
|
&libdecor_frame_interface,
|
||||||
libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname);
|
data);
|
||||||
|
if (data->shell_surface.libdecor.frame == NULL) {
|
||||||
|
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Failed to create libdecor frame!");
|
||||||
} else {
|
} else {
|
||||||
data->shell_surface.libdecor.frame = libdecor_decorate(c->shell.libdecor,
|
libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname);
|
||||||
data->surface,
|
libdecor_frame_map(data->shell_surface.libdecor.frame);
|
||||||
&libdecor_frame_interface,
|
|
||||||
data);
|
|
||||||
if (data->shell_surface.libdecor.frame == NULL) {
|
|
||||||
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Failed to create libdecor frame!");
|
|
||||||
} else {
|
|
||||||
libdecor_frame_set_app_id(data->shell_surface.libdecor.frame, c->classname);
|
|
||||||
libdecor_frame_map(data->shell_surface.libdecor.frame);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -1540,8 +1534,8 @@ void Wayland_HideWindow(_THIS, SDL_Window *window)
|
|||||||
#ifdef HAVE_LIBDECOR_H
|
#ifdef HAVE_LIBDECOR_H
|
||||||
if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) {
|
if (wind->shell_surface_type == WAYLAND_SURFACE_LIBDECOR) {
|
||||||
if (wind->shell_surface.libdecor.frame) {
|
if (wind->shell_surface.libdecor.frame) {
|
||||||
libdecor_frame_set_visibility(wind->shell_surface.libdecor.frame, false);
|
libdecor_frame_unref(wind->shell_surface.libdecor.frame);
|
||||||
libdecor_frame_set_app_id(wind->shell_surface.libdecor.frame, data->classname);
|
wind->shell_surface.libdecor.frame = NULL;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -132,10 +132,7 @@ static int SetSelectionText(_THIS, const char *text, Atom selection_type)
|
|||||||
X11_GetSDLCutBufferClipboardInternalFormat(display, SDL_X11_CLIPBOARD_MIME_TYPE_STRING), 8, PropModeReplace,
|
X11_GetSDLCutBufferClipboardInternalFormat(display, SDL_X11_CLIPBOARD_MIME_TYPE_STRING), 8, PropModeReplace,
|
||||||
(const unsigned char *)text, SDL_strlen(text));
|
(const unsigned char *)text, SDL_strlen(text));
|
||||||
|
|
||||||
if (X11_XGetSelectionOwner(display, selection_type) != window) {
|
X11_XSetSelectionOwner(display, selection_type, window, CurrentTime);
|
||||||
X11_XSetSelectionOwner(display, selection_type, window, CurrentTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -330,13 +330,16 @@ static void WarpMouseInternal(Window xwindow, const int x, const int y)
|
|||||||
Display *display = videodata->display;
|
Display *display = videodata->display;
|
||||||
#if SDL_VIDEO_DRIVER_X11_XINPUT2
|
#if SDL_VIDEO_DRIVER_X11_XINPUT2
|
||||||
int deviceid = 0;
|
int deviceid = 0;
|
||||||
/* It seems XIWarpPointer() doesn't work correctly on multi-head setups:
|
if (X11_Xinput2IsInitialized()) {
|
||||||
* https://developer.blender.org/rB165caafb99c6846e53d11c4e966990aaffc06cea
|
/* It seems XIWarpPointer() doesn't work correctly on multi-head setups:
|
||||||
*/
|
* https://developer.blender.org/rB165caafb99c6846e53d11c4e966990aaffc06cea
|
||||||
if (ScreenCount(display) == 1) {
|
*/
|
||||||
X11_XIGetClientPointer(display, None, &deviceid);
|
if (ScreenCount(display) == 1) {
|
||||||
|
X11_XIGetClientPointer(display, None, &deviceid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (deviceid != 0) {
|
if (deviceid != 0) {
|
||||||
|
SDL_assert(SDL_X11_HAVE_XINPUT2);
|
||||||
X11_XIWarpPointer(display, deviceid, None, xwindow, 0.0, 0.0, 0, 0, (double)x, (double)y);
|
X11_XIWarpPointer(display, deviceid, None, xwindow, 0.0, 0.0, 0, 0, (double)x, (double)y);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@@ -369,14 +372,7 @@ static int X11_WarpMouseGlobal(int x, int y)
|
|||||||
|
|
||||||
static int X11_SetRelativeMouseMode(SDL_bool enabled)
|
static int X11_SetRelativeMouseMode(SDL_bool enabled)
|
||||||
{
|
{
|
||||||
#if SDL_VIDEO_DRIVER_X11_XINPUT2
|
return X11_Xinput2IsInitialized() ? 0 : SDL_Unsupported();
|
||||||
if (X11_Xinput2IsInitialized()) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
SDL_Unsupported();
|
|
||||||
#endif
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int X11_CaptureMouse(SDL_Window *window)
|
static int X11_CaptureMouse(SDL_Window *window)
|
||||||
@@ -414,12 +410,9 @@ static Uint32 X11_GetGlobalMouseState(int *x, int *y)
|
|||||||
|
|
||||||
/* !!! FIXME: should we XSync() here first? */
|
/* !!! FIXME: should we XSync() here first? */
|
||||||
|
|
||||||
#if !SDL_VIDEO_DRIVER_X11_XINPUT2
|
if (!X11_Xinput2IsInitialized()) {
|
||||||
videodata->global_mouse_changed = SDL_TRUE;
|
|
||||||
#else
|
|
||||||
if (!SDL_X11_HAVE_XINPUT2)
|
|
||||||
videodata->global_mouse_changed = SDL_TRUE;
|
videodata->global_mouse_changed = SDL_TRUE;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
/* check if we have this cached since XInput last saw the mouse move. */
|
/* check if we have this cached since XInput last saw the mouse move. */
|
||||||
/* !!! FIXME: can we just calculate this from XInput's events? */
|
/* !!! FIXME: can we just calculate this from XInput's events? */
|
||||||
|
|||||||
+8
-1
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0...3.5)
|
||||||
project(SDL2_test)
|
project(SDL2_test)
|
||||||
|
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
@@ -168,6 +168,9 @@ add_sdl_test_executable(testoverlay2 NEEDS_RESOURCES testoverlay2.c testyuv_cvt.
|
|||||||
add_sdl_test_executable(testplatform NONINTERACTIVE testplatform.c)
|
add_sdl_test_executable(testplatform NONINTERACTIVE testplatform.c)
|
||||||
add_sdl_test_executable(testpower NONINTERACTIVE testpower.c)
|
add_sdl_test_executable(testpower NONINTERACTIVE testpower.c)
|
||||||
add_sdl_test_executable(testfilesystem NONINTERACTIVE testfilesystem.c)
|
add_sdl_test_executable(testfilesystem NONINTERACTIVE testfilesystem.c)
|
||||||
|
if(WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||||
|
add_sdl_test_executable(testfilesystem_pre NONINTERACTIVE testfilesystem_pre.c)
|
||||||
|
endif()
|
||||||
add_sdl_test_executable(testrendertarget NEEDS_RESOURCES testrendertarget.c testutils.c)
|
add_sdl_test_executable(testrendertarget NEEDS_RESOURCES testrendertarget.c testutils.c)
|
||||||
add_sdl_test_executable(testscale NEEDS_RESOURCES testscale.c testutils.c)
|
add_sdl_test_executable(testscale NEEDS_RESOURCES testscale.c testutils.c)
|
||||||
add_sdl_test_executable(testsem testsem.c)
|
add_sdl_test_executable(testsem testsem.c)
|
||||||
@@ -426,6 +429,10 @@ endforeach()
|
|||||||
|
|
||||||
set_tests_properties(testthread PROPERTIES TIMEOUT 40)
|
set_tests_properties(testthread PROPERTIES TIMEOUT 40)
|
||||||
set_tests_properties(testtimer PROPERTIES TIMEOUT 60)
|
set_tests_properties(testtimer PROPERTIES TIMEOUT 60)
|
||||||
|
if(TARGET testfilesystem_pre)
|
||||||
|
set_property(TEST testfilesystem_pre PROPERTY TIMEOUT 60)
|
||||||
|
set_property(TEST testfilesystem APPEND PROPERTY DEPENDS testfilesystem_pre)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(SDL_INSTALL_TESTS)
|
if(SDL_INSTALL_TESTS)
|
||||||
if(RISCOS)
|
if(RISCOS)
|
||||||
|
|||||||
@@ -102,8 +102,8 @@ const char *_nonRGBPixelFormatsVerbose[] = {
|
|||||||
/* Definition of some invalid formats for negative tests */
|
/* Definition of some invalid formats for negative tests */
|
||||||
const int _numInvalidPixelFormats = 2;
|
const int _numInvalidPixelFormats = 2;
|
||||||
Uint32 _invalidPixelFormats[] = {
|
Uint32 _invalidPixelFormats[] = {
|
||||||
0xfffffffe,
|
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1010102 + 1, 32, 4),
|
||||||
0xffffffff
|
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR, SDL_PACKEDLAYOUT_1010102 + 2, 32, 4)
|
||||||
};
|
};
|
||||||
const char *_invalidPixelFormatsVerbose[] = {
|
const char *_invalidPixelFormatsVerbose[] = {
|
||||||
"SDL_PIXELFORMAT_UNKNOWN",
|
"SDL_PIXELFORMAT_UNKNOWN",
|
||||||
@@ -121,7 +121,6 @@ const char *_invalidPixelFormatsVerbose[] = {
|
|||||||
int pixels_allocFreeFormat(void *arg)
|
int pixels_allocFreeFormat(void *arg)
|
||||||
{
|
{
|
||||||
const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
|
const char *unknownFormat = "SDL_PIXELFORMAT_UNKNOWN";
|
||||||
const char *expectedError = "Parameter 'format' is invalid";
|
|
||||||
const char *error;
|
const char *error;
|
||||||
int i;
|
int i;
|
||||||
Uint32 format;
|
Uint32 format;
|
||||||
@@ -172,6 +171,7 @@ int pixels_allocFreeFormat(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0 /* This succeeds for SDL3, but we don't expect SDL2 applications to call SDL_AllocFormat() for FOURCC formats directly */
|
||||||
/* Non-RGB formats */
|
/* Non-RGB formats */
|
||||||
for (i = 0; i < _numNonRGBPixelFormats; i++) {
|
for (i = 0; i < _numNonRGBPixelFormats; i++) {
|
||||||
format = _nonRGBPixelFormats[i];
|
format = _nonRGBPixelFormats[i];
|
||||||
@@ -182,6 +182,7 @@ int pixels_allocFreeFormat(void *arg)
|
|||||||
SDLTest_AssertPass("Call to SDL_AllocFormat()");
|
SDLTest_AssertPass("Call to SDL_AllocFormat()");
|
||||||
SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
|
SDLTest_AssertCheck(result == NULL, "Verify result is NULL");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Negative cases */
|
/* Negative cases */
|
||||||
|
|
||||||
@@ -196,23 +197,6 @@ int pixels_allocFreeFormat(void *arg)
|
|||||||
error = SDL_GetError();
|
error = SDL_GetError();
|
||||||
SDLTest_AssertPass("Call to SDL_GetError()");
|
SDLTest_AssertPass("Call to SDL_GetError()");
|
||||||
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
||||||
if (error != NULL) {
|
|
||||||
SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
|
|
||||||
"Validate error message, expected: '%s', got: '%s'", expectedError, error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Invalid free pointer */
|
|
||||||
SDL_ClearError();
|
|
||||||
SDLTest_AssertPass("Call to SDL_ClearError()");
|
|
||||||
SDL_FreeFormat(NULL);
|
|
||||||
SDLTest_AssertPass("Call to SDL_FreeFormat(NULL)");
|
|
||||||
error = SDL_GetError();
|
|
||||||
SDLTest_AssertPass("Call to SDL_GetError()");
|
|
||||||
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
|
||||||
if (error != NULL) {
|
|
||||||
SDLTest_AssertCheck(SDL_strcmp(error, expectedError) == 0,
|
|
||||||
"Validate error message, expected: '%s', got: '%s'", expectedError, error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
@@ -310,7 +294,6 @@ int pixels_getPixelFormatName(void *arg)
|
|||||||
int pixels_allocFreePalette(void *arg)
|
int pixels_allocFreePalette(void *arg)
|
||||||
{
|
{
|
||||||
const char *expectedError1 = "Parameter 'ncolors' is invalid";
|
const char *expectedError1 = "Parameter 'ncolors' is invalid";
|
||||||
const char *expectedError2 = "Parameter 'palette' is invalid";
|
|
||||||
const char *error;
|
const char *error;
|
||||||
int variation;
|
int variation;
|
||||||
int i;
|
int i;
|
||||||
@@ -375,19 +358,6 @@ int pixels_allocFreePalette(void *arg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Invalid free pointer */
|
|
||||||
SDL_ClearError();
|
|
||||||
SDLTest_AssertPass("Call to SDL_ClearError()");
|
|
||||||
SDL_FreePalette(NULL);
|
|
||||||
SDLTest_AssertPass("Call to SDL_FreePalette(NULL)");
|
|
||||||
error = SDL_GetError();
|
|
||||||
SDLTest_AssertPass("Call to SDL_GetError()");
|
|
||||||
SDLTest_AssertCheck(error != NULL, "Validate that error message was not NULL");
|
|
||||||
if (error != NULL) {
|
|
||||||
SDLTest_AssertCheck(SDL_strcmp(error, expectedError2) == 0,
|
|
||||||
"Validate error message, expected: '%s', got: '%s'", expectedError2, error);
|
|
||||||
}
|
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ int stdlib_sscanf(void *arg)
|
|||||||
long long_output, expected_long_output;
|
long long_output, expected_long_output;
|
||||||
long long long_long_output, expected_long_long_output;
|
long long long_long_output, expected_long_long_output;
|
||||||
size_t size_output, expected_size_output;
|
size_t size_output, expected_size_output;
|
||||||
char text[128];
|
char text[128], text2[128];
|
||||||
|
|
||||||
expected_output = output = 123;
|
expected_output = output = 123;
|
||||||
expected_result = -1;
|
expected_result = -1;
|
||||||
@@ -403,6 +403,82 @@ int stdlib_sscanf(void *arg)
|
|||||||
SDLTest_AssertCheck(expected_size_output == size_output, "Check output, expected: %zu, got: %zu", expected_size_output, size_output);
|
SDLTest_AssertCheck(expected_size_output == size_output, "Check output, expected: %zu, got: %zu", expected_size_output, size_output);
|
||||||
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 1;
|
||||||
|
text[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc def", "%s", text);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc def\", \"%%s\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 1;
|
||||||
|
text[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc,def", "%s", text);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%s\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc,def") == 0, "Check output, expected: \"abc\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 1;
|
||||||
|
text[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc,def", "%[cba]", text);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[cba]\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 1;
|
||||||
|
text[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc,def", "%[a-z]", text);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[z-a]\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 1;
|
||||||
|
text[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc,def", "%[^,]", text);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[^,]\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 0;
|
||||||
|
text[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc,def", "%[A-Z]", text);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[A-Z]\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "") == 0, "Check output, expected: \"\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 2;
|
||||||
|
text[0] = '\0';
|
||||||
|
text2[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc,def", "%[abc],%[def]", text, text2);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[abc],%%[def]\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text2, "def") == 0, "Check output, expected: \"def\", got: \"%s\"", text2);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 2;
|
||||||
|
text[0] = '\0';
|
||||||
|
text2[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc,def", "%[abc]%*[,]%[def]", text, text2);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc,def\", \"%%[abc]%%*[,]%%[def]\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text2, "def") == 0, "Check output, expected: \"def\", got: \"%s\"", text2);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 2;
|
||||||
|
text[0] = '\0';
|
||||||
|
text2[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc def", "%[abc] %[def]", text, text2);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc def\", \"%%[abc] %%[def]\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc") == 0, "Check output, expected: \"abc\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text2, "def") == 0, "Check output, expected: \"def\", got: \"%s\"", text2);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
|
expected_result = 1;
|
||||||
|
text[0] = '\0';
|
||||||
|
result = SDL_sscanf("abc123XYZ", "%[a-zA-Z0-9]", text);
|
||||||
|
SDLTest_AssertPass("Call to SDL_sscanf(\"abc123XYZ\", \"%%[a-zA-Z0-9]\", text)");
|
||||||
|
SDLTest_AssertCheck(SDL_strcmp(text, "abc123XYZ") == 0, "Check output, expected: \"abc123XYZ\", got: \"%s\"", text);
|
||||||
|
SDLTest_AssertCheck(expected_result == result, "Check return value, expected: %i, got: %i", expected_result, result);
|
||||||
|
|
||||||
return TEST_COMPLETED;
|
return TEST_COMPLETED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||||
|
|
||||||
|
This software is provided 'as-is', without any express or implied
|
||||||
|
warranty. In no event will the authors be held liable for any damages
|
||||||
|
arising from the use of this software.
|
||||||
|
|
||||||
|
Permission is granted to anyone to use this software for any purpose,
|
||||||
|
including commercial applications, and to alter it and redistribute it
|
||||||
|
freely.
|
||||||
|
*/
|
||||||
|
/* Call SDL_GetPrefPath to warm the SHGetFolderPathW cache */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We noticed frequent ci timeouts running testfilesystem on 32-bit Windows.
|
||||||
|
* Internally, this functions calls Shell32.SHGetFolderPathW.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "SDL.h"
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
Uint64 start;
|
||||||
|
(void)argc;
|
||||||
|
(void)argv;
|
||||||
|
SDL_Init(0);
|
||||||
|
start = SDL_GetTicks();
|
||||||
|
SDL_GetPrefPath("libsdl", "test_filesystem");
|
||||||
|
SDL_Log("SDL_GetPrefPath took %" SDL_PRIu64 "ms", SDL_GetTicks() - start);
|
||||||
|
SDL_Quit();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user