diff options
author | Matthew Waters <matthew@centricular.com> | 2020-09-23 19:01:22 +1000 |
---|---|---|
committer | Matthew Waters <matthew@centricular.com> | 2020-10-22 22:41:17 +1100 |
commit | 15f45dd613d159c4a0efa6af09a03e00523f9340 (patch) | |
tree | 4b699ec6e8c97cf87517dce7ebab9e937deca7d8 | |
parent | 1d05835e00540f00a0dc1624370341c00ffddc95 (diff) |
recipes/zlib: fix build with XCode 12
XCode 12 will now error out by default for implicit function
declarations.
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/646>
-rw-r--r-- | recipes/zlib.recipe | 3 | ||||
-rw-r--r-- | recipes/zlib/0001-meson-add-the-DSTDC-define-to-include-standard-C-hea.patch | 42 |
2 files changed, 44 insertions, 1 deletions
diff --git a/recipes/zlib.recipe b/recipes/zlib.recipe index 2bdc9cf6..4eecd6f9 100644 --- a/recipes/zlib.recipe +++ b/recipes/zlib.recipe @@ -12,7 +12,8 @@ class Recipe(recipe.Recipe): licenses = [{License.BSD_like: ['README']}] patches = ['zlib/0001-win32-fix-dll-name.patch', 'zlib/0001-Fix-test-builds-to-use-the-built-libz-headers-librar.patch', - 'zlib/0001-Add-a-meson-port.patch'] + 'zlib/0001-Add-a-meson-port.patch', + 'zlib/0001-meson-add-the-DSTDC-define-to-include-standard-C-hea.patch'] files_libs = ['libz'] files_devel = ['include/zlib.h', 'include/zconf.h', 'lib/pkgconfig/zlib.pc'] diff --git a/recipes/zlib/0001-meson-add-the-DSTDC-define-to-include-standard-C-hea.patch b/recipes/zlib/0001-meson-add-the-DSTDC-define-to-include-standard-C-hea.patch new file mode 100644 index 00000000..b6eb59ba --- /dev/null +++ b/recipes/zlib/0001-meson-add-the-DSTDC-define-to-include-standard-C-hea.patch @@ -0,0 +1,42 @@ +From 6bc4b7efe1c935826e7081bd53bed3209269b2fb Mon Sep 17 00:00:00 2001 +From: Matthew Waters <matthew@centricular.com> +Date: Wed, 23 Sep 2020 15:07:59 +1000 +Subject: [PATCH] meson: add the -DSTDC define to include standard C headers + +Fixes build error with XCode 12 erroring out on +implicit-function-declarations +--- + gzguts.h | 3 +++ + meson.build | 2 +- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gzguts.h b/gzguts.h +index 990a4d2..b9283f3 100644 +--- a/gzguts.h ++++ b/gzguts.h +@@ -21,6 +21,9 @@ + #include <stdio.h> + #include "zlib.h" + #ifdef STDC ++# if !defined(_MSC_VER) ++# include <unistd.h> ++# endif + # include <string.h> + # include <stdlib.h> + # include <limits.h> +diff --git a/meson.build b/meson.build +index 34819bb..3540420 100644 +--- a/meson.build ++++ b/meson.build +@@ -18,7 +18,7 @@ src = ['adler32.c', 'crc32.c', 'deflate.c', 'infback.c', 'inffast.c', 'inflate.c + headers = ['zconf.h', 'zlib.h'] + + zlib = library('z', src, +- c_args : ['-DZLIB_DLL'], ++ c_args : ['-DZLIB_DLL', '-DSTDC'], + link_args : link_args, + install : true, + version : meson.project_version()) +-- +2.24.3 (Apple Git-128) + |