From d203c554faa00fec55377d6640c8fb335a611a09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Wed, 3 Jul 2019 01:46:07 +0200 Subject: [PATCH] Fix C++ compatibility with older editline versions. For example, Ubuntu 16.04 and many similar long-term-support distros have older versions. --- src/nix/repl.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/nix/repl.cc b/src/nix/repl.cc index d8f81214..f857b2e8 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -9,7 +9,14 @@ #include #include #else +// editline < 1.15.2 don't wrap their API for C++ usage +// (added in https://github.com/troglobit/editline/commit/91398ceb3427b730995357e9d120539fb9bb7461). +// This results in linker errors due to to name-mangling of editline C symbols. +// For compatibility with these versions, we wrap the API here +// (wrapping multiple times on newer versions is no problem). +extern "C" { #include +} #endif #include "shared.hh"