summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-06-26 16:43:07 +0200
committerRobin Gareus <robin@gareus.org>2016-06-26 16:43:07 +0200
commit86763cba906dba3fdbc0c99a42a3f7123eaa380d (patch)
tree2d682830df4637d1b75fab880ec0f2ce98af6b13 /libs
parente37b250d4d3d483e708db60ac9774342fd4b9700 (diff)
Enable build for FreeBSD (part 1/2)
Adopted from Michael Beer -- GH pull-request #232 with minor changes: * rebased on master, * removed trailing whitespace, * don't explicitly change saved configuration defaults (wscript) * moved sys/wait (WNOHANG) to header include * separate changes in GUI and lib
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/route_group.cc1
-rw-r--r--libs/ardour/session.cc2
-rw-r--r--libs/ardour/session_state.cc4
-rw-r--r--libs/midi++2/midi++/ipmidi_port.h2
-rw-r--r--libs/pbd/cpus.cc6
-rw-r--r--libs/pbd/pbd/floating.h1
-rw-r--r--libs/pbd/pbd/system_exec.h3
-rw-r--r--libs/ptformat/ptfformat.cc1
8 files changed, 15 insertions, 5 deletions
diff --git a/libs/ardour/route_group.cc b/libs/ardour/route_group.cc
index f258e9f14d..91303af07e 100644
--- a/libs/ardour/route_group.cc
+++ b/libs/ardour/route_group.cc
@@ -32,6 +32,7 @@
#include "ardour/route.h"
#include "ardour/route_group.h"
#include "ardour/session.h"
+#include "ardour/debug.h"
#include "i18n.h"
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 0005584403..6ef78eacb6 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -3459,7 +3459,7 @@ Session::add_routes_inner (RouteList& new_routes, bool input_auto_connect, bool
}
}
-#ifndef __APPLE__
+#if !defined(__APPLE__) && !defined(__FreeBSD__)
/* clang complains: 'operator<<' should be declared prior to the call site or in an associated namespace of one of its
* arguments std::ostream& operator<<(std::ostream& o, ARDOUR::PresentationInfo const& rid)"
*/
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index a9d7828d8b..0075799a16 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -39,7 +39,7 @@
#include <sys/vfs.h>
#endif
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(__FreeBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#endif
@@ -2262,7 +2262,7 @@ Session::save_template (string template_name, bool replace_existing)
void
Session::refresh_disk_space ()
{
-#if __APPLE__ || (HAVE_SYS_VFS_H && HAVE_SYS_STATVFS_H)
+#if __APPLE__ || __FreeBSD__ || (HAVE_SYS_VFS_H && HAVE_SYS_STATVFS_H)
Glib::Threads::Mutex::Lock lm (space_lock);
diff --git a/libs/midi++2/midi++/ipmidi_port.h b/libs/midi++2/midi++/ipmidi_port.h
index 313208892f..d870c79ef0 100644
--- a/libs/midi++2/midi++/ipmidi_port.h
+++ b/libs/midi++2/midi++/ipmidi_port.h
@@ -23,7 +23,7 @@
#include <iostream>
#if defined(PLATFORM_WINDOWS)
#include <winsock.h>
-#elif defined(__FREE_BSD__)
+#elif defined(__FreeBSD__)
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/_sockaddr_storage.h>
diff --git a/libs/pbd/cpus.cc b/libs/pbd/cpus.cc
index fb94b475de..69421e5e92 100644
--- a/libs/pbd/cpus.cc
+++ b/libs/pbd/cpus.cc
@@ -43,10 +43,14 @@ hardware_concurrency()
{
#if defined(PTW32_VERSION) || defined(__hpux)
return pthread_num_processors_np();
-#elif defined(__APPLE__) || defined(__FreeBSD__)
+#elif defined(__APPLE__)
int count;
size_t size=sizeof(count);
return sysctlbyname("hw.physicalcpu",&count,&size,NULL,0)?0:count;
+#elif defined(__FreeBSD__)
+ int count;
+ size_t size=sizeof(count);
+ return sysctlbyname("hw.ncpu",&count,&size,NULL,0)?0:count;
#elif defined(HAVE_UNISTD) && defined(_SC_NPROCESSORS_ONLN)
int const count=sysconf(_SC_NPROCESSORS_ONLN);
return (count>0)?count:0;
diff --git a/libs/pbd/pbd/floating.h b/libs/pbd/pbd/floating.h
index 86ab4a68f0..d7d6349a34 100644
--- a/libs/pbd/pbd/floating.h
+++ b/libs/pbd/pbd/floating.h
@@ -28,6 +28,7 @@
#include <stdint.h>
+#include <cstdlib> // abs(int)
#include <cmath>
#include "pbd/libpbd_visibility.h"
diff --git a/libs/pbd/pbd/system_exec.h b/libs/pbd/pbd/system_exec.h
index d5b14c8273..a8a30ba18d 100644
--- a/libs/pbd/pbd/system_exec.h
+++ b/libs/pbd/pbd/system_exec.h
@@ -37,6 +37,9 @@
#undef interface // VKamyshniy: to avoid "include/giomm-2.4/giomm/dbusmessage.h:270:94: error: expected ',' or '...' before 'struct'"
#endif
+#else // posix
+#include <sys/types.h>
+#include <sys/wait.h> /* WNOHANG is part of the exposed API */
#endif
#include <string>
diff --git a/libs/ptformat/ptfformat.cc b/libs/ptformat/ptfformat.cc
index caf2c2f42a..3d66ec025e 100644
--- a/libs/ptformat/ptfformat.cc
+++ b/libs/ptformat/ptfformat.cc
@@ -15,6 +15,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <string>
#include <string.h>
#include <assert.h>