Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for building with exceptions disabled #1146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Oct 21, 2022

  1. Support for building with exceptions disabled

    1) A new macro YAML_CPP_NORETURN to annotate functions as not returning in dll.h
    2) A new function YAML_throw<ExceptionType>(args...) in exception.h
       this function will throw an exception unless exceptions are disabled in the compiler,
       detected by checking the pre-defined macro __cpp_exceptions
       In this case the exception class will be instantiated, and the user-provided function
       YAML::handle_exception(const char*) will be called on the exception's what() method
    3) if exceptions are disabled,and the library's user does not provide YAML::handle_exception,
       there will be a linker error
    4) all other files have been changed automatedly by running the following sed commands
       sed -i "s/throw \([A-Za-z]*\)(\(.*\))/YAML_throw<\1>(\2)/g" # throw statements for non-templated exceptions
       sed -i "s/throw \(.*\)<\(.*\)>(/YAML_throw<\1<\2> >(/g" # throw statements for templated exceptions
    twestenkarl committed Oct 21, 2022
    Configuration menu
    Copy the full SHA
    5b1c606 View commit details
    Browse the repository at this point in the history