aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-07-30 23:02:41 +0200
committerGitHub <noreply@github.com>2017-07-30 23:02:41 +0200
commita7538371fec595641bed2d5e2d92e5ae2ce89b94 (patch)
treef115ab0f9e90cbbf3c1d4a09cc4839c7de4fa1c1 /src
parent5cd68b39003dc51c5b80147d689cf7e8b67443b0 (diff)
downloadrneovim-a7538371fec595641bed2d5e2d92e5ae2ce89b94.tar.gz
rneovim-a7538371fec595641bed2d5e2d92e5ae2ce89b94.tar.bz2
rneovim-a7538371fec595641bed2d5e2d92e5ae2ce89b94.zip
build: linux does not always have execinfo.h (#7101)
Closes #7099
Diffstat (limited to 'src')
-rw-r--r--src/nvim/log.c7
-rw-r--r--src/nvim/log.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/src/nvim/log.c b/src/nvim/log.c
index 252fe5438d..b64aef3cac 100644
--- a/src/nvim/log.c
+++ b/src/nvim/log.c
@@ -25,6 +25,10 @@ static uv_mutex_t mutex;
# include "log.c.generated.h"
#endif
+#ifdef HAVE_EXECINFO_BACKTRACE
+# include <execinfo.h>
+#endif
+
static bool log_try_create(char *fname)
{
if (fname == NULL || fname[0] == '\0') {
@@ -173,8 +177,7 @@ FILE *open_log_file(void)
return stderr;
}
-#if defined(__linux__)
-# include <execinfo.h>
+#ifdef HAVE_EXECINFO_BACKTRACE
void log_callstack(const char *const func_name, const int line_num)
{
void *trace[100];
diff --git a/src/nvim/log.h b/src/nvim/log.h
index 2bd18f5776..743a8d17aa 100644
--- a/src/nvim/log.h
+++ b/src/nvim/log.h
@@ -61,7 +61,7 @@
__VA_ARGS__)
#endif
-#if defined(__linux__)
+#ifdef HAVE_EXECINFO_BACKTRACE
# define LOG_CALLSTACK() log_callstack(__func__, __LINE__)
#endif