Commit graph

4,790 commits

Author SHA1 Message Date
DarthMew
d38cdaa3b1
Merge pull request #118 from guijan/mkstemp
A couple of fixes.
2024-07-07 16:30:05 +02:00
DarthMew
0bee3c9ba0
Merge pull request #120 from guijan/musl
linux: switch ftruncate64 for ftruncate
2024-07-07 15:54:44 +02:00
DarthMew
cff104245a
Merge pull request #119 from guijan/enum
avoid out of range enum cast in HostReg
2024-07-07 15:00:02 +02:00
Guilherme Janczak
79108f3955
use __ANDROID__ not ANDROID
ANDROID is defined by the NDK
__ANDROID__ is defined by the compiler.

When compiling for android without the NDK, such as inside Termux,
ANDROID isn't defined.
2024-07-07 08:04:42 +00:00
Guilherme Janczak
9644a1b7fb
linux: switch ftruncate64 for ftruncate
POSIX guarantees that off_t is a signed integer type. It was typically
int32_t on historical versions of implementations. Some kind of
migration is necessary for platforms that started with int32_t, and
glibc did it the worst way possible: 32-bit platforms still default to
32-bit off_t, they added a _FILE_OFFSET_BITS macro to request a specific
size, and you can alternatively call nonstandard versions of standard
functions that work with off_t which use a specific size, these are
typically suffixed with "64" (e.g. ftruncate64, stat64) and work with a
nonstandard off64_t type.

Swanstation gets this confusing situation wrong by both defining
_FILE_OFFSET_BITS=64 and using the nonstandard .*64 functions on Linux.
This works on glibc, but breaks other libcs such as musl. By using the
standard names and letting _FILE_OFFSET_BITS handle the rest on glibc,
the code works on all Linux systems.

Ref: https://www.gnu.org/software/libc/manual/html_node/File-Size.html#index-ftruncate64
2024-07-07 00:01:21 +00:00
Guilherme Janczak
d62a9d2a9f
avoid out of range enum cast in HostReg
In file included from /home/jan/Work/swanstation/src/core/bus.cpp:6:
In file included from /home/jan/Work/swanstation/src/core/cpu_code_cache.h:14:
/home/jan/Work/swanstation/src/core/cpu_recompiler_types.h:70:37: error: integer value 16 is outside the valid range of values [0, 15] for the enumeration type 'Code' [-Wenum-constexpr-conver
sion]
   70 | constexpr HostReg HostReg_Invalid = static_cast<HostReg>(HostReg_Count);
      |                                     ^
2 warnings and 1 error generated.

The code was unspecified behavior in C++ prior to C++17, and was changed
to undefined behavior in C++17. Recent versions of Clang have added a
warning that is treated as an error by default for it, and this commit
fixes compilation on recent Clang.

Ref: https://wiki.sei.cmu.edu/confluence/display/cplusplus/INT50-CPP.+Do+not+cast+to+an+out-of-range+enumeration+value
Ref: https://releases.llvm.org/18.1.4/tools/clang/docs/DiagnosticsReference.html#wenum-constexpr-conversion
2024-07-06 22:01:17 +00:00
Guilherme Janczak
e54ca3a447
only #include <alloca.h> if it exists
This makes compilation succeed on FreeBSD.
2024-07-06 21:15:06 +00:00
Guilherme Janczak
651ff274e4
mkstemp: feature test, fix fd leak and unchecked return 2024-07-06 21:14:42 +00:00
DarthMew
d6f0f687ac
Update number of pads 2 2024-07-06 21:37:05 +02:00
DarthMew
ac0ef93546
Increase number of pads 2024-07-06 21:29:24 +02:00
DarthMew
22050d391c
Update descriptions 2024-07-04 17:43:15 +02:00
DarthMew
83776ae7d3 Implement NeGcon with rumble 2024-07-04 17:29:03 +02:00
DarthMew
0f401e2dee Default to a more compatible fastmem mode 2024-07-03 16:02:20 +02:00
DarthMew
46e39dbd59
Set this to true
Followup to 834a6f1241
2024-07-03 04:02:32 +02:00
DarthMew
834a6f1241 Provide more details regarding MDEC routines 2024-07-03 03:53:32 +02:00
DarthMew
8a999111ff
Remove unnecessary line 2024-06-29 18:00:58 +02:00
DarthMew
24aac046e0 texture_replacements: Use the swanstation folder inside RetroArch's system directory as base for the textures folder 2024-06-28 00:09:42 +02:00
DarthMew
ec7a200c76
Merge pull request #108 from guijan/redundant
remove redundant check for the empty string in filename
2024-06-26 16:16:33 +02:00
DarthMew
092b812725 byte_stream: Remove redundant code 2024-06-26 16:09:49 +02:00
Guilherme Janczak
b6226b61a2
remove redundant check for the empty string in filename
The OS APIs will error in such a case, we don't need to manually look
for this error.
2024-06-25 07:00:23 +00:00
DarthMew
7a27436548 types: __forceinline is for MVSC 2024-05-30 22:13:49 +02:00
DarthMew
0ddd642709
Workaround for older GNU compilers 2024-05-30 18:39:47 +02:00
DarthMew
f2b9a58b8f Exclude until necessary 2024-05-30 17:30:00 +02:00
DarthMew
5f7c7a199b Windows: Allow compiling without Visual Studio 2024-05-29 22:49:19 +02:00
libretroadmin
b4e78fdf68 libchdr updates 2024-05-26 20:45:15 +02:00
libretroadmin
eab1d36201 Use path_is_directory directly 2024-05-24 02:12:10 +02:00
DarthMew
7e0a69028e Move FindFiles out of if statement 2024-05-24 01:37:21 +02:00
libretroadmin
6a0cc4a1cf Use more libretro-common 2024-05-21 14:33:28 +02:00
libretroadmin
805e6407d4 Remove SanitizeFileName 2024-05-21 14:24:00 +02:00
libretroadmin
6b3df6cc12 Get rid of StringUtil::WideString functions 2024-05-21 13:22:58 +02:00
libretroadmin
071cd9e3e4 More usage of libretro-common 2024-05-21 12:44:36 +02:00
DarthMew
e91ad30a5c Backport game database entries 2024-05-21 01:33:46 +02:00
libretroadmin
bb70f43e4d Get rid of unused RenamePath 2024-05-20 06:04:47 +02:00
libretroadmin
c61a466471 Buildfix for Unix 2024-05-20 05:57:58 +02:00
libretroadmin
d3ea75502f Remove timestamp.cpp/timestamp.h - call path_mkdir and filestream
calls directly to avoid Windows shenanigans
2024-05-20 05:52:57 +02:00
libretroadmin
ea317b6e34 Use more libretro-common and libretro VFS 2024-05-20 05:17:45 +02:00
libretroadmin
6c7cb8619e Update CHD code to use libretro VFS 2024-05-20 04:36:34 +02:00
libretroadmin
9a4aee02e3 CreateDirectory - use libretro-common function 2024-05-20 04:22:17 +02:00
libretroadmin
130b79295c Start using libretro-common file_path_io functions for
stat functions
2024-05-20 04:14:52 +02:00
libretroadmin
b380a75b8b (PBP) Remove debug code 2024-05-20 02:48:55 +02:00
libretroadmin
7c5f78600a (PPF) Fix crash - rfclose() must be called AFTER the patch function 2024-05-20 02:47:07 +02:00
libretroadmin
a8b24fa99d Buildfix 2024-05-19 21:19:48 +02:00
libretroadmin
2f88cb9fbe Get rid of more stdio file I/O 2024-05-19 20:39:09 +02:00
libretroadmin
ea6119d035 (cd_image_pbp.cpp) Use libretro VFS 2024-05-19 20:31:18 +02:00
libretroadmin
d23696c236 More libretro VFS usage 2024-05-19 20:24:32 +02:00
libretroadmin
54be4bce18 Start using libretro VFS 2024-05-19 20:18:38 +02:00
libretroadmin
1f9462a9a9 First step hooking up VFS 2024-05-19 19:06:09 +02:00
libretroadmin
bc3352dead (Vulkan) Need to implement get_application_info otherwise will crash
on startup
2024-05-19 18:35:58 +02:00
DarthMew
929958a1ac
Fix Chrono Cross status screen 2024-05-06 21:14:21 +02:00
libretroadmin
6ed491d6ba (Common) Remove scope_guard.h 2024-04-26 05:26:21 +02:00