Skip to content

Commit

Permalink
Merge pull request #58 from DankRank/win-fix
Browse files Browse the repository at this point in the history
Various fixes for Win32/MinGW
  • Loading branch information
zevv authored Jun 23, 2017
2 parents bbcff5a + d95b76d commit afc6572
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.swp
*.o
*.exe
cscope.out
buckle
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ ifdef mingw
CROSS := i686-w64-mingw32-
CFLAGS += -Iwin32/include -Iwin32/include/AL
LDFLAGS += -mwindows -static-libgcc -static-libstdc++
CFLAGS += -DALURE_STATIC_LIBRARY
LIBS += -Lwin32/lib -lALURE32-static -lOpenAL32
LIBS += -Lwin32/lib -lALURE32 -lOpenAL32
SRC += scan-windows.c
else
OS := $(shell uname)
Expand Down Expand Up @@ -64,7 +63,7 @@ rec: rec.c
gcc -Wall -Werror rec.c -o rec

clean:
rm -f $(OBJS) $(BIN) core rec
$(RM) $(OBJS) $(BIN) core rec

strip: $(BIN)
$(STRIP) $(BIN)
6 changes: 3 additions & 3 deletions scan-windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static int state[256] = { 0 };

int scan(int verbose)
{
HINSTANCE hInst;
HINSTANCE hInst = GetModuleHandle(NULL);

kbh = SetWindowsHookEx(WH_KEYBOARD_LL, handle_kbh, hInst, 0);

Expand Down Expand Up @@ -55,7 +55,7 @@ LRESULT CALLBACK handle_kbh(int nCode, WPARAM wParam, LPARAM lParam)
void open_console()
{
int hConHandle;
long lStdHandle;
INT_PTR lStdHandle;
CONSOLE_SCREEN_BUFFER_INFO coninfo;

FILE *fp;
Expand All @@ -66,7 +66,7 @@ void open_console()
coninfo.dwSize.Y = 500;
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);

lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
lStdHandle = (INT_PTR)GetStdHandle(STD_OUTPUT_HANDLE);
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);

fp = _fdopen( hConHandle, "w" );
Expand Down

0 comments on commit afc6572

Please sign in to comment.