From 66422683e76968b726f1a6e650903ac0acbeac3a Mon Sep 17 00:00:00 2001 From: Raphael Assenat Date: Sat, 24 Oct 2015 15:04:38 -0400 Subject: [PATCH] Add missing stuff for windows build --- tool/Makefile.mingw | 4 ++-- tool/memmem.c | 15 +++++++++++++++ tool/sleep.c | 6 ++++++ tool/sleep.h | 6 ++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 tool/memmem.c create mode 100644 tool/sleep.c create mode 100644 tool/sleep.h diff --git a/tool/Makefile.mingw b/tool/Makefile.mingw index 594f3b3..1aedd31 100644 --- a/tool/Makefile.mingw +++ b/tool/Makefile.mingw @@ -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 diff --git a/tool/memmem.c b/tool/memmem.c new file mode 100644 index 0000000..b7fae87 --- /dev/null +++ b/tool/memmem.c @@ -0,0 +1,15 @@ +#include + +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 + +void sleep(int s) +{ + Sleep(s*1000); +} diff --git a/tool/sleep.h b/tool/sleep.h new file mode 100644 index 0000000..fdc4745 --- /dev/null +++ b/tool/sleep.h @@ -0,0 +1,6 @@ +#ifndef _sleep_h__ +#define _sleep_h__ + +void sleep(int s); + +#endif // _sleep_h__