rockbox/apps/plugins
Marc Andersen a3e93c496e lua: only define strerror/strcoll on native targets
apps/plugins/lua/rockaux.c defines strerror() and strcoll() so the Lua
plugin has something to link against on native targets, which have no
libc providing them. Hosted targets do have a libc, and defining them
there is at best redundant.

On the Windows simulator it is worse than redundant. Both come from
mingw's libmsvcrt.a, and because that is a static archive the linker
pulls in an archive member for an unrelated symbol, then finds a second
definition of these two, so lua.rock fails to link:

  libmsvcrt.a(...): multiple definition of `strcoll';
  rockaux.o:rockaux.c:244: first defined here
  libmsvcrt.a(...): multiple definition of `strerror';
  rockaux.o:rockaux.c:47: first defined here

On hosted Linux there is no diagnostic, because glibc supplies these
from a shared library where a local definition simply wins. That means
the plugin has been quietly shadowing glibc's strerror() with a stub
that always returned NULL, which is presumably not intended either.

Guard both with CONFIG_PLATFORM & PLATFORM_NATIVE, matching the guard
used a few lines above for errno. Hosted targets now get the real
implementations from their own libc.

This also silences a "redeclared without dllimport attribute" warning
that GCC 16 emits for the same clash.

Verified by building xduoox3 as a Windows simulator, xduoox3 as a Linux
simulator, and sansaclip as a native ARM target: all three link cleanly
with no multiple-definition errors.

Provenance, per the AI disclosure requirement in docs/CONTRIBUTING: this
change was drafted with Claude Code (Anthropic Claude Opus 5) at my
direction. Patch set 2 adopts Aidan MacDonald's review suggestion to key
the guard off PLATFORM_NATIVE rather than _WIN32.

Change-Id: I8ffb6fd792147c9067afa708003b1285fb9d07a4
2026-09-01 15:14:02 -04:00
..
bitmaps ap80max: New hosted port 2026-08-13 17:55:06 -07:00
chessbox 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
clock chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
doom 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
fft plugins/fft: do not starve other threads 2026-08-05 16:18:03 -04:00
fractals 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
frotz chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
goban 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
imageviewer 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
lib 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
lua lua: only define strerror/strcoll on native targets 2026-09-01 15:14:02 -04:00
lua_scripts filebrowse.lua add sort by type, add .bmp, .mod to known filetypes 2026-08-07 09:05:59 -04:00
midi 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
mikmod 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
mpegplayer 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
pacbox 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
pdbox 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
picross chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pictureflow chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
puzzles chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
reversi 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
rockboy 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
sdl 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
searchengine chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
shortcuts chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sudoku 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
tagcache chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
text_viewer 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
xrick chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
xworld chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
zxbox 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
2048.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
alarmclock.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
amaze.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
announce_status.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
battery_bench.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
bench_mem_jpeg.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
bench_scaler.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
blackjack.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
boomshine.lua chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
bounce.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
brickmania.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
bubbles.c ap80max: New hosted port 2026-08-13 17:55:06 -07:00
BUILD_OVERLAY
calculator.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
calendar.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
CATEGORIES plugins: add timer/countdown plugin 2026-04-16 21:35:52 -04:00
chessbox.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
chessclock.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
chip8.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
chopper.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
clix.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
codebuster.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
countdown_timer.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
credits.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
credits.pl chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
crypt_firmware.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
cube.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
cue_playlist.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
dart_scorer.c dart_scorer: scale better on smaller devices 2026-05-06 13:20:48 -04:00
db_folder_select.c plugins: db_folder_select, disktidy, main_menu_config: Fix selection dialog with Show Icons set to No 2025-04-10 12:30:29 +03:00
demystify.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
dice.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
dict.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
disktidy.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
disktidy.config disktidy: Add '__MACOSX' directories to the list 2026-04-01 10:32:40 -04:00
duke3d.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
elfdep.pl
file_picker.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
fire.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
fireworks.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
flipit.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
goban.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
greyscale.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
helloworld.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
helloworld.lua chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
invadrox.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
iriver_flash.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
iriverify.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
jackpot.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
jewels.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
keybox.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
keyremap.c [Feature] FS#13884 #2 allow merging imported native keymaps 2026-06-05 12:08:53 -04:00
lamp.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lastfm_scrobbler.c lastfm_scrobbler: fetch rbversion from plugin API 2026-08-25 13:17:08 -04:00
lastfm_scrobbler_viewer.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
logo.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lrcplayer.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
main_menu_config.c Use user preferred touchscreen mode in 'Main Menu Config' plugin instead of defaulting to 'button' mode. 2026-01-03 20:25:13 -05:00
matrix.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
maze.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
mazezam.c plugins & debug menu: apply consistent titles 2025-12-23 10:25:05 -05:00
md5sum.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
metronome.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
minesweeper.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
mosaique.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
mp3_encoder.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
multiboot_select.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
open_plugins.c [Bugfix] open_plugins.rock add 'add' item regardless & voice improvements 2026-06-09 00:39:31 -04:00
oscilloscope.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
otp.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pegbox.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
periodic_table.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
picross.lua Allow first level folders in plugin menu 2024-05-05 14:01:43 -04:00
pictureflow.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pitch_detector.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pitch_screen.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pixel-painter.lua chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
plasma.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
playing_time.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
plugin.lds ovl_offset: use elf symbols instead of refmap 2026-05-27 17:55:33 -04:00
plugin_crt0.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
plugins.make chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
pong.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
properties.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
quake.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
random_folder_advance_config.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rb_info.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
remote_control.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
resistor.c plugins & debug menu: apply consistent titles 2025-12-23 10:25:05 -05:00
robotfindskitten.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rockblox.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
rockblox1d.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rockbox-fonts.config FS#9059: Add WenQangYi Unibt font (William Poetra Yoga Hadisoeseno) 2024-10-27 22:04:54 -04:00
rockboy.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rocklife.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
rockpaint.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
search.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
settings_dumper.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
shopper.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sliding_puzzle.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
snake.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
snake2.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
snake2.levels
snow.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sokoban.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
sokoban.levels
solitaire.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
sort.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
SOURCES plugins: add timer/countdown plugin 2026-04-16 21:35:52 -04:00
SOURCES.app_build ap80max: New hosted port 2026-08-13 17:55:06 -07:00
spacerocks.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
speedread.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
star.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
starfield.c plugins: starfield: enable USB audio 2025-12-15 07:48:45 -05:00
stats.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
stopwatch.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
stopwatch.lua chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
SUBDIRS 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
SUBDIRS.app_build ap80max: New hosted port 2026-08-13 17:55:06 -07:00
superdom.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_boost.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_codec.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_core_jpeg.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_disk.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_fps.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_gfx.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_grey.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_greylib_bitmap_scale.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_kbd.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_mem.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_mem_jpeg.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_resize.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_sampr.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_scanrate.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_touchscreen.c ap80max: New hosted port 2026-08-13 17:55:06 -07:00
test_usb.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_viewports.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
test_viewports.lua chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
text_editor.c FS#13920 text_editor.c plugin do not terminate last line with \n 2026-06-05 02:17:38 -04:00
theme_remove.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
vbrfix.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
view_text.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
viewers.config [Feature] Playlis to cue plugin 2024-07-20 07:27:01 -04:00
vu_meter.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
wav2wv.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
wavview.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
windows_lnk.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
wolf3d.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
wormlet.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
xobox.c 3ds: Port refactor. 2026-09-01 08:39:07 -04:00
zxbox.c