contrib: gcrypt: Disable asm for NACL
[vlc.git] / extras / tools / bison-macOS-7df04f9.patch
blobb398dbb7c00f741ad6ff633c7086ce6228f48899
1 From 7df04f9b8a0adb1575ca0555775ec10860143cbf Mon Sep 17 00:00:00 2001
2 From: Bruno Haible <bruno@clisp.org>
3 Date: Fri, 7 Jul 2017 23:35:32 +0200
4 Subject: vasnprintf: port to macOS 10.13
6 Improve comments in last commit.
7 ---
8 lib/vasnprintf.c | 17 ++++++++++-------
9 2 files changed, 11 insertions(+), 7 deletions(-)
11 diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
12 index fecaf27..2e4eb19 100644
13 --- a/lib/vasnprintf.c
14 +++ b/lib/vasnprintf.c
15 @@ -4869,10 +4869,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
16 #endif
17 *fbp = dp->conversion;
18 #if USE_SNPRINTF
19 -# if ! (((__GLIBC__ > 2 \
20 - || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \
21 - && !defined __UCLIBC__) \
22 - || (defined __APPLE__ && defined __MACH__) \
23 +# if ! (((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) \
24 + && !defined __UCLIBC__) \
25 + || (defined __APPLE__ && defined __MACH__) \
26 || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
27 fbp[1] = '%';
28 fbp[2] = 'n';
29 @@ -4887,9 +4886,13 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
30 in format strings in writable memory may crash the program
31 (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
32 in this situation. */
33 - /* macOS 10.13 High Sierra behaves like glibc with
34 - _FORTIFY_SOURCE=2, and older macOS releases
35 - presumably do not need %n. */
36 + /* On Mac OS X 10.3 or newer, we know that snprintf's return
37 + value conforms to ISO C 99: the tests gl_SNPRINTF_RETVAL_C99
38 + and gl_SNPRINTF_TRUNCATION_C99 pass.
39 + Therefore we can avoid using %n in this situation.
40 + On Mac OS X 10.13 or newer, the use of %n in format strings
41 + in writable memory by default crashes the program, so we
42 + should avoid it in this situation. */
43 /* On native Windows systems (such as mingw), we can avoid using
44 %n because:
45 - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
46 --
47 cgit v1.0-41-gc330