From b168b8c0042b7fab3be6506a597c48898866ee7f Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Thu, 26 Oct 2000 11:03:23 +0000
Subject: [PATCH] Moved the last of the compiler-dependent macros (CHMOD,
 PUTENV, GETCWD) from sbbsdefs.h to sbbswrap.h.

---
 src/sbbs3/sbbsdefs.h | 20 --------------------
 src/sbbs3/sbbswrap.h | 32 ++++++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 28 deletions(-)

diff --git a/src/sbbs3/sbbsdefs.h b/src/sbbs3/sbbsdefs.h
index 4b5fc5288e..1d2f4c6929 100644
--- a/src/sbbs3/sbbsdefs.h
+++ b/src/sbbs3/sbbsdefs.h
@@ -766,26 +766,6 @@ enum {						/* Values of mode for userlist function     */
 #define GOTOXY(x,y)     rprintf("\x1b[%d;%dH",y,x);
 #define TM_YEAR(yy)		((yy)%100)
 
-#if defined(_MSC_VER)		/* Visual C++ */
-
-#define CHMOD(s,m)		_chmod(s,m)
-#define PUTENV  		_putenv
-#define GETCWD  		_getcwd
-
-#elif defined(__BORLANDC__)	/* Borland C++ */
-
-#define CHMOD(s,m)		_chmod(s,1,m)
-#define PUTENV  		putenv
-#define GETCWD  		getcwd
-
-#else	/* ??? */
-
-#define CHMOD(s,m)		chmod(s,m)
-#define PUTENV  		putenv
-#define GETCWD  		getcwd
-
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/src/sbbs3/sbbswrap.h b/src/sbbs3/sbbswrap.h
index 0508194fd7..c9698a7302 100644
--- a/src/sbbs3/sbbswrap.h
+++ b/src/sbbs3/sbbswrap.h
@@ -62,17 +62,17 @@ extern "C" {
 /* OS-specific */
 /***************/
 
-#ifdef _WIN32
+#if defined(_WIN32)
 
 	#define mswait(x)			Sleep(x)
 	#define sbbs_beep(freq,dur)	Beep(freq,dur)
 
-#elif defined __OS2__
+#elif defined(__OS2__)
 
 	#define mswait(x)			DosSleep(x)
 	#define sbbs_beep(freq,dur)	DosBeep(freq,dur)
 
-#elif defined __unix__
+#elif defined(__unix__)
 
 	#define mswait(x)			usleep(x*1000)
 	#define stricmp(x,y)		strcasecmp(x,y)
@@ -122,12 +122,28 @@ extern "C" {
 
 #endif
 
+/* Macros */
+#if defined(_MSC_VER) || defined(__MINGW32__)
+
+#define CHMOD(s,m)		_chmod(s,m)
+#define PUTENV  		_putenv
+#define GETCWD  		_getcwd
+
+#elif defined(__BORLANDC__)
+
+#define CHMOD(s,m)		_chmod(s,1,m)
+#define PUTENV  		putenv
+#define GETCWD  		getcwd
+
+#else	/* ??? */
+
+#define CHMOD(s,m)		chmod(s,m)
+#define PUTENV  		putenv
+#define GETCWD  		getcwd
 
-#ifdef _MSC_VER
-	#define snprintf			_snprintf
 #endif
 
-#ifdef __BORLANDC__
+#if defined(__BORLANDC__)
 	#define sbbs_random(x)		random(x)
 #else 
 	DLLEXPORT int	sbbs_random(int n);
@@ -137,8 +153,8 @@ extern "C" {
 	#define _chmod(p,f,a)		_rtl_chmod(p,f,a) 	/* _chmod obsolete in 4.x */
 #endif
 
-#if !defined _MSC_VER && !defined __BORLANDC__
-DLLEXPORT char* ultoa(ulong, char*, int radix);
+#if !defined(_MSC_VER) && !defined(__BORLANDC__)
+	DLLEXPORT char* ultoa(ulong, char*, int radix);
 #endif
 
 
-- 
GitLab