added option to not use custom assert macro

This commit is contained in:
Arvid Norberg 2011-02-24 18:15:15 +00:00
parent 47822c27fe
commit 20d763c8c7
3 changed files with 20 additions and 2 deletions

View File

@ -245,9 +245,10 @@ feature.compose <iconv>off : <define>TORRENT_USE_ICONV=0 ;
feature full-stats : on off : composite propagated link-incompatible ;
feature.compose <full-stats>off : <define>TORRENT_DISABLE_FULL_STATS ;
feature asserts : on off production : composite propagated ;
feature asserts : on off production system : composite propagated ;
feature.compose <asserts>production : <define>TORRENT_PRODUCTION_ASSERTS=1 ;
feature.compose <asserts>off : <define>TORRENT_NO_ASSERTS=1 ;
feature.compose <asserts>system : <define>TORRENT_USE_SYSTEM_ASSERTS=1 ;
feature windows-version : 2k xp vista win7 : composite propagated link-incompatible ;
feature.compose <windows-version>2k : <define>_WIN32_WINNT=0x0500 ;

View File

@ -363,6 +363,15 @@ Build features:
| | * ``off`` - force not using iconv (disables locale |
| | awareness except on windows). |
+--------------------------+----------------------------------------------------+
| ``asserts`` | * ``off`` - disable all asserts |
| | * ``peoduction`` - enable asserts in release |
| | builds, but don't abort, just log them to |
| | ``extern char const* libtorrent_assert_log``. |
| | * ``on`` - enable asserts in debug builds (this is |
| | the default). On GNU systems, print a stack |
| | trace of the assert and some more information. |
| | * ``system`` use the libc assert macro |
+--------------------------+----------------------------------------------------+
.. _MaxMind: http://www.maxmind.com/app/api
@ -626,6 +635,14 @@ defines you can use to control the build.
| ``TORRENT_NO_DEPRECATE`` | This will exclude all deprecated functions from |
| | the header files and cpp files. |
+----------------------------------------+-------------------------------------------------+
| ``TORRENT_PRODUCTION_ASSERTS`` | Define to either 0 or 1. Enables assert logging |
| | in release builds. |
+----------------------------------------+-------------------------------------------------+
| ``TORRENT_NO_ASSERTS`` | Disables all asserts. |
+----------------------------------------+-------------------------------------------------+
| ``TORRENT_USE_SYSTEM_ASSERTS`` | Uses the libc assert macro rather then the |
| | custom one. |
+----------------------------------------+-------------------------------------------------+
If you experience that libtorrent uses unreasonable amounts of cpu, it will

View File

@ -49,7 +49,7 @@ extern char const* libtorrent_assert_log;
std::string demangle(char const* name);
#endif
#if (defined __linux__ || defined __MACH__) && defined __GNUC__
#if (defined __linux__ || defined __MACH__) && defined __GNUC__ && !TORRENT_USE_SYSTEM_ASSERT
#if TORRENT_USE_IOSTREAM
#include <sstream>