diff Core/DicomNetworking/DicomAssociationParameters.cpp @ 3828:3d1bb2193832

fix build on os x
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 10 Apr 2020 16:35:41 +0200
parents 4570c57668a8
children ea1d32861cfc
line wrap: on
line diff
--- a/Core/DicomNetworking/DicomAssociationParameters.cpp	Fri Apr 10 16:12:10 2020 +0200
+++ b/Core/DicomNetworking/DicomAssociationParameters.cpp	Fri Apr 10 16:35:41 2020 +0200
@@ -34,33 +34,10 @@
 #include "../PrecompiledHeaders.h"
 #include "DicomAssociationParameters.h"
 
-
-#ifdef _WIN32
-/**
- * "The maximum length, in bytes, of the string returned in the buffer 
- * pointed to by the name parameter is dependent on the namespace provider,
- * but this string must be 256 bytes or less.
- * http://msdn.microsoft.com/en-us/library/windows/desktop/ms738527(v=vs.85).aspx
- **/
-#  define HOST_NAME_MAX 256
-#  include <winsock.h>
-#endif 
-
-
-#if !defined(HOST_NAME_MAX) && defined(_POSIX_HOST_NAME_MAX)
-/**
- * TO IMPROVE: "_POSIX_HOST_NAME_MAX is only the minimum value that
- * HOST_NAME_MAX can ever have [...] Therefore you cannot allocate an
- * array of size _POSIX_HOST_NAME_MAX, invoke gethostname() and expect
- * that the result will fit."
- * http://lists.gnu.org/archive/html/bug-gnulib/2009-08/msg00128.html
- **/
-#define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
-#endif
-
-
+#include "../Compatibility.h"
 #include "../Logging.h"
 #include "../OrthancException.h"
+#include "NetworkingCompatibility.h"
 
 #include <boost/thread/mutex.hpp>
 
@@ -143,10 +120,4 @@
       defaultTimeout_ = seconds;
     }
   }
-
-
-  size_t DicomAssociationParameters::GetMaxHostNameSize()
-  {
-    return HOST_NAME_MAX;
-  }  
 }