]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Made icc compiler happier without using a GCC-specific __attribute__.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 22 Feb 2011 01:31:02 +0000 (18:31 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 22 Feb 2011 01:31:02 +0000 (18:31 -0700)
Reverts r11236 while fixing the FileNameHashCacheUser code. Passes an icc test.

src/base/TextException.h

index bbad80387aa8d447fe4bcbf1327462dc5194c3c7..20a71c43db0d78ca9b3f022e547f1dea321aa6ca 100644 (file)
@@ -5,9 +5,6 @@
 
 #include <exception>
 
-#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))