-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix -Wunguarded-availability-new warnings
- Loading branch information
1 parent
b6f282b
commit dcef17d
Showing
6 changed files
with
179 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From 38a2bd810baf13107a87eb86087d0a24c47b0396 Mon Sep 17 00:00:00 2001 | ||
From: Peter Zhigalov <[email protected]> | ||
Date: Mon, 26 Sep 2022 09:08:56 +0700 | ||
Subject: [PATCH] GETTEXT: disable futimens/utimensat | ||
|
||
--- | ||
gettext-tools/config.h.in | 6 ++++++ | ||
1 file changed, 6 insertions(+) | ||
|
||
diff --git a/gettext-tools/config.h.in b/gettext-tools/config.h.in | ||
index 030077b..346fec2 100644 | ||
--- a/gettext-tools/config.h.in | ||
+++ b/gettext-tools/config.h.in | ||
@@ -1044,7 +1044,10 @@ | ||
#undef HAVE_FUNLOCKFILE | ||
|
||
/* Define to 1 if you have the `futimens' function. */ | ||
+/* | ||
+// warning: 'futimens' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] | ||
#undef HAVE_FUTIMENS | ||
+*/ | ||
|
||
/* Define to 1 if you have the `futimes' function. */ | ||
#undef HAVE_FUTIMES | ||
@@ -1697,7 +1700,10 @@ | ||
#undef HAVE_UTIME | ||
|
||
/* Define to 1 if you have the `utimensat' function. */ | ||
+/* | ||
+// warning: 'utimensat' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] | ||
#undef HAVE_UTIMENSAT | ||
+*/ | ||
|
||
/* Define to 1 if you have the <utime.h> header file. */ | ||
#undef HAVE_UTIME_H | ||
-- | ||
2.37.0 (Apple Git-136) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
From 6506b885fa34679df2c35bc281ea35fb8ee8129b Mon Sep 17 00:00:00 2001 | ||
From: Peter Zhigalov <[email protected]> | ||
Date: Mon, 26 Sep 2022 09:33:09 +0700 | ||
Subject: [PATCH] GLIB: disable utimensat | ||
|
||
--- | ||
gio/glocalfileinfo.c | 2 ++ | ||
meson.build | 3 ++- | ||
2 files changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c | ||
index 6f18695..c9e5c8b 100644 | ||
--- a/gio/glocalfileinfo.c | ||
+++ b/gio/glocalfileinfo.c | ||
@@ -2800,6 +2800,7 @@ set_mtime_atime (char *filename, | ||
return FALSE; | ||
} | ||
|
||
+#if defined (HAVE_UTIMENSAT) | ||
res = utimensat (AT_FDCWD, filename, times_n, 0); | ||
if (res == -1) | ||
{ | ||
@@ -2811,6 +2812,7 @@ set_mtime_atime (char *filename, | ||
g_strerror (errsv)); | ||
return FALSE; | ||
} | ||
+#endif | ||
return TRUE; | ||
} | ||
#endif | ||
diff --git a/meson.build b/meson.build | ||
index 3aa1a10..d7118fd 100644 | ||
--- a/meson.build | ||
+++ b/meson.build | ||
@@ -635,7 +635,8 @@ functions = [ | ||
'unsetenv', | ||
'uselocale', | ||
'utimes', | ||
- 'utimensat', | ||
+ # warning: 'utimensat' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] | ||
+ # 'utimensat', | ||
'valloc', | ||
'vasprintf', | ||
'vsnprintf', | ||
-- | ||
2.37.0 (Apple Git-136) | ||
|
28 changes: 28 additions & 0 deletions
28
patches/0001-LIBPNG-add-macOS-10.13-guard-for-inflateValidate.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
From 9f48523e5c41afb145349f4b7f4bbe9a0e520bf3 Mon Sep 17 00:00:00 2001 | ||
From: Peter Zhigalov <[email protected]> | ||
Date: Mon, 26 Sep 2022 09:18:50 +0700 | ||
Subject: [PATCH] LIBPNG: add macOS 10.13 guard for inflateValidate | ||
|
||
--- | ||
pngrutil.c | 5 ++++- | ||
1 file changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/pngrutil.c b/pngrutil.c | ||
index ca060dd..610272c 100644 | ||
--- a/pngrutil.c | ||
+++ b/pngrutil.c | ||
@@ -425,7 +425,10 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner) | ||
defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32) | ||
if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON) | ||
/* Turn off validation of the ADLER32 checksum in IDAT chunks */ | ||
- ret = inflateValidate(&png_ptr->zstream, 0); | ||
+ /* warning: 'inflateValidate' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] */ | ||
+ if (__builtin_available(macOS 10.13, *)) { | ||
+ ret = inflateValidate(&png_ptr->zstream, 0); | ||
+ } | ||
#endif | ||
|
||
if (ret == Z_OK) | ||
-- | ||
2.37.0 (Apple Git-136) | ||
|
17 changes: 10 additions & 7 deletions
17
...remove-unneeded-macOS-version-check.patch → ...emove-error-on-build-for-macos-11.0.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
From af11089244154e613cf3c265cee152216be40516 Mon Sep 17 00:00:00 2001 | ||
From 0dfb08db4b77545d730d2c65b6a3b30ccfe8684f Mon Sep 17 00:00:00 2001 | ||
From: Peter Zhigalov <[email protected]> | ||
Date: Tue, 20 Sep 2022 23:28:42 +0700 | ||
Subject: [PATCH] PCRE2: remove unneeded macOS version check | ||
Subject: [PATCH] PCRE2: remove error on build for macos < 11.0 | ||
|
||
--- | ||
src/sljit/sljitExecAllocator.c | 4 ---- | ||
1 file changed, 4 deletions(-) | ||
src/sljit/sljitExecAllocator.c | 8 +++----- | ||
1 file changed, 3 insertions(+), 5 deletions(-) | ||
|
||
diff --git a/src/sljit/sljitExecAllocator.c b/src/sljit/sljitExecAllocator.c | ||
index 92d940d..30b23d5 100644 | ||
index 92d940d..b9d0e33 100644 | ||
--- a/src/sljit/sljitExecAllocator.c | ||
+++ b/src/sljit/sljitExecAllocator.c | ||
@@ -150,11 +150,7 @@ static SLJIT_INLINE int get_map_jit_flag() | ||
@@ -150,11 +150,9 @@ static SLJIT_INLINE int get_map_jit_flag() | ||
|
||
static SLJIT_INLINE void apple_update_wx_flags(sljit_s32 enable_exec) | ||
{ | ||
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 110000 | ||
pthread_jit_write_protect_np(enable_exec); | ||
- pthread_jit_write_protect_np(enable_exec); | ||
-#else | ||
-#error "Must target Big Sur or newer" | ||
-#endif /* BigSur */ | ||
+ if (__builtin_available(macOS 11.0, *)) { | ||
+ pthread_jit_write_protect_np(enable_exec); | ||
+ } | ||
} | ||
#endif /* SLJIT_CONFIG_X86 */ | ||
#else /* !TARGET_OS_OSX */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
From f641dccf2eebd527d5a6e8073d1b813766a43929 Mon Sep 17 00:00:00 2001 | ||
From: Peter Zhigalov <[email protected]> | ||
Date: Mon, 26 Sep 2022 08:59:50 +0700 | ||
Subject: [PATCH] XZ: disable futimens | ||
|
||
--- | ||
config.h.in | 3 +++ | ||
1 file changed, 3 insertions(+) | ||
|
||
diff --git a/config.h.in b/config.h.in | ||
index c8ba420..f95b12c 100644 | ||
--- a/config.h.in | ||
+++ b/config.h.in | ||
@@ -133,7 +133,10 @@ | ||
#undef HAVE_FCNTL_H | ||
|
||
/* Define to 1 if you have the `futimens' function. */ | ||
+/* | ||
+// warning: 'futimens' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] | ||
#undef HAVE_FUTIMENS | ||
+*/ | ||
|
||
/* Define to 1 if you have the `futimes' function. */ | ||
#undef HAVE_FUTIMES | ||
-- | ||
2.37.0 (Apple Git-136) | ||
|