devkitPro / libogc

C Library for Wii and Gamecube homebrew
https://devkitpro.org/viewforum.php?f=40
Other
286 stars 70 forks source link

`lwp_mutex.h`: wrap `__lwp_mutex_seize_irq_trylock` in ifdef #137

Closed muff1n1634 closed 1 year ago

muff1n1634 commented 1 year ago

defined in lwp_mutex.inl which isn't distributed so compiler likes to yell at me

'u32 __lwp_mutex_seize_irq_trylock(lwp_mutex*, u32*)' declared 'static' but never defined [-Wunused-function]

DacoTaco commented 1 year ago

wintermute and i took a look at this and we feel like the correct fix is to not have prototypes and internal functions in headers to begin with, instead of "hiding" them away with define statements. if you feel like a challenge, feel free to change that instead :D

EDIT : i just took a look. basically removing the whole including lwp_mutex.inl & lwp_mutex_seize_irq_trylock part of the header, move the define of lwp_mutex_seize to the inc. then include the lwp_mutex.inl in the .c files that need it (which should be malloc_lock.c & mutex.c )

muff1n1634 commented 1 year ago

sure, i can start a draft PR for doing those kinds of changes instead (the "correct fix" suggestion)