On 06.01.22 00:56, Philippe Mathieu-Daudé wrote:
When building on macOS 12 we get:
../block/file-posix.c:3335:18: warning: 'IOMasterPort' is
deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]
kernResult = IOMasterPort( MACH_PORT_NULL, &masterPort );
^~~~~~~~~~~~
IOMainPort
Use IOMainPort (define it to IOMasterPort on macOS < 12),
and replace 'master' by 'main' in a variable name.
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
block/file-posix.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
I hope the [RFC] tag isn’t directed at me.
Still, I can give my comment, of course.
diff --git a/block/file-posix.c b/block/file-posix.c
index b283093e5b..0dcfce1856 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -3324,17 +3324,22 @@ BlockDriver bdrv_file = {
#if defined(__APPLE__) && defined(__MACH__)
static kern_return_t GetBSDPath(io_iterator_t mediaIterator, char
*bsdPath,
CFIndex maxPathSize, int flags);
+
+#if !defined(MAC_OS_VERSION_12_0)
So AFAIU from my quick rather fruit-less googling, this macro is
defined (to some version-defining integer) on every macOS version
starting from 12.0? (Just confirming because the name could also
mean it’d be defined only on 12.0.)