Changeset 6fa83f0 in mainline


Ignore:
Timestamp:
2018-07-05T21:41:23Z (6 years ago)
Author:
Dzejrou <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
68cfab1
Parents:
e7970fe
git-author:
Dzejrou <dzejrou@…> (2018-05-07 21:20:43)
git-committer:
Dzejrou <dzejrou@…> (2018-07-05 21:41:23)
Message:

cpp: added a macro that can be used for testing to check if an object was thrown

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/cpp/include/internal/trycatch.hpp

    re7970fe r6fa83f0  
    116116    if constexpr (expr = {}; ::std::aux::catch_blocks_allowed)
    117117
     118/**
     119 * This macro can be used for testing the library. If
     120 * exception handling is not available, it uses the
     121 * internal bool variable and if it is, it uses a
     122 * universal catch clause in which it sets the passed
     123 * checking variable to true.
     124 */
     125#define LIBCPP_EXCEPTION_THROW_CHECK(variable) \
     126    variable = ::std::aux::exception_thrown
     127
     128#else
     129#define LIBCPP_EXCEPTION_THROW_CHECK(variable) \
     130    catch (...) \
     131    { \
     132        variable = true; \
     133    }
    118134#endif
    119135
Note: See TracChangeset for help on using the changeset viewer.