Fix: Extend strlcpy implementation to Linux builds (#3616)
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions

* Fix: Add libbsd dependency for Linux builds

Adds conditional libbsd support to resolve strlcpy undefined reference
on Linux systems. Includes proper CMake detection and header includes.

* Fix: Use internal strlcpy implementation for Linux

- Extend existing Windows strlcpy implementation to Linux
- Remove libbsd dependency from CMakeLists.txt
- Resolves undefined reference to strlcpy on glibc systems

Uses the project's existing approach instead of adding external dependencies.
This commit is contained in:
Gabriel 2025-09-18 00:45:28 -03:00 committed by GitHub
parent 6ab7aa3b18
commit 7101caa80b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -802,8 +802,8 @@ u16 PS4_SYSV_ABI sceNetHtons(u16 host16) {
return htons(host16);
}
#ifdef WIN32
// there isn't a strlcpy function in windows so implement one
#if defined(WIN32) || defined(__linux__)
// there isn't a strlcpy function in windows/glibc so implement one
u64 strlcpy(char* dst, const char* src, u64 size) {
u64 src_len = strlen(src);