diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 5846d4a1ab005232b28958cfb5388683bbcc01f0..8c495344485050cf65223cb2f05504991aac69fc 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,15 @@
+2003-02-19  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>
+
+	* gnu/gcj/runtime/natStackTrace.cc: Include platform.h immediately
+	after config.h.  Use <> for consistency.
+	* java/lang/natObject.cc: Likewise.
+	* java/lang/natRuntime.cc: Likewise.
+	* java/lang/natSystem.cc: Likewise.
+	* java/util/natTimeZone.cc: Likewise.
+	* win32.cc: Likewise.
+	* include/posix.h (fcntl, socket, connect, close, bind, accept,
+	listen, write, read): Undef to avoid interference from OS macros.
+
 2003-02-19  Michael Koch  <konqueror@gmx.de>
 
 	* gnu/java/nio/ByteBufferImpl.java
diff --git a/libjava/gnu/gcj/runtime/natStackTrace.cc b/libjava/gnu/gcj/runtime/natStackTrace.cc
index 937f8dd34703d34a4a3a59ec17dc2d376ae1ae65..d39cd00dbababac8c6f5cc3bc82d5fb313ad3e7d 100644
--- a/libjava/gnu/gcj/runtime/natStackTrace.cc
+++ b/libjava/gnu/gcj/runtime/natStackTrace.cc
@@ -1,6 +1,6 @@
 // natStackTrace.cc - native helper methods for Throwable
 
-/* Copyright (C) 2000, 2002  Free Software Foundation, Inc
+/* Copyright (C) 2000, 2002, 2003  Free Software Foundation, Inc
 
    This file is part of libgcj.
 
@@ -16,6 +16,7 @@ details.  */
  */
 
 #include <config.h>
+#include <platform.h>
 
 #include <string.h>
 
@@ -31,8 +32,6 @@ details.  */
 #include <java/util/IdentityHashMap.h>
 #include <java/lang/ArrayIndexOutOfBoundsException.h>
 
-#include "platform.h"
-
 #include <sys/types.h>
 
 #include <stdlib.h>
diff --git a/libjava/include/posix.h b/libjava/include/posix.h
index 0e1220a10b3834279885c353417a874bba391d52..0aadd47d3b388167afea42a6bd4491c95ed27f06 100644
--- a/libjava/include/posix.h
+++ b/libjava/include/posix.h
@@ -60,6 +60,8 @@ _Jv_platform_close_on_exec (jint fd)
   ::fcntl (fd, F_SETFD, FD_CLOEXEC);
 }
 
+#undef fcntl
+
 #ifdef JV_HASH_SYNCHRONIZATION
 inline void
 _Jv_platform_usleep (unsigned long usecs)
@@ -80,18 +82,24 @@ _Jv_socket (int domain, int type, int protocol)
   return ::socket (domain, type, protocol);
 }
 
+#undef socket
+
 inline int
 _Jv_connect (jint fd, sockaddr *ptr, int len)
 {
    return ::connect (fd, ptr, len);
 }
 
+#undef connect
+
 inline int
 _Jv_close (jint fd)
 {
   return ::close (fd);
 }
 
+#undef close
+
 // Avoid macro definitions of bind from system headers, e.g. on
 // Solaris 7 with _XOPEN_SOURCE.  FIXME
 inline int
@@ -100,6 +108,8 @@ _Jv_bind (int fd, struct sockaddr *addr, int addrlen)
   return ::bind (fd, addr, addrlen);
 }
 
+#undef bind
+
 // Same problem with accept on Tru64 UNIX with _POSIX_PII_SOCKET
 inline int
 _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
@@ -107,24 +117,32 @@ _Jv_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
   return ::accept (fd, addr, addrlen);
 }
 
+#undef accept
+
 inline int
 _Jv_listen (int fd, int backlog)
 {
   return ::listen (fd, backlog);
 }
 
+#undef listen
+
 inline int
 _Jv_write(int s, void *buf, int len)
 {
   return ::write (s, buf, len);
 }
 
+#undef write
+
 inline int
 _Jv_read(int s, void *buf, int len)
 {
   return ::read (s, buf, len);
 }
 
+#undef read
+
 #endif /* DISABLE_JAVA_NET */
 
 #endif /* __JV_POSIX_H__ */
diff --git a/libjava/java/lang/natObject.cc b/libjava/java/lang/natObject.cc
index a050baa3f669aba58e941c3aae708b761e1b1bca..33f3e8de27fae202243e7970c1d9b1c9eed753ee 100644
--- a/libjava/java/lang/natObject.cc
+++ b/libjava/java/lang/natObject.cc
@@ -1,6 +1,6 @@
 // natObject.cc - Implementation of the Object class.
 
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -9,6 +9,7 @@ Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 details.  */
 
 #include <config.h>
+#include <platform.h>
 
 #include <string.h>
 
@@ -28,8 +29,6 @@ details.  */
 #include <java/lang/Cloneable.h>
 #include <java/lang/Thread.h>
 
-#include "platform.h"
-
 #ifdef LOCK_DEBUG
 #  include <stdio.h>
 #endif
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index 09f1e04f36191504309d185aab067f2fdab0f827..9879b259dd5ebef4191681b61fb2ee13835c9714 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -9,6 +9,7 @@ Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 details.  */
 
 #include <config.h>
+#include <platform.h>
 
 #include <stdlib.h>
 
@@ -33,8 +34,6 @@ details.  */
 
 #include <jni.h>
 
-#include "platform.h"
-
 #ifdef HAVE_PWD_H
 #include <pwd.h>
 #endif
diff --git a/libjava/java/lang/natSystem.cc b/libjava/java/lang/natSystem.cc
index ffa3f1a5053dbdc26f3eaeb75cfe623bdc9a6519..e2d423243867bca2b9f877def761503d7389869a 100644
--- a/libjava/java/lang/natSystem.cc
+++ b/libjava/java/lang/natSystem.cc
@@ -1,6 +1,6 @@
 // natSystem.cc - Native code implementing System class.
 
-/* Copyright (C) 1998, 1999, 2000, 2001 , 2002 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
 
    This file is part of libgcj.
 
@@ -9,6 +9,7 @@ Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 details.  */
 
 #include <config.h>
+#include <platform.h>
 
 #include <stdio.h>
 #include <string.h>
@@ -24,8 +25,6 @@ details.  */
 #include <java/io/PrintStream.h>
 #include <java/io/InputStream.h>
 
-#include "platform.h"
-
 
 
 void
diff --git a/libjava/java/util/natTimeZone.cc b/libjava/java/util/natTimeZone.cc
index ea59293513d5083231c7f326ec1a0a1c5365f022..cb564a9759118edc4a68221e94d785e41c6d667c 100644
--- a/libjava/java/util/natTimeZone.cc
+++ b/libjava/java/util/natTimeZone.cc
@@ -1,6 +1,6 @@
 // natTimeZone.cc -- Native side of TimeZone class.
 
-/* Copyright (C) 1998, 1999, 2000, 2001, 2002  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -9,12 +9,11 @@ Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 details.  */
 
 #include <config.h>
+#include <platform.h>
 
 #include <gcj/cni.h>
 #include <jvm.h>
 
-#include "platform.h"
-
 #include <java/util/TimeZone.h>
 #include <java/lang/Character.h>
 #include <java/lang/Integer.h>
diff --git a/libjava/win32.cc b/libjava/win32.cc
index af1163fbfa9ec42acc2ba28b6817309e1bae6b86..59c3be244b6eda83f74539b11dfcd569d103260b 100644
--- a/libjava/win32.cc
+++ b/libjava/win32.cc
@@ -1,6 +1,6 @@
 // win32.cc - Helper functions for Microsoft-flavored OSs.
 
-/* Copyright (C) 2002  Free Software Foundation
+/* Copyright (C) 2002, 2003  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -9,11 +9,11 @@ Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 details.  */
 
 #include <config.h>
+#include <platform.h>
 #include <jvm.h>
 #include <sys/timeb.h>
 #include <stdlib.h>
 
-#include "platform.h"
 #include <java/lang/ArithmeticException.h>
 #include <java/util/Properties.h>