Yep, it's on the wish list.
------------------
Tom Hanlin
PowerBASIC Staff
Announcement
Collapse
No announcement yet.
Opaque Pointers
Collapse
X
-
Great!
BTW, is something like TYPEDEF on the wishlist? It'd be handy when porting over Windows-C code,
something I seem to be doing a lot of lately
Thanks!
------------------
Mark Newman
Leave a comment:
-
Should make no noticeable difference.
------------------
Tom Hanlin
PowerBASIC Staff
Leave a comment:
-
Opaque Pointers
Hello all,
When dealing with some of the Windows internals, the APIs often use an "opaque pointer", which is a pointer
returned by the API to some unknown (to the client) structure, the details of which are unimportant to the
client. For example, in the SETUPAPI.H file:
Code:// // Define type for reference to device information set // typedef PVOID HDEVINFO;
DWORD is actually pointing to.
My question is, since PB doesn't support TYPEDEFs, could I replace the simple LONG/DWORD declaration with a
TYPE that contains a LONG/DWORD and thereby gain some code clarity? From the compiler's perspective, are the
two the same or is there extra overhead with the TYPE statement?
Code:TYPE HDEVINFO P AS DWORD END TYPE LOCAL tHdev as HDEVINFO tHdev.P = SomeFunctionThatReturnsOpaquePtr() SomeSubThatUsesOpaquePtr(tHdev.P)
using descriptive variable names helps, it's still something of a mess.
Thanks!
------------------
Mark NewmanTags: None
Leave a comment: