changeset 25:4f32a0c255dc

fix msvc
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 27 Oct 2016 12:44:35 +0200
parents 16ef671c9269
children 952b2c6ee0a2
files Framework/Orthanc/Resources/ThirdParty/VisualStudio/stdint.h Resources/CMake/LibTiffConfiguration.cmake
diffstat 2 files changed, 24 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Orthanc/Resources/ThirdParty/VisualStudio/stdint.h	Thu Oct 27 12:15:53 2016 +0200
+++ b/Framework/Orthanc/Resources/ThirdParty/VisualStudio/stdint.h	Thu Oct 27 12:44:35 2016 +0200
@@ -1,7 +1,7 @@
 // ISO C9x  compliant stdint.h for Microsoft Visual Studio
 // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 
 // 
-//  Copyright (c) 2006-2008 Alexander Chemeris
+//  Copyright (c) 2006-2013 Alexander Chemeris
 // 
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions are met:
@@ -13,8 +13,9 @@
 //      notice, this list of conditions and the following disclaimer in the
 //      documentation and/or other materials provided with the distribution.
 // 
-//   3. The name of the author may be used to endorse or promote products
-//      derived from this software without specific prior written permission.
+//   3. Neither the name of the product nor the names of its contributors may
+//      be used to endorse or promote products derived from this software
+//      without specific prior written permission.
 // 
 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
 // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@@ -40,6 +41,10 @@
 #pragma once
 #endif
 
+#if _MSC_VER >= 1600 // [
+#include <stdint.h>
+#else // ] _MSC_VER >= 1600 [
+
 #include <limits.h>
 
 // For Visual Studio 6 in C++ mode and for many Visual Studio versions when
@@ -238,10 +243,17 @@
 #define UINT64_C(val) val##ui64
 
 // 7.18.4.2 Macros for greatest-width integer constants
-#define INTMAX_C   INT64_C
-#define UINTMAX_C  UINT64_C
+// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
+// Check out Issue 9 for the details.
+#ifndef INTMAX_C //   [
+#  define INTMAX_C   INT64_C
+#endif // INTMAX_C    ]
+#ifndef UINTMAX_C //  [
+#  define UINTMAX_C  UINT64_C
+#endif // UINTMAX_C   ]
 
 #endif // __STDC_CONSTANT_MACROS ]
 
+#endif // _MSC_VER >= 1600 ]
 
 #endif // _MSC_STDINT_H_ ]
--- a/Resources/CMake/LibTiffConfiguration.cmake	Thu Oct 27 12:15:53 2016 +0200
+++ b/Resources/CMake/LibTiffConfiguration.cmake	Thu Oct 27 12:44:35 2016 +0200
@@ -13,13 +13,19 @@
 #include <string.h>
 ")
     file(WRITE ${LIBTIFF_SOURCES_DIR}/libtiff/tiffconf.h "
+#if defined(_MSC_VER)
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+typedef SSIZE_T ssize_t;
+#endif
+
 #include <stdint.h>
 #include <sys/types.h>
 ")
   endif()
 
   set(TIFF_FILLORDER FILLORDER_MSB2LSB)
-  if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
+  if (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "i.*86.*" OR
       CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64.*" OR
       CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64.*")
     set(TIFF_FILLORDER FILLORDER_LSB2MSB)