This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] [MinGW] [Committed]: Remove static local in natNetworkInterfaceWin32.cc


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 ();
     





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]