OSLib 6.11 Released
David Bryan
D.J.Bryan at cranfield.ac.uk
Thu Sep 28 04:26:20 BST 2000
Jonathan Coxhead wrote:
> David ...
>
> | > But in reality (with #include "oslib/os.h"), it will go looking for
> | > OSLibInclude:oslib/os.h, which it will find as the same thing.
> |
> | It does work, honest. [...]
>
> Sure it works, but it defeats the point. The reason to have the "oslib/"
> things everywhere is to avoid collisions with other names. People want to
> have the OSLib "os.h" *and* one from another library, at the same time.
> Clearly, the library headers have to include the disambiguated name, 'coz
> we don't want OSLib's "wimp.h" picking the "os.h" from a different library.
>
> Nice to hear you tried it, and it works, though.
But, the compiler will look for all includes initially in the same
directory as the current compilation unit. The compiler treats
the filename for wimp.h as
OSLibInclude:oslib.h.wimp
When it encounters
#include "os.h"
it strips off the "h.wimp", and adds "h.os". So it will be
looking for
OSLibInclude:oslib.h.os
Which it unambiguously finds :-)
The only reason I even suggested this was: If you have
"oslib/os.h" in the library header files, and the user wants to
carry on using "wimp.h", the search path has got to have all the
directories both with and without the final "oslib". This is only
likely to cause more emails to Tony. "I've put all six
directories on the search path, and it doesn't work." The answer
being, "Well, you now need twelve."
--
David Bryan
More information about the oslib-user
mailing list