]> git.pld-linux.org Git - packages/crossmingw32-glib2.git/blobdiff - glib2-win32.patch
- rediffed
[packages/crossmingw32-glib2.git] / glib2-win32.patch
index 5472d5b8783411db15aac6e3d25f0d5abaad7ec0..5678ac480658bcee50f2b8295d179653d3515643 100644 (file)
---- glib-2.40.0/glib/grand.c.orig      2014-02-22 16:29:07.000000000 +0100
-+++ glib-2.40.0/glib/grand.c   2014-03-25 18:45:39.693348981 +0100
-@@ -55,6 +55,7 @@
- #endif
- #ifdef G_OS_WIN32
-+#include <windows.h>
- #include <stdlib.h>
- #endif
+--- glib-2.58.0/gio/gwin32appinfo.c.orig       2018-08-30 19:12:08.000000000 +0200
++++ glib-2.58.0/gio/gwin32appinfo.c    2018-09-18 20:29:20.206457756 +0200
+@@ -22,6 +22,7 @@
  
---- glib-2.44.0/gio/gwin32networking.h.orig    2015-03-20 18:33:38.000000000 +0100
-+++ glib-2.44.0/gio/gwin32networking.h 2015-03-23 21:03:15.924279829 +0100
-@@ -24,8 +24,9 @@
- /* Check if more ANSI-compliant Winsock2 functions are provided */
- /* For run-time compatibility with Windows XP, remove when XP support dropped */
--typedef INT (WSAAPI *PFN_InetPton) (INT, PCTSTR, PVOID);
--typedef PCTSTR (WSAAPI *PFN_InetNtop) (INT, PVOID, PTSTR, size_t);
-+typedef ULONG NET_IFINDEX;
-+typedef INT (WSAAPI *PFN_InetPton) (INT, LPCTSTR, PVOID);
-+typedef LPCTSTR (WSAAPI *PFN_InetNtop) (INT, PVOID, PTSTR, size_t);
- typedef NET_IFINDEX (WINAPI *PFN_IfNameToIndex) (PCSTR);
- typedef struct _GWin32WinsockFuncs
---- glib-2.46.0/glib/gstrfuncs.c.orig  2015-09-12 18:05:31.000000000 +0200
-+++ glib-2.46.0/glib/gstrfuncs.c       2015-09-22 17:09:13.736714571 +0200
-@@ -1272,7 +1272,7 @@
-       gchar buf[1024];
-       GError *error = NULL;
--#if defined(G_OS_WIN32)
-+#if defined(G_OS_WIN32) && !defined(__MINGW32__)
-       strerror_s (buf, sizeof (buf), errnum);
-       msg = buf;
- #elif defined(HAVE_STRERROR_R)
---- glib-2.46.0/gio/gwin32appinfo.c.orig       2015-09-21 14:37:29.000000000 +0200
-+++ glib-2.46.0/gio/gwin32appinfo.c    2015-09-22 17:34:28.039984356 +0200
-@@ -34,6 +34,11 @@
- #include <gio/gwin32registrykey.h>
+ #include "config.h"
  
- #include <windows.h>
-+#include <wchar.h>
-+
-+#ifndef LOAD_LIBRARY_AS_IMAGE_RESOURCE
-+#define LOAD_LIBRARY_AS_IMAGE_RESOURCE 0x20
-+#endif
++#include <wctype.h>
+ #include <string.h>
  
- /* We need to watch 8 places:
-  * 0) HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations
---- glib-2.46.0/gio/gwin32registrykey.c.orig   2015-09-21 12:44:58.000000000 +0200
-+++ glib-2.46.0/gio/gwin32registrykey.c        2015-09-22 18:50:25.926459740 +0200
-@@ -25,10 +25,21 @@
+ #include "gcontenttype.h"
+--- glib-2.66.6/gio/gwin32registrykey.c.orig   2021-02-07 19:11:29.468421063 +0100
++++ glib-2.66.6/gio/gwin32registrykey.c        2021-02-07 19:51:00.202244362 +0100
+@@ -25,12 +25,17 @@
  #pragma warning ( disable:4005 )
  #endif
  #include <windows.h>
 +#ifdef __MINGW32__
 +#include <ddk/ntstatus.h>
 +#include <ddk/ntddk.h>
-+#if !defined HKEY_PERFORMANCE_NLSTEXT
-+#define HKEY_PERFORMANCE_NLSTEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000060) )
-+#endif
-+#if ! defined HKEY_PERFORMANCE_TEXT
-+#define HKEY_PERFORMANCE_TEXT (( HKEY ) (ULONG_PTR)((LONG)0x80000050) )
-+#endif
 +#else
  #include <ntstatus.h>
  #include <winternl.h>
 +#endif
  
+ #include "gstrfuncsprivate.h"
 -#ifndef _WDMDDK_
-+#if !defined(_WDMDDK_) && !defined(__WINDDK_H)
++#if !defined(_WDMDDK_) && !defined(_DDK_WINDDK_H)
  typedef enum _KEY_INFORMATION_CLASS {
    KeyBasicInformation,
    KeyNodeInformation,
---- glib-2.46.2/glib/gwin32.c.orig     2015-11-05 21:49:18.000000000 +0100
-+++ glib-2.46.2/glib/gwin32.c  2015-11-08 14:51:02.152308457 +0100
-@@ -60,8 +60,12 @@
- #pragma comment (lib, "ntoskrnl.lib")
- #endif
+--- glib-2.66.8/glib/gstdio.c.orig     2021-03-18 14:47:48.333693500 +0100
++++ glib-2.66.8/glib/gstdio.c  2021-05-22 12:33:01.585554332 +0200
+@@ -39,6 +39,11 @@
+ #include <io.h>
+ #include <sys/utime.h>
+ #include <stdlib.h> /* for MB_CUR_MAX */
++#include <ctype.h>
++#include <malloc.h>
++#ifdef __MINGW32__
++#include <winioctl.h>
++#endif
  #else
+ #include <utime.h>
+ #include <errno.h>
+@@ -57,6 +62,7 @@
+ #endif
+ #if defined (G_OS_WIN32)
++#  if !defined(__MINGW32__)
+ /* We can't include Windows DDK and Windows SDK simultaneously,
+  * so let's copy this here from MinGW-w64 DDK.
+@@ -93,6 +99,7 @@ typedef struct _REPARSE_DATA_BUFFER
+     } GenericReparseBuffer;
+   };
+ } REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER;
++#  endif
+ static int
+ w32_error_to_errno (DWORD error_code)
+@@ -191,7 +198,7 @@ _g_win32_filetime_to_unix_time (const FI
+   return result / hundreds_of_usec_per_sec;
+ }
+-#  ifdef _MSC_VER
++#  if defined(_MSC_VER) || defined(__MINGW32__)
+ #    ifndef S_IXUSR
+ #      define _S_IRUSR _S_IREAD
+ #      define _S_IWUSR _S_IWRITE
+@@ -199,9 +206,13 @@ _g_win32_filetime_to_unix_time (const FI
+ #      define S_IRUSR _S_IRUSR
+ #      define S_IWUSR _S_IWUSR
+ #      define S_IXUSR _S_IXUSR
++#    endif
++#    ifndef S_IXGRP
+ #      define S_IRGRP (S_IRUSR >> 3)
+ #      define S_IWGRP (S_IWUSR >> 3)
+ #      define S_IXGRP (S_IXUSR >> 3)
++#    endif
++#    ifndef S_IXOTH
+ #      define S_IROTH (S_IRGRP >> 3)
+ #      define S_IWOTH (S_IWGRP >> 3)
+ #      define S_IXOTH (S_IXGRP >> 3)
+--- glib-2.58.0/glib/giowin32.c.orig   2018-08-30 19:12:08.000000000 +0200
++++ glib-2.58.0/glib/giowin32.c        2018-09-15 10:12:54.423173008 +0200
+@@ -70,6 +70,7 @@
+ #include "glib.h"
+ #include <stdlib.h>
++#include <winerror.h>
+ #include <winsock2.h>
+ #include <windows.h>
+ #include <conio.h>
+--- glib-2.58.0/gio/gioerror.c.orig    2018-08-30 19:12:08.000000000 +0200
++++ glib-2.58.0/gio/gioerror.c 2018-09-17 20:04:51.387461074 +0200
+@@ -23,6 +23,7 @@
+ #include "gioerror.h"
+ #ifdef G_OS_WIN32
++#include <winerror.h>
+ #include <winsock2.h>
+ #endif
+--- glib-2.66.0/gio/gnetworking.h.in.orig      2020-09-10 17:57:49.379170952 +0200
++++ glib-2.66.0/gio/gnetworking.h.in   2020-09-10 18:00:37.804925178 +0200
+@@ -25,8 +25,11 @@
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
+ #include <windns.h>
++#include <winerror.h>
+ #include <mswsock.h>
++#ifndef __MINGW32__
+ #include <wspiapi.h>
++#endif
+ #include <iphlpapi.h>
+ #undef interface
+--- glib-2.58.0/gio/gwin32networkmonitor.c.orig        2018-08-30 19:12:08.000000000 +0200
++++ glib-2.58.0/gio/gwin32networkmonitor.c     2018-09-26 17:22:59.000209749 +0200
+@@ -28,6 +28,7 @@
+ #include <winsock2.h>
+ #include <ws2tcpip.h>
++#include <netioapi.h>
+ #include <iphlpapi.h>
+ #include <stdio.h>
+--- glib-2.66.8/glib/gutils.h.orig     2021-05-22 12:33:27.583570901 +0200
++++ glib-2.66.8/glib/gutils.h  2021-05-22 12:34:08.529030255 +0200
+@@ -343,7 +343,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
+  * wants the function to be called when it *itself* exits (or is
+  * detached, in case the caller, too, is a DLL).
+  */
+-#if (defined(__MINGW_H) && !defined(_STDLIB_H_)) || (defined(_MSC_VER) && !defined(_INC_STDLIB))
++#if (defined(__MINGW_H) && !defined(_STDLIB_H_) && !defined(_STDLIB_H)) || (defined(_MSC_VER) && !defined(_INC_STDLIB))
+ int atexit (void (*)(void));
+ #endif
+ #define g_atexit(func) atexit(func) GLIB_DEPRECATED_MACRO_IN_2_32
+--- glib-2.60.0/glib/gstdio-private.c.orig     2019-03-04 21:06:14.000000000 +0100
++++ glib-2.60.0/glib/gstdio-private.c  2019-03-17 08:40:17.301017330 +0100
+@@ -17,6 +17,8 @@
+  * along with this library; if not, see <http://www.gnu.org/licenses/>.
+  */
++#include <wctype.h>
++
+ /* Strips "\\\\?\\" extended prefix or
+  * "\\??\\" NT Object Manager prefix from
+  * @str in-place, using memmove.
+--- glib-2.60.0/gio/tests/g-file-info.c.orig   2019-03-04 21:06:14.000000000 +0100
++++ glib-2.60.0/gio/tests/g-file-info.c        2019-03-17 20:58:44.544317727 +0100
+@@ -30,6 +30,9 @@
+ #include <stdio.h>
+ #include <glib/gstdio.h>
+ #include <windows.h>
 +#ifdef __MINGW32__
-+#include <ddk/ntddk.h>
-+#else
- #include <winternl.h>
++#include <winioctl.h>
++#endif
+ #include <shlobj.h>
+ #include <io.h> /* for _get_osfhandle */
  #endif
+--- glib-2.60.0/gio/tests/network-address.c.orig       2019-03-04 21:06:14.000000000 +0100
++++ glib-2.60.0/gio/tests/network-address.c    2019-03-17 21:18:09.974670716 +0100
+@@ -3,6 +3,9 @@
+ #include <gio/gio.h>
+ #include <gio/gnetworking.h>
++#ifdef __MINGW32__
++#include <ntddndis.h>
 +#endif
  
- #include "glib.h"
- #include "gthreadprivate.h"
+ static void
+ test_basic (void)
+--- glib-2.62.0/glib/gtimezone.c.orig  2019-09-05 18:56:49.000000000 +0200
++++ glib-2.62.0/glib/gtimezone.c       2019-09-10 19:30:55.332089477 +0200
+@@ -817,7 +817,7 @@
+       for (year = first, i = 0; *rules != NULL && year <= last; year++)
+         {
+           gboolean failed = FALSE;
+-          swprintf_s (s, 11, L"%d", year);
++          swprintf (s, 12, L"%d", year);
+           if (!failed)
+             {
+--- glib-2.66.8/glib/gwin32.c.orig     2021-03-18 14:47:48.347693400 +0100
++++ glib-2.66.8/glib/gwin32.c  2021-05-22 12:35:00.835079487 +0200
+@@ -1109,7 +1109,7 @@ g_win32_veh_handler (PEXCEPTION_POINTERS
+       return EXCEPTION_CONTINUE_SEARCH;
+     }
+-  fprintf_s (stderr,
++  fprintf (stderr,
+              "Exception code=0x%lx flags=0x%lx at 0x%p",
+              er->ExceptionCode,
+              er->ExceptionFlags,
+@@ -1118,7 +1118,7 @@ g_win32_veh_handler (PEXCEPTION_POINTERS
+   switch (er->ExceptionCode)
+     {
+     case EXCEPTION_ACCESS_VIOLATION:
+-      fprintf_s (stderr,
++      fprintf (stderr,
+                  ". Access violation - attempting to %s at address 0x%p\n",
+                  er->ExceptionInformation[0] == 0 ? "read data" :
+                  er->ExceptionInformation[0] == 1 ? "write data" :
+@@ -1127,7 +1127,7 @@ g_win32_veh_handler (PEXCEPTION_POINTERS
+                  (void *) er->ExceptionInformation[1]);
+       break;
+     case EXCEPTION_IN_PAGE_ERROR:
+-      fprintf_s (stderr,
++      fprintf (stderr,
+                  ". Page access violation - attempting to %s at address 0x%p with status %Ix\n",
+                  er->ExceptionInformation[0] == 0 ? "read from an inaccessible page" :
+                  er->ExceptionInformation[0] == 1 ? "write to an inaccessible page" :
+@@ -1137,7 +1137,7 @@ g_win32_veh_handler (PEXCEPTION_POINTERS
+                  er->ExceptionInformation[2]);
+       break;
+     default:
+-      fprintf_s (stderr, "\n");
++      fprintf (stderr, "\n");
+       break;
+     }
+--- glib-2.62.0/glib/gwin32-private.c.orig     2019-09-05 18:56:49.000000000 +0200
++++ glib-2.62.0/glib/gwin32-private.c  2019-09-10 19:45:50.857238001 +0200
+@@ -40,10 +40,10 @@
+   char event_str[STR_BUFFER_SIZE] = {0};
+   gsize event_str_len;
+-  _snprintf_s (pid_str, STR_BUFFER_SIZE, G_N_ELEMENTS (pid_str), "%lu", pid);
++  snprintf (pid_str, STR_BUFFER_SIZE, "%lu", pid);
+   pid_str[G_N_ELEMENTS (pid_str) - 1] = 0;
+   pid_str_len = strlen (pid_str);
+-  _snprintf_s (event_str, STR_BUFFER_SIZE, G_N_ELEMENTS (pid_str), "%Iu", event);
++  snprintf (event_str, STR_BUFFER_SIZE, "%Iu", event);
+   event_str[G_N_ELEMENTS (pid_str) - 1] = 0;
+   event_str_len = strlen (event_str);
+ #undef STR_BUFFER_SIZE
This page took 0.043815 seconds and 4 git commands to generate.