From 64996a0a056b716c85d1702329ef9f774f2f12e5 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Sat, 20 Apr 2013 03:34:52 +0000 Subject: [PATCH] Forum: #1177. Only compile EXIV2_RCSID for Complers: GCC/G++/MSC to silence warnings. All others (clang,Oracle) ignore. Added Oracle compiler detection to version.cpp --- src/rcsid_int.hpp | 14 +++----------- src/version.cpp | 9 +++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/rcsid_int.hpp b/src/rcsid_int.hpp index 030e675d..973f3f5b 100644 --- a/src/rcsid_int.hpp +++ b/src/rcsid_int.hpp @@ -53,22 +53,14 @@ */ -#if defined(__clang__) -#define EXIV2_RCSID(id) - -#elif defined(OS_SOLARIS) -#define EXIV2_RCSID(id) \ - { \ - inline const char* getRcsId(const char*) { return id ; } \ - const char* rcsId = getRcsId(rcsId); \ - } - -#else +#if defined(__GNUG__) || defined(__GNUC__) || defined (_MSC_VER) #define EXIV2_RCSID(id) \ namespace { \ inline const char* getRcsId(const char*) { return id ; } \ const char* rcsId = getRcsId(rcsId); \ } +#else +#define EXIV2_RCSID(id) #endif #endif // #if !defined (EXIV2_RCSID) diff --git a/src/version.cpp b/src/version.cpp index 6bc6aef8..6883b394 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -169,10 +169,19 @@ EXIV2API void dumpLibraryInfo(std::ostream& os) "G++" ; #elif defined(__GNUC__) "GCC" ; +#elif defined(__SUNPRO_CC) + "CC (oracle)"; +#elif defined (__SUNPRO_C) + "cc (oracle)"; #else "unknown" ; #endif +#if defined(__SUNPRO_CC) || defined (__SUNPRO_C) +#define __oracle__ +#endif + + #ifndef __VERSION__ #ifdef __clang__version__ #define __VERSION__ __clang__version__