raphlinus / font-rs

Apache License 2.0
753 stars 49 forks source link

Fix compilation on MSVC #2

Closed Connicpu closed 6 years ago

Connicpu commented 7 years ago

Just a few simple changes were required. MSVC doesn't know what -std or -march means, and you can't directly use a typecast for __m128* types, there's an intrinsic to do that cast. I tested this on the VS2015 compiler.

emoon commented 7 years ago

Just a question here (as there are no issues for this repo I just ask here as it's related to this) wouldn't it be possible to use the simd crate https://github.com/huonw/simd or isn't that one flexible enough?

raphlinus commented 7 years ago

@emoon Yes, see this comment: https://www.reddit.com/r/rust/comments/4vqpxx/inside_the_fastest_font_renderer_in_the_world/d60so4g

It's totally worth exploring. The main downside is that it would only build on nightly, as it hasn't been stabilized (yet).

I'll add issues, sorry about that.

emoon commented 7 years ago

@raphlinus Ah, I thought it was in stable by now so going the C route for this case makes sense then.

Connicpu commented 7 years ago

Thanks for the suggestions! I made the changes and rebased.

raphlinus commented 6 years ago

Apologies for not following up on this. The change looks good but I wouldn't be surprised if practices for cross-platform C have improved (or changed) in the interim. I'll try it next time I'm at a Windows box, but I want to merge the improved tests and so on first.

raphlinus commented 6 years ago

Thanks for the PR and apologies for me not looking at it earlier. The cast doesn't need to be conditional, so #18 is a cleaner fix for that. Not sure about the command line switches, presumably people are able to compile it now?

kpp commented 6 years ago

It would be better to use https://github.com/AdamNiederer/faster instead of C. And there will be no xcompile errors at all.