Index: otp/erts/etc/win32/erl_log.c =================================================================== --- otp.orig/erts/etc/win32/erl_log.c 2014-09-30 01:57:04.959641700 +0300 +++ otp/erts/etc/win32/erl_log.c 2014-09-30 01:57:10.286298300 +0300 @@ -32,7 +32,7 @@ static void print_last_error(char* message); -main() +int main(int argc, char *argv[]) { HANDLE in; HANDLE out; Index: otp/erts/emulator/drivers/win32/win_efile.c =================================================================== --- otp.orig/erts/emulator/drivers/win32/win_efile.c 2014-09-30 01:57:04.952975000 +0300 +++ otp/erts/emulator/drivers/win32/win_efile.c 2014-09-30 21:10:42.622164600 +0300 @@ -27,6 +27,7 @@ #include "sys.h" #include #include +#include #include "erl_efile.h" #define DBG_TRACE_MASK 0 @@ -81,15 +82,6 @@ (ft).dwHighDateTime = ull.HighPart; \ } while(0) - -static int check_error(int result, Efile_error* errInfo); -static int set_error(Efile_error* errInfo); -static int set_os_errno(Efile_error* errInfo, DWORD os_errno); -static int is_root_unc_name(const WCHAR *path); -static int extract_root(WCHAR *name); -static unsigned short dos_to_posix_mode(int attr, const WCHAR *name); - - struct wpath_tmp_buffer { struct wpath_tmp_buffer* next; WCHAR buffer[1]; @@ -98,7 +90,18 @@ typedef struct { Efile_error* errInfo; struct wpath_tmp_buffer* buf_list; -}Efile_call_state; +} Efile_call_state; + +static int check_error(int result, Efile_error* errInfo); +static int do_delete_file(Efile_call_state*, char*); +static int do_openfile(Efile_call_state*, char*, int, int*, Sint64*); +static int do_symlink(Efile_call_state*, char*, char*); +static int do_write_info(Efile_call_state*, Efile_info*, char*); +static int set_error(Efile_error* errInfo); +static int set_os_errno(Efile_error* errInfo, DWORD os_errno); +static int is_root_unc_name(const WCHAR *path); +static int extract_root(WCHAR *name); +static unsigned short dos_to_posix_mode(int attr, const WCHAR *name); static void call_state_init(Efile_call_state* state, Efile_error* errInfo) { Index: otp/erts/emulator/sys/win32/sys.c =================================================================== --- otp.orig/erts/emulator/sys/win32/sys.c 2014-09-30 01:57:04.959641700 +0300 +++ otp/erts/emulator/sys/win32/sys.c 2014-09-30 01:57:10.432964700 +0300 @@ -33,6 +33,7 @@ #include "../../drivers/win32/win_con.h" #include "erl_cpu_topology.h" #include +#include "../common/erl_check_io.h" void erts_sys_init_float(void); @@ -59,7 +60,9 @@ typedef struct driver_data DriverData; -static void init_console(); +struct async_io; + +static void init_console(void); static int get_and_remove_option(int* argc, char** argv, const char* option); static char *get_and_remove_option2(int *argc, char **argv, const char *option); @@ -149,7 +152,7 @@ HMODULE beam_module = NULL; -void erl_sys_init(); +void erl_sys_init(void); void erl_sys_args(int* argc, char** argv); @@ -376,10 +379,10 @@ } void -os_version(pMajor, pMinor, pBuild) -int* pMajor; /* Pointer to major version. */ -int* pMinor; /* Pointer to minor version. */ -int* pBuild; /* Pointer to build number. */ +os_version( + int * pMajor, /* Pointer to major version. */ + int * pMinor, /* Pointer to minor version. */ + int * pBuild) /* Pointer to build number. */ { *pMajor = int_os_version.dwMajorVersion; *pMinor = int_os_version.dwMinorVersion; @@ -922,8 +925,8 @@ if (aio->ov.hEvent == NULL) return -1; if (use_threads) { - OV_BUFFER_PTR(aio) = NULL; - OV_NUM_TO_READ(aio) = 0; + aio->ov.Internal = NULL; + aio->ov.InternalHigh = 0; aio->ioAllowed = CreateAutoEvent(FALSE); if (aio->ioAllowed == NULL) return -1; @@ -993,8 +996,8 @@ if (aio->thread != (HANDLE) -1) { DEBUGF(("async_read_file: signaling thread 0x%x, event 0x%x\n", aio->thread, aio->ioAllowed)); - OV_BUFFER_PTR(aio) = buf; - OV_NUM_TO_READ(aio) = numToRead; + aio->ov.Internal = (ULONG_PTR)buf; + aio->ov.InternalHigh = (ULONG_PTR)numToRead; ResetEvent(aio->ov.hEvent); SetEvent(aio->ioAllowed); } else { @@ -1043,8 +1046,8 @@ if (aio->thread != (HANDLE) -1) { DEBUGF(("async_write_file: signaling thread 0x%x, event 0x%x\n", aio->thread, aio->ioAllowed)); - OV_BUFFER_PTR(aio) = buf; - OV_NUM_TO_READ(aio) = numToWrite; + aio->ov.Internal = (ULONG_PTR)buf; + aio->ov.InternalHigh = (ULONG_PTR)numToWrite; ResetEvent(aio->ov.hEvent); SetEvent(aio->ioAllowed); } else { Index: otp/erts/emulator/sys/win32/dosmap.c =================================================================== --- otp.orig/erts/emulator/sys/win32/dosmap.c 2014-09-30 01:57:04.956308400 +0300 +++ otp/erts/emulator/sys/win32/dosmap.c 2014-09-30 01:57:10.466297900 +0300 @@ -24,7 +24,7 @@ /* Only use for win32 if linking to MSVCR??.DLL and not if statically linking to LIBCMT.LIB */ -#if defined(WIN32) && defined(_MT) && defined(_DLL) +#if defined(WIN32) #include #include Index: otp/erts/etc/win32/win_erlexec.c =================================================================== --- otp.orig/erts/etc/win32/win_erlexec.c 2014-09-30 00:39:07.223515900 +0300 +++ otp/erts/etc/win32/win_erlexec.c 2014-09-30 01:57:10.489631200 +0300 @@ -46,9 +46,7 @@ #define LOAD_BEAM_DYNAMICALLY 1 static int start(char* emu, char** argv); static void start_winsock(void); -static char* last_error(void); static char* last_wsa_error(void); -static char* win32_errorstr(int error); static int has_console(void); static char** fnuttify_argv(char **argv); static void free_fnuttified(char **v); @@ -400,7 +398,7 @@ exit(1); } -static char* +char* last_error(void) { return win32_errorstr(GetLastError()); @@ -412,7 +410,7 @@ * isn't called again. */ -static char* +char* win32_errorstr(int error) { static LPTSTR lpBufPtr = NULL; Index: otp/lib/wx/c_src/egl_impl.cpp =================================================================== --- otp.orig/lib/wx/c_src/egl_impl.cpp 2014-09-30 03:56:00.492034200 +0300 +++ otp/lib/wx/c_src/egl_impl.cpp 2014-09-30 03:56:01.988698700 +0300 @@ -74,11 +74,9 @@ # define OPENGLU_LIB "libGLU.so.1" # endif #endif -extern "C" { DRIVER_INIT(EGL_DRIVER) { return NULL; } -} int egl_init_opengl(void *erlCallbacks) {