From 2eae15a8779b4bbd5c5184e5b76eae479d1e493b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net>
Date: Fri, 14 May 2021 19:52:13 -0400
Subject: [PATCH] Fix(?) more Windows warnings.

---
 src/conio/curs_cio.c   | 2 +-
 src/conio/scale.c      | 1 +
 src/conio/x_events.c   | 1 +
 src/syncterm/bbslist.c | 1 +
 src/syncterm/ripper.c  | 1 +
 src/xpdev/strwrap.h    | 2 +-
 6 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/conio/curs_cio.c b/src/conio/curs_cio.c
index f3f6d5328b..01883602e9 100644
--- a/src/conio/curs_cio.c
+++ b/src/conio/curs_cio.c
@@ -111,7 +111,7 @@ static int _putch(unsigned char ch, BOOL refresh_now, int cp)
 	cchar_t	cha;
 	wchar_t wch[2] = {0};
 	attr_t	attr = 0;
-	short	cpair;
+	short	cpair = 0;
 
 	attr_get(&attr, &cpair, NULL);
 	attr &= ~A_COLOR;
diff --git a/src/conio/scale.c b/src/conio/scale.c
index 9849011588..87c7cdfb14 100644
--- a/src/conio/scale.c
+++ b/src/conio/scale.c
@@ -1,3 +1,4 @@
+#include <math.h>
 #include <stdbool.h>
 #include <stdlib.h>
 
diff --git a/src/conio/x_events.c b/src/conio/x_events.c
index ce352d7e98..6ac3fb35bf 100644
--- a/src/conio/x_events.c
+++ b/src/conio/x_events.c
@@ -3,6 +3,7 @@
  * event thread.
  */
  
+#include <math.h>
 #include <unistd.h>
 #include <stdbool.h>
 
diff --git a/src/syncterm/bbslist.c b/src/syncterm/bbslist.c
index 2818245090..e5d950794c 100644
--- a/src/syncterm/bbslist.c
+++ b/src/syncterm/bbslist.c
@@ -7,6 +7,7 @@
 #include <dirwrap.h>
 #include <ini_file.h>
 #include <uifc.h>
+#include <xpprintf.h>
 #include "filepick.h"
 
 #include "syncterm.h"
diff --git a/src/syncterm/ripper.c b/src/syncterm/ripper.c
index 1c1a574e78..b406d0817a 100644
--- a/src/syncterm/ripper.c
+++ b/src/syncterm/ripper.c
@@ -23,6 +23,7 @@
 #if defined(__unix__)
 	#include <unistd.h>
 #endif
+#include <time.h>
 #include <vidmodes.h>
 #include <xpbeep.h>
 
diff --git a/src/xpdev/strwrap.h b/src/xpdev/strwrap.h
index f30d54e450..e52986f122 100644
--- a/src/xpdev/strwrap.h
+++ b/src/xpdev/strwrap.h
@@ -18,7 +18,7 @@ char* ltoa(long val, char* str, int radix);
 
 #endif
 
-#ifdef _MSVC
+#if defined(_MSC_VER) || defined(__MSVCRT__)
 #if defined(__cplusplus)
 extern "C" {
 #endif
-- 
GitLab