From a4e827eb6e652bf8ff0a179e810da297d3c9a628 Mon Sep 17 00:00:00 2001 From: malaterre Date: Sat, 15 Jan 2005 03:49:49 +0000 Subject: [PATCH] ENH: Apparently implementation of GetMacAddress linux also works on my cygwin --- src/gdcmDocument.cxx | 8 ++++---- src/gdcmUtil.cxx | 14 ++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gdcmDocument.cxx b/src/gdcmDocument.cxx index 5e4ae372..fb6e0126 100644 --- a/src/gdcmDocument.cxx +++ b/src/gdcmDocument.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDocument.cxx,v $ Language: C++ - Date: $Date: 2005/01/14 11:28:30 $ - Version: $Revision: 1.190 $ + Date: $Date: 2005/01/15 03:49:49 $ + Version: $Revision: 1.191 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -1077,7 +1077,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, BinEntry *newBinEntry; SeqEntry *newSeqEntry; VRKey vr; - bool used=false; + bool used = false; while (true) { @@ -1086,7 +1086,7 @@ void Document::ParseDES(DocEntrySet *set, long offset, break; } - used=true; + used = true; newDocEntry = ReadNextDocEntry( ); if ( !newDocEntry ) { diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 8f2f84f7..8457f0a3 100644 --- a/src/gdcmUtil.cxx +++ b/src/gdcmUtil.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmUtil.cxx,v $ Language: C++ - Date: $Date: 2005/01/15 00:52:36 $ - Version: $Revision: 1.90 $ + Date: $Date: 2005/01/15 03:49:49 $ + Version: $Revision: 1.91 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -50,11 +50,13 @@ #include //for bzero on unix #endif -#ifdef __linux__ +#if defined(__linux__) || defined(__CYGWIN__) #include #include #include #include +#endif +#ifdef __linux__ #include #endif @@ -684,8 +686,8 @@ long GetMacAddrSys ( u_char *addr) return 0; #endif //_WIN32 -// implementation for Linux -#ifdef __linux__ +// implementation for GNU/Linux and cygwin +#if defined(__linux__) || defined(__CYGWIN__) struct ifreq ifr; struct ifreq *IFR; struct ifconf ifc; @@ -866,7 +868,7 @@ long GetMacAddrSys ( u_char *addr) std::string Util::GetMACAddress() { - // This is a rip from: http://cplus.kompf.de/macaddr.html for Linux, HPUX and AIX + // This is a rip from: http://cplus.kompf.de/macaddr.html for Linux/CYGWIN, HPUX and AIX // and http://tangentsoft.net/wskfaq/examples/src/snmpmac.cpp for windows version // and http://groups-beta.google.com/group/sol.lists.freebsd.hackers/msg/0d0f862e05fce6c0 for the FreeBSD version // and http://developer.apple.com/samplecode/GetPrimaryMACAddress/GetPrimaryMACAddress.html for MacOSX version -- 2.48.1