Skip to content
Snippets Groups Projects
Commit 37b143ce authored by stijn's avatar stijn Committed by Paul Sokolovsky
Browse files

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.
parent 61e77a4e
No related branches found
No related tags found
No related merge requests found
...@@ -50,8 +50,10 @@ SRC_C = \ ...@@ -50,8 +50,10 @@ SRC_C = \
gccollect.c \ gccollect.c \
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
ifeq (,$(findstring MSYS,$(UNAME_S)))
SRC_C += windows/fmode.c SRC_C += windows/fmode.c
endif endif
endif
OBJ = $(PY_O) OBJ = $(PY_O)
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
......
...@@ -87,6 +87,10 @@ ...@@ -87,6 +87,10 @@
#ifdef __LP64__ #ifdef __LP64__
typedef long mp_int_t; // must be pointer size typedef long mp_int_t; // must be pointer size
typedef unsigned long mp_uint_t; // must be pointer size typedef unsigned long mp_uint_t; // must be pointer size
#elif defined ( __MINGW32__ ) && defined( _WIN64 )
#include <stdint.h>
typedef __int64 mp_int_t;
typedef unsigned __int64 mp_uint_t;
#else #else
// These are definitions for machines where sizeof(int) == sizeof(void*), // These are definitions for machines where sizeof(int) == sizeof(void*),
// regardless for actual size. // regardless for actual size.
...@@ -115,6 +119,8 @@ typedef const void *machine_const_ptr_t; // must be of pointer size ...@@ -115,6 +119,8 @@ typedef const void *machine_const_ptr_t; // must be of pointer size
// We need to provide a declaration/definition of alloca() // We need to provide a declaration/definition of alloca()
#ifdef __FreeBSD__ #ifdef __FreeBSD__
#include <stdlib.h> #include <stdlib.h>
#elif defined( _WIN32 )
#include <malloc.h>
#else #else
#include <alloca.h> #include <alloca.h>
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment