Commit 260eb7c4 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

We don't actually have/use nspr.h for Windows builds

We only use NSPR to build libmozjs, not to build sbbs. So define our own MIN and MAX macros if they're not already defined (e.g. from sys/param.h on *nix). Such a simple can o' worms, but wormful can it was.
parent a0284de9
Pipeline #1058 passed with stage
in 16 minutes and 51 seconds
......@@ -37,7 +37,6 @@
#include "sbbs.h"
#include "cmdshell.h"
#include <nspr.h>
extern "C" void client_on(SOCKET sock, client_t* client, BOOL update);
......@@ -243,10 +242,10 @@ bool sbbs_t::logon()
bprintf(text[TimeToChangePw],cfg.sys_pwdays);
c=0;
while(c < PR_MAX(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
while(c < MAX(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
str[c]=sbbs_random(43)+'0';
if(IS_ALPHANUMERIC(str[c]))
c++;
c++;
}
str[c]=0;
bprintf(text[YourPasswordIs],str);
......
......@@ -38,7 +38,6 @@
#include "sbbs.h"
#include "petdefs.h"
#include "cmdshell.h"
#include <nspr.h>
/****************************************************************************/
/* This function is invoked when a user enters "NEW" at the NN: prompt */
......@@ -382,7 +381,7 @@ BOOL sbbs_t::newuser()
}
else {
c=0;
while(c < PR_MAX(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
while(c < MAX(RAND_PASS_LEN, cfg.min_pwlen)) { /* Create random password */
useron.pass[c]=sbbs_random(43)+'0';
if(IS_ALPHANUMERIC(useron.pass[c]))
c++;
......
......@@ -83,6 +83,13 @@ typedef struct js_callback {
#define JSVAL_NULL_OR_VOID(val) (JSVAL_IS_NULL(val) || JSVAL_IS_VOID(val))
#ifndef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
#endif
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#endif
/************/
/* Maximums */
/************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment