On Mon, 23 Feb 2009, [email protected] wrote:
> Log Message:
> -----------
> 2009-02-23 09:04 UTC-0800 Pritpal Bedi ([email protected])
>   * harbour/contrib/gtwvg/wvgwin.c
>     + #define NONAMELESSUNION
>       It may fix OW' few warnings. Please test.

Hi Pritpal,

The above breaks MinGW compilation.

../../wvgwin.c:1617: error: structure has no member named `item'
../../wvgwin.c:1618: error: structure has no member named `item'
../../wvgwin.c:1619: error: structure has no member named `item'
../../wvgwin.c:1623: error: structure has no member named `item'
../../wvgwin.c:1625: error: structure has no member named `item'

You cannot use NONAMELESSUNION and then access union members without
union name.

My second question is why you are trying to redefine structures from
windows header files?

   #ifdef UNICODE
   typedef struct tagTVINSERTSTRUCTW
   {
     HTREEITEM hParent;
     HTREEITEM hInsertAfter;
     TV_ITEMW  item;
   } TVINSERTSTRUCTW, FAR *LPTVINSERTSTRUCTW;
   #else
   typedef struct tagTVINSERTSTRUCTA
   {
     HTREEITEM hParent;
     HTREEITEM hInsertAfter;
     TV_ITEMA  item;
   } TVINSERTSTRUCTA, FAR *LPTVINSERTSTRUCTA;
   #endif

This is very danger and may cause unpredictable results even if
you exactly copy the definition. Just simply windows needs
#pragma pack(...) for some definitions and such copied definitions
does not respect pack/alignment header settings at all.
Never make anything like that as long as it's not strictly necessary
and you very well know possible alignment interactions so you are
sure that it will work in all cases.

best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to