From 81e2495abab0cdd8ce303842c19764e653faa35a Mon Sep 17 00:00:00 2001 From: Pentium44 Date: Wed, 7 Apr 2021 20:23:29 -0700 Subject: [PATCH] OSX / BSD support --- README.md | 2 ++ src/config.h | 3 +++ src/deps.h | 1 + src/md5.c | 2 +- src/network.c | 4 +++- 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/config.h diff --git a/README.md b/README.md index f628341..1d4f304 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ Using SlideScript * Modify test.ss to learn the basics of SS. * Run ./test.ss to execute the script. +***NOTE: if compiling on OSX/BSD, please uncomment #define BSD in src/config.h*** + Documentation ----- Here is a list of functions and features that SlideScript comes with diff --git a/src/config.h b/src/config.h new file mode 100644 index 0000000..f5c8c03 --- /dev/null +++ b/src/config.h @@ -0,0 +1,3 @@ +// DEFINE IF YOU WANT TO COMPILE VIA BSD / OSX +//#define BSD 1 + diff --git a/src/deps.h b/src/deps.h index 3cc8629..c333fba 100644 --- a/src/deps.h +++ b/src/deps.h @@ -12,6 +12,7 @@ #include #include #include +#include "config.h" #include "sbyteswap.h" #include // Networking diff --git a/src/md5.c b/src/md5.c index 4e35011..da47597 100644 --- a/src/md5.c +++ b/src/md5.c @@ -72,7 +72,7 @@ static void common64_end (md5_ctx_t *ctx, int swap_needed) if (remaining >= 8) { 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; } diff --git a/src/network.c b/src/network.c index 63cf80f..5fe7663 100644 --- a/src/network.c +++ b/src/network.c @@ -305,7 +305,9 @@ void snet_http(int port, int forkval) if(fork() != 0) syn_error("ss:net:http forked"); - signal(SIGCLD, SIG_IGN); +#ifndef BSD + signal(SIGCLD, SIG_IGN); +#endif signal(SIGHUP, SIG_IGN); for(i=0;i<32;i++) { close(i);