summaryrefslogtreecommitdiffstats
path: root/plugins/native/bison-1-fixes.patch
blob: e8bb66e4bd1b4f50fe31da86e47a9c7f917ff2af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
This file is part of MXE. See LICENSE.md for licensing information.

Contains ad hoc patches for cross building.

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Thu, 1 Mar 2018 15:42:14 +1100
Subject: [PATCH 1/1] fix for crash on High Sierra due to usage of %n in
 dynamic format strings

taken from:
https://github.com/macports/macports-ports/commit/14451f57e899ba3bd8672830944209cf0bbb87a7

With format string strictness, High Sierra also enforces that %n isn't used
in dynamic format strings, but we should just disable its use on darwin in
general.

diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 1111111..2222222 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -4858,7 +4858,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #endif
                   *fbp = dp->conversion;
 #if USE_SNPRINTF
-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !defined(__APPLE__) && !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
                 fbp[1] = '%';
                 fbp[2] = 'n';
                 fbp[3] = '\0';