Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » So many preprocessor defines for platform !
Re: So many preprocessor defines for platform ! [message #39635 is a reply to message #39633] Thu, 11 April 2013 16:20 Go to previous messageGo to previous message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
My guess is that different libraries (plugins) use different definitions and that's why there is plenty of them.

For example:
_WIN32 - png, sqlite, bz2
WIN32 - z lib, png, tiff
__WIN32__ - png, tiff
__linux__ - png

and so on.

I think you should use PLATFORM_* definitions in your upp code.

void MyMultiplatformFunction(...)
{

common code

#ifdef PLATFORM_LINUX

code specific to linux only

#elif defined(PLATFORM_POSIX)

code specific to posix systems (linux, bsd, solaris, osx?)

#elif defined(PLATFORM_WIN64) 

code specific to windows 64-bit only

#elif defined(PLATFORM_WIN32) 

code specific to windows 32/64

#endif

common code

}

[Updated on: Thu, 11 April 2013 16:22]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: U++ for Android?
Next Topic: Strange behaviour: spy++ vs Ranorex vs EnumChildWindows
Goto Forum:
  


Current Time: Sat Apr 27 01:19:14 CEST 2024

Total time taken to generate the page: 0.06862 seconds