Bug 402395 - Dangling semi-colon caused when "ac_add_options --disable-logging" throws warning in VS2005. patch by Masayuki Nakano (masayuki@d-toybox.com), r=dwitte, sr=bsmedberg, a=beltzner for M9.
authordwitte@stanford.edu
Mon, 05 Nov 2007 11:29:12 -0800
changeset 7342 7fa45d09cd376bf900929011a98bb9fb43e0bd7e
parent 7341 1840305d8700dc45f5de78734ceda6a96635461e
child 7343 b10e2342b3983f5dc3850be83df74fd6658ad0e6
push idunknown
push userunknown
push dateunknown
reviewersdwitte, bsmedberg, beltzner
bugs402395
milestone1.9a9pre
Bug 402395 - Dangling semi-colon caused when "ac_add_options --disable-logging" throws warning in VS2005. patch by Masayuki Nakano (masayuki@d-toybox.com), r=dwitte, sr=bsmedberg, a=beltzner for M9.
netwerk/cookie/src/nsCookieService.cpp
--- a/netwerk/cookie/src/nsCookieService.cpp
+++ b/netwerk/cookie/src/nsCookieService.cpp
@@ -201,19 +201,21 @@ struct nsEnumerationData
 #define GET_COOKIE PR_FALSE
 
 #ifdef PR_LOGGING
 static PRLogModuleInfo *sCookieLog = PR_NewLogModule("cookie");
 
 #define COOKIE_LOGFAILURE(a, b, c, d)    LogFailure(a, b, c, d)
 #define COOKIE_LOGSUCCESS(a, b, c, d, e) LogSuccess(a, b, c, d, e)
 #define COOKIE_LOGEVICTED(a)             LogEvicted(a)
-#define COOKIE_LOGSTRING(lvl, fmt) \
-  PR_LOG(sCookieLog, lvl, fmt);    \
-  PR_LOG(sCookieLog, lvl, ("\n"))
+#define COOKIE_LOGSTRING(lvl, fmt)   \
+  PR_BEGIN_MACRO                     \
+    PR_LOG(sCookieLog, lvl, fmt);    \
+    PR_LOG(sCookieLog, lvl, ("\n")); \
+  PR_END_MACRO
 
 static void
 LogFailure(PRBool aSetCookie, nsIURI *aHostURI, const char *aCookieString, const char *aReason)
 {
   // if logging isn't enabled, return now to save cycles
   if (!PR_LOG_TEST(sCookieLog, PR_LOG_WARNING))
     return;
 
@@ -317,20 +319,20 @@ LogFailure(PRBool aSetCookie, nsIURI *aH
 
 static inline void
 LogSuccess(PRBool aSetCookie, nsIURI *aHostURI, const nsAFlatCString &aCookieString, nsCookie *aCookie, PRBool aReplacing)
 {
   LogSuccess(aSetCookie, aHostURI, aCookieString.get(), aCookie, aReplacing);
 }
 
 #else
-#define COOKIE_LOGFAILURE(a, b, c, d)    /* nothing */
-#define COOKIE_LOGSUCCESS(a, b, c, d, e) /* nothing */
-#define COOKIE_LOGEVICTED(a)             /* nothing */
-#define COOKIE_LOGSTRING(a, b)           /* nothing */
+#define COOKIE_LOGFAILURE(a, b, c, d)    PR_BEGIN_MACRO /* nothing */ PR_END_MACRO
+#define COOKIE_LOGSUCCESS(a, b, c, d, e) PR_BEGIN_MACRO /* nothing */ PR_END_MACRO
+#define COOKIE_LOGEVICTED(a)             PR_BEGIN_MACRO /* nothing */ PR_END_MACRO
+#define COOKIE_LOGSTRING(a, b)           PR_BEGIN_MACRO /* nothing */ PR_END_MACRO
 #endif
 
 /******************************************************************************
  * nsCookieService impl:
  * private list sorting callbacks
  *
  * these functions return:
  *   < 0 if the first element should come before the second element,