aboutsummaryrefslogtreecommitdiffhomepage
path: root/absl/base/internal
diff options
context:
space:
mode:
authorGravatar Daniel Ylitalo <daniel@ylitalo.io>2017-12-13 21:02:50 +0100
committerGravatar Derek Mauro <761129+derekmauro@users.noreply.github.com>2017-12-13 15:02:50 -0500
commit5fe41affbaab5b9ad4876a6295c78f21a86d862d (patch)
treed6cb31cf0deb80dc295e6fae0b287d482ac4a947 /absl/base/internal
parent04edad3801ec0b1091df9157b879d8f6a50c5036 (diff)
FreeBSD compability (#57)
Diffstat (limited to 'absl/base/internal')
-rw-r--r--absl/base/internal/endian.h2
-rw-r--r--absl/base/internal/raw_logging.cc5
-rw-r--r--absl/base/internal/sysinfo.cc2
3 files changed, 6 insertions, 3 deletions
diff --git a/absl/base/internal/endian.h b/absl/base/internal/endian.h
index 602129e..edc10f1 100644
--- a/absl/base/internal/endian.h
+++ b/absl/base/internal/endian.h
@@ -22,6 +22,8 @@
#elif defined(__APPLE__)
// Mac OS X / Darwin features
#include <libkern/OSByteOrder.h>
+#elif defined(__FreeBSD__)
+#include <sys/endian.h>
#elif defined(__GLIBC__)
#include <byteswap.h> // IWYU pragma: export
#endif
diff --git a/absl/base/internal/raw_logging.cc b/absl/base/internal/raw_logging.cc
index 1b849ab..301b108 100644
--- a/absl/base/internal/raw_logging.cc
+++ b/absl/base/internal/raw_logging.cc
@@ -34,7 +34,8 @@
//
// This preprocessor token is also defined in raw_io.cc. If you need to copy
// this, consider moving both to config.h instead.
-#if defined(__linux__) || defined(__APPLE__) || defined(__Fuchsia__)
+#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \
+ defined(__Fuchsia__)
#include <unistd.h>
@@ -47,7 +48,7 @@
// ABSL_HAVE_SYSCALL_WRITE is defined when the platform provides the syscall
// syscall(SYS_write, /*int*/ fd, /*char* */ buf, /*size_t*/ len);
// for low level operations that want to avoid libc.
-#if defined(__linux__) && !defined(__ANDROID__)
+#if (defined(__linux__) || defined(__FreeBSD__)) && !defined(__ANDROID__)
#include <sys/syscall.h>
#define ABSL_HAVE_SYSCALL_WRITE 1
#define ABSL_LOW_LEVEL_WRITE_SUPPORTED 1
diff --git a/absl/base/internal/sysinfo.cc b/absl/base/internal/sysinfo.cc
index 00e98b6..884c312 100644
--- a/absl/base/internal/sysinfo.cc
+++ b/absl/base/internal/sysinfo.cc
@@ -29,7 +29,7 @@
#include <sys/syscall.h>
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/sysctl.h>
#endif