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

Set MacOS platform version in one place #4471

Merged
merged 2 commits into from
Oct 31, 2023
Merged

Set MacOS platform version in one place #4471

merged 2 commits into from
Oct 31, 2023

Conversation

chalcolith
Copy link
Member

This PR specifies the MacOS platform version (currently "13.0.0") in only one place, and uses CMake variables and C/C++ defines to set it appropriately.

Fixes #4469

This PR specifies the MacOS platform version (currently "13.0.0") in only one place, and uses CMake variables and C/C++ defines to set it appropriately.
@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Oct 30, 2023
Comment on lines +25 to +26
#define STR(x) STR2(x)
#define STR2(x) #x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need STR2 instead of only STR(X) #x?

Copy link
Member

@jemc jemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, other than sharing Sean's question about the macro

@SeanTAllen SeanTAllen merged commit ffc2dc0 into main Oct 31, 2023
23 checks passed
@SeanTAllen SeanTAllen deleted the fix_4469 branch October 31, 2023 18:10
@ponylang-main ponylang-main removed the discuss during sync Should be discussed during an upcoming sync label Oct 31, 2023
@chalcolith
Copy link
Member Author

That's how the C preprocessor works: https://gcc.gnu.org/onlinedocs/gcc-3.4.3/cpp/Stringification.html

"If you want to stringify the result of expansion of a macro argument, you have to use two levels of macros.

     #define xstr(s) str(s)
     #define str(s) #s
     #define foo 4
     str (foo)
          ==> "foo"
     xstr (foo)
          ==> xstr (4)
          ==> str (4)
          ==> "4"

s is stringified when it is used in str, so it is not macro-expanded first. But s is an ordinary argument to xstr, so it is completely macro-expanded before xstr itself is expanded (see Argument Prescan). Therefore, by the time str gets to its argument, it has already been macro-expanded."

@ponylang-main ponylang-main added the discuss during sync Should be discussed during an upcoming sync label Oct 31, 2023
@chalcolith chalcolith removed the discuss during sync Should be discussed during an upcoming sync label Oct 31, 2023
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.

Clean up MacOS platform version setting
4 participants