Closed liamwhite closed 1 year ago
__nx_win_init
/__nx_win_exit
are declared as weak in init.c/fini.c so that the linker does not pull them if you don't ever use the default window. It is intentional that they are defined as strong symbols in default_window.c.
The default window mechanism is intended to reduce boilerplate for 99% of use cases, and using it is not a requirement in any of the homebrew APIs that exist. If you need to obtain a NWindow in a specific way, then you can do that directly with VI APIs instead of bothering with the default window.
These were clearly intended to be overridable, but weren't since they weren't declared weak at the definition.
https://github.com/switchbrew/libnx/blob/dca4fb772aabf24c680561337f6bdffa69d7eb9a/nx/source/runtime/init.c#L101 https://github.com/switchbrew/libnx/blob/dca4fb772aabf24c680561337f6bdffa69d7eb9a/nx/source/runtime/init.c#L152