提交 83affaa6 编写于 作者: P Pavel Borzenkov 提交者: Andreas Färber

raw-posix: Do not use CONFIG_COCOA macro

Use __APPLE__ and __MACH__ macros instead of CONFIG_COCOA to detect Mac
OS X host. The patch is based on Ben Leslie's patch:
http://patchwork.ozlabs.org/patch/97859/Signed-off-by: NBen Leslie <benno@benno.id.au>
Signed-off-by: NPavel Borzenkov <pavel.borzenkov@gmail.com>
Acked-by: NKevin Wolf <kwolf@redhat.com>
Signed-off-by: NAndreas Färber <andreas.faerber@web.de>
上级 42fe1c24
......@@ -29,7 +29,7 @@
#include "module.h"
#include "block/raw-posix-aio.h"
#ifdef CONFIG_COCOA
#if defined(__APPLE__) && (__MACH__)
#include <paths.h>
#include <sys/param.h>
#include <IOKit/IOKitLib.h>
......@@ -505,7 +505,7 @@ again:
}
if (size == 0)
#endif
#ifdef CONFIG_COCOA
#if defined(__APPLE__) && defined(__MACH__)
size = LONG_LONG_MAX;
#else
size = lseek(fd, 0LL, SEEK_END);
......@@ -650,7 +650,7 @@ static BlockDriver bdrv_file = {
/***********************************************/
/* host device */
#ifdef CONFIG_COCOA
#if defined(__APPLE__) && defined(__MACH__)
static kern_return_t FindEjectableCDMedia( io_iterator_t *mediaIterator );
static kern_return_t GetBSDPath( io_iterator_t mediaIterator, char *bsdPath, CFIndex maxPathSize );
......@@ -728,7 +728,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
{
BDRVRawState *s = bs->opaque;
#ifdef CONFIG_COCOA
#if defined(__APPLE__) && defined(__MACH__)
if (strstart(filename, "/dev/cdrom", NULL)) {
kern_return_t kernResult;
io_iterator_t mediaIterator;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册