Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d305e7d

Browse files
committed
handle errno defns for mingw and use correct executable name
1 parent 85d5d32 commit d305e7d

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,8 @@ TAGS
5858
#################
5959
*.orig
6060

61+
# Emacs backup files
62+
####################
63+
*~
64+
6165
*.DS_Store

mpy-cross/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ endif
1414
include ../py/mkenv.mk
1515

1616
# define main target
17+
18+
ifeq ($(OS),Windows_NT)
19+
# Detect a MINGW32 build, and change the name of the final executable.
20+
PROG = mpy-cross.exe
21+
else
1722
PROG = mpy-cross
23+
endif
1824

1925
# qstr definitions (must come before including py.mk)
2026
QSTR_DEFS = qstrdefsport.h

mpy-cross/mpconfigport.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,50 @@
8585
#define MICROPY_PY_IO (0)
8686
#define MICROPY_PY_SYS (0)
8787

88+
// MINGW only handles these errno names.
89+
#ifdef __MINGW32__
90+
#define MICROPY_PY_UERRNO_LIST \
91+
X(EPERM) \
92+
X(ENOENT) \
93+
X(ESRCH) \
94+
X(EINTR) \
95+
X(EIO) \
96+
X(ENXIO) \
97+
X(E2BIG) \
98+
X(ENOEXEC) \
99+
X(EBADF) \
100+
X(ECHILD) \
101+
X(EAGAIN) \
102+
X(ENOMEM) \
103+
X(EACCES) \
104+
X(EFAULT) \
105+
X(EBUSY) \
106+
X(EEXIST) \
107+
X(EXDEV) \
108+
X(ENODEV) \
109+
X(ENOTDIR) \
110+
X(EISDIR) \
111+
X(EINVAL) \
112+
X(ENFILE) \
113+
X(EMFILE) \
114+
X(ENOTTY) \
115+
X(EFBIG) \
116+
X(ENOSPC) \
117+
X(ESPIPE) \
118+
X(EROFS) \
119+
X(EMLINK) \
120+
X(EPIPE) \
121+
X(EDOM) \
122+
X(ERANGE) \
123+
X(EDEADLOCK) \
124+
X(EDEADLK) \
125+
X(ENAMETOOLONG) \
126+
X(ENOLCK) \
127+
X(ENOSYS) \
128+
X(ENOTEMPTY) \
129+
X(EILSEQ)
130+
#endif
131+
88132
// type definitions for the specific machine
89133

90134
#ifdef __LP64__

0 commit comments

Comments
 (0)