Hacker News new | ask | show | jobs
by masfuerte 13 hours ago
Being pedantic, the COM vtable layout is defined independently of C++. The Windows headers used to (and maybe still do) have macros that could declare COM vtables as explicit structs so you could use Windows COM interfaces from C.

That used to be the case anyway. It's possible they binned the C support in the switch to 64-bit. I haven't looked since.

1 comments

Yes the support is still there, although official MS documentation no longer mentions it. Some of those headers rather flagrantly violate C's strict aliasing rules, which I suspect is the reason MSVC never implemented type-based aliasing optimizations.