You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a newer version of the header file one of the defines is missing. Let's say the second define is missing. So the inc-file would be updated to:
const
SDL_DEFINE1 = 0;
SDL_DEFINE3 = 2;
However, this raises (at least) two problems.
The define is (obviously) missing if someone is using an older version of sdl2 instead of the particualrly one to which the inc-file got updated.
The second concern is raised particularly because we are not always updating consistently to one particular version AND not all files at the same time: Let's say some files are not updated yet (very old version), some are updated (not the most recent version), some are updated to the latest version of sdl2. If now in the newest version some defines are deleted because they are gone, this may conflict with functions or expectations which are present in very old or older versions as they need or at least expect these defines/functions to be present.
The example above can be extended to structs/records where in newer version fields are missing or change their variable type.
Solution:
Actually, I don't know a simple solution yet. except to have some conditional compilation. Something like:
Keep everything as updated as possible. If SDL2 removes something, we remove it as well. Leave it to users to upgrade or downgrade the Pascal units as needed.
As you proposed - keep old stuff around, but guarded by some IFDEF block. Add a section to the README to tell users what's going on and how to enable deprecated identifiers.
Free-Pascal-meets-SDL-Website commented on Feb 14, 2022
Activity
suve commentedon Feb 13, 2022
Three solutions come to my mind:
deprecated.IFDEFblock. Add a section to the README to tell users what's going on and how to enable deprecated identifiers.Free-Pascal-meets-SDL-Website commentedon Feb 14, 2022
What option do you prefer for our project?
Free-Pascal-meets-SDL-Website commentedon Jul 11, 2022
I made further research on this. I think it is safe to remove the conditional.
See https://stackoverflow.com/questions/27296111/is-possible-to-mark-an-entire-const-block-as-deprecated for reference. There are variables shown to be deprecated in an identical way for Delphi.
Originally posted by @Free-Pascal-meets-SDL-Website in #52 (comment)