freebsd-ports/audio/dpf-plugins-lv2/files/patch-dpf_dgl_src_Window.cpp
Yuri Victorovich cfbf316fb4 audio/dpf-plugins-lv2: Update 1.1-1 -> 1.2
Reported by:	portscout
2019-02-28 18:17:42 +00:00

26 lines
756 B
C++

--- dpf/dgl/src/Window.cpp.orig 2019-02-28 06:54:29 UTC
+++ dpf/dgl/src/Window.cpp
@@ -51,6 +51,10 @@ extern "C" {
#include "../StandaloneWindow.hpp"
#include "../../distrho/extra/String.hpp"
+#if defined(__FreeBSD__)
+#include <unistd.h>
+#endif
+
#define FOR_EACH_WIDGET(it) \
for (std::list<Widget*>::iterator it = fWidgets.begin(); it != fWidgets.end(); ++it)
@@ -1216,7 +1220,12 @@ bool Window::openFileBrowser(const FileB
# ifdef DISTRHO_OS_LINUX
if (startDir.isEmpty())
{
+#if defined(__FreeBSD__)
+ char buf[1024];
+ if (char* const dir_name = ::getwd(buf))
+#else
if (char* const dir_name = get_current_dir_name())
+#endif
{
startDir = dir_name;
std::free(dir_name);