[geos-commits] r3564 - in branches/3.3: . tests/unit/capi

svn_geos at osgeo.org svn_geos at osgeo.org
Sun Jan 8 08:46:08 EST 2012


Author: strk
Date: 2012-01-08 05:46:07 -0800 (Sun, 08 Jan 2012)
New Revision: 3564

Modified:
   branches/3.3/CMakeLists.txt
   branches/3.3/NEWS
   branches/3.3/tests/unit/capi/GEOSisValidDetailTest.cpp
Log:
Backports

Missing <cctype> header for toupper. Fixed Visual C++ warning.
Fixed (hopefully) CMake issues with std:: namespace detection (Ticket #493)

Modified: branches/3.3/CMakeLists.txt
===================================================================
--- branches/3.3/CMakeLists.txt	2012-01-07 21:09:01 UTC (rev 3563)
+++ branches/3.3/CMakeLists.txt	2012-01-08 13:46:07 UTC (rev 3564)
@@ -156,11 +156,6 @@
 # Setup C/C++ library features
 #################################################################################
 
-include(TestForSTDNamespace)
-if (CMAKE_NO_STD_NAMESPACE)
-  message(FATAL_ERROR "Detected compiler does not support std namespace on STL classes")
-endif()
-
 # check header files
 include(CheckIncludeFiles)
 

Modified: branches/3.3/NEWS
===================================================================
--- branches/3.3/NEWS	2012-01-07 21:09:01 UTC (rev 3563)
+++ branches/3.3/NEWS	2012-01-08 13:46:07 UTC (rev 3564)
@@ -2,7 +2,8 @@
 2012-??-??
 
 - Bug fixes / improvements
-    - Fix MSVC compilation of ambiguous log() call #506
+    - Fix MSVC compilation of ambiguous log() call (#506)
+    - Fix CMake issues with std:: namespace detection (#493)
 
 Changes in 3.3.2
 2012-01-05

Modified: branches/3.3/tests/unit/capi/GEOSisValidDetailTest.cpp
===================================================================
--- branches/3.3/tests/unit/capi/GEOSisValidDetailTest.cpp	2012-01-07 21:09:01 UTC (rev 3563)
+++ branches/3.3/tests/unit/capi/GEOSisValidDetailTest.cpp	2012-01-08 13:46:07 UTC (rev 3564)
@@ -6,6 +6,7 @@
 // geos
 #include <geos_c.h>
 // std
+#include <cctype>
 #include <cstdarg>
 #include <cstdio>
 #include <cstdlib>
@@ -54,10 +55,13 @@
           return ret;
         }
 
-	void strToUpper(std::string &str)
+        void strToUpper(std::string &str)
         {
-          for(size_t i = 0, len = str.size(); i < len; ++i)
-            str[i] = std::toupper(str[i]);
+            using std::toupper;
+            using std::string;
+            
+            for(string::size_type i = 0, len = str.size(); i < len; ++i)
+                str[i] = static_cast<string::value_type>(toupper(str[i]));
         }
 
         ~test_capiisvaliddetail_data()



More information about the geos-commits mailing list