[Scummvm-cvs-logs] scummvm master -> 263adb5cfcd485a99ad869ed702586202e8bc7b6

lordhoto lordhoto at gmail.com
Sun May 29 21:16:45 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
263adb5cfc COMMON: Limit pragma warning use in algorithm.h to MSVC.


Commit: 263adb5cfcd485a99ad869ed702586202e8bc7b6
    https://github.com/scummvm/scummvm/commit/263adb5cfcd485a99ad869ed702586202e8bc7b6
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2011-05-29T12:12:42-07:00

Commit Message:
COMMON: Limit pragma warning use in algorithm.h to MSVC.

Since we only want to disable a MSVC specific warning with it and other
compilers might have different warnings numbers it is safer to only target
MSVC here.

Changed paths:
    common/algorithm.h



diff --git a/common/algorithm.h b/common/algorithm.h
index fa9d08b..00c0e1c 100644
--- a/common/algorithm.h
+++ b/common/algorithm.h
@@ -236,8 +236,10 @@ void sort(T first, T last) {
 
 // MSVC is complaining about the minus operator being applied to an unsigned type
 // We disable this warning for the affected section of code
+#if defined(_MSC_VER)
 #pragma warning(push)
 #pragma warning(disable: 4146)
+#endif
 
 /**
  * Euclid's algorithm to compute the greatest common divisor.
@@ -261,7 +263,9 @@ T gcd(T a, T b) {
 	return b;
 }
 
+#if defined(_MSC_VER)
 #pragma warning(pop)
+#endif
 
 } // End of namespace Common
 #endif






More information about the Scummvm-git-logs mailing list