Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The function ffs doesn't exist for windows, so we have to define it.
[simgrid.git] / src / xbt / setset.c
index e01e105..d5c33e9 100644 (file)
@@ -4,6 +4,23 @@
 #include "setset_private.h"
 #include "xbt/sysdep.h"
 
+/*The function ffs doesn't exist for windows*/
+#ifdef WIN32
+       int XBT_INLINE ffs(int x)
+       {
+               int r;
+               __asm{
+                       mov ecx, [x]
+                       bsf eax, ecx
+                       jnz ffs1
+                       mov eax, -1
+                       ffs1:
+                       mov[r],eax
+               }
+               return(r);
+       }
+#endif
+
 /**
  *  \brief Create a new setset data structure
  *  \param size The initial size of the setset (in number of elements)