updated win32 support for MINGW32-compiler/cross-compiler
[librfid] / src / rfid_layer2_iso14443a.c
index 2c4cb1e..f39aa80 100644 (file)
@@ -23,8 +23,9 @@
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
-// #define DEBUG_LIBRFID
+#ifdef  __MINGW32__
+#include <windows.h>
+#endif/*__MINGW32__*/
 
 #include <librfid/rfid.h>
 #include <librfid/rfid_layer2.h>
@@ -350,6 +351,12 @@ iso14443a_init(struct rfid_reader_handle *rh)
 
        memset(h, 0, sizeof(*h));
        
+#ifdef  __MINGW32__
+       randctx[0] ^= GetTickCount();
+#endif/*__MINGW32__*/
+        for(ret=0;ret<23;ret++)
+            random_bit();
+       
        h->l2 = &rfid_layer2_iso14443a;
        h->rh = rh;
        h->priv.iso14443a.state = ISO14443A_STATE_NONE;