OSLib 6.11 Released

Jonathan Coxhead jonathan at doves.demon.co.uk
Mon Sep 25 22:04:50 BST 2000


 | > > All #includes in the library headers now specify the OSLib: library
 | > > path to  avoid possible name clashes with other libraries.
 | > 
 | > This has caused considerable hassle for those of use who are building 
RISC
 | > OS applications on other platorms (either to use superior debugging 
tools
 | > or to build with cross compilers which aren't currently available for 
RISC
 | > OS).

   I'm not sure I like it either---it seems like it crosses some 
abstraction barrier that it shouldn't.

 | Well, I find it useful. Nasty #defines time? I think you can do something
 | like:
 | 
 | #define INC_PREFIX "OSLib:"  (or "" at your preference)
 | 
 | then
 | 
 | #include INC_PREFIX ## "header.h"
 | 
 | but I haven't actually tried it. (Or just make everyone on other 
platforms
 | sed them ;) )

   That doesn't work---it's explicitly pointed out in the C Standard that 
you can't do that.

   As far as I can see, the best way to decrease the chance of collision 
with other headers is to use the already-existing division of OSLib into 4 
functional units: Core, Computer, User, Toolbox. Norcroft C already maps 
"/" in include directives onto "." (as well as converted "X.h" into "h.X"), 
so the following should work a charm:

      #include "Core/os.h"
      #include "Computer/osfind.h"
      #include "User/wimp.h"
      #include "Toolbox/keyboardshortcut.h"

etc, and compile with -I$.OSLib or its moral equivalent.

   I think that's completely portable to all platforms, and reduces the 
chance of a collision to damn close to 0. Am I right?

        /|
 o o o (_|/
        /|
       (_/



More information about the oslib-user mailing list