Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 239d25b in mainline


Ignore:
Timestamp:
2019-07-02T10:58:42Z (16 months ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
master
Children:
4d68584
Parents:
fda6dd4
Message:

cpp: add the ability to catch named exceptions when exceptions are turned off and the trycatch macros are used, change old default handler for catch

File:
1 edited

Legend:

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

    rfda6dd4 r239d25b  
    6767
    6868/**
     69 * The language allows us to odr-use a variable
     70 * that is not defined. We use this to support
     71 * macros redefining the catch keyword that are
     72 * followed by a block that uses that symbol.
     73 *
     74 * Normally, that would produce a compiler error
     75 * as the declaration of that variale would be removed
     76 * with the catch statement, but if we use the following
     77 * declaration's name as the name of the caught exception,
     78 * all will work well because of this extern declaration.
     79 *
     80 * Note: We do not follow our usual convention of using
     81 * the aux:: namespace because that cannot be used in
     82 * variable declaration.
     83 */
     84extern int __exception;
     85
     86/**
    6987 * These macros allow us to choose how the program
    7088 * should behave when an exception is thrown
     
    87105#define LIBCPP_EXCEPTION_IGNORE       /* IGNORE */
    88106#define LIBCPP_EXCEPTION_HANDLE_THROW LIBCPP_EXCEPTION_IGNORE
    89 #define LIBCPP_EXCEPTION_HANDLE_CATCH LIBCPP_EXCEPTION_HANG
     107#define LIBCPP_EXCEPTION_HANDLE_CATCH LIBCPP_EXCEPTION_ABORT
    90108
    91109#define try if constexpr (::std::aux::try_blocks_allowed)
Note: See TracChangeset for help on using the changeset viewer.