Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit c2a25ad7 authored by rswindell's avatar rswindell

Added FreeBSD support (based on Eric Jones' patch).

parent 0d377a30
......@@ -35,7 +35,13 @@
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
/* FreeBSD's malloc.h is deprecated, it drops a warning and */
/* #includes <stdlib.h>, which is already here. */
#ifndef __FreeBSD__
#include <malloc.h>
#endif
#include "lzh.h"
/****************************************************************************/
......
......@@ -12,7 +12,15 @@
#include <stdlib.h>
#include <unistd.h>
#include <termios.h>
/* Do the correct thing under BSD */
#ifndef __FreeBSD__
#include <sys/kd.h>
#endif
#ifdef __FreeBSD__
#include <sys/kbio.h>
#endif
#include <sys/time.h>
#include <sys/types.h>
#include <signal.h>
......
......@@ -50,7 +50,11 @@
#ifdef RINGBUF_USE_STD_RTL
#ifndef VTOOLSD
/* FreeBSD uses <stdlib.h> instead of <malloc.h> */
#ifndef __FreeBSD__
#include <malloc.h> /* malloc prototype */
#endif
#include <string.h> /* memcpy prototype */
#endif
......
......@@ -71,7 +71,13 @@
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
#ifndef __FreeBSD__
#include <malloc.h>
#endif
#include <sys/stat.h>
/***********************/
......
......@@ -104,4 +104,10 @@
#define SHUT_RDWR 2 /* for shutdown() */
#endif
#ifndef IPPORT_FTP
#define IPPORT_FTP 21
#define IPPORT_TELNET 23
#define IPPORT_SMTP 25
#endif
#endif /* Don't add anything after this line */
......@@ -45,7 +45,20 @@
#include <unistd.h> /* usleep */
#include <fcntl.h> /* O_NOCCTY */
#include <ctype.h> /* toupper */
/* FreeBSD uses kbio.h instead of kd.h */
/* BSD also needs mount.h instead of vfs.h */
/* param.h has needed definitions for the FreeBSD system */
#ifndef __FreeBSD__
#include <sys/kd.h> /* KIOCSOUND */
#endif
#ifdef __FreeBSD__
#include <sys/param.h>
#include <sys/mount.h>
#include <sys/kbio.h>
#endif
#include <sys/ioctl.h> /* ioctl */
#ifdef __GLIBC__ /* actually, BSD, but will work for now */
......@@ -393,7 +406,9 @@ ulong DLLCALL getfreediskspace(char* path)
return(NumberOfFreeClusters*SectorsPerCluster*BytesPerSector);
#elif defined(__GLIBC__)
/* statfs is also used under FreeBSD */
#elif defined(__GLIBC__) || defined(__FreeBSD__)
struct statfs fs;
......
......@@ -48,7 +48,11 @@
#endif
/* ANSI C Library headers */
#include <malloc.h>
#ifndef __FreeBSD__
#include <malloc.h>
#endif
#include <time.h>
#include <errno.h>
#include <fcntl.h>
......
......@@ -36,7 +36,10 @@
****************************************************************************/
/* ANSI */
#include <malloc.h>
#ifndef __FreeBSD__
#include <malloc.h>
#endif
/* SMB-specific */
#include "smblib.h"
......
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