Index: otp/erts/emulator/sys/win32/sys_float.c =================================================================== --- otp.orig/erts/emulator/sys/win32/sys_float.c 2014-09-29 00:35:14.235409800 +0300 +++ otp/erts/emulator/sys/win32/sys_float.c 2014-09-29 21:05:43.719389200 +0300 @@ -30,10 +30,26 @@ static void fpe_exception(int sig); +#if defined(__MINGW_GCC_VERSION) +#ifdef USE_MATHERR +int erts_matherr(struct _exception *exc); +void +erts_sys_init_float(void) +{ + __mingw_setusermatherr(erts_matherr); +} +#else void erts_sys_init_float(void) { } +#endif +#else +void +erts_sys_init_float(void) +{ +} +#endif void erts_thread_init_float(void) { } @@ -120,7 +136,7 @@ int sys_double_to_chars_ext(double fp, char *buffer, size_t buffer_size, size_t decimals) { - unsigned char *s = buffer; + char *s = buffer; if (erts_snprintf(buffer, buffer_size, "%.*e", decimals, fp) >= buffer_size) return -1; @@ -135,8 +151,13 @@ #ifdef USE_MATHERR +#if defined(__MINGW_GCC_VERSION) +int +erts_matherr(struct _exception *exc) +#else int matherr(struct _exception *exc) +#endif { erl_fp_exception = 1; DEBUGF(("FP exception (matherr) (0x%x) (%d)\n", exc->type, erl_fp_exception)); Index: otp/erts/etc/win32/erl.c =================================================================== --- otp.orig/erts/etc/win32/erl.c 2014-09-29 21:05:23.759414700 +0300 +++ otp/erts/etc/win32/erl.c 2014-09-29 21:05:43.752722500 +0300 @@ -248,9 +248,8 @@ free(dir); if (p == NULL) { error("Cannot find erlexec.exe"); - } else { - return p; } + return p; } static void get_parameters(void) Index: otp/erts/etc/win32/win_erlexec.c =================================================================== --- otp.orig/erts/etc/win32/win_erlexec.c 2014-09-29 00:35:14.235409800 +0300 +++ otp/erts/etc/win32/win_erlexec.c 2014-09-29 21:05:43.766055800 +0300 @@ -131,6 +131,7 @@ } } +void free_env_val(char *value) { if (value) Index: otp/lib/odbc/c_src/Makefile.in =================================================================== --- otp.orig/lib/odbc/c_src/Makefile.in 2014-09-29 21:05:42.069391300 +0300 +++ otp/lib/odbc/c_src/Makefile.in 2014-09-29 21:05:43.792722400 +0300 @@ -22,6 +22,7 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk USING_MINGW=@MIXED_CYGWIN_MINGW@ +BITS64=@BITS64@ ifeq ($(TYPE),debug) TYPEMARKER = .debug @@ -59,7 +60,9 @@ ENTRY_OBJ=$(ERL_TOP)/erts/obj/$(TARGET)/port_entry.o PORT_ENTRY_POINT=erl_port_entry ifeq ($(USING_MINGW), yes) +ifneq ($(BITS64), yes) ENTRY_LDFLAGS=-Xlinker --thumb-entry=$(PORT_ENTRY_POINT) +endif else ENTRY_LDFLAGS=-entry:$(PORT_ENTRY_POINT) endif Index: otp/lib/odbc/c_src/odbcserver.c =================================================================== --- otp.orig/lib/odbc/c_src/odbcserver.c 2014-09-29 21:05:36.022732400 +0300 +++ otp/lib/odbc/c_src/odbcserver.c 2014-09-29 21:05:43.816055700 +0300 @@ -134,7 +134,7 @@ /* ---------------- Main functions ---------------------------------------*/ static void spawn_sup(const char *port); #ifdef WIN32 -DWORD WINAPI database_handler(const char *port); +void WINAPI database_handler(const char *port); #else void database_handler(const char *port); #endif Index: otp/lib/odbc/configure.in =================================================================== --- otp.orig/lib/odbc/configure.in 2014-09-28 15:49:17.906250000 +0300 +++ otp/lib/odbc/configure.in 2014-09-29 21:05:43.856055700 +0300 @@ -248,4 +248,11 @@ LDFLAGS="$LDFLAGS $sanitizers" ]) +BITS64= + +if test $ac_cv_sizeof_void_p = 8; then + BITS64=yes +fi +AC_SUBST(BITS64) + AC_OUTPUT(c_src/$host/Makefile:c_src/Makefile.in) Index: otp/lib/wx/c_src/Makefile.in =================================================================== --- otp.orig/lib/wx/c_src/Makefile.in 2014-09-29 21:05:42.239391100 +0300 +++ otp/lib/wx/c_src/Makefile.in 2014-09-29 21:05:43.922722200 +0300 @@ -111,7 +111,7 @@ CC_O = $(V_CC) -c $(CFLAGS) $(WX_CFLAGS) $(COMMON_CFLAGS) OBJC_CC_O = $(OBJC_CC) -c $(CFLAGS) $(OBJC_CFLAGS) $(WX_CFLAGS) $(COMMON_CFLAGS) -CXX_O = $(V_CXX) -c $(CXX_FLAGS) $(WX_CXX_FLAGS) $(COMMON_CFLAGS) +CXX_O = $(V_CXX) -c -fpermissive $(CXX_FLAGS) $(WX_CXX_FLAGS) $(COMMON_CFLAGS) ifeq ($(SYS_TYPE),win32) GL_LIBS = -lopengl32 -lglu32