Index: otp/erts/emulator/sys/win32/sys_float.c =================================================================== --- otp.orig/erts/emulator/sys/win32/sys_float.c 2014-02-02 15:53:14.981602200 +0200 +++ otp/erts/emulator/sys/win32/sys_float.c 2014-02-02 16:01:44.776591200 +0200 @@ -31,10 +31,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) { } @@ -121,7 +137,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; @@ -136,8 +152,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-02-02 15:52:35.328125000 +0200 +++ otp/erts/etc/win32/erl.c 2014-02-02 16:01:44.899925000 +0200 @@ -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-02-02 15:53:15.328269700 +0200 +++ otp/erts/etc/win32/win_erlexec.c 2014-02-02 16:01:44.939925100 +0200 @@ -129,6 +129,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-02-02 15:53:52.521697000 +0200 +++ otp/lib/odbc/c_src/Makefile.in 2014-02-02 16:01:45.083259000 +0200 @@ -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-02-02 15:52:43.187500000 +0200 +++ otp/lib/odbc/c_src/odbcserver.c 2014-02-02 16:01:45.139925800 +0200 @@ -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 @@ -345,9 +345,9 @@ } #ifdef WIN32 -DWORD WINAPI database_handler(const char *port) +void WINAPI database_handler(const char *port) #else - void database_handler(const char *port) +void database_handler(const char *port) #endif { db_result_msg msg; Index: otp/lib/odbc/configure.in =================================================================== --- otp.orig/lib/odbc/configure.in 2014-02-02 15:52:43.187500000 +0200 +++ otp/lib/odbc/configure.in 2014-02-02 16:01:45.203259400 +0200 @@ -228,4 +228,11 @@ LM_TRY_ENABLE_CFLAG([-Werror=return-type], [CFLAGS]) fi +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-02-02 15:55:07.000000000 +0200 +++ otp/lib/wx/c_src/Makefile.in 2014-02-02 16:04:49.900558400 +0200 @@ -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) -CPP_O = $(V_CPP) -c $(CXX_FLAGS) $(WX_CXX_FLAGS) $(COMMON_CFLAGS) +CPP_O = $(V_CPP) -c -fpermissive $(CXX_FLAGS) $(WX_CXX_FLAGS) $(COMMON_CFLAGS) ifeq ($(SYS_TYPE),win32) GL_LIBS = -lopengl32 -lglu32