]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/nt-base.h
Handle short months in png_write_iTIME()
[imagemagick] / MagickCore / nt-base.h
index dfefa63fae56d66f33efa2df532a5c39302d2d21..518c45b563bae68ea483bad82115b83c32a6283a 100644 (file)
@@ -1,11 +1,11 @@
 /*
-  Copyright 1999-2014 ImageMagick Studio LLC, a non-profit organization
+  Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization
   dedicated to making software imaging solutions freely available.
   
   You may not use this file except in compliance with the License.
   obtain a copy of the License at
   
-    http://www.imagemagick.org/script/license.php
+    https://www.imagemagick.org/script/license.php
   
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,8 +15,8 @@
 
   MagickCore Windows NT utility methods.
 */
-#ifndef _MAGICKCORE_NT_BASE_H
-#define _MAGICKCORE_NT_BASE_H
+#ifndef MAGICKCORE_NT_BASE_H
+#define MAGICKCORE_NT_BASE_H
 
 #include "MagickCore/exception.h"
 #include "MagickCore/geometry.h"
@@ -37,6 +37,8 @@ extern "C" {
 #include <io.h>
 #include <process.h>
 #include <errno.h>
+#include <malloc.h>
+#include <sys/utime.h>
 #if defined(_DEBUG) && !defined(__MINGW32__) && !defined(__MINGW64__)
 #include <crtdbg.h>
 #endif
@@ -65,6 +67,10 @@ extern "C" {
     1310 Visual c++ .NET 2003
     1400 Visual C++ 2005
     1500 Visual C++ 2008
+    1600 Visual C++ 2010
+    1700 Visual C++ 2012
+    1800 Visual C++ 2013
+    1900 Visual C++ 2015
 */
 
 #if !defined(chsize)
@@ -89,6 +95,10 @@ extern "C" {
 #if !defined(closedir)
 #  define closedir(directory)  NTCloseDirectory(directory)
 #endif
+#define MAGICKCORE_HAVE_ERF
+#if defined(_VISUALC_) && (_MSC_VER < 1700)
+#  define erf(x)  NTErf(x)
+#endif
 #if !defined(fdopen)
 #  define fdopen  _fdopen
 #endif
@@ -97,13 +107,15 @@ extern "C" {
 #endif
 #if !defined(fseek) && !defined(__MINGW32__) && !defined(__MINGW64__)
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \
-  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && (__MSVCRT_VERSION__ < 0x800)
+  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \
+  !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800))
 #  define fseek  _fseeki64
 #endif
 #endif
 #if !defined(fstat) && !defined(__BORLANDC__)
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \
-  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && (__MSVCRT_VERSION__ < 0x800)
+  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \
+  !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800))
 #  define fstat  _fstati64
 #else
 #  define fstat  _fstat
@@ -114,7 +126,8 @@ extern "C" {
 #endif
 #if !defined(ftell) && !defined(__MINGW32__) && !defined(__MINGW64__)
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \
-  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && (__MSVCRT_VERSION__ < 0x800)
+  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \
+  !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800))
 #  define ftell  _ftelli64
 #endif
 #endif
@@ -130,9 +143,6 @@ extern "C" {
 #if !defined(hypot)
 #  define hypot  _hypot
 #endif
-#if !defined(inline)
-#  define inline __inline
-#endif
 #if !defined(isatty)
 #  define isatty  _isatty
 #endif
@@ -140,11 +150,16 @@ extern "C" {
 #define locale_t _locale_t
 #endif
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \
-  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && (__MSVCRT_VERSION__ < 0x800)
+  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \
+  !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800))
+#if !defined(lseek)
 #  define lseek  _lseeki64
+#endif
 #else
+#if !defined(lseek)
 #  define lseek  _lseek
 #endif
+#endif
 #if !defined(MAGICKCORE_LTDL_DELEGATE)
 #if !defined(lt_dlclose)
 #  define lt_dlclose(handle)  NTCloseLibrary(handle)
@@ -197,7 +212,7 @@ extern "C" {
 #define fprintf_l  _fprintf_s_l
 #endif
 #if !defined(read)
-#  define read  _read
+#  define read(fd,buffer,count)  _read(fd,buffer,(unsigned int) count)
 #endif
 #if !defined(readdir)
 #  define readdir(directory)  NTReadDirectory(directory)
@@ -216,7 +231,8 @@ extern "C" {
 #endif
 #if !defined(stat) && !defined(__BORLANDC__)
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \
-  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && (__MSVCRT_VERSION__ < 0x800)
+  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \
+  !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800))
 #  define stat  _stati64
 #else
 #  define stat  _stat
@@ -232,7 +248,8 @@ extern "C" {
 #  define sysconf(name)  NTSystemConfiguration(name)
 #endif
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \
-  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && (__MSVCRT_VERSION__ < 0x800)
+  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \
+  !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800))
 #  define tell  _telli64
 #else
 #  define tell  _tell
@@ -243,6 +260,15 @@ extern "C" {
 #if !defined(tempnam)
 #  define tempnam  _tempnam_s
 #endif
+#if !defined(umask)
+#  define umask  _umask
+#endif
+#if !defined(unlink)
+#  define unlink  _unlink
+#endif
+#if !defined(utime)
+#  define utime(filename,time)  _utime(filename,(struct _utimbuf*) time)
+#endif
 #if !defined(vfprintf_l)
 #define vfprintf_l  _vfprintf_l
 #endif
@@ -255,23 +281,18 @@ extern "C" {
 #define vsnprintf_l  _vsnprintf_l
 #endif
 #if !defined(write)
-#  define write  _write
+#  define write(fd,buffer,count)  _write(fd,buffer,(unsigned int) count)
 #endif
 #if !defined(wstat) && !defined(__BORLANDC__)
 #if defined(MAGICKCORE_WINDOWS_SUPPORT) && !defined(Windows95) && \
-  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && (__MSVCRT_VERSION__ < 0x800)
+  !(defined(_MSC_VER) && (_MSC_VER < 1400)) && \
+  !(defined(__MSVCRT_VERSION__) && (__MSVCRT_VERSION__ < 0x800))
 #  define wstat  _wstati64
 #else
 #  define wstat  _wstat
 #endif
 #endif
 
-#if defined(_MT) && defined(MAGICKCORE_WINDOWS_SUPPORT)
-#  define SAFE_GLOBAL  __declspec(thread)
-#else
-#  define SAFE_GLOBAL
-#endif
-
 #if defined(__BORLANDC__)
 #undef _O_RANDOM
 #define _O_RANDOM 0
@@ -294,11 +315,9 @@ extern MagickExport char
 extern MagickExport const GhostInfo_
   *NTGhostscriptDLLVectors(void);
 
-extern MagickExport int
-  NTGhostscriptUnLoadDLL(void);
-
 extern MagickExport void
   NTErrorHandler(const ExceptionType,const char *,const char *),
+  NTGhostscriptUnLoadDLL(void),
   NTWarningHandler(const ExceptionType,const char *,const char *);
 #endif