Just noting a small (and hard to track) issue I had with precompiler macros; unless you're making heavy/advanced use of macros, you probably wont come across this issue.
If you encapsulate multiple lines of code in a macro, including comments, it will not compile if any of the comments contain the character `, because the precompiler will incorrectly try to parse a macro within the comment.
Example (this does not compile):
(this compiles):Code:`define TESTMACRO(A) `A function Blah() { `TESTMACRO(// The macro `WEWT does not exist) }
The only difference between the two, is a ` within the commented text.Code:`define TESTMACRO(A) `A function Blah() { `TESTMACRO(// The macro WEWT does not exist) }
The code I was originally working with, which caused this issue (deliberately missing a lot of context, as the only relevant line is the comment):
Code:`SET_PROPACCESS(GetObjAddress(SourceObj) + SourcePropertyObj.Offset, OrigAccessAddress, `SET_UPROP_OFFSET(default.PropArrayRef, 0, OrigPropOffset, SourceSize = default.PropAccess.ArrayRef.ArrayNum; ) // Skips using `SET_PROPACCESS as it should not be used recursively default.DefaultObj.PropAccessAddress = GetObjAddress(DestObj) + DestPropertyObj.Offset; `SET_UPROP_OFFSET(default.PropArrayRef, 0, OrigPropOffset, DestSize = default.PropAccess.ArrayRef.ArrayNum; ) )




Reply With Quote


Bookmarks