block/file-posix: Remove a deprecation warning on macOS 12
commitaa44d3f6b8d2f08f09034f287efec8890633cc38
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Wed, 5 Jan 2022 23:46:01 +0000 (6 00:46 +0100)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Tue, 15 Mar 2022 12:36:33 +0000 (15 13:36 +0100)
treebc24a79b621921b55564ba291cb9c9dbcf52d75b
parent2e84d8521f596689d96e07ac377d2af1479774ba
block/file-posix: Remove a deprecation warning on macOS 12

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

Replace by IOMainPort, redefining it to IOMasterPort if not available.

Suggested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed by: Cameron Esfahani <dirty@apple.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Tested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
block/file-posix.c