# # # patch "sanity.hh" # from [951ca81383d05b993b47eabd193ed463da4c7d86] # to [19833d71e120eb72d50c8af9bbd6a246ccecf971] # # patch "transforms.cc" # from [6e6641098498ee2cce52e6bc37bc784532fb6d5c] # to [6e2402c0251b0a18051c43bbd9b5a6887391978c] # ============================================================ --- sanity.hh 951ca81383d05b993b47eabd193ed463da4c7d86 +++ sanity.hh 19833d71e120eb72d50c8af9bbd6a246ccecf971 @@ -24,10 +24,12 @@ #include "mt-stdint.h" #include "quick_alloc.hh" // to get the QA() macro -#ifdef __GNUC__ -#define NORETURN __attribute__((noreturn)) +#if defined(__GNUC__) +#define NORETURN(x) x __attribute__((noreturn)) +#elif defined(WIN32) +#define NORETURN(x) __declspec(noreturn) x #else -#define NORETURN +#define NORETURN(x) x #endif // our assertion / sanity / error logging system *was* based on GNU Nana, @@ -76,17 +78,17 @@ struct sanity { char const * file, int line); void warning(i18n_format const & fmt, char const * file, int line); - void naughty_failure(std::string const & expr, i18n_format const & explain, - std::string const & file, int line) NORETURN; - void error_failure(std::string const & expr, i18n_format const & explain, - std::string const & file, int line) NORETURN; - void invariant_failure(std::string const & expr, - std::string const & file, int line) NORETURN; - void index_failure(std::string const & vec_expr, + NORETURN(void naughty_failure(std::string const & expr, i18n_format const & explain, + std::string const & file, int line)); + NORETURN(void error_failure(std::string const & expr, i18n_format const & explain, + std::string const & file, int line)); + NORETURN(void invariant_failure(std::string const & expr, + std::string const & file, int line)); + NORETURN(void index_failure(std::string const & vec_expr, std::string const & idx_expr, unsigned long sz, unsigned long idx, - std::string const & file, int line) NORETURN; + std::string const & file, int line)); void gasp(); private: ============================================================ --- transforms.cc 6e6641098498ee2cce52e6bc37bc784532fb6d5c +++ transforms.cc 6e2402c0251b0a18051c43bbd9b5a6887391978c @@ -60,7 +60,9 @@ using boost::scoped_array; // paradigm "must" be used. this program is intended for source code // control and I make no bones about it. -static void NORETURN +NORETURN(static void error_in_transform(Botan::Exception & e)); + +static void error_in_transform(Botan::Exception & e) { // why do people make up their own out-of-memory exceptions?