[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42627] branches/carve_booleans/extern/ carve/include/carve: Carve booleans: cleanup and compile fix for msvc

Sergey Sharybin sergey.vfx at gmail.com
Wed Dec 14 10:53:38 CET 2011


Revision: 42627
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42627
Author:   nazgul
Date:     2011-12-14 09:53:25 +0000 (Wed, 14 Dec 2011)
Log Message:
-----------
Carve booleans: cleanup and compile fix for msvc

Patches for bundling are bit outdated now, will update them when all
planned changes would be done to carve.

Modified Paths:
--------------
    branches/carve_booleans/extern/carve/include/carve/boost/random.hpp
    branches/carve_booleans/extern/carve/include/carve/collection/unordered/vcpp_impl.hpp
    branches/carve_booleans/extern/carve/include/carve/win32.h

Removed Paths:
-------------
    branches/carve_booleans/extern/carve/include/carve/external/

Modified: branches/carve_booleans/extern/carve/include/carve/boost/random.hpp
===================================================================
--- branches/carve_booleans/extern/carve/include/carve/boost/random.hpp	2011-12-14 08:51:50 UTC (rev 42626)
+++ branches/carve_booleans/extern/carve/include/carve/boost/random.hpp	2011-12-14 09:53:25 UTC (rev 42627)
@@ -3,11 +3,14 @@
 #include <iostream>
 #include <vector>
 #include <limits>
-#include <stdint.h>
 #include <stdexcept>
 #include <cmath>
 #include <algorithm>
 
+#if !defined(_MSC_VER)
+#include <stdint.h>
+#endif
+
 namespace boost {
 
 // type_traits could help here, but I don't want to depend on type_traits.

Modified: branches/carve_booleans/extern/carve/include/carve/collection/unordered/vcpp_impl.hpp
===================================================================
--- branches/carve_booleans/extern/carve/include/carve/collection/unordered/vcpp_impl.hpp	2011-12-14 08:51:50 UTC (rev 42626)
+++ branches/carve_booleans/extern/carve/include/carve/collection/unordered/vcpp_impl.hpp	2011-12-14 09:53:25 UTC (rev 42627)
@@ -20,6 +20,22 @@
 #include <hash_map>
 #include <hash_set>
 
+namespace stdext {
+    template <class T>
+    inline void hash_combine(std::size_t& seed, T const& v)
+    {
+        seed ^= hash_value(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
+    }
+
+    template<class _Ty1, class _Ty2> inline
+    size_t hash_value(const std::pair<_Ty1, _Ty2>& _Keyval) {
+        size_t seed = 0;
+        hash_combine(seed, _Keyval.first);
+        hash_combine(seed, _Keyval.second);
+        return seed;
+    }
+}
+
 namespace std {
 
   namespace {
@@ -53,7 +69,7 @@
     unordered_map() : super() {}
   };
 
-  template <typename Value, typename Hash = stdext::hash_compare<Key, less<Key> >, typename Pred = std::equal_to<Value> >
+  template <typename Value, typename Hash = stdext::hash_compare<Value, less<Value> >, typename Pred = std::equal_to<Value> >
   class unordered_set
     : public stdext::hash_set<Value, hash_traits<Value, Hash> > {
     typedef stdext::hash_set<Value, hash_traits<Value, Hash> > super;

Modified: branches/carve_booleans/extern/carve/include/carve/win32.h
===================================================================
--- branches/carve_booleans/extern/carve/include/carve/win32.h	2011-12-14 08:51:50 UTC (rev 42626)
+++ branches/carve_booleans/extern/carve/include/carve/win32.h	2011-12-14 09:53:25 UTC (rev 42627)
@@ -5,14 +5,20 @@
 #pragma warning (disable : 4996)
 #pragma warning (disable : 4786)
 
-#if 0
-typedef char int8_t;
-typedef short int16_t;
-typedef long int32_t;
+#if defined(_WIN32) && !defined(__MINGW32__)
 
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned long uint32_t;
+/* The __intXX are built-in types of the visual complier! So we don't
+   need to include anything else here.
+   Thistypedefs should be in sync with types from MEM_sys_types.h */
+
+typedef signed __int8  int8_t;
+typedef signed __int16 int16_t;
+typedef signed __int32 int32_t;
+
+typedef unsigned __int8  uint8_t;
+typedef unsigned __int16 uint16_t;
+typedef unsigned __int32 uint32_t;
+
 #endif
 
 #include <string.h>




More information about the Bf-blender-cvs mailing list