Zeex / samp-plugin-profiler

Performance profiler plugin for SA-MP server
http://forum.sa-mp.com/showthread.php?t=271129
BSD 2-Clause "Simplified" License
46 stars 8 forks source link

Ambiguity with amx_assembly's profiler.inc when including profiler plugin's include #33

Open AGraber opened 6 years ago

AGraber commented 6 years ago

When one includes profiler and amx_assembly (YSI includes amx_assembly) under some specific folder structures, it's uncertain what include will the compiler will choose. Folder layout can't be changed sometimes due to usage of dependency helpers like gitmodules or sampctl.

One solution would be to rename the include. @Southclaws also suggested:

An alternative would be to move it into a subdirectory since paths are things checked for uniqueness, not just the name. This would make the include path #include <profiler/profiler>.

AGraber commented 6 years ago

duplicate of #27

ADRFranklin commented 5 years ago

This is not a duplicate of #27 and is still an issue. Fixing the include guard will not fix how sampctl checks for duplicated include names.

This issue should still be active

ADRFranklin commented 5 years ago

Maybe it should be renamed from profiler.inc to samp_profiler.inc

Southclaws commented 5 years ago

It's mostly unrelated to sampctl, the compiler itself has a list of places to search for includes and if two includes in any of those locations have the same name, it's not simple to predict which one the compiler will choose. This is why the error was added to sampctl, to prevent this non-obvious case from even being possible.

I assume the compiler will choose the first (based on -i order), but I'm not sure if this is undefined behaviour or not. Either way, it's not great.

gfalqui commented 4 years ago

I'm having this issue too. A rename of the include would be nice please.

Southclaws commented 4 years ago

An alternative would be to move it into a subdirectory since paths are things checked for uniqueness, not just the name. This would make the include path #include <profiler/profiler>.