This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[PATCH] [MinGW] [Committed]: Remove static local in natNetworkInterfaceWin32.cc
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Sat, 04 Sep 2004 22:41:37 -0500
- Subject: [PATCH] [MinGW] [Committed]: Remove static local in natNetworkInterfaceWin32.cc
- Reply-to: gnustuff at thisiscool dot com
Hi People,
The static local in getRealNetworkInterfaces() caused an implicit
dependency on libsupc++ which somehow never manifested itself
before. I committed the following patch to fix this. It's less-than-ideal,
but the comments should hopefully justify why a more aesthetically-pleasing
fix isn't really justified at this point.
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/
ChangeLog
2004-09-04 Mohan Embar <gnustuff@thisiscool.com>
* java/net/natNetworkInterfaceWin32.cc (getRealNetworkInterfaces):
Changed pfn from static local to local.
Index: java/net/natNetworkInterfaceWin32.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/natNetworkInterfaceWin32.cc,v
retrieving revision 1.5
diff -u -2 -r1.5 natNetworkInterfaceWin32.cc
--- java/net/natNetworkInterfaceWin32.cc 2 Dec 2003 22:26:50 -0000 1.5
+++ java/net/natNetworkInterfaceWin32.cc 5 Sep 2004 03:12:28 -0000
@@ -117,5 +117,14 @@
java::net::NetworkInterface::getRealNetworkInterfaces ()
{
- static PfnGetRealNetworkInterfaces pfn =
+ // This next declaration used to be a static local,
+ // but this introduced a dependency on libsupc++ due
+ // to _cxa_guard_acquire and _cxa_guard_release.
+ // When Win95 is gone and we eventually get rid of
+ // winsock2GetRealNetworkInterfaces, we can rework
+ // all of this. Alternatively, we could move this all
+ // to win32.cc and initialize this at startup time,
+ // but that seems more trouble than it's worth at
+ // the moment.
+ PfnGetRealNetworkInterfaces pfn =
determineGetRealNetworkInterfacesFN ();