pingus-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Platform Specific Code


From: Neil Hotmail
Subject: Re: Platform Specific Code
Date: Mon, 21 Oct 2002 20:30:51 +0100

| Sounds nice so far. There shouldn't be to much #ifdef Win32 anymore since
| pingus.hxx slurped quite a few.
There are a fair few (say 10/15), but the important thing is there are more
than there need to be.

> I think the best way to do this would be to have a #include file for each
> platform, and a different directory for each platform, there is already a
> Win32 directory, so I would like to add a Linux one.
| Moving linux specific code into it's own directory is certainly a good
idea,
| but what exactly do you mean by a #include for each platform?
Linux/Standard.hxx
Win32/Standard.hxx

then in Pingus.hxx
#ifdef WIN32
   #include "Win32/Standard"
#elseif LINUX
  #include "Linux/Standard"
#else
  #die painfully
#endif


> The #include files could have:
> const char* PathSeparator = "\\"
> void ShowURL(std::string& url) //open a browser
> #define chdir _chdir
> void MakeDirectory(std::string& path)
| Is this code meant to introduce globally valid names for functions which
| differ between Linux and Win32? If so it's probably enough add #defines
for
| Win32 into pingus.hxx since it's included by every other header.
This way pingus.hxx would include the appropriate platform specific code, as
above, the fact that its included by everything should make it a lot easier.
It will also make it shorter when Pingu's gets ported to 50 OS's.

> Also: system.cxx is badly implemented in my opinion - would it not be
> better to have separate files for each OS implementing system?
| That would quite likely be a superior implementation.

> I am quite happy to do this work, but I thought I'd better ask first, as
> it is a quite major reorganisation.
| I don't see the major reorganisation yet. There isn't that much platform
| specific code in Pingus since most is abstracted by ClanLib...
| Seems that I've misunderstood something or we define major different. ;-)

I lie, for major read minor. I just thought I'd check first anyway.

Ginge





reply via email to

[Prev in Thread] Current Thread [Next in Thread]