--- helpers/makesis-2.0.0/src/stub.cpp.orig	2012-12-02 13:45:00.000000000 +0900
+++ helpers/makesis-2.0.0/src/stub.cpp	2012-12-02 13:45:36.000000000 +0900
@@ -3,6 +3,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <stdlib.h> /* mbstowcs */
+#include <stdint.h>
 #include <unistd.h> /* read */
 #include <errno.h>
 #include <stdio.h>
@@ -68,7 +69,7 @@
 BOOL ReadFile(HANDLE hFile, LPVOID buffer, DWORD bytesToRead,
 	      LPDWORD bytesRead, void *)
 {
-	int fd = (int)hFile;
+	int fd = (uintptr_t)hFile;
 
 	const int size = read(fd, buffer, bytesToRead);
 
@@ -84,13 +85,13 @@
 
 BOOL CloseHandle(HANDLE fd)
 {
-	return close((int)fd) == 0;
+	return close((uintptr_t)fd) == 0;
 }
 
 
 DWORD WINAPI GetFileSize(HANDLE h, LPDWORD)
 {
-	int fd = (int)h;
+	int fd = (uintptr_t)h;
 	int ret = 0;
 
 	struct stat s;
@@ -167,7 +168,7 @@
 	       LPCVOID buffer, DWORD bytesToWrite,
 	       LPDWORD bytesWritten, void*)
 {
-	int fd = (int)hFile;
+	int fd = (uintptr_t)hFile;
 
 	ssize_t ret = write(fd, buffer, bytesToWrite);
 	if(ret == -1) {
@@ -188,7 +189,7 @@
 {
   (void)highword;
 
-  int fd = (int)hFile;
+  int fd = (uintptr_t)hFile;
   off_t off = 0;
 
   if(method == FILE_BEGIN)
