Mark Jones' thread Re: Unicode in-line string literals sometimes produce error? (http://www.masm32.com/board/index.php?topic=9492.0) prompted me to do some tweaking to GoAsm's handling of conditional assembly within macros and structures.
It was not documented, but in previous versions of GoAsm you could use conditional assembly directly within a structure, for example:-
NMHDR STRUCT
hwndFrom DD
idFrom DD
code DD
ENDS
;
NMTTDISPINFO STRUCT
hdr NMHDR
lpszText DD
#if STRINGS UNICODE
szText DW 80 DUP ?
#else
szText DB 80 DUP ?
#endif
hinst DD
uFlags DD
lParam DD
ENDS
DATA
Use1 NMTTDISPINFO
Use2 NMTTDISPINFO <<>,,"Hello",,,,>
However, GoAsm was not initialising correctly in Use2 above. This has now been fixed, as well as Mark's issues.
This works ok on all my code, and unless I have accidentally introduced some errors it will form the basis of the next version of GoAsm.
[attachment deleted by admin]
I have now replaced this with GoAsm 0.56.04h
[attachment deleted by admin]
It doesn't seem to mind my headers, all of my current projects appear to assemble without errors, some are quite complex and will require some testing though. I have to decide whether my headers should use this feature, I like the idea of being able to use the W and A versions of a structure regardless of whether I am using strings unicode or not.
Found something - other than this though, I get proper builds for projects:
TBBUTTON STRUCT
iBitmap DD
idCommand DD
fsState DB
fsStyle DB
#ifdef _WIN64
bReserved DB 6 DUP ?
#else
bReserved DB 2 DUP ?
#endif
dwData DD
iString DD
ENDS
CODE
Start:
push SIZEOF TBBUTTON ;Line 1
mov eax,SIZEOF TBBUTTON ;Line 2
Error - could not get size of structure/union... occurs only for Line 1 when _WIN64 is not defined (switch order of lines and error does not occur). Although this assembles with _WIN64 defined, it looks like there is a size error (conditional perhaps throwing off automatic alignment/padding).
Hi Wayne
Thanks for spotting this, yes there was a problem - now fixed though.
In the proposed latest GoAsm attached 0.56.04k I've also improved error reporting from include files in the case of unclosed structs/macros/unions and continuation characters, error reporting in the case of unclosed conditional assembly, and corrected a couple of things when declaring data directly in a DUP.
[attachment deleted by admin]