From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlneU-0005xK-JY for qemu-devel@nongnu.org; Sat, 17 May 2014 19:04:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WlneL-0003zv-Iz for qemu-devel@nongnu.org; Sat, 17 May 2014 19:04:26 -0400 Received: from mail-we0-x229.google.com ([2a00:1450:400c:c03::229]:61752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WlneL-0003zp-Cs for qemu-devel@nongnu.org; Sat, 17 May 2014 19:04:17 -0400 Received: by mail-we0-f169.google.com with SMTP id u56so4094197wes.0 for ; Sat, 17 May 2014 16:04:16 -0700 (PDT) From: =?UTF-8?q?Marc=20Mar=C3=AD?= Date: Sun, 18 May 2014 01:03:28 +0200 Message-Id: <1400367823-32610-2-git-send-email-marc.mari.barcelo@gmail.com> In-Reply-To: <1400367823-32610-1-git-send-email-marc.mari.barcelo@gmail.com> References: <1400367823-32610-1-git-send-email-marc.mari.barcelo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v3 01/16] include/qemu-common.h: Add QEMU_DPRINTF macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc=20Mar=C3=AD?= , Stefan Hajnoczi , Peter Crosthwaite , =?UTF-8?q?Andreas=20F=C3=A4rber?= Create this macro to let debug macros to have the same format through the codebase and use regular ifs instead of ifdef. Signed-off-by: Marc MarĂ­ --- include/qemu-common.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/qemu-common.h b/include/qemu-common.h index 3f3fd60..acdcf08 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -463,3 +463,10 @@ int parse_debug_env(const char *name, int max, int initial); const char *qemu_ether_ntoa(const MACAddr *mac); #endif + +#define QEMU_DPRINTF(cond,pfx,fmt,...) \ + do { \ + if (cond) { \ + fprintf(stderr, pfx": %s:"fmt, __func__, ## __VA_ARGS__); \ + } \ + } while (0) -- 1.7.10.4