From 49bdfe0ed63c263bf55208b5216fee77784797ac Mon Sep 17 00:00:00 2001 From: Austin Shafer Date: Fri, 5 Jun 2020 18:39:40 -0400 Subject: [PATCH] Add support for FreeBSD Create platform definitions required for building on FreeBSD. --- samples/timestamp.cc | 2 +- src/platform.h | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/samples/timestamp.cc b/samples/timestamp.cc index 50c65393e..29f5a9957 100644 --- a/samples/timestamp.cc +++ b/samples/timestamp.cc @@ -19,7 +19,7 @@ #if defined(_WIN32) || defined(_WIN64) #define SAMPLE_PLATFORM_WINDOWS 1 #define SAMPLE_PLATFORM_POSIX 0 -#elif defined(__linux__) || defined(__APPLE__) +#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) #define SAMPLE_PLATFORM_POSIX 1 #define SAMPLE_PLATFORM_WINDOWS 0 #endif diff --git a/src/platform.h b/src/platform.h index 65784946a..fc37dd455 100644 --- a/src/platform.h +++ b/src/platform.h @@ -22,6 +22,9 @@ namespace amber { #elif defined(__linux__) #define AMBER_PLATFORM_LINUX 1 #define AMBER_PLATFORM_POSIX 1 +#elif defined(__FreeBSD__) +#define AMBER_PLATFORM_FREEBSD 1 +#define AMBER_PLATFORM_POSIX 1 #elif defined(__APPLE__) #define AMBER_PLATFORM_APPLE 1 #define AMBER_PLATFORM_POSIX 1 @@ -39,6 +42,10 @@ namespace amber { #define AMBER_PLATFORM_LINUX 0 #endif +#if !defined(AMBER_PLATFORM_FREEBSD) +#define AMBER_PLATFORM_FREEBSD 0 +#endif + #if !defined(AMBER_PLATFORM_APPLE) #define AMBER_PLATFORM_APPLE 0 #endif