oxen-core/contrib/epee/include/readline_suspend.h
Jason Rhinelander 44d6715d56 Make suspend_readline a (usable) no-op when readline not available
This moves all the conditional HAVE_READLINE into once place rather than
scattering it everywhere we want to suspend readline.  (Since the class
does nothing the compiler can trivially optimize it away when we don't
have readline).
2020-05-20 00:48:59 -03:00

19 lines
339 B
C++

#pragma once
namespace rdln
{
class readline_buffer;
// RAII class to suspend readline. If not built with readline support, this class is a no-op.
class suspend_readline
{
#ifdef HAVE_READLINE
public:
suspend_readline();
~suspend_readline();
private:
readline_buffer* m_buffer;
bool m_restart;
#endif
};
}