From 28982aae92cf996d9e5f7f4e95e8c95027080f60 Mon Sep 17 00:00:00 2001 From: nia Date: Sun, 22 Mar 2020 10:49:06 +0000 Subject: [PATCH 1/2] Fix build on NetBSD --- src/file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file.cc b/src/file.cc index 79043d1c..0e6a7738 100644 --- a/src/file.cc +++ b/src/file.cc @@ -21,7 +21,7 @@ #include #include -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__NetBSD__) #include #endif @@ -624,7 +624,7 @@ String get_kak_binary_path() kak_assert(res != -1); buffer[res] = '\0'; return buffer; -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__NetBSD__) int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; size_t res = sizeof(buffer); sysctl(mib, 4, buffer, &res, NULL, 0); From 7d4a83a4493536627f80099ea338a28a51183ff1 Mon Sep 17 00:00:00 2001 From: nia Date: Sun, 22 Mar 2020 11:00:27 +0000 Subject: [PATCH 2/2] || -> or for consistency --- src/file.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/file.cc b/src/file.cc index 0e6a7738..600eae1f 100644 --- a/src/file.cc +++ b/src/file.cc @@ -21,7 +21,7 @@ #include #include -#if defined(__FreeBSD__) || defined(__NetBSD__) +#if defined(__FreeBSD__) or defined(__NetBSD__) #include #endif @@ -624,7 +624,7 @@ String get_kak_binary_path() kak_assert(res != -1); buffer[res] = '\0'; return buffer; -#elif defined(__FreeBSD__) || defined(__NetBSD__) +#elif defined(__FreeBSD__) or defined(__NetBSD__) int mib[] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1}; size_t res = sizeof(buffer); sysctl(mib, 4, buffer, &res, NULL, 0);