[libcxx] r178237 - Add missing #ifndef _LIBCPP_NO_EXCEPTIONS around throw in include/thread.

Howard Hinnant hhinnant at apple.com
Thu Mar 28 11:57:56 PDT 2013


On Mar 28, 2013, at 2:42 PM, Matthieu Monrocq <matthieu.monrocq at gmail.com> wrote:

> 
> 
> On Thu, Mar 28, 2013 at 4:00 PM, Howard Hinnant <hhinnant at apple.com> wrote:
> Author: hhinnant
> Date: Thu Mar 28 10:00:04 2013
> New Revision: 178237
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=178237&view=rev
> Log:
> Add missing #ifndef _LIBCPP_NO_EXCEPTIONS around throw in include/thread.
> 
> Modified:
>     libcxx/trunk/include/thread
> 
> Modified: libcxx/trunk/include/thread
> URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/thread?rev=178237&r1=178236&r2=178237&view=diff
> ==============================================================================
> --- libcxx/trunk/include/thread (original)
> +++ libcxx/trunk/include/thread Thu Mar 28 10:00:04 2013
> @@ -144,9 +144,11 @@ template <class _Tp>
>  __thread_specific_ptr<_Tp>::__thread_specific_ptr()
>  {
>      int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
> +#ifndef _LIBCPP_NO_EXCEPTIONS
>      if (__ec)
>          throw system_error(error_code(__ec, system_category()),
>                             "__thread_specific_ptr construction failed");
> +#endif
>  }
> 
> I don't know if you typically worry about warnings, but "__ec" is now unused when _LIBCPP_NO_EXCEPTIONS is defined.

Thanks, Committed revision 178267.

Howard




More information about the cfe-commits mailing list