Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The function ffs doesn't exist for windows, so we have to define it.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 14 Jun 2010 14:44:39 +0000 (14:44 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 14 Jun 2010 14:44:39 +0000 (14:44 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7858 48e7efb5-ca39-0410-a469-dd3cf9ba447f

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)