propose to rename natPlainSocketImpl to natPosixPlainSocketImpl

Adam Megacz
Fri Feb 1 15:32:00 GMT 2002

Bryce McKinlay <> writes:
> >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.

You're saying roll all the platform specific stuff into one file per
platform? I like it. So would contain code formerly found
  portions of for which it makes sense to do this [win32_exception_handler()]

Common code would remain in

This also eliminates the symlink games, and makes porting very
straightforward (just copy and rewrite each function from top
to bottom). Heck, there couled even be a template file
"" with super-verbose comments and empty function bodies
to walk somebody through the porting work.

Code duplication wouldn't be a big issue, even in the case of
"subflavors", since a given platform is usually a subflavor of only
one other platform. So ECOS would be handled as a bunch of ifdef's in I don't think we're ever going to find a platform that uses
winsock for networking and pthreads for condition variables =)

Would it make sense to have a directory to hold these files?

I'll volunteer to prepare patches for this as part of my win32 work if
it's agreeable.

  - a

More information about the Java mailing list