[Orxonox-commit 4002] r8676 - code/branches/unity_build/src/libraries/util
rgrieder at orxonox.net
rgrieder at orxonox.net
Mon May 30 00:22:20 CEST 2011
Author: rgrieder
Date: 2011-05-30 00:22:19 +0200 (Mon, 30 May 2011)
New Revision: 8676
Modified:
code/branches/unity_build/src/libraries/util/CMakeLists.txt
code/branches/unity_build/src/libraries/util/Convert.h
Log:
Fixed MSVC warnings in Convert.h in a different fashion that doesn't require CMake code.
Modified: code/branches/unity_build/src/libraries/util/CMakeLists.txt
===================================================================
--- code/branches/unity_build/src/libraries/util/CMakeLists.txt 2011-05-29 22:14:57 UTC (rev 8675)
+++ code/branches/unity_build/src/libraries/util/CMakeLists.txt 2011-05-29 22:22:19 UTC (rev 8676)
@@ -41,13 +41,6 @@
StringUtils.cc
)
-IF(MSVC)
- # Simply using #pragma warning(disable:4244) doesn't really disable it
- # if the warning occurs in a template in another file
- # Hence promote it manually to a higher warning level (4)
- SET_SOURCE_FILES_PROPERTIES(MultiType.cc PROPERTIES COMPILE_FLAGS "-w44244")
-ENDIF()
-
ORXONOX_ADD_LIBRARY(util
FIND_HEADER_FILES
LINK_LIBRARIES
Modified: code/branches/unity_build/src/libraries/util/Convert.h
===================================================================
--- code/branches/unity_build/src/libraries/util/Convert.h 2011-05-29 22:14:57 UTC (rev 8675)
+++ code/branches/unity_build/src/libraries/util/Convert.h 2011-05-29 22:22:19 UTC (rev 8676)
@@ -132,6 +132,12 @@
#include "Debug.h"
#include "ImplicitConversion.h"
+// disable warnings about possible loss of data
+#ifdef ORXONOX_COMPILER_MSVC
+# pragma warning(push)
+# pragma warning(disable:4244)
+#endif
+
namespace orxonox
{
///////////////////
@@ -470,4 +476,9 @@
};
}
+// Reinstate warnings
+#ifdef ORXONOX_COMPILER_MSVC
+# pragma warning(pop)
+#endif
+
#endif /* _Convert_H__ */
More information about the Orxonox-commit
mailing list