From 5e440e24c4b7de82994d29cc94072b3ea510150b Mon Sep 17 00:00:00 2001 From: Alex Rousskov Date: Mon, 21 Feb 2011 18:31:02 -0700 Subject: [PATCH] Made icc compiler happier without using a GCC-specific __attribute__. Reverts r11236 while fixing the FileNameHashCacheUser code. Passes an icc test. --- src/base/TextException.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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)) -- 2.47.3