build: prefer WIN32 over __MINGW32__ checks

WIN32 is always defined when __MINGW32__ is defined, but the
converse is not true.  WIN32 is more generic, if someone were
to ever attempt porting to a microsoft compiler.  This does
not affect Cygwin, which intentionally does not define WIN32.

* src/qemu/qemu_driver.c (qemuDomainGetBlockInfo): Use more
generic flag macro.
* src/storage/storage_backend.c
(virStorageBackendUpdateVolTargetInfoFD)
(virStorageBackendRunProgRegex): Likewise.
* tools/console.h (vshRunConsole): Likewise.
This commit is contained in:
Eric Blake 2010-05-03 14:44:12 -06:00
parent c4157e5272
commit 9f87b631ce
4 changed files with 11 additions and 11 deletions

View File

@ -9080,7 +9080,7 @@ static int qemuDomainGetBlockInfo(virDomainPtr dom,
} }
if (S_ISREG(sb.st_mode)) { if (S_ISREG(sb.st_mode)) {
#ifndef __MINGW32__ #ifndef WIN32
info->physical = (unsigned long long)sb.st_blocks * info->physical = (unsigned long long)sb.st_blocks *
(unsigned long long)DEV_BSIZE; (unsigned long long)DEV_BSIZE;
#else #else

View File

@ -954,7 +954,7 @@ virStorageBackendUpdateVolTargetInfoFD(virStorageVolTargetPtr target,
if (allocation) { if (allocation) {
if (S_ISREG(sb.st_mode)) { if (S_ISREG(sb.st_mode)) {
#ifndef __MINGW32__ #ifndef WIN32
*allocation = (unsigned long long)sb.st_blocks * *allocation = (unsigned long long)sb.st_blocks *
(unsigned long long)DEV_BSIZE; (unsigned long long)DEV_BSIZE;
#else #else
@ -1184,7 +1184,7 @@ virStorageBackendStablePath(virStoragePoolObjPtr pool,
} }
#ifndef __MINGW32__ #ifndef WIN32
/* /*
* Run an external program. * Run an external program.
* *
@ -1466,7 +1466,7 @@ virStorageBackendRunProgNul(virStoragePoolObjPtr pool,
return 0; return 0;
} }
#else #else /* WIN32 */
int int
virStorageBackendRunProgRegex(virConnectPtr conn, virStorageBackendRunProgRegex(virConnectPtr conn,
@ -1494,4 +1494,4 @@ virStorageBackendRunProgNul(virConnectPtr conn,
virStorageReportError(VIR_ERR_INTERNAL_ERROR, _("%s not implemented on Win32"), __FUNCTION__); virStorageReportError(VIR_ERR_INTERNAL_ERROR, _("%s not implemented on Win32"), __FUNCTION__);
return -1; return -1;
} }
#endif #endif /* WIN32 */

View File

@ -1,7 +1,7 @@
/* /*
* console.c: A dumb serial console client * console.c: A dumb serial console client
* *
* Copyright (C) 2007, 2008 Red Hat, Inc. * Copyright (C) 2007, 2008, 2010 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -22,7 +22,7 @@
#include <config.h> #include <config.h>
#ifndef __MINGW32__ #ifndef WIN32
# include <stdio.h> # include <stdio.h>
# include <sys/types.h> # include <sys/types.h>
@ -197,4 +197,4 @@ int vshRunConsole(const char *tty) {
return ret; return ret;
} }
#endif /* !__MINGW32__ */ #endif /* !WIN32 */

View File

@ -1,7 +1,7 @@
/* /*
* console.c: A dumb serial console client * console.c: A dumb serial console client
* *
* Copyright (C) 2007 Red Hat, Inc. * Copyright (C) 2007, 2010 Red Hat, Inc.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -23,10 +23,10 @@
#ifndef __VIR_CONSOLE_H__ #ifndef __VIR_CONSOLE_H__
# define __VIR_CONSOLE_H__ # define __VIR_CONSOLE_H__
# ifndef __MINGW32__ # ifndef WIN32
int vshRunConsole(const char *tty); int vshRunConsole(const char *tty);
# endif /* !__MINGW32__ */ # endif /* !WIN32 */
#endif /* __VIR_CONSOLE_H__ */ #endif /* __VIR_CONSOLE_H__ */