From d305e7d6cfea2e336784d756997e4da725041f83 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 Jul 2018 22:29:36 -0400 Subject: [PATCH] handle errno defns for mingw and use correct executable name --- .gitignore | 4 ++++ mpy-cross/Makefile | 6 ++++++ mpy-cross/mpconfigport.h | 44 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/.gitignore b/.gitignore index aa4ff6dab2c2..4f4c91d82edd 100644 --- a/.gitignore +++ b/.gitignore @@ -58,4 +58,8 @@ TAGS ################# *.orig +# Emacs backup files +#################### +*~ + *.DS_Store diff --git a/mpy-cross/Makefile b/mpy-cross/Makefile index 7764d5bef947..c9b6cca0f328 100644 --- a/mpy-cross/Makefile +++ b/mpy-cross/Makefile @@ -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 diff --git a/mpy-cross/mpconfigport.h b/mpy-cross/mpconfigport.h index e227d1be5484..04f9a24d5c69 100644 --- a/mpy-cross/mpconfigport.h +++ b/mpy-cross/mpconfigport.h @@ -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__