Archived
1
0
Fork 0

Removed a unused file and updated debug.h macros

This commit is contained in:
Henrik Hautakoski 2010-04-27 08:45:13 +02:00 committed by Henrik Hautakoski
parent aca1e7240f
commit 401b11fdcf
2 changed files with 17 additions and 30 deletions

View file

@ -1,25 +1,19 @@
/* /* common/debug.h - debugging macros and definitions
* Common Debugging macros and definitions
*
* Copyright (C) 2010 Archived
* *
* This program is free software: you can redistribute it and/or modify * Copyright (C) 2010 Henrik Hautakoski <henrik.hautakoski@gmail.com>
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is free software: you can redistribute it and/or modify
* but WITHOUT ANY WARRANTY; without even the implied warranty of * it under the terms of the GNU General Public License as published by
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * the Free Software Foundation, either version 3 of the License, or
* GNU General Public License for more details. * (at your option) any later version.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _COMMON_DEBUG_H #ifndef __COMMON_DEBUG_H
#define _COMMON_DEBUG_H #define __COMMON_DEBUG_H
#include <stdio.h>
#include <stdlib.h>
#define __perror(...) fprintf(stderr, __VA_ARGS__) #define __perror(...) fprintf(stderr, __VA_ARGS__)
@ -29,8 +23,7 @@
#ifdef __DEBUG__ #ifdef __DEBUG__
#include <stdio.h> #define __str(x) #x
#include <stdlib.h>
#define dassert(expr) \ #define dassert(expr) \
((expr) ? \ ((expr) ? \
@ -38,11 +31,14 @@
__perror("ASSERT: \"" #expr "\" at %s:%i\n", __FILE__, __LINE__)) __perror("ASSERT: \"" #expr "\" at %s:%i\n", __FILE__, __LINE__))
#define dprint(...) \ #define dprint(...) \
__perror("DEBUG: " __VA_ARGS__) __dprint(__FILE__, __LINE__, __VA_ARGS__)
#define __dprint(file, line, ...) \
__perror("# " file ":" __str(line) " -> " __VA_ARGS__)
#else #else
#define dassert(expr) #define dassert(expr)
#define dprint(...) #define dprint(...)
#endif #endif
#endif /* _COMMON_DEBUG_H */ #endif /* __COMMON_DEBUG_H */

View file

@ -1,9 +0,0 @@
#include <string.h>
#include <stdio.h>
#include <assert.h>
void unit_fmt_path() {
assert();
}