From fb1595d62db87e321f5aa5efb3546de4cb31a332 Mon Sep 17 00:00:00 2001 From: LibretroAdmin Date: Wed, 4 Nov 2026 18:58:18 +0100 Subject: [PATCH] samples: link on MinGW again verbosity.c mirrors each log line into the desktop companion under HAVE_COMPANION_WIMP, which ui_companion_driver.h turns on for every desktop Windows build, so each sample that links verbosity.c failed to link there: undefined ui_companion_driver_log_active and ui_companion_driver_log_msg. samples/ui_companion_log_stub.c gives the six of them a companion that is never open. The database sample's main.c used strlcpy() without , an error with GCC 14 and later. --- samples/frontend/salamander_pending/Makefile | 1 + samples/playlist/Makefile | 1 + samples/runloop/log_ring/Makefile | 1 + samples/tasks/core_backup/Makefile | 1 + samples/tasks/database/Makefile | 1 + samples/tasks/database/main.c | 1 + samples/tasks/playlist_manager/Makefile | 3 +- samples/ui_companion_log_stub.c | 40 ++++++++++++++++++++ 8 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 samples/ui_companion_log_stub.c diff --git a/samples/frontend/salamander_pending/Makefile b/samples/frontend/salamander_pending/Makefile index 5fde1bb49f..18487b3af4 100644 --- a/samples/frontend/salamander_pending/Makefile +++ b/samples/frontend/salamander_pending/Makefile @@ -12,6 +12,7 @@ LRC := $(CORE_DIR)/libretro-common SOURCES := salamander_pending_test.c \ $(CORE_DIR)/frontend/frontend_salamander.c \ $(CORE_DIR)/verbosity.c \ + $(CORE_DIR)/samples/ui_companion_log_stub.c \ $(LRC)/file/file_path.c \ $(LRC)/file/file_path_io.c \ $(LRC)/string/rstrtod.c \ diff --git a/samples/playlist/Makefile b/samples/playlist/Makefile index 11c6f7a6d4..a004b2b44f 100644 --- a/samples/playlist/Makefile +++ b/samples/playlist/Makefile @@ -9,6 +9,7 @@ SOURCES_C := \ $(CORE_DIR)/samples/playlist/playlist_parity_test.c \ $(CORE_DIR)/playlist.c \ $(CORE_DIR)/verbosity.c \ + $(CORE_DIR)/samples/ui_companion_log_stub.c \ $(LIBRETRO_COMM_DIR)/formats/json/rjson.c \ $(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \ $(LIBRETRO_COMM_DIR)/compat/compat_strl.c \ diff --git a/samples/runloop/log_ring/Makefile b/samples/runloop/log_ring/Makefile index 4f7b9dbdf8..b65ba5c5ba 100644 --- a/samples/runloop/log_ring/Makefile +++ b/samples/runloop/log_ring/Makefile @@ -3,6 +3,7 @@ ROOT := ../../.. LC := $(ROOT)/libretro-common TARGET := log_ring_test SOURCES := log_ring_test.c $(ROOT)/verbosity.c \ + $(ROOT)/samples/ui_companion_log_stub.c \ $(LC)/rthreads/rthreads.c $(LC)/compat/compat_strl.c \ $(LC)/file/file_path.c $(LC)/file/file_path_io.c \ $(LC)/streams/file_stream.c $(LC)/vfs/vfs_implementation.c \ diff --git a/samples/tasks/core_backup/Makefile b/samples/tasks/core_backup/Makefile index ea244667d0..df49b15fe6 100644 --- a/samples/tasks/core_backup/Makefile +++ b/samples/tasks/core_backup/Makefile @@ -30,6 +30,7 @@ SOURCES := \ $(LIBRETRO_COMM_DIR)/rthreads/rthreads.c \ $(LIBRETRO_COMM_DIR)/rthreads/retro_eventcount.c \ $(CORE_DIR)/verbosity.c \ + $(CORE_DIR)/samples/ui_companion_log_stub.c \ $(LIBRETRO_COMM_DIR)/streams/interface_stream.c \ $(LIBRETRO_COMM_DIR)/streams/file_stream.c \ $(LIBRETRO_COMM_DIR)/string/rstrtod.c \ diff --git a/samples/tasks/database/Makefile b/samples/tasks/database/Makefile index 747951601f..951f9730b0 100644 --- a/samples/tasks/database/Makefile +++ b/samples/tasks/database/Makefile @@ -101,6 +101,7 @@ SOURCES_C := \ $(CORE_DIR)/playlist.c \ $(CORE_DIR)/manual_content_scan.c \ $(CORE_DIR)/verbosity.c \ + $(CORE_DIR)/samples/ui_companion_log_stub.c \ $(LIBRETRO_COMM_DIR)/formats/m3u/rm3u.c \ $(LIBRETRO_COMM_DIR)/formats/logiqx_dat/logiqx_dat.c \ $(CORE_DIR)/libretro-db/bintree.c \ diff --git a/samples/tasks/database/main.c b/samples/tasks/database/main.c index 3d6b7b0971..f352d14cae 100644 --- a/samples/tasks/database/main.c +++ b/samples/tasks/database/main.c @@ -3,6 +3,7 @@ #include #include +#include #include #include "../../../core_info.h" diff --git a/samples/tasks/playlist_manager/Makefile b/samples/tasks/playlist_manager/Makefile index 319185d755..64898b03cc 100644 --- a/samples/tasks/playlist_manager/Makefile +++ b/samples/tasks/playlist_manager/Makefile @@ -48,7 +48,8 @@ SOURCES := pl_manager_budget_test.c \ $(LIBRETRO_COMM_DIR)/compat/compat_strldup.c \ $(LIBRETRO_COMM_DIR)/compat/compat_posix_string.c \ $(LIBRETRO_COMM_DIR)/compat/fopen_utf8.c \ - $(REPO_ROOT)/verbosity.c + $(REPO_ROOT)/verbosity.c \ + $(REPO_ROOT)/samples/ui_companion_log_stub.c OBJS := $(call sample_objs,$(SOURCES:.c=.o)) diff --git a/samples/ui_companion_log_stub.c b/samples/ui_companion_log_stub.c new file mode 100644 index 0000000000..d4f4339381 --- /dev/null +++ b/samples/ui_companion_log_stub.c @@ -0,0 +1,40 @@ +/* Copyright (C) 2010-2026 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (ui_companion_log_stub.c). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/* verbosity.c mirrors each line into the desktop companion wherever + * ui_companion_driver.h turns HAVE_COMPANION_WIMP on, which is every + * desktop Windows build. A sample that links verbosity.c has no + * companion: none is ever open. */ + +#include + +bool ui_companion_driver_log_active(void); +void ui_companion_driver_log_msg(const char *msg); + +bool ui_companion_driver_log_active(void) +{ + return false; +} + +void ui_companion_driver_log_msg(const char *msg) +{ + (void)msg; +}