[thread] Can't use boost/thread/mutex.hpp without boost_system

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

[thread] Can't use boost/thread/mutex.hpp without boost_system

Artyom Beilis
Hello,

The Boost.Thread version in trunk does not allow to use simple mutex as it was
possible before:


  #include <boost/thread/mutex.hpp>
  #include <iostream>

  int main()
  {
          boost::mutex l;
          {
                  boost::unique_lock<boost::mutex> g(l);
                  std::cout << "Test" << std::endl;
          }
  }


Was working fine without linking with 1.48 and 1.46 but now
it fails with current trunk version requiring dependency on Boost.System.

It breaks some code and breaks at least Boost.Locale.

Is this change intentional or a bug? If it is intentional I'd
like to know to fix Boost.Locale if not then is it possible to fix it.


Artyom Beilis
--------------
CppCMS - C++ Web Framework:   http://cppcms.sf.net/
CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Vicente Botet
Artyom Beilis wrote
Hello,

The Boost.Thread version in trunk does not allow to use simple mutex as it was
possible before:


  #include <boost/thread/mutex.hpp>
  #include <iostream>

  int main()
  {
          boost::mutex l;
          {
                  boost::unique_lock<boost::mutex> g(l);
                  std::cout << "Test" << std::endl;
          }
  }


Was working fine without linking with 1.48 and 1.46 but now
it fails with current trunk version requiring dependency on Boost.System.
Hi,

I was not aware that Boost.Thread was working as a header only library. I have added some support to report errors following the C++11 standard, using Boost.System. You need to link with Boost.System library. Is this an issue?

It breaks some code and breaks at least Boost.Locale.
Is there some break other than the need to link with?

Is this change intentional or a bug? If it is intentional I'd
like to know to fix Boost.Locale if not then is it possible to fix it.
It was intentional. I hope that you just need to link in addition with boost_system.

Aside, I proposed Beman a patch to make Boost.System header-only when I tried to make Boost.Chrono header-only but he didn't accepted it :(.

I'm trying to make some changes that are code compatible, but I was unable to avoid the link issue.

Best,
Vicente
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Artyom Beilis
>>

>> The Boost.Thread version in trunk does not allow to use simple mutex as it
>> was
>> possible before:
>>
>>
>>   #include &lt;boost/thread/mutex.hpp&gt;
>>   #include <iostream>
>>
>>   int main()
>>   {
>>           boost::mutex l;
>>           {
>>                   boost::unique_lock<boost::mutex> g(l);
>>                   std::cout << "Test" << std::endl;
>>           }
>>   }
>>
>>
>> Was working fine without linking with 1.48 and 1.46 but now
>> it fails with current trunk version requiring dependency on Boost.System.
>>
>
>Hi,
>
>I was not aware that Boost.Thread was working as a header only library. I
>have added some support to report errors following the C++11 standard, using
>Boost.System. You need to link with Boost.System library. Is this an issue?
>

Till now I could use Boost.Locale without dependencies on Thread when
it was working without ICU. It is not a problem to add a dependency.

I just thought if there is a some kind of lightweight mutex that can be
used without boost.thread? I can bring something on my own (it is really
20 lines of code) just maybe there is something ready for roll...

If not I'll add dependency on system.


>
>
>> It breaks some code and breaks at least Boost.Locale.
>>
>
>Is there some break other than the need to link with?
>
>

No, it there is not other problems.

Artyom


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Vicente Botet
Le 18/01/12 15:09, Artyom Beilis a écrit :

>>> The Boost.Thread version in trunk does not allow to use simple mutex as it
>>> was
>>> possible before:
>>>
>>>
>>>    #include&lt;boost/thread/mutex.hpp&gt;
>>>    #include<iostream>
>>>
>>>    int main()
>>>    {
>>>            boost::mutex l;
>>>            {
>>>                    boost::unique_lock<boost::mutex>  g(l);
>>>                    std::cout<<  "Test"<<  std::endl;
>>>            }
>>>    }
>>>
>>>
>>> Was working fine without linking with 1.48 and 1.46 but now
>>> it fails with current trunk version requiring dependency on Boost.System.
>>>
>> Hi,
>>
>> I was not aware that Boost.Thread was working as a header only library. I
>> have added some support to report errors following the C++11 standard, using
>> Boost.System. You need to link with Boost.System library. Is this an issue?
>>
> Till now I could use Boost.Locale without dependencies on Thread when
> it was working without ICU. It is not a problem to add a dependency.
>
> I just thought if there is a some kind of lightweight mutex that can be
> used without boost.thread? I can bring something on my own (it is really
> 20 lines of code) just maybe there is something ready for roll...
>
> If not I'll add dependency on system.
>
I really thought, that people was looking for a C++11 compliant  
implementation. I see now that I might be wrong.

As for Boost.Chrono, I could add the dependency to Boost.System
conditionally and come back to the preceding exceptions. Let me know if
it is worth doing it.

Best,
Vicente

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Joshua Boyce-2
On Thu, Jan 19, 2012 at 8:22 AM, Vicente J. Botet Escriba <
[hidden email]> wrote:

>
> I really thought, that people was looking for a C++11 compliant
>  implementation. I see now that I might be wrong.
>
> As for Boost.Chrono, I could add the dependency to Boost.System
> conditionally and come back to the preceding exceptions. Let me know if it
> is worth doing it.
>
> Best,
> Vicente


I can't speak for others, but I know that I personally am interested in
improved C++11 compliance for Boost.Thread.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Artyom Beilis
In reply to this post by Vicente Botet
> From: Vicente J. Botet Escriba <[hidden email]>
>>
>>  I just thought if there is a some kind of lightweight mutex that can be
>>  used without boost.thread? I can bring something on my own (it is really
>>  20 lines of code) just maybe there is something ready for roll...
>>
>>  If not I'll add dependency on system.
>>
> I really thought, that people was looking for a C++11 compliant 
> implementation. I see now that I might be wrong.
>
> As for Boost.Chrono, I could add the dependency to Boost.System
> conditionally and come back to the preceding exceptions. Let me know if
> it is worth doing it.
>
> Best,
> Vicente
>

I think I'll just switch to boost::detail::lightweight_mutex in all places
where I don't really need Boost.Thread

Artyom


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Anthony Williams-4
In reply to this post by Vicente Botet
On 18/01/12 14:01, Vicente Botet wrote:
> I was not aware that Boost.Thread was working as a header only library.

This was a much-requested feature, so I made sure that boost::mutex at
least was usable header-only.

Anthony
--
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
just::thread C++11 thread library             http://www.stdthread.co.uk
Just Software Solutions Ltd       http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Artyom Beilis
----- Original Message -----
> From: Anthony Williams <[hidden email]>
> On 18/01/12 14:01, Vicente Botet wrote:
>>  I was not aware that Boost.Thread was working as a header only library.
>
> This was a much-requested feature, so I made sure that boost::mutex at least was
> usable header-only.
>
> Anthony
>

So would this be fixed or I should switch to lightweight mutex?

Artyom

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Vicente Botet
Le 19/01/12 13:12, Artyom Beilis a écrit :
> ----- Original Message -----
>> From: Anthony Williams<[hidden email]>
>> On 18/01/12 14:01, Vicente Botet wrote:
>>>   I was not aware that Boost.Thread was working as a header only library.
>> This was a much-requested feature, so I made sure that boost::mutex at least was
>> usable header-only.
>>
Oh, I remember that now.
> So would this be fixed or I should switch to lightweight mutex?
>
>
As far as Boost.System is not-header-only we can not have both:
boost::mutex header-only and compliant with c++11.
As said before, I could let the user the possibility to set Boost.Thread
to don't use Boost.System via BOOST_THREAD_DONT_USE_SYSTEM. Artyom,
Anthony is this satisfactory for you?

Best,
Vicente


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Anthony Williams-4
On 19/01/12 21:39, Vicente J. Botet Escriba wrote:

> Le 19/01/12 13:12, Artyom Beilis a écrit :
>> ----- Original Message -----
>>> From: Anthony Williams<[hidden email]>
>>> On 18/01/12 14:01, Vicente Botet wrote:
>>>> I was not aware that Boost.Thread was working as a header only library.
>>> This was a much-requested feature, so I made sure that boost::mutex
>>> at least was
>>> usable header-only.
>>>
> Oh, I remember that now.
>> So would this be fixed or I should switch to lightweight mutex?
>>
>>
> As far as Boost.System is not-header-only we can not have both:
> boost::mutex header-only and compliant with c++11.
> As said before, I could let the user the possibility to set Boost.Thread
> to don't use Boost.System via BOOST_THREAD_DONT_USE_SYSTEM. Artyom,
> Anthony is this satisfactory for you?

That sounds reasonable to me: if people wish to use Boost.Thread
header-only then they can define the macro, but anyone who needs to use
the full features must link against the library, so can cope with the
additional dependency on Boost.System.

It would be great if we could ensure that code with incompatible
settings wouldn't link. We could mask out the parts of Boost.Thread that
do need the library with that macro, for starters, so we don't need
separate builds of the library with and without that macro.

Anthony
--
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
just::thread C++11 thread library             http://www.stdthread.co.uk
Just Software Solutions Ltd       http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Vicente Botet
Le 20/01/12 08:42, Anthony Williams a écrit :

> On 19/01/12 21:39, Vicente J. Botet Escriba wrote:
>> Le 19/01/12 13:12, Artyom Beilis a écrit :
>>> ----- Original Message -----
>>>> From: Anthony Williams<[hidden email]>
>>>> On 18/01/12 14:01, Vicente Botet wrote:
>>>>> I was not aware that Boost.Thread was working as a header only
>>>>> library.
>>>> This was a much-requested feature, so I made sure that boost::mutex
>>>> at least was
>>>> usable header-only.
>>>>
>> Oh, I remember that now.
>>> So would this be fixed or I should switch to lightweight mutex?
>>>
>>>
>> As far as Boost.System is not-header-only we can not have both:
>> boost::mutex header-only and compliant with c++11.
>> As said before, I could let the user the possibility to set Boost.Thread
>> to don't use Boost.System via BOOST_THREAD_DONT_USE_SYSTEM. Artyom,
>> Anthony is this satisfactory for you?
>
> That sounds reasonable to me: if people wish to use Boost.Thread
> header-only then they can define the macro, but anyone who needs to
> use the full features must link against the library, so can cope with
> the additional dependency on Boost.System.
>
> It would be great if we could ensure that code with incompatible
> settings wouldn't link. We could mask out the parts of Boost.Thread
> that do need the library with that macro, for starters, so we don't
> need separate builds of the library with and without that macro.
>
> Anthony
Hi,

Ihave found that a little patch to Boost.System could make it
header-only. It seems that Beman has already tried it, but there are
some errors. Here it is the patch

device3-1:trunk viboes$ svn diff boost/system libs/system
Index: boost/system/error_code.hpp
===================================================================
--- boost/system/error_code.hpp    (revision 76354)
+++ boost/system/error_code.hpp    (working copy)
@@ -504,7 +504,7 @@

  #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas

-# ifdef BOOST_ERROR_CODE_HEADER_ONLY
+# ifdef BOOST_SYSTEM_INLINED
  #   include <boost/../libs/system/src/error_code.cpp>
  # endif

Index: libs/system/src/error_code.cpp
===================================================================
--- libs/system/src/error_code.cpp    (revision 76354)
+++ libs/system/src/error_code.cpp    (working copy)
@@ -407,20 +407,20 @@
    {

  # ifndef BOOST_SYSTEM_NO_DEPRECATED
-    BOOST_SYSTEM_DECL error_code throws; // "throw on error" special
error_code;
+    BOOST_SYSTEM_DECL BOOST_SYSTEM_INLINE error_code throws; // "throw
on error" special error_code;
                                           //  note that it doesn't
matter if this
                                           //  isn't initialized before
use since
                                           //  the only use is to take its
                                           //  address for comparison
purposes
  # endif

-    BOOST_SYSTEM_DECL const error_category & system_category()
+    BOOST_SYSTEM_DECL BOOST_SYSTEM_INLINE const error_category &
system_category()
      {
        static const system_error_category  system_category_const;
        return system_category_const;
      }

-    BOOST_SYSTEM_DECL const error_category & generic_category()
+    BOOST_SYSTEM_DECL BOOST_SYSTEM_INLINE const error_category &
generic_category()
      {
        static const generic_error_category generic_category_const;
        return generic_category_const;


Arytom, please could you try the patch to see if this could work for you
(define BOOST_SYSTEM_INLINED)? If it is the case, we could see with
Beman if he can apply the patch on trunk.

Best,
Vicente

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Mathias Gaunard-2
On 01/21/2012 11:29 PM, Vicente J. Botet Escriba wrote:

> Ihave found that a little patch to Boost.System could make it
> header-only. It seems that Beman has already tried it, but there are
> some errors. Here it is the patch
>
> device3-1:trunk viboes$ svn diff boost/system libs/system
> Index: boost/system/error_code.hpp
> ===================================================================
> --- boost/system/error_code.hpp (revision 76354)
> +++ boost/system/error_code.hpp (working copy)
> @@ -504,7 +504,7 @@
>
> #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
>
> -# ifdef BOOST_ERROR_CODE_HEADER_ONLY
> +# ifdef BOOST_SYSTEM_INLINED
> # include <boost/../libs/system/src/error_code.cpp>
> # endif

Doesn't that still enable autolink with MSVC?


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Vicente Botet
Le 22/01/12 00:23, Mathias Gaunard a écrit :

> On 01/21/2012 11:29 PM, Vicente J. Botet Escriba wrote:
>
>> Ihave found that a little patch to Boost.System could make it
>> header-only. It seems that Beman has already tried it, but there are
>> some errors. Here it is the patch
>>
>> device3-1:trunk viboes$ svn diff boost/system libs/system
>> Index: boost/system/error_code.hpp
>> ===================================================================
>> --- boost/system/error_code.hpp (revision 76354)
>> +++ boost/system/error_code.hpp (working copy)
>> @@ -504,7 +504,7 @@
>>
>> #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
>>
>> -# ifdef BOOST_ERROR_CODE_HEADER_ONLY
>> +# ifdef BOOST_SYSTEM_INLINED
>> # include <boost/../libs/system/src/error_code.cpp>
>> # endif
>
> Doesn't that still enable autolink with MSVC?
>
I don't think so. I could be missing something, could explain why do you
think that?

Vicente



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Beman Dawes
In reply to this post by Vicente Botet
On Sat, Jan 21, 2012 at 5:29 PM, Vicente J. Botet Escriba
<[hidden email]> wrote:
>...
>
> Ihave found that a little patch to Boost.System could make it header-only.
> It seems that Beman has already tried it, but there are some errors.

I'd like to make Boost.System available for header-only use, but IIRC
the suggested changes broke some other libraries that use
Boost.System.

Also, I'd like to see a Boost guideline worked out for how to make
libraries header only without dumping vast numbers of names for
operating system headers into the global namespace.

--Beman

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Vicente Botet
Le 22/01/12 03:37, Beman Dawes a écrit :
> On Sat, Jan 21, 2012 at 5:29 PM, Vicente J. Botet Escriba
> <[hidden email]>  wrote:
>> ...
>>
>> Ihave found that a little patch to Boost.System could make it header-only.
>> It seems that Beman has already tried it, but there are some errors.
> I'd like to make Boost.System available for header-only use, but IIRC
> the suggested changes broke some other libraries that use
> Boost.System.
Please, could you point me to which libraries are you referring to?
> Also, I'd like to see a Boost guideline worked out for how to make
> libraries header only without dumping vast numbers of names for
> operating system headers into the global namespace.

I recognize that it could be difficult for libraries as Boost.Thread or
Boost.FileSystem, but I don't think Boost.System will be on this case as
its dependency are really minor, isn't it?
Could you explain more deeply the problem you want to avoid?

Best,
Vicente

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Artyom Beilis
In reply to this post by Vicente Botet
> From: Vicente J. Botet Escriba <[hidden email]>
> Le 19/01/12 13:12, Artyom Beilis a écrit :
>>>  From: Anthony Williams<[hidden email]>
>>>  On 18/01/12 14:01, Vicente Botet wrote:
>>>>    I was not aware that Boost.Thread was working as a header only
> library.
>>>  This was a much-requested feature, so I made sure that boost::mutex at
> least was
>>>  usable header-only.
>>>
> Oh, I remember that now.
>>  So would this be fixed or I should switch to lightweight mutex?
>>
>>
> As far as Boost.System is not-header-only we can not have both:
> boost::mutex header-only and compliant with c++11.
> As said before, I could let the user the possibility to set Boost.Thread
> to don't use Boost.System via BOOST_THREAD_DONT_USE_SYSTEM. Artyom,
> Anthony is this satisfactory for you?
>
> Best,
> Vicente
>
>


Actually I don't really like using macro BOOST_THREAD_DONT_USE_SYSTEM,
unless the boost-thread with and without it are **binary-compatible**.

If it can't be done I'd rather prefer that Boost.Thread would require
explicit linking.

There is already too much problems with Boost ABI. Consider one
part of library included <boost/thread/mutex.hpp> with 
BOOST_THREAD_DONT_USE_SYSTEM and some other without and linked
with boost_thread. If this macro makes code binary incompatible
it is bad and I don't think it should be used.

There are enough problems with Boost API as it is and I don't
think we would add more.

In this case making lightweight mutexas part of public boost
interface would be much better.


I don't really care about linking with other library I just
wanted to be consistent in my code. That's it.

 
Artyom Beilis
--------------
CppCMS - C++ Web Framework:   http://cppcms.sf.net/ 

CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/>

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Vicente Botet
Le 22/01/12 12:10, Artyom Beilis a écrit :

>> From: Vicente J. Botet Escriba<[hidden email]>
>> Le 19/01/12 13:12, Artyom Beilis a écrit :
>>>>   From: Anthony Williams<[hidden email]>
>>>>   On 18/01/12 14:01, Vicente Botet wrote:
>>>>>     I was not aware that Boost.Thread was working as a header only
>> library.
>>>>   This was a much-requested feature, so I made sure that boost::mutex at
>> least was
>>>>   usable header-only.
>>>>
>> Oh, I remember that now.
>>>   So would this be fixed or I should switch to lightweight mutex?
>>>
>>>
>> As far as Boost.System is not-header-only we can not have both:
>> boost::mutex header-only and compliant with c++11.
>> As said before, I could let the user the possibility to set Boost.Thread
>> to don't use Boost.System via BOOST_THREAD_DONT_USE_SYSTEM. Artyom,
>> Anthony is this satisfactory for you?
>>
>> Best,
>> Vicente
>>
>>
>
> Actually I don't really like using macro BOOST_THREAD_DONT_USE_SYSTEM,
> unless the boost-thread with and without it are **binary-compatible**.
>
> If it can't be done I'd rather prefer that Boost.Thread would require
> explicit linking.
>
> There is already too much problems with Boost ABI. Consider one
> part of library included<boost/thread/mutex.hpp>  with
> BOOST_THREAD_DONT_USE_SYSTEM and some other without and linked
> with boost_thread. If this macro makes code binary incompatible
> it is bad and I don't think it should be used.
>
> There are enough problems with Boost API as it is and I don't
> think we would add more.
>
> In this case making lightweight mutexas part of public boost
> interface would be much better.
>
>
> I don't really care about linking with other library I just
> wanted to be consistent in my code. That's it.

You are right. A library should be header-only or not, but not both.

Let see if Boost.System could be moved to the set of header-only libraries.

If it is not the case, we will see what can be done with lightweight
mutexes.

On the meantime you will need to link with Boost.System :(

Best,
Vicente

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Mathias Gaunard-2
In reply to this post by Vicente Botet
On 01/22/2012 12:38 AM, Vicente J. Botet Escriba wrote:

> Le 22/01/12 00:23, Mathias Gaunard a écrit :
>> On 01/21/2012 11:29 PM, Vicente J. Botet Escriba wrote:
>>
>>> Ihave found that a little patch to Boost.System could make it
>>> header-only. It seems that Beman has already tried it, but there are
>>> some errors. Here it is the patch
>>>
>>> device3-1:trunk viboes$ svn diff boost/system libs/system
>>> Index: boost/system/error_code.hpp
>>> ===================================================================
>>> --- boost/system/error_code.hpp (revision 76354)
>>> +++ boost/system/error_code.hpp (working copy)
>>> @@ -504,7 +504,7 @@
>>>
>>> #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
>>>
>>> -# ifdef BOOST_ERROR_CODE_HEADER_ONLY
>>> +# ifdef BOOST_SYSTEM_INLINED
>>> # include <boost/../libs/system/src/error_code.cpp>
>>> # endif
>>
>> Doesn't that still enable autolink with MSVC?
>>
> I don't think so. I could be missing something, could explain why do you
> think that?

<boost/system/config.hpp> includes <boost/config/auto_link.hpp>
regardless or whether BOOST_SYSTEM_INLINED is defined or not.


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Vicente Botet
Le 22/01/12 13:41, Mathias Gaunard a écrit :

> On 01/22/2012 12:38 AM, Vicente J. Botet Escriba wrote:
>> Le 22/01/12 00:23, Mathias Gaunard a écrit :
>>> On 01/21/2012 11:29 PM, Vicente J. Botet Escriba wrote:
>>>
>>>> Ihave found that a little patch to Boost.System could make it
>>>> header-only. It seems that Beman has already tried it, but there are
>>>> some errors. Here it is the patch
>>>>
>>>> device3-1:trunk viboes$ svn diff boost/system libs/system
>>>> Index: boost/system/error_code.hpp
>>>> ===================================================================
>>>> --- boost/system/error_code.hpp (revision 76354)
>>>> +++ boost/system/error_code.hpp (working copy)
>>>> @@ -504,7 +504,7 @@
>>>>
>>>> #include <boost/config/abi_suffix.hpp> // pops abi_prefix.hpp pragmas
>>>>
>>>> -# ifdef BOOST_ERROR_CODE_HEADER_ONLY
>>>> +# ifdef BOOST_SYSTEM_INLINED
>>>> # include <boost/../libs/system/src/error_code.cpp>
>>>> # endif
>>>
>>> Doesn't that still enable autolink with MSVC?
>>>
>> I don't think so. I could be missing something, could explain why do you
>> think that?
>
> <boost/system/config.hpp> includes <boost/config/auto_link.hpp>
> regardless or whether BOOST_SYSTEM_INLINED is defined or not.
>
>
The code I can see contains

#ifdef BOOST_SYSTEM_INLINED
#define BOOST_SYSTEM_INLINE inline
#define BOOST_SYSTEM_DECL

#else
#define BOOST_SYSTEM_INLINE
...
//
// And include the header that does the work:
//
#include <boost/config/auto_link.hpp>
#endif  // auto-linking disabled

#endif // BOOST_SYSTEM_INLINED

The inclusion of boost/config/auto_link.hpp is on the else part, so
included only when Boost.System will not be inlined.

Vicente

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|

Re: [thread] Can't use boost/thread/mutex.hpp without boost_system

Mathias Gaunard-2
On 01/22/2012 02:01 PM, Vicente J. Botet Escriba wrote:

> The inclusion of boost/config/auto_link.hpp is on the else part, so
> included only when Boost.System will not be inlined.

I thought BOOST_SYSTEM_INLINED was a new macro you were introducing in
this patch.

So header-only support for Boost.System has always been there, and is
not new at all?


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
12