Skip to content

Commit afc6572

Browse files
authored
Merge pull request #58 from DankRank/win-fix
Various fixes for Win32/MinGW
2 parents bbcff5a + d95b76d commit afc6572

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.swp
22
*.o
3+
*.exe
34
cscope.out
45
buckle

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ ifdef mingw
1616
CROSS := i686-w64-mingw32-
1717
CFLAGS += -Iwin32/include -Iwin32/include/AL
1818
LDFLAGS += -mwindows -static-libgcc -static-libstdc++
19-
CFLAGS += -DALURE_STATIC_LIBRARY
20-
LIBS += -Lwin32/lib -lALURE32-static -lOpenAL32
19+
LIBS += -Lwin32/lib -lALURE32 -lOpenAL32
2120
SRC += scan-windows.c
2221
else
2322
OS := $(shell uname)
@@ -64,7 +63,7 @@ rec: rec.c
6463
gcc -Wall -Werror rec.c -o rec
6564

6665
clean:
67-
rm -f $(OBJS) $(BIN) core rec
66+
$(RM) $(OBJS) $(BIN) core rec
6867

6968
strip: $(BIN)
7069
$(STRIP) $(BIN)

scan-windows.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static int state[256] = { 0 };
1616

1717
int scan(int verbose)
1818
{
19-
HINSTANCE hInst;
19+
HINSTANCE hInst = GetModuleHandle(NULL);
2020

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

@@ -55,7 +55,7 @@ LRESULT CALLBACK handle_kbh(int nCode, WPARAM wParam, LPARAM lParam)
5555
void open_console()
5656
{
5757
int hConHandle;
58-
long lStdHandle;
58+
INT_PTR lStdHandle;
5959
CONSOLE_SCREEN_BUFFER_INFO coninfo;
6060

6161
FILE *fp;
@@ -66,7 +66,7 @@ void open_console()
6666
coninfo.dwSize.Y = 500;
6767
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
6868

69-
lStdHandle = (long)GetStdHandle(STD_OUTPUT_HANDLE);
69+
lStdHandle = (INT_PTR)GetStdHandle(STD_OUTPUT_HANDLE);
7070
hConHandle = _open_osfhandle(lStdHandle, _O_TEXT);
7171

7272
fp = _fdopen( hConHandle, "w" );

0 commit comments

Comments
 (0)