GDExtension: Save and compare modification times separately for reload #84315
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.
In the current GDExtension reload code, we're combining the last modification time of the .gdextension file and the library file by storing only the highest one, and then checking if it's changed by checking if either files' new modification time is greater than that value. This works great on Linux, where modification times move forward in time by default, even when copying existing files (unless you go out of your way to preserve the modification time).
However, this can have some issues on Windows because copied files will have the same modification time of the original file by default.
So, this PR switches to storing each last modification time individually, and simply checks if the modification time has changed (not that it's greater, just that it's different). As far as I can tell, this matches how the editor decides to reload normal resources, which also have "the two file problem" where you have the actual content file (ex file.png) and the import settings file (ex file.png.import).
Fixes #82738