Progress! Structure and union definitions ( including nested ) and natural size alignment are now fully implemented!
I
stink think:
- I found an Easter Egg.
- NASMX_STRUC macro, forgot to define, a structure size.
In this thread, i posted, some where above, file named: "win64_demo1.asm",
it show's that CREATESTRUCT_size variable is and was recognized.
But current test, on "Commit [r202]" (Latest snapshot), shows that something went\gone wrong,
OR at least, there is some, new "structure size" variable.
Just look, code file: "nasmx-code-202-trunk\demos\win64\DEMO1\demo1.asm", was updated to:
;// DEMO1.ASM
;//
;// Copyright (C)2005-2011 The NASMX Project
;//
;// This is a fully UNICODE aware, typedefined demo that demonstrates
;// using NASMX typedef system to make your code truly portable between
;// 32 and 64-bit systems using either ASCII or UNICODE
;//
;// Contributors:
;// Bryant Keller
;// Rob Neff
;//
%include 'windemos.inc'
entry demo1
[section .code]
proc demo1, ptrdiff_t argcount, ptrdiff_t cmdline
locals none
; CREATESTRUCT
; -----------------------------------------------------------------------------------
invoke wsprintfA,buffer,txt_number,txt_CREATESTRUCT,CREATESTRUCT.lpCreateParams
invoke wsprintfA,buffer,txt_number,txt_CREATESTRUCT,CREATESTRUCT_size
invoke wsprintfA,buffer,txt_number,txt_CREATESTRUCT,CREATESTRUCT_Size
invoke wsprintfA,buffer,txt_number,txt_CREATESTRUCT,CREATESTRUCT_SIZE
invoke MessageBoxA, NULL, buffer, NULL, MB_OK
invoke ExitProcess, NULL
endproc
[section .data]
buffer: times 250 db 0
txt_number: declare(NASMX_TCHAR) NASMX_TEXT('%s, %d'), 0x0
txt_CREATESTRUCT: declare(NASMX_TCHAR) NASMX_TEXT('CREATESTRUCT'), 0x0
NASMX_STRUC CREATESTRUCT
NASMX_RESERVE lpCreateParams, ptrdiff_t, 1
NASMX_RESERVE hInstance, ptrdiff_t, 1
NASMX_RESERVE hMenu, ptrdiff_t, 1
NASMX_RESERVE hWndParent, ptrdiff_t, 1
NASMX_RESERVE cy, int32_t, 1
NASMX_RESERVE cx, int32_t, 1
NASMX_RESERVE y, int32_t, 1
NASMX_RESERVE x, int32_t, 1
NASMX_RESERVE style, int32_t, 1
NASMX_RESERVE lpszName, ptrdiff_t, 1
NASMX_RESERVE lpszClass, ptrdiff_t, 1
NASMX_RESERVE ExStyle, int32_t, 1
NASMX_ENDSTRUC
AND,
It produces, compile output:
DEMO1.asm:25: error: symbol `CREATESTRUCT_size' undefined
DEMO1.asm:26: error: symbol `CREATESTRUCT_Size' undefined
DEMO1.asm:27: error: symbol `CREATESTRUCT_SIZE' undefined
Usage of variable "CREATESTRUCT.lpCreateParams", proves, that CREATESTRUCT is defined.
So, i tried at least three common possible "struct size" variable definitions and none of them was\were recognized.
Might be caused by...
OLD code, nasmx.inc, NASMX_STRUCT, here we could define CREATESTRUCT_size (%$__nx_size):
....
;// create new ctx and initialize
%push %3
%xdefine %$__nx_name %%__tname
%assign %$__nx_size %%__tsize
...
NEW code, nasmx.inc, NASMX_STRUCT, here is no such thing (%$__nx_size):
...
;// create new ctx and initialize
%push %3
%xdefine %$__nx_name %%__tname
%define %$__nx_isnested %%__is_nested
...
So, i got no clue, how to get "structure size".