First, make sure you have understood that the OCP is not violated at the time when you change some source code, see my answer here for a detailed explanation. The OCP is followed or violated at the time when a certain component is designed, and whether the OCP is followed or violated depends on the fact it's behaviour can or cannot be changed without changing it's source code afterwards.
In it's strongest form, the OCP is about binary components which might be reused in a parametrized fashion by someone who does not even has access to the source code. Still, I think the principle can also be applied to components deployed in source - the technical impossibility to change the source code of a component isn't mandatory for the OCP, it is about the non-necessity changing the code.
Now in the described case, this boils down to the question
what exactly counts as the source code of your component? Is the XCode project file (the place where XCODE_MACRO_PAGE_MAX
lives) part of the source, or not?
can this component be reused and adapted in a black-box fashion, for example by different groups or people who will never change the source code?
I guess in the described case, it makes usually most sense to count the cpp and header files together with the related XCode project file as the source code of your component. In this case, the component is not OCP compliant.
However, I can also imagine a scenario where you define a group of headers and cpp files (without the XCode project itself) as "the source code of your component", and deploy this group of files into different XCode projects with different XCODE_MACRO_PAGE_MAX
settings (maybe projects in different Git repositories). In that case, I think it could be justified to say your component is following the OCP - in some sense.
So in short, it depends on where you draw the borders of what belongs to a component, and the responsibilities for the maintenance of the component's source code itself vs it's parametric parts.
Note that following the OCP should have always a clear purpose, since it comes for the price of higher complexity. If the person or team who maintains the headers, cpps and project file for the component is the same, and your project does not have different build configurations with different PAGE_MAX values, then moving the default PAGE_MAX value into a macro XCODE_MACRO_PAGE_MAX
in the project file introduces will probably not be worth the hassle. And when in doubt, prefer the simpler solution over the more complex one.