From: Alex Rousskov Date: Tue, 22 Feb 2011 01:31:02 +0000 (-0700) Subject: Made icc compiler happier without using a GCC-specific __attribute__. X-Git-Tag: take06~27^2~135 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e440e24c4b7de82994d29cc94072b3ea510150b;p=thirdparty%2Fsquid.git Made icc compiler happier without using a GCC-specific __attribute__. Reverts r11236 while fixing the FileNameHashCacheUser code. Passes an icc test. --- diff --git a/src/base/TextException.h b/src/base/TextException.h index bbad80387a..20a71c43db 100644 --- a/src/base/TextException.h +++ b/src/base/TextException.h @@ -5,9 +5,6 @@ #include -#if __GNUC__ -__attribute__((unused)) -#endif static unsigned int FileNameHashCached(const char *fname); // simple exception to report custom errors @@ -63,6 +60,12 @@ FileNameHashCached(const char *fname) return lastHash; } +/// Avoids "defined but not used" warnings for FileNameHashCached +class FileNameHashCacheUser +{ + bool use(void *ptr=NULL) { return ptr != (void*)&FileNameHashCached; } +}; + #if !defined(TexcHere) # define TexcHere(msg) TextException((msg), __FILE__, __LINE__, \ (FileNameHashCached(__FILE__)<<14) | (__LINE__ & 0x3FFF))