example/nfc-relay-picc: Move windows related code into contrib/win32

This commit is contained in:
Romuald Conty 2011-06-27 08:56:38 +00:00
parent 4259f595ec
commit 7b6baafd1d
2 changed files with 36 additions and 14 deletions

View file

@ -48,23 +48,12 @@
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <nfc/nfc.h>
#include "nfc-utils.h"
// TODO Move this Windows conditional code in contrib/win32/ or contrib/windows.h
#ifndef _WIN32
// Needed by sleep() under Unix
# include <unistd.h>
# define sleep sleep
# define SUSP_TIME 1 // secs.
#else
// Needed by Sleep() under Windows
# include <winbase.h>
# define sleep Sleep
# define SUSP_TIME 1000 // msecs.
#endif
#define MAX_FRAME_LEN 264
#define MAX_DEVICE_COUNT 2
@ -432,7 +421,7 @@ main (int argc, char *argv[])
if (!quiet_output) {
printf ("Waiting %is to simulate longer relay...\n", waiting_time);
}
sleep(waiting_time * SUSP_TIME);
sleep(waiting_time);
}
// Show transmitted response
if (!quiet_output) {