<div dir="ltr"><div>Technical problem:</div><div>* a unit name collision of two independent library code. Either library are using unit with the same name. The code in the conflicting units is different. Thus one library should use its own unit, the other should use its own. </div>
<div>Since FPC allows to specify the search path for the whole compiled program, the second library used, will be using a wrong unit (from the first library), causing either compilation to fail or wrong code generated;</div>
<div><br></div>Can anyone think of any logical problems with this feature:<div>* allow any unit (or units under specified directories) to use their own "unit-search" paths, than defined for the project. In that case if a library has its own unit, the compiler will be using the library specific unit (by finding it in the library specific search path).</div>
<div><br></div><div>From compiler point of view - it's only a matter of where to find the source code for the unit and how to name the resulting objects and object file. (names must not conflict, in case some units of a compiler project match);</div>
<div>Linker, shouldn't have any issues as long as objects files were created properly; </div><div>Debugging information - no problems here, since the source file name is specified explicitly and is typically full path;</div>
<div><br></div><div>Limitations: </div><div>* two units with the same name are not allowed to be used by any other unit at the same time</div><div>uses unitA (from pathA), unitA (from pathB) - not allowed;</div><div>* RTTI collisions are not to be resolved by this feature; </div>
<div><br></div><div>thanks,</div><div>Dmitry </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 30, 2013 at 4:38 PM, Dmitry Boyarintsev <span dir="ltr"><<a href="mailto:skalogryz.lists@gmail.com" target="_blank">skalogryz.lists@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="im"><div class="gmail_quote">On Wed, Oct 30, 2013 at 3:45 PM, Marco van de Voort <span dir="ltr"><<a href="mailto:marcov@stack.nl" target="_blank">marcov@stack.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">What if unitaa needs recompilation, and it is not in the dir it was originally<br>
compiled in. .\some\other\place then has a different meaning.<br>
<br>
Specially if the relative paths are short (like ..\src\ or so), there is still<br>
quite some room for clashes.<br>
<br>
That is probably the reason it is mainly used in the DPR, there relative<br>
paths can be interpreted relative to the .dpr, and .dpr's are generally not<br>
recompiled in other directories.<br></blockquote><div> </div></div></div>Definitely, that's not the way to go. Since a unit source can rarely be adequate to the compilation environment. <br></div><div class="gmail_extra">
</div>
<div class="gmail_extra"><br>thanks,<br>Dmitry<br></div></div>
</blockquote></div><br></div>