aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/drivers')
-rw-r--r--erts/emulator/drivers/common/gzio.c2
-rw-r--r--erts/emulator/drivers/common/inet_drv.c71
-rw-r--r--erts/emulator/drivers/win32/ttsl_drv.c3
-rw-r--r--erts/emulator/drivers/win32/win_con.c101
-rw-r--r--erts/emulator/drivers/win32/win_efile.c3
5 files changed, 162 insertions, 18 deletions
diff --git a/erts/emulator/drivers/common/gzio.c b/erts/emulator/drivers/common/gzio.c
index 741cb6ae20..a9303d55bc 100644
--- a/erts/emulator/drivers/common/gzio.c
+++ b/erts/emulator/drivers/common/gzio.c
@@ -27,7 +27,9 @@
#endif
#ifdef __WIN32__
+#ifndef HAVE_CONFLICTING_FREAD_DECLARATION
#define HAVE_CONFLICTING_FREAD_DECLARATION
+#endif
#define FILENAMES_16BIT 1
#endif
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 7d952b0c71..e0d869f328 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -110,6 +110,77 @@
#undef EWOULDBLOCK
#undef ETIMEDOUT
+#ifdef EINPROGRESS
+#undef EINPROGRESS
+#endif
+#ifdef EALREADY
+#undef EALREADY
+#endif
+#ifdef ENOTSOCK
+#undef ENOTSOCK
+#endif
+#ifdef EDESTADDRREQ
+#undef EDESTADDRREQ
+#endif
+#ifdef EMSGSIZE
+#undef EMSGSIZE
+#endif
+#ifdef EPROTOTYPE
+#undef EPROTOTYPE
+#endif
+#ifdef ENOPROTOOPT
+#undef ENOPROTOOPT
+#endif
+#ifdef EPROTONOSUPPORT
+#undef EPROTONOSUPPORT
+#endif
+#ifdef EOPNOTSUPP
+#undef EOPNOTSUPP
+#endif
+#ifdef EAFNOSUPPORT
+#undef EAFNOSUPPORT
+#endif
+#ifdef EADDRINUSE
+#undef EADDRINUSE
+#endif
+#ifdef EADDRNOTAVAIL
+#undef EADDRNOTAVAIL
+#endif
+#ifdef ENETDOWN
+#undef ENETDOWN
+#endif
+#ifdef ENETUNREACH
+#undef ENETUNREACH
+#endif
+#ifdef ENETRESET
+#undef ENETRESET
+#endif
+#ifdef ECONNABORTED
+#undef ECONNABORTED
+#endif
+#ifdef ECONNRESET
+#undef ECONNRESET
+#endif
+#ifdef ENOBUFS
+#undef ENOBUFS
+#endif
+#ifdef EISCONN
+#undef EISCONN
+#endif
+#ifdef ENOTCONN
+#undef ENOTCONN
+#endif
+#ifdef ECONNREFUSED
+#undef ECONNREFUSED
+#endif
+#ifdef ELOOP
+#undef ELOOP
+#endif
+#ifdef EHOSTUNREACH
+#undef EHOSTUNREACH
+#endif
+
+
#define HAVE_MULTICAST_SUPPORT
#define ERRNO_BLOCK WSAEWOULDBLOCK
diff --git a/erts/emulator/drivers/win32/ttsl_drv.c b/erts/emulator/drivers/win32/ttsl_drv.c
index fd88dafd34..e636761c67 100644
--- a/erts/emulator/drivers/win32/ttsl_drv.c
+++ b/erts/emulator/drivers/win32/ttsl_drv.c
@@ -21,6 +21,9 @@
* smart line for output.
*/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "sys.h"
#include <ctype.h>
#include <stdlib.h>
diff --git a/erts/emulator/drivers/win32/win_con.c b/erts/emulator/drivers/win32/win_con.c
index c788ad409d..6b45b92cbe 100644
--- a/erts/emulator/drivers/win32/win_con.c
+++ b/erts/emulator/drivers/win32/win_con.c
@@ -21,6 +21,9 @@
#define _UNICODE 1
#include <tchar.h>
#include <stdio.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "sys.h"
#include <windowsx.h>
#include "resource.h"
@@ -34,6 +37,23 @@
#define REALLOC(X,Y) realloc(X,Y)
#define FREE(X) free(X)
+#if SIZEOF_VOID_P == 8
+#define WIN64 1
+#ifndef GCL_HBRBACKGROUND
+#define GCL_HBRBACKGROUND GCLP_HBRBACKGROUND
+#endif
+#define DIALOG_PROC_RET INT_PTR
+#define CF_HOOK_RET INT_PTR
+#define CC_HOOK_RET INT_PTR
+#define OFN_HOOK_RET INT_PTR
+#else
+#define DIALOG_PROC_RET BOOL
+#define CF_HOOK_RET UINT
+#define CC_HOOK_RET UINT
+#define OFN_HOOK_RET UINT
+#endif
+
+
#ifndef STATE_SYSTEM_INVISIBLE
/* Mingw problem with oleacc.h and WIN32_LEAN_AND_MEAN */
#define STATE_SYSTEM_INVISIBLE 0x00008000
@@ -150,7 +170,7 @@ static TCHAR *erlang_window_title = TEXT("Erlang");
static unsigned __stdcall ConThreadInit(LPVOID param);
static LRESULT CALLBACK ClientWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
-static BOOL CALLBACK AboutDlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam);
+static DIALOG_PROC_RET CALLBACK AboutDlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam);
static ScreenLine_t *ConNewLine(void);
static void DeleteTopLine(void);
static void ensure_line_below(void);
@@ -1608,7 +1628,7 @@ OnEditSelAll(HWND hwnd)
InvalidateRect(hwnd, NULL, TRUE);
}
-UINT APIENTRY CFHookProc(HWND hDlg,UINT iMsg,WPARAM wParam,LPARAM lParam)
+CF_HOOK_RET APIENTRY CFHookProc(HWND hDlg,UINT iMsg,WPARAM wParam,LPARAM lParam)
{
/* Hook procedure for font dialog box */
HWND hOwner;
@@ -1626,11 +1646,11 @@ UINT APIENTRY CFHookProc(HWND hDlg,UINT iMsg,WPARAM wParam,LPARAM lParam)
OffsetRect(&rc, -rcDlg.right, -rcDlg.bottom);
SetWindowPos(hDlg,HWND_TOP,rcOwner.left + (rc.right / 2),
rcOwner.top + (rc.bottom / 2),0,0,SWP_NOSIZE);
- return 1;
+ return (CF_HOOK_RET) 1;
default:
break;
}
- return 0; /* Let the default procedure process the message */
+ return (CF_HOOK_RET) 0; /* Let the default procedure process the message */
}
static BOOL
@@ -1705,7 +1725,7 @@ ConSetFont(HWND hwnd)
InvalidateRect(hwnd, NULL, TRUE);
}
-UINT APIENTRY
+CC_HOOK_RET APIENTRY
CCHookProc(HWND hDlg,UINT iMsg,WPARAM wParam,LPARAM lParam)
{
/* Hook procedure for choose color dialog box */
@@ -1724,11 +1744,11 @@ CCHookProc(HWND hDlg,UINT iMsg,WPARAM wParam,LPARAM lParam)
OffsetRect(&rc, -rcDlg.right, -rcDlg.bottom);
SetWindowPos(hDlg,HWND_TOP,rcOwner.left + (rc.right / 2),
rcOwner.top + (rc.bottom / 2),0,0,SWP_NOSIZE);
- return 1;
+ return (CC_HOOK_RET) 1;
default:
break;
}
- return 0; /* Let the default procedure process the message */
+ return (CC_HOOK_RET) 0; /* Let the default procedure process the message */
}
void ConChooseColor(HWND hwnd)
@@ -1758,7 +1778,8 @@ void ConChooseColor(HWND hwnd)
}
}
-UINT APIENTRY OFNHookProc(HWND hwndDlg,UINT iMsg,WPARAM wParam,LPARAM lParam)
+OFN_HOOK_RET APIENTRY OFNHookProc(HWND hwndDlg,UINT iMsg,
+ WPARAM wParam,LPARAM lParam)
{
/* Hook procedure for open file dialog box */
HWND hOwner,hDlg;
@@ -1777,11 +1798,11 @@ UINT APIENTRY OFNHookProc(HWND hwndDlg,UINT iMsg,WPARAM wParam,LPARAM lParam)
OffsetRect(&rc, -rcDlg.right, -rcDlg.bottom);
SetWindowPos(hDlg,HWND_TOP,rcOwner.left + (rc.right / 2),
rcOwner.top + (rc.bottom / 2),0,0,SWP_NOSIZE);
- return 1;
+ return (OFN_HOOK_RET) 1;
default:
break;
}
- return 0; /* the let default procedure process the message */
+ return (OFN_HOOK_RET) 0; /* the let default procedure process the message */
}
static void
@@ -1933,7 +1954,7 @@ write_outbuf(TCHAR *data, int num_chars)
return num_chars;
}
-BOOL CALLBACK AboutDlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
+DIALOG_PROC_RET CALLBACK AboutDlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
HWND hOwner;
RECT rc,rcOwner,rcDlg;
@@ -1953,17 +1974,17 @@ BOOL CALLBACK AboutDlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
rcOwner.top + (rc.bottom / 2),0,0,SWP_NOSIZE);
SetDlgItemText(hDlg, ID_VERSIONSTRING,
TEXT("Erlang emulator version ") TEXT(ERLANG_VERSION));
- return TRUE;
+ return (DIALOG_PROC_RET) TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
case IDCANCEL:
EndDialog(hDlg,0);
- return TRUE;
+ return (DIALOG_PROC_RET) TRUE;
}
break;
}
- return FALSE;
+ return (DIALOG_PROC_RET) FALSE;
}
static void
@@ -2117,7 +2138,7 @@ AddToCmdHistory(void)
}
}
-static TBBUTTON tbb[] =
+/*static TBBUTTON tbb[] =
{
0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
@@ -2149,6 +2170,39 @@ static TBBUTTON tbb[] =
2, IDMENU_FONT, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, 0, 0, 0, 0,
3, IDMENU_ABOUT, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE, 0, 0, 0, 0,
0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0, 0, 0,
+ };*/
+static TBBUTTON tbb[] =
+{
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {0, IDMENU_COPY, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE},
+ {1, IDMENU_PASTE, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE},
+ {2, IDMENU_FONT, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE},
+ {3, IDMENU_ABOUT, TBSTATE_ENABLED, TBSTYLE_AUTOSIZE},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP}
};
static TBADDBITMAP tbbitmap =
@@ -2156,6 +2210,17 @@ static TBADDBITMAP tbbitmap =
HINST_COMMCTRL, IDB_STD_SMALL_COLOR,
};
+#ifdef HARDDEBUG
+/* For really hard GUI startup debugging, place DEBUGBOX() macros in code
+ and get modal message boxes with the line number. */
+static void debug_box(int line) {
+ TCHAR buff[1024];
+ swprintf(buff,1024,TEXT("DBG:%d"),line);
+ MessageBox(NULL,buff,TEXT("DBG"),MB_OK|MB_APPLMODAL);
+}
+
+#define DEBUGBOX() debug_box(__LINE__)
+#endif
static HWND
InitToolBar(HWND hwndParent)
@@ -2169,7 +2234,6 @@ InitToolBar(HWND hwndParent)
COLORMAP colorMap;
colorMap.from = RGB(192, 192, 192);
colorMap.to = backgroundColor;
-
/* Create toolbar window with tooltips */
hwndTB = CreateWindowEx(0,TOOLBARCLASSNAME,(TCHAR *)NULL,
WS_CHILD|CCS_TOP|WS_CLIPSIBLINGS|TBSTYLE_TOOLTIPS,
@@ -2180,9 +2244,10 @@ InitToolBar(HWND hwndParent)
tbbitmap.hInst = NULL;
tbbitmap.nID = (UINT) CreateMappedBitmap(beam_module, 1,0, &colorMap, 1);
SendMessage(hwndTB, TB_ADDBITMAP, (WPARAM) 4,
- (WPARAM) &tbbitmap);
+ (LPARAM) &tbbitmap);
+
SendMessage(hwndTB,TB_ADDBUTTONS, (WPARAM) 30,
- (LPARAM) (LPTBBUTTON) tbb);
+ (LPARAM) tbb);
if (toolbarVisible)
ShowWindow(hwndTB, SW_SHOW);
diff --git a/erts/emulator/drivers/win32/win_efile.c b/erts/emulator/drivers/win32/win_efile.c
index 931bb196f1..0bc701c4cb 100644
--- a/erts/emulator/drivers/win32/win_efile.c
+++ b/erts/emulator/drivers/win32/win_efile.c
@@ -21,6 +21,9 @@
*/
#include <windows.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "sys.h"
#include <ctype.h>
#include <wchar.h>