[PATCH] D28220: provide Win32 native threading

2017-01-05 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: include/__threading_support:474 + system_clock::time_point(duration_cast(duration)); + auto timeout_ms = duration_cast(abstime - system_clock::now()); + compnerd wrote: > halyavin wrote: > > Since negative

[PATCH] D28220: provide Win32 native threading

2017-01-06 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. LGTM. Comment at: include/__threading_support:480 + if (!SleepConditionVariableSRW(__cv, __m, + timeout_ms.count() > 0 ? timeout_ms.count() +: 0,

[PATCH] D28220: provide Win32 native threading

2017-01-03 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: include/__threading_support:421 +if (!SleepConditionVariableCS(__cv, __m, + duration_cast(timeout).count())) + return GetLastError(); We can have integer overflow on cast to

[PATCH] D28220: provide Win32 native threading

2017-01-04 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: include/__threading_support:474 + system_clock::time_point(duration_cast(duration)); + auto timeout_ms = duration_cast(abstime - system_clock::now()); + Since negative timeouts can't be avoided, we must make

[PATCH] D28441: [libc++] [CMake] Link with /nodefaultlibs on Windows

2017-01-07 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: lib/CMakeLists.txt:113 + add_library_flags(msvcrt) # C runtime startup files + add_library_flags(iso_stdio_wide_specifiers) +endif() EricWF wrote: > smeenai wrote: > > Maybe add a comment explaining the purpose of

[PATCH] D28441: [libc++] [CMake] Link with /nodefaultlibs on Windows

2017-01-07 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: lib/CMakeLists.txt:112 + add_library_flags(vcruntime) # C++ runtime + add_library_flags(msvcrt) # C runtime startup files + add_library_flags(iso_stdio_wide_specifiers) As far as I know, applications shouldn't use

[PATCH] D28441: [libc++] [CMake] Link with /nodefaultlibs on Windows

2017-01-07 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: lib/CMakeLists.txt:112 + add_library_flags(vcruntime) # C++ runtime + add_library_flags(msvcrt) # C runtime startup files + add_library_flags(iso_stdio_wide_specifiers) halyavin wrote: > As far as I know,

[PATCH] D28441: [libc++] [CMake] Link with /nodefaultlibs on Windows

2017-01-07 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: lib/CMakeLists.txt:113 + add_library_flags(msvcrt) # C runtime startup files + add_library_flags(iso_stdio_wide_specifiers) +endif() EricWF wrote: > halyavin wrote: > > EricWF wrote: > > > smeenai wrote: > > > >

[PATCH] D28220: provide Win32 native threading

2017-01-04 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: include/__threading_support:458 + __libcpp_mutex_reference&& __m, + timespec* __ts) +{ In posix, pthread_cond_timedwait uses absolute time but we use relative

[PATCH] D28441: [libc++] [CMake] Link with /nodefaultlibs on Windows

2017-01-06 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added inline comments. Comment at: lib/CMakeLists.txt:108-109 +if (LIBCXX_TARGETING_WINDOWS) + add_compile_flags(/Zl) + add_link_flags(/nodefaultlib) + add_library_flags(ucrt) # Universal C runtime smeenai wrote: > These should be guarded under a

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-04-23 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. Here is how we solved this problem in our libc++ fork: #define _LIBCPP_UCRT_INCLUDE(x) <../ucrt/x> #define _LIBCPP_MSVC_INCLUDE(x) <../../VC/include/x> #ifdef _LIBCPP_COMPILER_MSVC #include _LIBCPP_UCRT_INCLUDE(wchar.h) #else #include_next #endif As

[PATCH] D30837: [libcxx] Support for shared_ptr<T()>

2017-03-10 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. But std::allocator is deprecated in C++17. I don't know a good solution, I just used int as an arbitrary type when I faced similar problem. https://reviews.llvm.org/D30837 ___ cfe-commits mailing list

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-07-17 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. In https://reviews.llvm.org/D32411#799878, @mclow.lists wrote: > @smeenai wrote: > > > This is kinda ugly, but I can't think of a better way to do it. I'm fine > > with this, but given that it's a pretty invasive change, I'm not > > comfortable accepting. You may

[PATCH] D32411: [libcxx] Provide #include_next alternative for MSVC

2017-04-24 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. BTW, the list of include files which are located in [PROGRAM_FILES]\Microsoft Visual Studio 14.0\VC\include directory is - stdbool.h - limits.h - stdint.h - setjmp.h The rest is in [PROGRAM_FILES]\Windows Kits\10\Include\10.0.whatever.0\ucrt directory. Which

[PATCH] D40181: [libcxx] Allow to set locale on Windows.

2017-11-22 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. In https://reviews.llvm.org/D40181#930779, @mstorsjo wrote: > (but I think it does define some sort of dummy functions that at least will > allow it to build) Looked into MinGW-w64 sources and this is indeed the case. _configthreadlocale will return -1 and will

[PATCH] D40181: [libcxx] Allow to set locale on Windows.

2017-11-22 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin updated this revision to Diff 123921. halyavin added a comment. Herald added a subscriber: krytarowski. Fixed problem with C++98, added std for nullptr_t and switched on _l functions for MinGW. https://reviews.llvm.org/D40181 Files: include/__config include/__locale

[PATCH] D40181: [libcxx] Allow to set locale on Windows.

2017-11-22 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin updated this revision to Diff 123923. https://reviews.llvm.org/D40181 Files: include/__config include/__locale include/support/win32/locale_win32.h src/support/win32/locale_win32.cpp Index: include/__config === ---

[PATCH] D40181: [libcxx] Allow to set locale on Windows.

2017-11-23 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. @EricWF, could you please commit this change? https://reviews.llvm.org/D40181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D40071: [libcxx] Implement exception_ptr on Windows without msvcprt.dll

2017-12-04 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin marked an inline comment as done. halyavin added inline comments. Comment at: src/support/runtime/exception_pointer_msvc.ipp:119-123 +#ifdef _M_AMD64 +RtlPcToFileHeader( +reinterpret_cast(const_cast(throw_info)), +_base); +#endif

[PATCH] D40774: [libcxx] Fix intrinsics for MSVC

2017-12-04 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. In https://reviews.llvm.org/D40774#943993, @smeenai wrote: > Are you actually using libc++ with cl? :) People mostly use it to compile on Windows but I heard someone launches the result too. Since no one complains and it passed most of the testing, I guess the

[PATCH] D40775: [libcxx] Add underscores to win32 locale headers.

2017-12-04 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin updated this revision to Diff 125354. https://reviews.llvm.org/D40775 Files: include/support/win32/locale_win32.h src/support/win32/locale_win32.cpp Index: src/support/win32/locale_win32.cpp === ---

[PATCH] D40071: [libcxx] Implement exception_ptr on Windows without msvcprt.dll

2017-12-04 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin updated this revision to Diff 125356. halyavin added a comment. Updated diff to include whole context. https://reviews.llvm.org/D40071 Files: include/exception src/support/runtime/exception_pointer_msvc.ipp Index: src/support/runtime/exception_pointer_msvc.ipp

[PATCH] D40775: [libcxx] Add underscores to win32 locale headers.

2017-12-13 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. @EricWF , could you please look at this change? It doesn't have any functional changes. https://reviews.llvm.org/D40775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D40181: [libcxx] Allow to set locale on Windows.

2017-11-17 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin created this revision. Fix the problem PR31516 with setting locale on Windows by wrapping _locale_t with a pointer-like class. Reduces 74 test failures in std/localization test suite to 47 test failures (on llvm clang, Visual Studio 2015).

[PATCH] D39962: [libcxx] Fix current_exception test on Windows.

2017-11-13 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin created this revision. Take extra copies in current_exception() into account. https://reviews.llvm.org/D39962 Files: test/std/language.support/support.exception/propagation/current_exception.pass.cpp Index:

[PATCH] D39961: [libcxx] Fix rethrow_if_nested test on Windows.

2017-11-13 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin created this revision. Stack overflow is caused by B copy constructor invoking default constructor of std::nested_exception which tries to capture current exception. Capturing current exception copies it and since our current exception is B, we call B's copy constructor and cause

[PATCH] D39962: [libcxx] Fix current_exception test on Windows.

2017-11-15 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin updated this revision to Diff 122998. halyavin added a comment. Add lower bound too. https://reviews.llvm.org/D39962 Files: test/std/language.support/support.exception/propagation/current_exception.pass.cpp Index:

[PATCH] D40071: [libcxx] Implement exception_ptr on Windows without msvcprt.dll

2017-11-15 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin created this revision. Herald added a reviewer: EricWF. This change removes dependency on Microsoft STL implementation but adds dependency on VC runtime implementation. We will need to evolve and add #ifdef's to this code as new versions of Visual Studio runtime will come out. Tested

[PATCH] D40774: [libcxx] Fix intrinsics for MSVC

2017-12-05 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. In https://reviews.llvm.org/D40774#944751, @smeenai wrote: > In https://reviews.llvm.org/D40774#944749, @halyavin wrote: > > > In https://reviews.llvm.org/D40774#943993, @smeenai wrote: > > > > > Are you actually using libc++ with cl? :) > > > > > > People mostly use it

[PATCH] D40774: [libcxx] Fix intrinsics for MSVC

2017-12-03 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin created this revision. The parameter was previously renamed but MSVC path was not updated. https://reviews.llvm.org/D40774 Files: include/algorithm Index: include/algorithm === --- include/algorithm +++

[PATCH] D40775: [libcxx] Add underscores to win32 locale headers.

2017-12-03 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin created this revision. Avoid possible collisions with macros. Repository: rCXX libc++ https://reviews.llvm.org/D40775 Files: include/support/win32/locale_win32.h src/support/win32/locale_win32.cpp Index: src/support/win32/locale_win32.cpp

[PATCH] D40775: [libcxx] Add underscores to win32 locale headers.

2018-03-11 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin updated this revision to Diff 137945. halyavin added a comment. update to new revision https://reviews.llvm.org/D40775 Files: src/support/win32/locale_win32.cpp Index: src/support/win32/locale_win32.cpp === ---

[PATCH] D40775: [libcxx] Add underscores to win32 locale headers.

2018-03-11 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. ping. https://reviews.llvm.org/D40775 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D40181: [libcxx] Allow to set locale on Windows.

2019-03-19 Thread Andrey Khalyavin via Phabricator via cfe-commits
halyavin added a comment. Yes, I considered it. But Microsoft documentation is not clear whether it will work or not for restoring inconsistent locales. The documentation shows how to save inconsistent locales with LC_ALL but doesn't provide an example for restoring them. Repository: rL