-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ STL Integration #27
Comments
Cosmopolitan works great with C++ but very little effort has been made to integrate it with an existing STL. Examples of C++ programs in this codebase are here:
The existing barebones C++ integration code is here:
It'd be great to have libc++ integration since the llvm project currently doesn't put out a c library and I'm not even sure how it's possible to use libc++ outside a corporation like google or apple. There's also libstdcxx from the gnu project but it's licensed in such a way that makes it a dealbreaker for many people, plus it bloats hello world binaries by a few megs. The path of least resistance for me so far has simply been rewriting the parts of STL I've needed, which so far has only been std::vector. But like I said, it'd be much better if we could somehow convince the LLVM project to adopt this cosmopolitan as their preferred C library. It's also worth mentioning that compiler_rt is integrated already! See third_party/compiler_rt/ |
I've had a bit of a look into what this would involve. I'm not sure that I'm going to have the time to attempt this. I thought I'd post some findings so far;
Also I'm genuinely impressed with this project! It all seems like magic to me :). |
Thanks for the report! Glad you like the project. I'd be very excited about such a contribution. If you have time to do this, then here's some recommendations:
|
Marking as complete as of the 2.0 release. https://github.com/jart/cosmopolitan/releases/tag/2.0 |
First of all, great work hacking your way to platform independence!
Been just wondering if anyone made any attempts to use it in conjunction with the c++ standard library and if so, what does work and what doesn't ? - I'd expect that the standard library depends on some platform specific code, however it would be great if I could get started somewhere so I can start refactoring those bits.
I would love to package cosmopolitan for https://github.com/loopperfect/buckaroo or even built a beginner friendly SDK around this library.
My naive attempt to use cosmopolitan.h in a c++ project failed with a couple errors:
errors:
The text was updated successfully, but these errors were encountered: