Add new platform functions for global directories #4458
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds some new platform functions around global directories and fixes up an existing one.
plat_get_global_config_dirlooks like it had been started before, but it assumed a particular buffer size and would wipe out your stack if the buffer was < 1024 bytes. This has been corrected and now a buffer length must be specified.plat_get_global_data_dirwas added for a global data directory.plat_get_temp_dirwas added as a way to get a temporary directory to store files or data. This mostly utilizes OS-level temporary directories.On macOS, we will from this point forward standardize on using
86Boxfor application-specific directories instead of the reverse domain identifier. This makes things more consistent across platforms. For example, the global application data location will be~/Library/Application Support/86Boxand the global config directory will be~/Library/Preferences/86Box.As part of the move toward the consistent application data directory name,
~/Library/Application Support/86Boxwill also be a valid ROM search path. The existing ROM search path is still in place.The platform function updates were also added and updated on the SDL side as well.
Checklist
References
N/A