1 From 33e25a4a6c6dc7632b15ee50637d33b4c3cf729e Mon Sep 17 00:00:00 2001
2 From: Max Filippov <jcmvbkbc@gmail.com>
3 Date: Thu, 6 Sep 2012 04:36:46 +0400
4 Subject: [PATCH] target-xtensa: fix missing errno codes for mingw32
6 Put the following errno value mappings under #ifdef:
8 xtensa-semi.c: In function 'errno_h2g':
9 xtensa-semi.c:113: error: 'ENOTBLK' undeclared (first use in this function)
10 xtensa-semi.c:113: error: (Each undeclared identifier is reported only once
11 xtensa-semi.c:113: error: for each function it appears in.)
12 xtensa-semi.c:113: error: array index in initializer not of integer type
13 xtensa-semi.c:113: error: (near initialization for 'guest_errno')
14 xtensa-semi.c:124: error: 'ETXTBSY' undeclared (first use in this function)
15 xtensa-semi.c:124: error: array index in initializer not of integer type
16 xtensa-semi.c:124: error: (near initialization for 'guest_errno')
17 xtensa-semi.c:134: error: 'ELOOP' undeclared (first use in this function)
18 xtensa-semi.c:134: error: array index in initializer not of integer type
19 xtensa-semi.c:134: error: (near initialization for 'guest_errno')
21 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
22 Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
23 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
25 target-xtensa/xtensa-semi.c | 6 ++++++
26 1 file changed, 6 insertions(+)
28 diff --git a/target-xtensa/xtensa-semi.c b/target-xtensa/xtensa-semi.c
29 index e745bef..52be07a 100644
30 --- a/target-xtensa/xtensa-semi.c
31 +++ b/target-xtensa/xtensa-semi.c
32 @@ -110,7 +110,9 @@ static uint32_t errno_h2g(int host_errno)
33 [ENOMEM] = TARGET_ENOMEM,
34 [EACCES] = TARGET_EACCES,
35 [EFAULT] = TARGET_EFAULT,
37 [ENOTBLK] = TARGET_ENOTBLK,
39 [EBUSY] = TARGET_EBUSY,
40 [EEXIST] = TARGET_EEXIST,
41 [EXDEV] = TARGET_EXDEV,
42 @@ -121,7 +123,9 @@ static uint32_t errno_h2g(int host_errno)
43 [ENFILE] = TARGET_ENFILE,
44 [EMFILE] = TARGET_EMFILE,
45 [ENOTTY] = TARGET_ENOTTY,
47 [ETXTBSY] = TARGET_ETXTBSY,
49 [EFBIG] = TARGET_EFBIG,
50 [ENOSPC] = TARGET_ENOSPC,
51 [ESPIPE] = TARGET_ESPIPE,
52 @@ -131,7 +135,9 @@ static uint32_t errno_h2g(int host_errno)
54 [ERANGE] = TARGET_ERANGE,
55 [ENOSYS] = TARGET_ENOSYS,
57 [ELOOP] = TARGET_ELOOP,
61 if (host_errno == 0) {