From 3e8e114d9ad54ff9c8f96b922ae2dc18e8652b51 Mon Sep 17 00:00:00 2001
From: "Rob Swindell (on Windows 11)" <rob@synchro.net>
Date: Mon, 18 Dec 2023 21:40:11 -0800
Subject: [PATCH] Fix new Windows build warnings and errors

---
 src/sbbs3/load_cfg.c | 10 +++++-----
 src/sbbs3/ssl.h      |  2 +-
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/sbbs3/load_cfg.c b/src/sbbs3/load_cfg.c
index f2274fade3..62faaf6d09 100644
--- a/src/sbbs3/load_cfg.c
+++ b/src/sbbs3/load_cfg.c
@@ -26,8 +26,8 @@
 #include "datewrap.h"
 #include "text.h"	/* TOTAL_TEXT */
 #include "ini_file.h"
-#ifdef USE_CRYPTLIB
-#include "cryptlib.h"
+#if defined(SBBS) && defined(USE_CRYPTLIB)
+	#include "ssl.h"
 #endif
 
 static void prep_cfg(scfg_t* cfg);
@@ -36,7 +36,7 @@ static void free_attr_cfg(scfg_t* cfg);
 int 	lprintf(int level, const char *fmt, ...);	/* log output */
 
 /* readtext.c */
-char *	readtext(long *line, FILE *stream, long dflt);
+char *	readtext(int *line, FILE *stream, long dflt);
 
 // Returns 0-based text string index
 int get_text_num(const char* id)
@@ -348,11 +348,11 @@ void prep_cfg(scfg_t* cfg)
 
 void free_cfg(scfg_t* cfg)
 {
-#ifdef USE_CRYPTLIB
+#if defined(SBBS) && defined(USE_CRYPTLIB)
 	lock_ssl_cert();
 	if (cfg->tls_certificate != -1 && cfg->prepped) {
 		cryptDestroyContext(cfg->tls_certificate);
-		cfg->tls_certificate == -1;
+		cfg->tls_certificate = -1;
 	}
 	unlock_ssl_cert();
 #endif
diff --git a/src/sbbs3/ssl.h b/src/sbbs3/ssl.h
index f4d3596ae5..b6a911f7fd 100644
--- a/src/sbbs3/ssl.h
+++ b/src/sbbs3/ssl.h
@@ -1,7 +1,7 @@
 #ifndef SBBS_SSL_H
 #define SBBS_SSL_H
 
-#include "sbbs.h"	// For DLLEXPORT
+#include "dllexport.h"
 #include <cryptlib.h>
 #include "scfgdefs.h"
 #include <stdbool.h>
-- 
GitLab