Add missing stuff for windows build

This commit is contained in:
Raphael Assenat 2015-10-24 15:04:38 -04:00
parent 9f1dbf6bdd
commit 66422683e7
4 changed files with 29 additions and 2 deletions

View File

@ -6,9 +6,9 @@ LDFLAGS=-lsetupapi
PREFIX=/usr/local
PROG=wusbmote_ctl
PROG=gcn64ctl
OBJS=main.o wusbmote.o hid.o
OBJS=main.o gcn64.o mempak.o gcn64lib.o hexdump.o gc2n64_adapter.o ihex.o delay.o hid.o sleep.o memmem.o
.PHONY : clean install

15
tool/memmem.c Normal file
View File

@ -0,0 +1,15 @@
#include <string.h>
void *memmem(const void *haystack, size_t haystack_len,
const void *needle, size_t needle_len)
{
int i;
if (needle_len > haystack_len)
return NULL;
for (i=0; i<haystack_len; i++) {
if (!memcmp(haystack +i, needle, needle_len))
return haystack + i;
}
return NULL;
}

6
tool/sleep.c Normal file
View File

@ -0,0 +1,6 @@
#include <windows.h>
void sleep(int s)
{
Sleep(s*1000);
}

6
tool/sleep.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef _sleep_h__
#define _sleep_h__
void sleep(int s);
#endif // _sleep_h__