view src/mesa-2-ucrt.patch @ 5962:88dfa92d0c86

Add patches for building packages with UCRT. * src/flac-1-ucrt.patch, src/gdal-2-ucrt.patch, src/mesa-2-ucrt.patch: Don't set specific msvcrt version. * src/flac.mk: autoreconf after applying patch. * dist-files.mk: Add new files to build system.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 18 Nov 2021 14:59:34 +0100
parents
children 8b434abc6fc1
line wrap: on
line source

From a3b60fc23f2968e2d22c8d46baf29d4cd90b0d5c Mon Sep 17 00:00:00 2001
From: Jeremy Drake <github@jdrake.com>
Date: Sat, 16 Oct 2021 16:50:46 -0700
Subject: [PATCH] mesa: fixes for UCRT.

--- mesa-21.2.4/meson.build.orig	2021-10-16 16:02:38.021997300 -0700
+++ mesa-21.2.4/meson.build	2021-10-16 16:03:24.287545400 -0700
@@ -1046,8 +1046,6 @@
       '-D_HAS_EXCEPTIONS=0', # Tell C++ STL to not use exceptions
       '-DNOMINMAX',
     ]
-  else
-    pre_args += ['-D__MSVCRT_VERSION__=0x0700']
   endif
 elif host_machine.system() == 'openbsd'
   pre_args += '-D_ISOC11_SOURCE'
--- mesa-21.2.4/src/compiler/spirv/vtn_private.h.orig	2021-10-16 15:28:02.537761600 -0700
+++ mesa-21.2.4/src/compiler/spirv/vtn_private.h	2021-10-16 15:28:05.959391400 -0700
@@ -41,7 +41,7 @@
 struct vtn_decoration;
 
 /* setjmp/longjmp is broken on MinGW: https://sourceforge.net/p/mingw-w64/bugs/406/ */
-#ifdef __MINGW32__
+#if defined(__MINGW32__) && !defined(_UCRT)
   #define vtn_setjmp __builtin_setjmp
   #define vtn_longjmp __builtin_longjmp
 #else
--- mesa-21.2.4/src/compiler/nir/nir.h.orig	2021-10-14 12:59:05.367845000 -0700
+++ mesa-21.2.4/src/compiler/nir/nir.h	2021-10-16 15:55:09.881268400 -0700
@@ -54,7 +54,7 @@
 
 #include "nir_opcodes.h"
 
-#if defined(_WIN32) && !defined(snprintf)
+#if defined(_WIN32) && !defined(snprintf) && !defined(_UCRT)
 #define snprintf _snprintf
 #endif
 
--- mesa-21.2.4/src/compiler/nir/nir_lower_atomics_to_ssbo.c.orig	2021-10-14 12:59:05.375845200 -0700
+++ mesa-21.2.4/src/compiler/nir/nir_lower_atomics_to_ssbo.c	2021-10-16 15:55:30.818804300 -0700
@@ -27,10 +27,6 @@
 #include "nir.h"
 #include "nir_builder.h"
 
-#if defined(_WIN32) && !defined(snprintf)
-#define snprintf _snprintf
-#endif
-
 /*
  * Remap atomic counters to SSBOs, starting from the shader's next SSBO slot
  * (info.num_ssbos).
--- mesa-21.2.4/src/gallium/drivers/swr/swr_fence.cpp.orig	2021-10-16 16:29:10.287533700 -0700
+++ mesa-21.2.4/src/gallium/drivers/swr/swr_fence.cpp	2021-10-16 16:29:45.678206500 -0700
@@ -29,7 +29,7 @@
 #include "swr_screen.h"
 #include "swr_fence.h"
 
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__MINGW32__)
 #include <sched.h>
 #endif