[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Platform Specific Code
From: |
David Philippi |
Subject: |
Re: Platform Specific Code |
Date: |
Mon, 21 Oct 2002 20:58:12 +0200 |
User-agent: |
KMail/1.4.1 |
On Monday 21 October 2002 18:27, Neil Hotmail wrote:
> Basically, I would like to remove all #ifdef WIN32 statements, and make it
> so that Pingu's is a general program with specific include files for
> Windows/Linux/Whatever it gets ported to, instead of being Linux based
> with some Windows hacks. This will probably help getting it ported to
> elsewhere, but even if it doesn't its the "right thing" to do.
Sounds nice so far. There shouldn't be to much #ifdef Win32 anymore since
pingus.hxx slurped quite a few.
> 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?
> 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.
> 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. ;-)
Bye David