Hi
Now I'm going after PMColour.
https://github.com/OS2World/DEV-SAMPLES-PM-PMColour
It compiled and works with the tools I decided to use. I just have this warning about a pointer that I don't know how to solve it.
gcc -Wall -Zomf -c -O2 pmcolour.c -o pmcolour.obj
pmcolour.c: In function 'DlgProc':
pmcolour.c:116:23: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
116 | *cwdata->rgb = *((RGB *) &mp1);
| ~^~~~~~~~~~~~~
gcc -Zomf pmcolour.obj pmcolour.res pmcolour.def -o pmcolour.exe
wrc pmcolour.res
Open Watcom Windows and OS/2 Resource Compiler Version 2.0beta1 LA
Portions Copyright (c) 1993-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
Any tip is welcome.
Regards
First, try this: *cwdata->rgb = (RGB)mp1;
If that still does not work, then consult the gcc Compiler's manual and see how you can disable the "strict-aliasing" warning.
"-Wstrict-aliasing" enables it so maybe "-Wno-strict-aliasing" disables it. You will have to find out.
The story behind this warning: first you tell gcc that mp1 is of type MPARAM which effectively evaluates to ULONG aka unsigned long int.
That would mean that &mp1 is a pointer to unsigned long int. Then all of a sudden you tell it that &mp1 is a pointer to an RGB.
Since gcc is a picky smartass it tells you that it's not ok to first claim it is a pointer to an unsigned long int and later claim it is a pointer to an RGB.