Changes to allow it to compile in FreeBSD and fix a few issues that were picked up by clang 10.

This commit is contained in:
Mike Brady
2021-06-22 13:49:11 +01:00
parent 6295b35338
commit e925e196c8
8 changed files with 68 additions and 16 deletions
+12 -5
View File
@@ -1,14 +1,9 @@
#ifndef _DEFINITIONS_H
#define _DEFINITIONS_H
//#include <libconfig.h>
//#include <signal.h>
//#include <stdint.h>
#include <sys/socket.h>
//#include "audio.h"
#include "config.h"
//#include "mdns.h"
#if defined(__APPLE__) && defined(__MACH__)
/* Apple OSX and iOS (Darwin). ------------------------------ */
@@ -23,6 +18,18 @@
#define COMPILE_FOR_LINUX_AND_FREEBSD_AND_CYGWIN_AND_OPENBSD 1
#endif
#if defined(__linux__)
#define COMPILE_FOR_LINUX 1
#endif
#if defined(__FreeBSD__) || defined(__OpenBSD__)
#define COMPILE_FOR_BSD 1
#endif
#if defined(__FreeBSD__)
#define COMPILE_FOR_FREEBSD 1
#endif
// struct sockaddr_in6 is bigger than struct sockaddr. derp
#ifdef AF_INET6
#define SOCKADDR struct sockaddr_storage