You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

You want to handle fatal errors (assertions) yourself rather than have the library call abort()

Step-by-step guide

This can be done via the C API

  1. Define a function with the following signature:

    typedef void (*codes_assertion_failed_proc)(const char* message);
  2. Then call

    codes_set_codes_assertion_failed_proc(&your_function);
  3. Now the library will call the chosen function (which for example could do nothing or throw a C++ exception) instead of the abort.
  4. To restore the default behaviour, call

    codes_set_codes_assertion_failed_proc(NULL);
  5. xx




  • No labels