From 96fd394e573465f44a7d3a868b1fba8c27b08883 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Fri, 26 Jul 2002 20:00:40 +0000 Subject: [PATCH] Added SET_ERROR macro. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@461 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/registrar/Debug.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/servers/registrar/Debug.h b/src/servers/registrar/Debug.h index 1cc894772a..487686f2ed 100644 --- a/src/servers/registrar/Debug.h +++ b/src/servers/registrar/Debug.h @@ -5,6 +5,9 @@ ** Initial version by Axel Dörfler, axeld@pinc-software.de ** This file may be used under the terms of the OpenBeOS License. */ +#ifndef DEBUG +# define DEBUG 1 +#endif #include #define __out printf @@ -26,8 +29,9 @@ #define DEBUG_APP "REG" #ifdef DEBUG #define PRINT(x) { __out(DEBUG_APP ": "); __out x; } - #define REPORT_ERROR(status) __out(DEBUG_APP ": %s:%ld: %s\n",__FUNCTION__,__LINE__,strerror(status)); + #define REPORT_ERROR(status) __out(DEBUG_APP ": %s:%d: %s\n",__FUNCTION__,__LINE__,strerror(status)); #define RETURN_ERROR(err) { status_t _status = err; if (_status < B_OK) REPORT_ERROR(_status); return _status;} + #define SET_ERROR(var, err) { status_t _status = err; if (_status < B_OK) REPORT_ERROR(_status); var = _status; } #define FATAL(x) { __out(DEBUG_APP ": "); __out x; } #define INFORM(x) { __out(DEBUG_APP ": "); __out x; } #define FUNCTION(x) { __out(DEBUG_APP ": %s() ",__FUNCTION__); __out x; } @@ -38,6 +42,7 @@ #define PRINT(x) ; #define REPORT_ERROR(status) ; #define RETURN_ERROR(status) return status; + #define SET_ERROR(var, err) var = err; #define FATAL(x) { __out(DEBUG_APP ": "); __out x; } #define INFORM(x) { __out(DEBUG_APP ": "); __out x; } #define FUNCTION(x) ;