SA-MP Forums Archive
YSI: redifinition of constant/macro - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: YSI: redifinition of constant/macro (/showthread.php?tid=646543)



YSI: redifinition of constant/macro - Kampott - 18.12.2017

So, basically i tried to include y_timers then i got those warning after trying to compile.
Код HTML:
C:\Users\Kampot\Desktop\SAMP\pawno\include\YSI_Coding\..\YSI_Data\y_foreach/iterators.inc(760) : warning 201: redefinition of constant/macro (symbol "CreateVehicle")
C:\Users\Kampot\Desktop\SAMP\pawno\include\YSI_Coding\..\YSI_Data\y_foreach/iterators.inc(778) : warning 201: redefinition of constant/macro (symbol "AddStaticVehicle")
C:\Users\Kampot\Desktop\SAMP\pawno\include\YSI_Coding\..\YSI_Data\y_foreach/iterators.inc(802) : warning 201: redefinition of constant/macro (symbol "AddStaticVehicleEx")
C:\Users\Kampot\Desktop\SAMP\pawno\include\YSI_Coding\..\YSI_Data\y_foreach/iterators.inc(818) : warning 201: redefinition of constant/macro (symbol "DestroyVehicle")
These are the lines that are causing the problem:
Код HTML:
	#if defined _ALS_CreateVehicle
		#undef CreateVehicle
	#else
		#define _ALS_CreateVehicle
	#endif
	#define CreateVehicle Iter_CreateVehicle
Код HTML:
	#if defined _ALS_AddStaticVehicle
		#undef AddStaticVehicle
	#else
		#define _ALS_AddStaticVehicle
	#endif
	#define AddStaticVehicle Iter_AddStaticVehicle
Код HTML:
	#if defined _ALS_AddStaticVehicleEx
		#undef AddStaticVehicleEx
	#else
		#define _ALS_AddStaticVehicleEx
	#endif
	#define AddStaticVehicleEx Iter_AddStaticVehicleEx
Код HTML:
	#if defined _ALS_AddStaticVehicleEx
		#undef AddStaticVehicleEx
	#else
		#define _ALS_AddStaticVehicleEx
	#endif
	#define AddStaticVehicleEx Iter_AddStaticVehicleEx
So, how can i fix this?


Re: YSI: redifinition of constant/macro - Konstantinos - 18.12.2017

YSI hooks the function correctly so the problem is in another include that defines these four vehicle functions and just reports the first include found. I've seen many complains about those includes that get vehicle color that never used hooks and take a look here: https://sampforum.blast.hk/showthread.php?tid=570910


Re: YSI: redifinition of constant/macro - Kampott - 18.12.2017

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
YSI hooks the function correctly so the problem is in another include that defines these four vehicle functions and just reports the first include found. I've seen many complains about those includes that get vehicle color that never used hooks and take a look here: https://sampforum.blast.hk/showthread.php?tid=570910
Thanks, i found the source of the problem, it was an include that i didn't even use.