winefile: Fix the compilation when _NO_EXTENSIONS is defined.
Francois Gouget
fgouget at free.fr
Wed Mar 30 09:57:46 CDT 2011
---
This patch should be independent from the other winefile patches.
It fixes compilation errors and warnings when _NO_EXTENSIONS is defined.
I think this macro should be dropped. The tricky part is that it
controls various aspects of winefile like:
* whether we show '.' and '..'
* whether we show the ctime, mtime and atime and other properties
(the GUI should actually make this configurable)
* whether to show '/'
* probably more
So I think we should pick some code from both the #ifndef and #ifdef
branches to get the exact behavior we want to see in winefile. In some
cases this may even mean replacing this macro with __WINE__ checks.
But at least now it should compile fine with or without _NO_EXTENSIONS.
programs/winefile/winefile.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c
index 40175f0..51a889d 100644
--- a/programs/winefile/winefile.c
+++ b/programs/winefile/winefile.c
@@ -2105,6 +2105,7 @@ static BOOL activate_drive_window(LPCWSTR path)
return FALSE;
}
+#ifndef _NO_EXTENSIONS
static BOOL activate_fs_window(LPCWSTR filesys)
{
HWND child_wnd;
@@ -2127,6 +2128,7 @@ static BOOL activate_fs_window(LPCWSTR filesys)
return FALSE;
}
+#endif /* _NO_EXTENSIONS */
static LRESULT CALLBACK FrameWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
{
@@ -2562,6 +2564,7 @@ static BOOL calc_widths(Pane* pane, BOOL anyway)
}
+#ifndef _NO_EXTENSIONS
/* calculate one preferred column width */
static void calc_single_width(Pane* pane, int col)
@@ -2620,6 +2623,7 @@ static void calc_single_width(Pane* pane, int col)
SendMessageW(pane->hwnd, LB_SETHORIZONTALEXTENT, x, 0);
}
+#endif /* _NO_EXTENSIONS */
static BOOL pattern_match(LPCWSTR str, LPCWSTR pattern)
@@ -3314,7 +3318,7 @@ static void draw_item(Pane* pane, LPDRAWITEMSTRUCT dis, Entry* entry, int calcWi
} else
hpen = CreatePen(PS_DOT, 0, RGB(255,255,255));
- lastPen = SelectPen(dis->hDC, hpen);
+ lastPen = SelectObject(dis->hDC, hpen);
lastBrush = SelectObject(dis->hDC, GetStockObject(HOLLOW_BRUSH));
SetROP2(dis->hDC, R2_XORPEN);
Rectangle(dis->hDC, focusRect.left, focusRect.top, focusRect.right, focusRect.bottom);
@@ -3986,6 +3990,7 @@ static BOOL CtxMenu_HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam)
}
+#ifndef _NO_EXTENSIONS
static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParent, int cidl, LPCITEMIDLIST* apidl, int x, int y)
{
IContextMenu* pcm;
@@ -4031,6 +4036,7 @@ static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParen
return FAILED(hr)? hr: executed? S_OK: S_FALSE;
}
+#endif /* _NO_EXTENSIONS */
static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
@@ -4681,7 +4687,7 @@ static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam)
{
WCHAR cls[128];
- GetClassName(hwnd, cls, 128);
+ GetClassNameW(hwnd, cls, 128);
if (!lstrcmpW(cls, (LPCWSTR)lparam)) {
g_foundPrevInstance++;
--
1.7.4.1
More information about the wine-patches
mailing list