]> granicus.if.org Git - imagemagick/commitdiff
Added windows implementation of getpagesize.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sat, 1 Apr 2017 17:28:04 +0000 (19:28 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sat, 1 Apr 2017 17:28:04 +0000 (19:28 +0200)
MagickCore/nt-base-private.h
MagickCore/nt-base.c
MagickCore/utility.c

index df401fe91a80f04ac7742a4c9ae1069ba8dc4dd2..04d1734842718ad9eb0fdab8edafa13acfc64962 100644 (file)
@@ -135,6 +135,7 @@ extern MagickPrivate int
   NTSystemCommand(const char *,char *);
 
 extern MagickPrivate ssize_t
+  NTGetPageSize(void),
   NTSystemConfiguration(int),
   NTTellDirectory(DIR *);
 
index e81bd1c62b76f18bd7c2354a34a00a16544b1765..48eaad98bf9fd00469cefb34910db071eee1b911 100644 (file)
@@ -1025,6 +1025,33 @@ MagickPrivate MagickBooleanType NTGetModulePath(const char *module,char *path)
 %                                                                             %
 %                                                                             %
 %                                                                             %
++    N T G e t P a g e S i z e                                                %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  NTGetPageSize() returns the page size under Windows.
+%
+%  The format of the NTPageSize
+%
+%      NTPageSize()
+%
+*/
+MagickPrivate ssize_t NTGetPageSize(void)
+{
+  SYSTEM_INFO
+    system_info;
+
+   GetSystemInfo(&system_info);
+   return((ssize_t) system_info.dwPageSize);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   N T G h o s t s c r i p t D L L                                           %
 %                                                                             %
 %                                                                             %
index 7543865ec048b012315e9fc032827e28dfcbb2ed..6554c739c6462dc705051d0ab6db5f16d3de4ccd 100644 (file)
@@ -1113,10 +1113,10 @@ MagickPrivate ssize_t GetMagickPageSize(void)
     return(page_size);
 #if defined(MAGICKCORE_HAVE_SYSCONF) && defined(_SC_PAGE_SIZE)
   page_size=(ssize_t) sysconf(_SC_PAGE_SIZE);
-#else
-#if defined(MAGICKCORE_HAVE_GETPAGESIZE)
+#elif defined(MAGICKCORE_HAVE_GETPAGESIZE)
   page_size=(ssize_t) getpagesize();
-#endif
+#elif defined(MAGICKCORE_WINDOWS_SUPPORT)
+  page_size=NTGetPageSize();
 #endif
   if (page_size <= 0)
     page_size=16384;