Improving OpenJDK portability - platform specific C conditionals
spoole at linux.vnet.ibm.com
Mon Jul 18 16:00:40 PDT 2011
I want to start a discussion about the "right" way to deal with a
particular aspect of C code portability - namely platform specific
In porting to AIX we've frequently had to deal with extending lines like:
*#ifdef LINUX *
*#if defined(LINUX) || defined(AIX)
But that seems wrong - it doesn't aid OpenJDK portability except for one
specific new platform. It seems to me a better choice is not to
extend the ifdefs as above but to move towards a capability based
So have something like *#ifdef HAS_SPECIFIC_FUNCTION* and then
somewhere else have a build file the turns on *HAS_SPECIFIC_FUNCTION *if
building on AIX or Linux.
Ultimately of course this path takes you down to supporting a
I assume this topic has come up before - what's the perceived wisdom for
dealing with this problem?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the porters-dev