adtools icon indicating copy to clipboard operation
adtools copied to clipboard

Add std::wstring

Open ksdhans opened this issue 2 years ago • 10 comments

Std::wstring is currently undefined, which is a problem when using/porting code that requires it. People are implementing workarounds such as: https://www.amigans.net/modules/newbb/viewtopic.php?post_id=113200#forumpost113200

Could we get this fixed, so that workarounds can be removed?

NOTE: I'm using GCC 8.3.1, so haven't tested it with a newer GCC version.

ksdhans avatar Mar 17 '22 06:03 ksdhans

My guess is that this is due to missing wchar support in clib2. I don't have working Linux HW right now so I can't say for sure though.

I think that @afxgroup is working on extending clib2. Maybe maybe wchar is one of those things he's adding.

sodero avatar Mar 17 '22 20:03 sodero

I don't use clib2, because every time I try it, something else breaks.

ksdhans avatar Mar 18 '22 05:03 ksdhans

Yes, but unless I misunderstand how adtools work, libstd++v3 is configured and built using clib2 (per default at least), so even though you don't use -mcrt=clib2 when building your project, you will be limited by what autotools finds in the configure step when gcc itself is built.

sodero avatar Mar 18 '22 07:03 sodero

@sodero There is a separate c++config.h for newlib, so it seems to be generating per clib configurations. I did try manually tweaking it to enable wstring, but ended up with a whole array of errors. A bit weird, considering that wstring is basically std::basic_string<wchar_t>.

ksdhans avatar Mar 18 '22 08:03 ksdhans

On my clib2 everything works correclty with wchar and c++ (except some usual problems with libstdc++.so i have to fix one day). I think i will open it soon because I need help

afxgroup avatar Mar 18 '22 09:03 afxgroup

@ksdhans Ah, I didn't know that. I focused only on clib2 since the newlib code is hidden to me.

@afxgroup Sounds good. Did you implement the all the wchar_* functions?

sodero avatar Mar 18 '22 09:03 sodero

@afxgroup Once you publish your work it's probably time to consolidate the efforts. I implemented C11 threading BTW. The thrd_* and mtx_* parts seem to work fine. I don't have a clear understanding of how TSS is supposed to work though.

sodero avatar Mar 18 '22 10:03 sodero

@afxgroup Sounds good. Did you implement the all the wchar_* functions?

Yes. With some tests too. However everything needs to test deeply and i'm expecting lot of pull requests from you.. :D

afxgroup avatar Mar 18 '22 17:03 afxgroup

Yes. With some tests too. However everything needs to test deeply and i'm expecting lot of pull requests from you.. :D

Excellent, I'll do my best with the PR:s :)

sodero avatar Mar 18 '22 23:03 sodero

Repository is now visible

https://github.com/afxgroup/clib2

afxgroup avatar Mar 21 '22 17:03 afxgroup