Salome HOME
Porting to OCCT 7.8.0 mbs/OCCT780_Rebased
authorjfa <jfa@opencascade.com>
Mon, 15 Jan 2024 13:31:55 +0000 (13:31 +0000)
committermbs <martin.bernhard@opencascade.com>
Thu, 28 Mar 2024 18:49:17 +0000 (18:49 +0000)
src/Basics/smIdType.hxx.in

index 4ad268d72577690a54051a3cd7d61ff1e0e9569a..d1b3e9e61ba6a554c82181070089e2b48c461e67 100644 (file)
 
 #cmakedefine SALOME_USE_64BIT_IDS
 
+#include "Basics_OCCTVersion.hxx"
+
 #include <cinttypes>
+#include <cstddef>
 #include <limits>
 
 #ifndef SALOME_USE_64BIT_IDS
@@ -36,6 +39,7 @@ typedef std::int64_t smIdType;
 
 struct smIdHasher
 {
+#if OCC_VERSION_LARGE < 0x07080000
   static int HashCode(const smIdType theValue,  const int theUpperBound)
   {
     return static_cast<int> ((theValue & std::numeric_limits<smIdType>::max()) % theUpperBound + 1);
@@ -45,6 +49,16 @@ struct smIdHasher
   {
     return id1 == id2;
   }
+#else
+  size_t operator()(const smIdType theValue) const
+  {
+    return static_cast<size_t> (theValue & std::numeric_limits<smIdType>::max());
+  }
+  bool operator()(const smIdType& theValue1, const smIdType& theValue2) const
+  {
+    return theValue1 == theValue2;
+  }
+#endif
 };
 
 template <class T> inline smIdType ToSmIdType(T val)