propose to rename natPlainSocketImpl to natPosixPlainSocketImpl

Bryce McKinlay
Fri Feb 1 14:23:00 GMT 2002

Adam Megacz wrote:

>What do you all think of merging all the platform-specific files into
>a single file per class, and a single .java file per class,
>using #ifdefs for platform-specific stuff.

In general I think it is a bad idea. In the cases where most/all of the 
code is different (xxx-threads, etc), #ifdefs would just make the files 
long and confusing.

>As far as I can tell, the code overlap rules aren't too simple. If you
>force each platform to have a seperate file, you wind up with a lot of
>code duplication. By keeping all the code for in one
>place, you can use #ifdefs to control code sharing -- sometimes Win32
>and POSIX use the same code, other times they don't.

In cases where much of the implementation is the same, but a few key 
functions are different (eg, an alternative would be to 
have a .cc and .h file at the top level (,, etc) which contain implementations of various 
platform-specific functions, much the same way as the threads/GC 
interface works currently. This way there is a clean separation of what 
needs to be ported to get libgcj running on a new platform. On the other 
hand, its easy to imagine platforms that are mostly-posix but differ in 
a few key areas (eg file system), or mostly win32 but a bit different 
(winCE), so it could be that #ifdefs would be required even inside



More information about the Java mailing list