OSX / BSD support

This commit is contained in:
Pentium44 2021-04-07 20:23:29 -07:00
parent 6309826bf2
commit 81e2495aba
5 changed files with 10 additions and 2 deletions

View File

@ -10,6 +10,8 @@ Using SlideScript
* Modify test.ss to learn the basics of SS. * Modify test.ss to learn the basics of SS.
* Run ./test.ss to execute the script. * Run ./test.ss to execute the script.
***NOTE: if compiling on OSX/BSD, please uncomment #define BSD in src/config.h***
Documentation Documentation
----- -----
Here is a list of functions and features that SlideScript comes with Here is a list of functions and features that SlideScript comes with

3
src/config.h Normal file
View File

@ -0,0 +1,3 @@
// DEFINE IF YOU WANT TO COMPILE VIA BSD / OSX
//#define BSD 1

View File

@ -12,6 +12,7 @@
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#include "config.h"
#include "sbyteswap.h" #include "sbyteswap.h"
#include <sys/types.h> #include <sys/types.h>
// Networking // Networking

View File

@ -72,7 +72,7 @@ static void common64_end (md5_ctx_t *ctx, int swap_needed)
if (remaining >= 8) if (remaining >= 8)
{ {
uint64_md5 t = ctx->total64 << 3; uint64_md5 t = ctx->total64 << 3;
if (swap_needed) t = __bswap_64 (t); if (swap_needed) t = bswap_64 (t);
*(uint64_md5 *) (&ctx->wbuffer [64 - 8]) = t; *(uint64_md5 *) (&ctx->wbuffer [64 - 8]) = t;
} }

View File

@ -305,7 +305,9 @@ void snet_http(int port, int forkval)
if(fork() != 0) if(fork() != 0)
syn_error("ss:net:http forked"); syn_error("ss:net:http forked");
signal(SIGCLD, SIG_IGN); #ifndef BSD
signal(SIGCLD, SIG_IGN);
#endif
signal(SIGHUP, SIG_IGN); signal(SIGHUP, SIG_IGN);
for(i=0;i<32;i++) { for(i=0;i<32;i++) {
close(i); close(i);