From: Francesco Chemolli Date: Mon, 12 Nov 2012 13:11:36 +0000 (+0100) Subject: Changed HERE macro to be a true nop, clarified documentation, and marked is as deprec... X-Git-Tag: SQUID_3_4_0_1~521 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc9d2eb0679fbe748b546303ee129004ccc14e78;p=thirdparty%2Fsquid.git 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. --- 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");