xerpi / vita2hos

[WIP] PlayStation Vita to Horizon OS (Nintendo Switch OS) translation layer
https://discord.gg/Z9kAsBqkbx
GNU General Public License v2.0
1.1k stars 32 forks source link

Use macros for module exports #32

Closed gio3k closed 1 year ago

gio3k commented 2 years ago

Convenience macros (EXPORT, GET_EXPORT_ENTRY, GET_EXPORT_NID) for module exports / registry The export NID is now defined with the function declaration and can be accessed using GET_EXPORT_NID! This makes registry a bit cleaner:

... {
  GET_EXPORT_ENTRY(sceTouchGetPanelInfo), // or:
  {GET_EXPORT_NID(sceTouchGetPanelInfo), sceTouchGetPanelInfo}
} ...

(this PR only updates SceTouch so we can figure out if this is a good method or not, I'll update the other modules if it is!)

xerpi commented 1 year ago

Inspired from your idea, implemented here: https://github.com/xerpi/vita2hos/commit/ef16d7cc223aef193870369ac67616bdb16b7151