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

This commit is contained in:
Robin Mills
2013-04-20 03:34:52 +00:00
parent 8f86aab390
commit 64996a0a05
2 changed files with 12 additions and 11 deletions
+3 -11
View File
@@ -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)
+9
View File
@@ -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__