From 690a9634c8a2cb46e5444122515e01df107e4f09 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Wed, 17 Jan 2024 21:00:41 -0500
Subject: [PATCH] Make CerateEvent() prototype on *nix compatible with Win32

On Win32, the name param is an LPCSTR which apparently is Microsoft
talk for const char *.

In C we're allowed to do whatever we want, but in C++, this matters
more.
---
 src/sbbs3/main.cpp  | 2 +-
 src/xpdev/xpevent.c | 2 +-
 src/xpdev/xpevent.h | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/sbbs3/main.cpp b/src/sbbs3/main.cpp
index d4b698ecd8..3281a01eef 100644
--- a/src/sbbs3/main.cpp
+++ b/src/sbbs3/main.cpp
@@ -3679,7 +3679,7 @@ bool sbbs_t::init()
 #ifdef USE_CRYPTLIB
 	pthread_mutex_init(&ssh_mutex,NULL);
 	ssh_mutex_created = true;
-	ssh_active = CreateEvent(NULL, TRUE, FALSE, (void *)"ssh_active");
+	ssh_active = CreateEvent(NULL, TRUE, FALSE, "ssh_active");
 #endif
 	pthread_mutex_init(&input_thread_mutex,NULL);
 	input_thread_mutex_created = true;
diff --git a/src/xpdev/xpevent.c b/src/xpdev/xpevent.c
index e37de331c3..c97fd8a05f 100644
--- a/src/xpdev/xpevent.c
+++ b/src/xpdev/xpevent.c
@@ -25,7 +25,7 @@
 #include "genwrap.h"
 
 xpevent_t
-CreateEvent(void *sec, BOOL bManualReset, BOOL bInitialState, void *name)
+CreateEvent(void *sec, BOOL bManualReset, BOOL bInitialState, const char *name)
 {
 	xpevent_t	event;
 
diff --git a/src/xpdev/xpevent.h b/src/xpdev/xpevent.h
index 657362aed8..f3eb26c9d7 100644
--- a/src/xpdev/xpevent.h
+++ b/src/xpdev/xpevent.h
@@ -40,7 +40,7 @@ typedef struct xpevent *xpevent_t;
 #if defined(__cplusplus)
 extern "C" {
 #endif
-xpevent_t	CreateEvent(void *sec, BOOL bManualReset, BOOL bInitialState, void *name);
+xpevent_t	CreateEvent(void *sec, BOOL bManualReset, BOOL bInitialState, const char *name);
 BOOL		SetEvent(xpevent_t event);
 BOOL		ResetEvent(xpevent_t event);
 BOOL		CloseEvent(xpevent_t event);
-- 
GitLab