From fc9d2eb0679fbe748b546303ee129004ccc14e78 Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Mon, 12 Nov 2012 14:11:36 +0100 Subject: [PATCH] Changed HERE macro to be a true nop, clarified documentation, and marked is as deprecated. Fixed syntax bug in comm.cc unearthed by the macro-to-function change. --- src/Debug.h | 15 +++++++++++---- src/comm.cc | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Debug.h b/src/Debug.h index a117d85f42..3df1cfc0de 100644 --- a/src/Debug.h +++ b/src/Debug.h @@ -115,13 +115,20 @@ const char * SkipBuildPrefix(const char* path); } \ } while (/*CONSTCOND*/ 0) -/* - * HERE is a macro that you can use like this: +/** stream manipulator which does nothing. + * \deprecated Do not add to new code, and remove when editing old code * + * Its purpose is to inactivate calls made following previous debugs() + * guidelines such as * debugs(1,2, HERE << "some message"); + * + * His former objective is now absorbed in the debugs call itself */ -//TODO: just before branching Squid 3.4, blanket-remove HERE from the source -#define HERE "" +inline std::ostream& +HERE(std::ostream& s) +{ + return s; +} /* * MYNAME is for use at debug levels 0 and 1 where HERE is too messy. diff --git a/src/comm.cc b/src/comm.cc index 9412564c24..5a87c69189 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -2135,7 +2135,7 @@ comm_open_uds(int sock_type, return -1; } - debugs(50, 3, HERE "Opened UDS FD " << new_socket << " : family=" << AI.ai_family << ", type=" << AI.ai_socktype << ", protocol=" << AI.ai_protocol); + debugs(50, 3, "Opened UDS FD " << new_socket << " : family=" << AI.ai_family << ", type=" << AI.ai_socktype << ", protocol=" << AI.ai_protocol); /* update fdstat */ debugs(50, 5, HERE << "FD " << new_socket << " is a new socket"); -- 2.47.2