X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpolynomial%2Fdebug.h;h=5f191165cfaa3e1ce70dec0a4886b18bcceec44f;hp=48659fdd8bc4d3d2e086d6ec1d12f3a8a32f091d;hb=8cffcdf13d817a47f217f1a1043317d95969e070;hpb=80b1c3e0ee0e465d56e5c76bef4e52ef2dbc5197 diff --git a/ginac/polynomial/debug.h b/ginac/polynomial/debug.h index 48659fdd..5f191165 100644 --- a/ginac/polynomial/debug.h +++ b/ginac/polynomial/debug.h @@ -1,30 +1,53 @@ -#ifndef GINAC_MOD_GCD_DEBUG_HPP -#define GINAC_MOD_GCD_DEBUG_HPP +/** @file debug.h + * + * Utility macros and functions for debugging. */ + +/* + * GiNaC Copyright (C) 1999-2019 Johannes Gutenberg University Mainz, Germany + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef GINAC_MOD_GCD_DEBUG_H +#define GINAC_MOD_GCD_DEBUG_H + +#include "compiler.h" + #include -#include -#include #include -#include "compiler.h" +#include +#include #define DEBUG_PREFIX __func__ << ':' << __LINE__ << ": " #define EXCEPTION_PREFIX std::string(__func__) + std::string(": ") + -#define Dout2(stream, msg) \ -do { \ - stream << DEBUG_PREFIX << msg << std::endl << std::flush; \ +#define Dout2(stream, msg) \ +do { \ + stream << DEBUG_PREFIX << msg << std::endl << std::flush; \ } while (0) #define Dout(msg) Dout2(std::cout, msg) -#define bug3_on(condition, the_exception, msg) \ -do { \ - if (unlikely(condition)) { \ - std::ostringstream err_stream; \ - Dout2(err_stream, "BUG: " << msg); \ - throw the_exception(err_stream.str()); \ - } \ +#define bug3_on(condition, the_exception, msg) \ +do { \ + if (unlikely(condition)) { \ + std::ostringstream err_stream; \ + Dout2(err_stream, "BUG: " << msg); \ + throw the_exception(err_stream.str()); \ + } \ } while (0) #define bug_on(condition, msg) bug3_on(condition, std::logic_error, msg) -#endif // GINAC_MOD_GCD_DEBUG_HPP - +#endif // ndef GINAC_MOD_GCD_DEBUG_H