Closed Y-Less closed 7 years ago
That will also cover the reinclusion case, so the _foreach_included
check isn't needed any more (which is good, because I might have to add something to detect and complain about that symbol to YSI).
I don't understand why people uses foreach and YSI together but ok, I will add some checks.
And I want to save ability to include foreach twice, so I think that something like that is better:
#if defined _FOREACH_LOCAL_VERSION
#endinput
#endif
#define _FOREACH_LOCAL_VERSION 19
// Foreach is testing us.
#if defined _FOREACH_INC_TEST
#endinput
#endif
#if !defined _samp_included
#error Please include a_samp or a_npc before foreach
#endif
What do you think?
People don't really use them together, but a lot of people tend to have both downloaded from various sources and modes. The code I posted already has an include guard in it so you can't include it twice.
The code I posted already has an include guard in it so you can't include it twice.
But if I will include twice (with your code), I will get _FOREACH_LOCAL_VERSION already defined
error.
You shouldn't do - that only happens if the two definitions are different. Two identical defines are ignored.
I didn't know about this, thanks.
I've had multiple reports of problems, which people attributed to both the new compiler and YSI:
https://github.com/Zeex/pawn/issues/164 https://github.com/Misiur/YSI-Includes/issues/166
After investigation, I found out it was this:
http://forum.sa-mp.com/showpost.php?p=3768059
Can you please put the headers back in, people are used to just having both working fine, with whichever is newer being used. Or at least some reduced headers so YSI can query that file, but your version won't query YSI if you really don't want YSI being used. Maybe just: