fasmg can read the constant directly from the RC file:
import_c_define.g
; import C/C++ preprocessor style defines (just numbers for now)
; usage:
; include "import_c_define.g",THE_FILE equ "app.rc"
calminstruction reader line&
match =mvmacro? =reader? =, =?,line
jno go
assemble line
skip: exit
go: match =#=define? name= value // any?,line
jyes ok
match =#=define? name= value,line
jno skip
ok: arrange line,name =:== value
assemble line
end calminstruction
include THE_FILE,mvmacro ?,reader
mvmacro reader,?
purge reader
... the include parsing of fasmg insures this will follow nested files. The
#defines can get complex - I just haven't had a need for any of that.