X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmUtil.cxx;h=9d121654eb6bc22c389de5b7d03bcd1c122574c6;hb=130558c1fc10cbc2d5d58484b310fa86bd20d81b;hp=1b7462cc7bf15ccbe8c94164afc1166e339f7f08;hpb=038a3b7f67769dc20b4c46f3c9dcad7cc63d1161;p=gdcm.git diff --git a/src/gdcmUtil.cxx b/src/gdcmUtil.cxx index 1b7462cc..9d121654 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/18 08:01:42 $ - Version: $Revision: 1.110 $ + Date: $Date: 2005/01/18 16:19:57 $ + Version: $Revision: 1.112 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -28,7 +28,7 @@ #include //only included in implementation file #include //only included in implementation file -#if defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__MINGW32__) #include // for gethostname & gethostbyname #undef GetCurrentTime #else @@ -496,13 +496,10 @@ int GetMacAddrSys ( unsigned char *addr ) #ifdef __sun //The POSIX version is broken anyway on Solaris, plus would require full //root power - int i; struct arpreq parpreq; - struct sockaddr_in sa, *psa; - struct in_addr inaddr; + struct sockaddr_in *psa; struct hostent *phost; char hostname[MAXHOSTNAMELEN]; - unsigned char *ptr; char **paddrs; int sock, status=0; @@ -672,7 +669,7 @@ std::string Util::GetIPAddress() # define HOST_NAME_MAX 255 // In this case we should maybe check the string was not truncated. // But I don't known how to check that... -#if defined(_MSC_VER) || defined(__BORLANDC__) +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) // with WinSock DLL we need to initialise the WinSock before using gethostname WORD wVersionRequested = MAKEWORD(1,0); WSADATA WSAData; @@ -708,7 +705,7 @@ std::string Util::GetIPAddress() } // str now contains one local IP address -#if defined(_MSC_VER) || defined(__BORLANDC__) +#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__MINGW32__) WSACleanup(); #endif