Skip to content

Commit

Permalink
handle errno defns for mingw and use correct executable name
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed Jul 11, 2018
1 parent 85d5d32 commit d305e7d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@ TAGS
#################
*.orig

# Emacs backup files
####################
*~

*.DS_Store
6 changes: 6 additions & 0 deletions mpy-cross/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ endif
include ../py/mkenv.mk

# define main target

ifeq ($(OS),Windows_NT)
# Detect a MINGW32 build, and change the name of the final executable.
PROG = mpy-cross.exe
else
PROG = mpy-cross
endif

# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h
Expand Down
44 changes: 44 additions & 0 deletions mpy-cross/mpconfigport.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,50 @@
#define MICROPY_PY_IO (0)
#define MICROPY_PY_SYS (0)

// MINGW only handles these errno names.
#ifdef __MINGW32__
#define MICROPY_PY_UERRNO_LIST \
X(EPERM) \
X(ENOENT) \
X(ESRCH) \
X(EINTR) \
X(EIO) \
X(ENXIO) \
X(E2BIG) \
X(ENOEXEC) \
X(EBADF) \
X(ECHILD) \
X(EAGAIN) \
X(ENOMEM) \
X(EACCES) \
X(EFAULT) \
X(EBUSY) \
X(EEXIST) \
X(EXDEV) \
X(ENODEV) \
X(ENOTDIR) \
X(EISDIR) \
X(EINVAL) \
X(ENFILE) \
X(EMFILE) \
X(ENOTTY) \
X(EFBIG) \
X(ENOSPC) \
X(ESPIPE) \
X(EROFS) \
X(EMLINK) \
X(EPIPE) \
X(EDOM) \
X(ERANGE) \
X(EDEADLOCK) \
X(EDEADLK) \
X(ENAMETOOLONG) \
X(ENOLCK) \
X(ENOSYS) \
X(ENOTEMPTY) \
X(EILSEQ)
#endif

// type definitions for the specific machine

#ifdef __LP64__
Expand Down

0 comments on commit d305e7d

Please sign in to comment.