9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] drawterm: get 64-bit windows to work
@ 2022-05-07  2:13 Amavect
  2022-05-14 21:48 ` [9front] " Amavect
  0 siblings, 1 reply; 9+ messages in thread
From: Amavect @ 2022-05-07  2:13 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

Hi,

This gets drawterm to compile and not segfault under x86_64 mingw-w64.
Tested on Wine and MSYS2.

I noticed that the win32-386 and posix-386 directories are nearly the
same (some asm preprocessor metarule in the win32-386 Makefile?), so I
used posix-amd64 for libmachdep.a instead of making a new directory.
I'll leave keeping or removing win32-386/ up to discussion.

Thanks,
Amavect

[-- Attachment #2.1: Type: text/plain, Size: 337 bytes --]

from postmaster@9front:
The following attachment had content that we can't
prove to be harmless.  To avoid possible automatic
execution, we changed the content headers.
The original header was:

	Content-Type: text/x-patch
	Content-Transfer-Encoding: 7bit
	Content-Disposition: attachment;
 filename=0001-get-64-bit-windows-to-work.patch

[-- Attachment #2.2: 0001-get-64-bit-windows-to-work.patch.suspect --]
[-- Type: application/octet-stream, Size: 2021 bytes --]

 From e96ba525c4a5ff82fabfddd8e4e42f6b675e0949 Mon Sep 17 00:00:00 2001
From: Amavect <amavect@gmail.com>
Date: Fri, 6 May 2022 20:59:22 -0500
Subject: [PATCH] get 64-bit windows to work

---
 Make.win64         | 32 ++++++++++++++++++++++++++++++++
 gui-win32/screen.c |  4 ++--
 include/9windows.h |  2 +-
 3 files changed, 35 insertions(+), 3 deletions(-)
 create mode 100644 Make.win64

diff --git a/Make.win64 b/Make.win64
new file mode 100644
index 0000000..1232bc4
--- /dev/null
+++ b/Make.win64
@@ -0,0 +1,32 @@
+# Windows via mingw-w64
+# MING=mingw32- is necessary if you're cross-compiling
+# on another platform.  Otherwise the binaries are just
+# named gcc, etc.
+
+AUDIO=win32
+MING=x86_64-w64-mingw32-
+#MING=
+AR=$(MING)ar
+CC=$(MING)gcc
+AS=$(MING)as
+RANLIB=$(MING)ranlib
+WINDRES=$(MING)windres
+CFLAGS=-Wall -Wno-missing-braces -I$(ROOT)/include -I$(ROOT) -I$(ROOT)/kern -c -DWINDOWS -DUNICODE -O2
+O=o
+FS=fs-win32
+IP=win32
+OS=win32
+GUI=win32
+LDADD=-lgdi32 -lws2_32 -lwinmm -mwindows
+TARG=drawterm.exe
+XOFILES=glenda-t.$O
+
+all: default
+
+# for root
+libmachdep.a:
+	(cd posix-amd64; make)
+
+glenda-t.$O: glenda-t.rc glenda-t.ico
+	$(WINDRES) -i glenda-t.rc -o glenda-t.o
+
diff --git a/gui-win32/screen.c b/gui-win32/screen.c
index 3790417..81c9fe6 100644
--- a/gui-win32/screen.c
+++ b/gui-win32/screen.c
@@ -532,7 +532,7 @@ setcursor(void)
 	free(and);
 	free(xor);
 
-	PostMessage(window, WM_SETCURSOR, (int)window, 0);
+	PostMessage(window, WM_SETCURSOR, (WPARAM)window, 0);
 }
 
 void
@@ -543,7 +543,7 @@ cursorarrow(void)
 		hcursor = 0;
 	}
 	SetCursor(LoadCursor(0, IDC_ARROW));
-	PostMessage(window, WM_SETCURSOR, (int)window, 0);
+	PostMessage(window, WM_SETCURSOR, (WPARAM)window, 0);
 }
 
 
diff --git a/include/9windows.h b/include/9windows.h
index e779475..e65e955 100644
--- a/include/9windows.h
+++ b/include/9windows.h
@@ -18,4 +18,4 @@
 
 typedef __int64		p9_vlong;
 typedef	unsigned __int64 p9_uvlong;
-typedef unsigned uintptr;
+typedef uintptr_t uintptr;
-- 
2.36.0



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-05-15 21:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07  2:13 [9front] [PATCH] drawterm: get 64-bit windows to work Amavect
2022-05-14 21:48 ` [9front] " Amavect
2022-05-14 22:38   ` ori
2022-05-15  7:01     ` sirjofri
2022-05-15 14:48       ` ori
2022-05-15 15:44         ` sirjofri
2022-05-15 15:47           ` ori
2022-05-15 15:57           ` sirjofri
2022-05-15 20:56           ` Amavect

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).