]> www.ginac.de Git - ginac.git/blobdiff - ginac/debugmsg.h
* fixed some mindboggling tremendous superhuge gigantic #*@$&! memory leaks.
[ginac.git] / ginac / debugmsg.h
index caf8bcb42897cc843f4b8226f8013c130f0b17e2..08457b5a91d6d5333ebb476732178e1b43e333f3 100644 (file)
@@ -2,12 +2,32 @@
  *
  *  Utilities needed for debugging only. */
 
-#ifndef _DEBUGMSG_H_
-#define _DEBUGMSG_H_
+/*
+ *  GiNaC Copyright (C) 1999-2001 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __GINAC_DEBUGMSG_H__
+#define __GINAC_DEBUGMSG_H__
+
+#include <iostream>
 
 #ifdef _DEBUG
 #define VERBOSE
-#define DOASSERT (VERBOSE||DEBUG)
+#define DO_GINAC_ASSERT (VERBOSE||DEBUG)
 #endif
 
 #define LOGLEVEL_CONSTRUCT          0x0001
 #define LOGLEVEL_ALL                0xffff
 
 #define LOGMASK (LOGLEVEL_PRINT)
-// #define LOGMASK (LOGLEVEL_PRINT | LOGLEVEL_ASSIGNMENT | LOGLEVEL_OPERATOR | LOGLEVEL_DUPLICATE | LOGLEVEL_OPERATOR | LOGLEVEL_MEMBER_FUNCTION | LOGLEVEL_NONMEMBER_FUNCTION )
-
-#include <assert.h>
-#include <iostream>
+// #define LOGMASK (LOGLEVEL_PRINT | LOGLEVEL_ASSIGNMENT | LOGLEVEL_OPERATOR | LOGLEVEL_DUPLICATE | LOGLEVEL_OPERATOR | LOGLEVEL_MEMBER_FUNCTION | LOGLEVEL_NONMEMBER_FUNCTION)
 
 #ifdef VERBOSE
-#define debugmsg(msg, loglevel) if ((loglevel) & ~LOGMASK) clog << (msg) << endl;
+#define debugmsg(msg, loglevel) if ((loglevel) & ~LOGMASK) std::clog << (msg) << std::endl;
 #else
 #define debugmsg(msg, loglevel)
 #endif // def VERBOSE
 
-#ifdef DOASSERT
-#define ASSERT(X) assert(X)
-#else
-#define ASSERT(X) ((void)0)
-#endif
-
-#endif // ndef _DEBUGMSG_H_
-
+#endif // ndef __GINAC_DEBUGMSG_H__