This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] -fno-exceptions cleanups


> The __throw_future_error function needs to be guarded by
> 
> #if defined(_GLIBCXX_HAS_GTHREADS) &&
> defined(_GLIBCXX_USE_C99_STDINT_TR1) \ &&
> defined(_GLIBCXX_ATOMIC_BUILTINS_4)
> 
> or future_error and future_errc need to be moved outside the guard and
> defined unconditionally.

Here.

tested x86_64/linux
tested x86_64/linux --disable-threads

-benjamin
2009-08-10  Benjamin Kosnik  <bkoz@redhat.com>

	* include/std/future: Move error handling bits outside macro guard.
	* src/future.cc: Adjust.

	* include/precompiled/stdc++.h: Add future.
	* doc/xml/manual/using.xml: Same.


Index: src/future.cc
===================================================================
--- src/future.cc	(revision 150641)
+++ src/future.cc	(working copy)
@@ -24,8 +24,6 @@
 
 #include <future>
 
-#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
-  && defined(_GLIBCXX_ATOMIC_BUILTINS_4)
 namespace
 {
   struct future_error_category : public std::error_category
@@ -73,6 +71,3 @@
   const char* 
   future_error::what() const throw() { return _M_code.message().c_str(); }
 }
-
-#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
-       // && _GLIBCXX_ATOMIC_BUILTINS_4
Index: doc/xml/manual/using.xml
===================================================================
--- doc/xml/manual/using.xml	(revision 150641)
+++ doc/xml/manual/using.xml	(working copy)
@@ -242,54 +242,55 @@
 </row>
 <row>
 <entry><filename class="headerfile">functional</filename></entry>
+<entry><filename class="headerfile">future</filename></entry>
 <entry><filename class="headerfile">initalizer_list</filename></entry>
 <entry><filename class="headerfile">iomanip</filename></entry>
 <entry><filename class="headerfile">ios</filename></entry>
-<entry><filename class="headerfile">iosfwd</filename></entry>
 </row>
 <row>
+<entry><filename class="headerfile">iosfwd</filename></entry>
 <entry><filename class="headerfile">iostream</filename></entry>
 <entry><filename class="headerfile">istream</filename></entry>
 <entry><filename class="headerfile">iterator</filename></entry>
 <entry><filename class="headerfile">limits</filename></entry>
-<entry><filename class="headerfile">list</filename></entry>
 </row>
 <row>
+<entry><filename class="headerfile">list</filename></entry>
 <entry><filename class="headerfile">locale</filename></entry>
 <entry><filename class="headerfile">map</filename></entry>
 <entry><filename class="headerfile">memory</filename></entry>
 <entry><filename class="headerfile">mutex</filename></entry>
-<entry><filename class="headerfile">new</filename></entry>
 </row>
 <row>
+<entry><filename class="headerfile">new</filename></entry>
 <entry><filename class="headerfile">numeric</filename></entry>
 <entry><filename class="headerfile">ostream</filename></entry>
 <entry><filename class="headerfile">queue</filename></entry>
 <entry><filename class="headerfile">random</filename></entry>
-<entry><filename class="headerfile">ratio</filename></entry>
 </row>
 <row>
+<entry><filename class="headerfile">ratio</filename></entry>
 <entry><filename class="headerfile">regex</filename></entry>
 <entry><filename class="headerfile">set</filename></entry>
 <entry><filename class="headerfile">sstream</filename></entry>
 <entry><filename class="headerfile">stack</filename></entry>
-<entry><filename class="headerfile">stdexcept</filename></entry>
 </row>
 <row>
+<entry><filename class="headerfile">stdexcept</filename></entry>
 <entry><filename class="headerfile">streambuf</filename></entry>
 <entry><filename class="headerfile">string</filename></entry>
 <entry><filename class="headerfile">system_error</filename></entry>
 <entry><filename class="headerfile">thread</filename></entry>
-<entry><filename class="headerfile">tuple</filename></entry>
 </row>
 <row>
+<entry><filename class="headerfile">tuple</filename></entry>
 <entry><filename class="headerfile">type_traits</filename></entry>
 <entry><filename class="headerfile">typeinfo</filename></entry>
 <entry><filename class="headerfile">unordered_map</filename></entry>
 <entry><filename class="headerfile">unordered_set</filename></entry>
-<entry><filename class="headerfile">utility</filename></entry>
 </row>
 <row>
+<entry><filename class="headerfile">utility</filename></entry>
 <entry><filename class="headerfile">valarray</filename></entry>
 <entry><filename class="headerfile">vector</filename></entry>
 </row>
Index: include/std/future
===================================================================
--- include/std/future	(revision 150641)
+++ include/std/future	(working copy)
@@ -43,9 +43,6 @@
 #include <exception>
 #include <cstdatomic>
 
-#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
-  && defined(_GLIBCXX_ATOMIC_BUILTINS_4)
-
 namespace std
 {
   /**
@@ -111,6 +108,9 @@
   template<typename _Result>
     class promise;
 
+#if defined(_GLIBCXX_HAS_GTHREADS) && defined(_GLIBCXX_USE_C99_STDINT_TR1) \
+  && defined(_GLIBCXX_ATOMIC_BUILTINS_4)
+
   // Holds the result of a future
   struct _Future_result_base
   {
@@ -929,12 +929,12 @@
       promise<_Result>                  _M_promise;
     };
 
+#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
+       // && _GLIBCXX_ATOMIC_BUILTINS_4
+
   // @} group futures
 }
 
-#endif // _GLIBCXX_HAS_GTHREADS && _GLIBCXX_USE_C99_STDINT_TR1
-       // && _GLIBCXX_ATOMIC_BUILTINS_4
-
 #endif // __GXX_EXPERIMENTAL_CXX0X__
 
 #endif // _GLIBCXX_FUTURE
Index: include/precompiled/stdc++.h
===================================================================
--- include/precompiled/stdc++.h	(revision 150641)
+++ include/precompiled/stdc++.h	(working copy)
@@ -98,6 +98,7 @@
 #include <chrono>
 #include <condition_variable>
 #include <forward_list>
+#include <future>
 #include <mutex>
 #include <random>
 #include <ratio>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]