mvadkert / rpms / qemu

Forked from rpms/qemu 6 years ago
Clone
5544c1b
From 33e25a4a6c6dc7632b15ee50637d33b4c3cf729e Mon Sep 17 00:00:00 2001
5544c1b
From: Max Filippov <jcmvbkbc@gmail.com>
5544c1b
Date: Thu, 6 Sep 2012 04:36:46 +0400
5544c1b
Subject: [PATCH] target-xtensa: fix missing errno codes for mingw32
5544c1b
5544c1b
Put the following errno value mappings under #ifdef:
5544c1b
5544c1b
xtensa-semi.c: In function 'errno_h2g':
5544c1b
xtensa-semi.c:113: error: 'ENOTBLK' undeclared (first use in this function)
5544c1b
xtensa-semi.c:113: error: (Each undeclared identifier is reported only once
5544c1b
xtensa-semi.c:113: error: for each function it appears in.)
5544c1b
xtensa-semi.c:113: error: array index in initializer not of integer type
5544c1b
xtensa-semi.c:113: error: (near initialization for 'guest_errno')
5544c1b
xtensa-semi.c:124: error: 'ETXTBSY' undeclared (first use in this function)
5544c1b
xtensa-semi.c:124: error: array index in initializer not of integer type
5544c1b
xtensa-semi.c:124: error: (near initialization for 'guest_errno')
5544c1b
xtensa-semi.c:134: error: 'ELOOP' undeclared (first use in this function)
5544c1b
xtensa-semi.c:134: error: array index in initializer not of integer type
5544c1b
xtensa-semi.c:134: error: (near initialization for 'guest_errno')
5544c1b
5544c1b
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
5544c1b
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
5544c1b
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1b
---
5544c1b
 target-xtensa/xtensa-semi.c | 6 ++++++
5544c1b
 1 file changed, 6 insertions(+)
5544c1b
5544c1b
diff --git a/target-xtensa/xtensa-semi.c b/target-xtensa/xtensa-semi.c
5544c1b
index e745bef..52be07a 100644
5544c1b
--- a/target-xtensa/xtensa-semi.c
5544c1b
+++ b/target-xtensa/xtensa-semi.c
5544c1b
@@ -110,7 +110,9 @@ static uint32_t errno_h2g(int host_errno)
5544c1b
         [ENOMEM]        = TARGET_ENOMEM,
5544c1b
         [EACCES]        = TARGET_EACCES,
5544c1b
         [EFAULT]        = TARGET_EFAULT,
5544c1b
+#ifdef ENOTBLK
5544c1b
         [ENOTBLK]       = TARGET_ENOTBLK,
5544c1b
+#endif
5544c1b
         [EBUSY]         = TARGET_EBUSY,
5544c1b
         [EEXIST]        = TARGET_EEXIST,
5544c1b
         [EXDEV]         = TARGET_EXDEV,
5544c1b
@@ -121,7 +123,9 @@ static uint32_t errno_h2g(int host_errno)
5544c1b
         [ENFILE]        = TARGET_ENFILE,
5544c1b
         [EMFILE]        = TARGET_EMFILE,
5544c1b
         [ENOTTY]        = TARGET_ENOTTY,
5544c1b
+#ifdef ETXTBSY
5544c1b
         [ETXTBSY]       = TARGET_ETXTBSY,
5544c1b
+#endif
5544c1b
         [EFBIG]         = TARGET_EFBIG,
5544c1b
         [ENOSPC]        = TARGET_ENOSPC,
5544c1b
         [ESPIPE]        = TARGET_ESPIPE,
5544c1b
@@ -131,7 +135,9 @@ static uint32_t errno_h2g(int host_errno)
5544c1b
         [EDOM]          = TARGET_EDOM,
5544c1b
         [ERANGE]        = TARGET_ERANGE,
5544c1b
         [ENOSYS]        = TARGET_ENOSYS,
5544c1b
+#ifdef ELOOP
5544c1b
         [ELOOP]         = TARGET_ELOOP,
5544c1b
+#endif
5544c1b
     };
5544c1b
 
5544c1b
     if (host_errno == 0) {
5544c1b
-- 
5544c1b
1.7.12.1
5544c1b