|
From: sfeam (E. Merritt) <eam...@gm...> - 2013-07-24 15:53:35
|
On Wednesday, 24 July 2013, Allin Cottrell wrote:
> I have need of a 64-bit Windows build of gnuplot and I've been
> working on cross-compiling from Linux using mingw64. I see
> several places in current CVS where the code generates errors
> and warnings. I'm attaching a patch-set which quells the
> errors and warnings, but unfortunately I'm not able to test on
> win64 at present.
I can't help with evaluation of the full patch, but one set of
changes strikes me as being wrong on the face of it:
%%%%%%%%%%%%%%
+#ifdef _WIN64
+INT_PTR CALLBACK PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
+#else
BOOL CALLBACK PrintDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
+#endif
%%%%%%%%%%%%%%
There's no way it can be correct to label a Boolean value as a pointer.
The equivalent substitution occurs several places in your patch.
I didn't check each one, but the routine PrintDlgProc really does return
TRUE or FALSE, so I think at least in this case, if not all of them,
the original code was correct.
Ethan
>
> If I'm understanding the code correctly there's one place that
> I haven't patched which may be a problem, namely the
> definition of struct tagLS in win/wgraph.c. The first member
> of this struct is an int ("widtype"). I believe it should be
> redefined for win64 as LONG_PTR, since it is assigned to via
> the function GetWindowLong(), which maps to GetWindowLongPtr()
> on win64, and the latter returns a 64-bit pointer.
>
> Some of the changes I've made are actually OK for win32, from
> Windows 2000 onward. But I guess gnuplot aims to support older
> Windows versions than that; I've therefore bracketed all my
> changes with "#ifdef _WIN64" so as to leave the 32-bit code
> unaffected.
>
> --
> Allin Cottrell
> Department of Economics
> Wake Forest University, NC
|