Hi

Just to correct my previous message, the alternative stralign.h I
found doesn't work for me after all when building Ninja, I made a mistake
building it before to think it did work.

So the diff I provided for further info in my previous message may not be
that useful

So to recap, I'm using stralign.h from here:
http://sourceforge.net/projects/mingwbuilds/files/host-windows/releases/4.8.1/64-bit/threads-win32/seh/
that fails on stralign.h:

#ifndef __CRT__NO_INLINE
  __CRT_INLINE PUWSTR_C ua_wcschr(PCUWSTR String,WCHAR Character) {
    if(WSTR_ALIGNED(String)) return ::wcschr((PCWSTR)String,Character);
    return (PUWSTR_C)uaw_wcschr(String,Character);
  }
  __CRT_INLINE PUWSTR_C ua_wcsrchr(PCUWSTR String,WCHAR Character) {
    if(WSTR_ALIGNED(String)) return ::wcsrchr((PCWSTR)String,Character);
    return (PUWSTR_C)uaw_wcsrchr(String,Character);
  }

I added the :: characters above to make Ninja compile, but I doubt that is
the right fix even it works or appears to.

If there exists a "latest" release of these files, please give me a full
link to where and I'll try them and report back.

Alternatively, if anyone else want's to try to build Ninja on github with
libcxx and clang++ using the same mingw's C headers I am using,
then they should see the same conflict I am seeing with libcxx's headers
and mingw's stralign.h that I'd like to fix.

Until someone with more experience than me tries that, I'm stuck wrestling
with it. But here's the clang++ output from compiling with that setup:
[9/12/26] CXX build\disk_interface.o
FAILED: clang++ -MMD -MT build\disk_interface.o -MF
build\disk_interface.o.d -nostdinc++ -I/libcxx/include -march=corei7
-std=c++11 -Wall -Wextra -Wno-deprecated -Wno-unused-parameter -fno-rtti
-fno-exceptions -pipe -Wno-missing-field-initializers -DNINJA_
PYTHON="python.exe" -O3 -DNDEBUG -D_WIN32_WINNT=0x0601
-DWIN32_LEAN_AND_MEAN -c src\disk_interface.cc -o build\disk_interface.o
In file included from src\disk_interface.cc:24:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:116:37:
error: call to 'wcschr' is ambiguous
    if(WSTR_ALIGNED(String)) return wcschr((PCWSTR)String,Character);
                                    ^~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:840:34:
note: candidate function
  _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
                                 ^
/libcxx/include\cwchar:180:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
                                                ^
In file included from src\disk_interface.cc:24:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:120:37:
error: call to 'wcsrchr' is ambiguous
    if(WSTR_ALIGNED(String)) return wcsrchr((PCWSTR)String,Character);
                                    ^~~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:851:34:
note: candidate function
  _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
                                 ^
/libcxx/include\cwchar:186:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s,
wchar_t __c) {return ::wcsrchr(__s, __c);}
                                                ^
2 errors generated.
[0/12/26] CXX build\build.o
FAILED: clang++ -MMD -MT build\build.o -MF build\build.o.d -nostdinc++
-I/libcxx/include -march=corei7 -std=c++11 -Wall -Wextra -Wno-deprecated
-Wno-unused-parameter -fno-rtti -fno-exceptions -pipe
-Wno-missing-field-initializers -DNINJA_PYTHON="python.exe
" -O3 -DNDEBUG -D_WIN32_WINNT=0x0601 -DWIN32_LEAN_AND_MEAN -c src\build.cc
-o build\build.o
In file included from src\build.cc:33:
In file included from src/subprocess.h:25:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:116:37:
error: call to 'wcschr' is ambiguous
    if(WSTR_ALIGNED(String)) return wcschr((PCWSTR)String,Character);
                                    ^~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:840:34:
note: candidate function
  _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
                                 ^
/libcxx/include\cwchar:180:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s,
wchar_t __c) {return ::wcschr(__s, __c);}
                                                ^
In file included from src\build.cc:33:
In file included from src/subprocess.h:25:
In file included from
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\windows.h:114:
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\stralign.h:120:37:
error: call to 'wcsrchr' is ambiguous
    if(WSTR_ALIGNED(String)) return wcsrchr((PCWSTR)String,Character);
                                    ^~~~~~~
c:\mingw\bin\..\lib\clang\3.4\../../../x86_64-w64-mingw32/include\wchar.h:851:34:
note: candidate function
  _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
                                 ^
/libcxx/include\cwchar:186:49: note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s,
wchar_t __c) {return ::wcsrchr(__s, __c);}
                                                ^
2 errors generated.
ninja: build stopped: subcommand failed.

Thanks
Glen
------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to