You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in my comment the following logic makes it that AVOID_CPP11_CODECVT is always set when using a MinGW compiler, even though MinGW also supports codecvt (probably starting from GCC 5.1 upwards as well).
The easy fix could be to just remove the __MINGW32__ check since the GNUC check should work for MinGW as well.
Furthermore MinGW doesn't seem to support the alloca.h header, so when someone would be using an older compiler the else branch would fail to compile.
// Note: <codecvt> is C++11. It exists in libc++ (LLVM) but is patchy in libstdc++ pre-GCC 5
#ifndef AVOID_CPP11_CODECVT
# include<codecvt>// Narrow/widen - C++11
#else
# include<iconv.h>
# include<alloca.h>
#endif
On a personal note: I find the double "negation" a bit confusing. Why define a Marco called "AVOID_X" and the check whether it's NOT defined? But that's maybe just me. 😉
The text was updated successfully, but these errors were encountered:
On a personal note: I find the double "negation" a bit confusing. Why define a Marco called "AVOID_X" and the check whether it's NOT defined? But that's maybe just me.
I suppose it could be a value and inverted. You are free submit a patch. ;)
As mentioned in my comment the following logic makes it that
AVOID_CPP11_CODECVT
is always set when using a MinGW compiler, even though MinGW also supports codecvt (probably starting from GCC 5.1 upwards as well).The easy fix could be to just remove the
__MINGW32__
check since the GNUC check should work for MinGW as well.Furthermore MinGW doesn't seem to support the
alloca.h
header, so when someone would be using an older compiler the else branch would fail to compile.One fix I saw is to use
malloc.h
for Windows.Relevant file: https://github.com/billyquith/GWork/blob/gwork/source/gwork/source/Utility.cpp
On a personal note: I find the double "negation" a bit confusing. Why define a Marco called "AVOID_X" and the check whether it's NOT defined? But that's maybe just me. 😉
The text was updated successfully, but these errors were encountered: