Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move option change handlers out of options.cpp #7639

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Conversation

glebm
Copy link
Collaborator

@glebm glebm commented Jan 10, 2025

The first commit replaces sgOptions with GetOptions():
In C++, globals initialization order accross translation units is not defined. Accessing a global via a function ensures that it is initialized.

The second commit moves the handlers out of options.cpp, significantly reducing the amount of dependencies options.cpp has.

Fixes #7638

@glebm glebm enabled auto-merge (rebase) January 10, 2025 19:00
@glebm glebm changed the title sgOptions -> GetOptions() Move option change handlers out of options.cpp Jan 11, 2025
@glebm glebm force-pushed the options branch 2 times, most recently from e3c6e8c to f702588 Compare January 11, 2025 12:13
@glebm
Copy link
Collaborator Author

glebm commented Jan 11, 2025

Rebased

@glebm
Copy link
Collaborator Author

glebm commented Jan 11, 2025

Rebased

AJenbo
AJenbo previously approved these changes Jan 12, 2025
@AJenbo
Copy link
Member

AJenbo commented Jan 12, 2025

Needs another rebase apparently

glebm added 2 commits January 12, 2025 21:33
In C++, globals initialization order accross translation units is not
defined. Accessing a global via a function ensures that it is initialized.

This will be needed for diasurgical#7638, which will statically initialize change
handlers after the Options object has been initialized.
@glebm
Copy link
Collaborator Author

glebm commented Jan 12, 2025

@AJenbo Rebased

@glebm glebm merged commit 88a9a06 into diasurgical:master Jan 13, 2025
23 checks passed
@glebm glebm deleted the options branch January 13, 2025 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option change handlers should be registered outside of options.cpp
2 participants