8000 mpy-cross: Fix mingw and msys2 compilation · unixjazz/circuitpython@37b143c · GitHub
[go: up one dir, main page]

Skip to content

Commit 37b143c

Browse files
stinospfalcon
authored andcommitted
mpy-cross: Fix mingw and msys2 compilation
When compiling with msys2's gcc there's no need to apply the binary fmode so adjust the Makefile to reflect that. When compiling with mingw we need to include malloc.h since there is no alloca.h, and the 64bit detection in mpconfigport.h needs some adjustment.
1 parent 61e77a4 commit 37b143c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

mpy-cross/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ SRC_C = \
5050
gccollect.c \
5151

5252
ifeq ($(OS),Windows_NT)
53-
SRC_C += windows/fmode.c
53+
ifeq (,$(findstring MSYS,$(UNAME_S)))
54+
SRC_C += windows/fmode.c
55+
endif
5456
endif
5557

5658
OBJ = $(PY_O)

mpy-cross/mpconfigport.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@
8787
#ifdef __LP64__
8888
typedef long mp_int_t; // must be pointer size
8989
typedef unsigned long mp_uint_t; // must be pointer size
90+
#elif defined ( __MINGW32__ ) && defined( _WIN64 )
91+
#include <stdint.h>
92+
t 8249 ypedef __int64 mp_int_t;
93+
typedef unsigned __int64 mp_uint_t;
9094
#else
9195
// These are definitions for machines where sizeof(int) == sizeof(void*),
9296
// regardless for actual size.
@@ -115,6 +119,8 @@ typedef const void *machine_const_ptr_t; // must be of pointer size
115119
// We need to provide a declaration/definition of alloca()
116120
#ifdef __FreeBSD__
117121
#include <stdlib.h>
122+
#elif defined( _WIN32 )
123+
#include <malloc.h>
118124
#else
119125
#include <alloca.h>
120126
#endif

0 commit comments

Comments
 (0)
0