The MASM Forum Archive 2004 to 2012

Project Support Forums => GoAsm Assembler and Tools => Topic started by: Yuri on July 20, 2009, 04:31:19 PM

Title: Problem with nested structures' names
Post by: Yuri on July 20, 2009, 04:31:19 PM
The problem arises if I use generic names for nested structures, for example, HDITEM rather than directly HDITEMA or HDITEMW. To illustrate this, I have composed a simple example:

SampleA STRUCT
  a DD
  b DD
ENDS

#ifndef UNICODE
#define Sample SampleA
#endif

MyStruct1 STRUCT
  c Sample
  d DD
  e DD
ENDS

MyStruct2 STRUCT
  c SampleA
  d DD
  e DD
ENDS

; ==============================================================================

DATA SECTION

example1 MyStruct1
example2 MyStruct2
buf DB 100 DUP 0

; ==============================================================================

CODE SECTION

Start:
invoke msvcrt.dll:sprintf, addr buf, <"example1 size: %d",13,10,"example2 size: %d",0>, \
                                       sizeof example1, sizeof example2
add esp,16
invoke user32.dll:MessageBoxA, 0, addr buf, "Test", 0
ret


Here's what it reports to me:
Quote
---------------------------
Test
---------------------------
example1 size: 8

example2 size: 16
---------------------------
ОК   
---------------------------

The sizes are different, though Sample was defined to be the same as SampleA.
Title: Re: Problem with nested structures' names
Post by: jorgon on July 20, 2009, 07:01:07 PM
Hi Yuri

Thanks for paring down this bug making it easier to chase up.
I'm working on this and will come back to you.

Title: Re: Problem with nested structures' names
Post by: jorgon on July 21, 2009, 12:33:36 PM
Yuri

I've added this functionality in GoAsm Version 0.56.6e which can be obtained from this thread (http://www.masm32.com/board/index.php?topic=11895.0) to which you have contributed.

Title: Re: Problem with nested structures' names
Post by: Yuri on July 21, 2009, 04:46:59 PM
Thank you for the quick help, Jeremy! Now everything is OK.  :)