Hi Patrick,

On Tue, 2005-04-19 at 14:20 +0200, Patrick Daehne wrote: 
> Hello,
> 
> maybe it is generally a good idea to replace the OSG-defined symbol "darwin"
> by the symbol "__APPLE__" that is defined by default on MacOS X (and
> Darwin).
> 
> BTW, a similar problem exists on Windows - all Windows-specific code is
> enabled by the OSG-defined symbol "WIN32", instead of the symbol "_WIN32"
> that is defined by default (at least when using the Microsoft and the Intel
> compilers).

yeah, we had a discussion about inventing our own system-identification
defines before, and it didn't seem necessary at the time. But given the
fact that things apparently change more often than we expected, it might
be a good idea to revisit that.

Here's my proposal:

add to the head of OSGConfig.h some platform/compiler detection defines.
I'm thinking of defines like these:

OSG_OS_WINDOWS, OSG_OS_IRIX, OSG_OS_LINUX, OSG_OS_MACOSX etc.
OSG_OS (with a value of "WINDOWS", "IRIX", etc.)
OSG_OS_MAJOR_VERSION, OSG_OS_MINOR_VERSION (e.g. "2","69" for my FC3)

OSG_COMPILER_CL, OSG_COMPILER_ICC, OSG_COMPILER_GCC etc.
OSG_COMPILER (with a value of "CL", "ICC", etc.)
OSG_COMPILER_MAJOR_VERSION, OSG_COMPILER_MINOR_VERSION (e.g. "3", "42"
for FC3)

It might be worth having some combined ones for OS/compiler combinations
like OSG_WINDOWS_ICL, OSG_LINUX_ICL etc.

Based on these OSGConfig should set feature-specific defines (which it
already does quite a lot), and the other system headers should be as
platform-independent as possible.

Comments? How do other systems handle this?

        Dirk



-------------------------------------------------------
SF.Net email is sponsored by: GoToMeeting - the easiest way to collaborate
online with coworkers and clients while avoiding the high cost of travel and
communications. There is no equipment to buy and you can meet as often as
you want. Try it free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to