dpp icon indicating copy to clipboard operation
dpp copied to clipboard

Stdcall methods on msvc return differently from functions

Open Laeeth opened this issue 5 years ago • 4 comments

So we should just include a test to keep compiler honest.

https://gist.githubusercontent.com/retep998/9503145841a61551d3c6/raw/a78ed471356f44430e7f9522f45878f9b4e55a19/com.cpp

https://github.com/rust-lang/rfcs/issues/1342

Laeeth avatar Jan 09 '19 02:01 Laeeth

I'm not even sure it makes sense for dpp to ever support MSVC - it uses libclang, the manglings won't work, and compilers have leeway to implement things differently, especially with the lack of a standard ABI for C++.

dpp should definitely work on Windows at some point.

atilaneves avatar Jan 09 '19 12:01 atilaneves

Didn't follow the meaning of support msvc. Use case here for time being is quite substantial on windows and there we use msvc for now though I am trying to explore moving to clang.

Clang supports msvc abi and mangling though it's not perfect, especially for new features. I presume that means libclang is the same.

https://clang.llvm.org/docs/MSVCCompatibility.html

Libclang D bindings I think do work on windows with some effort. And even if they didn't I suspect you could tell libclang to target windows msvc though probably dpp would be confused by cross compilation.

Laeeth avatar Jan 10 '19 04:01 Laeeth

For D community, yeah you can just #include cpp and it works. That's amazing - let's move our game dev to D. Uh it's Linux only ..

Laeeth avatar Jan 10 '19 04:01 Laeeth

I think the manglings mostly will work.

Laeeth avatar Jan 10 '19 04:01 Laeeth