mirror of
https://github.com/oxen-io/oxen-core.git
synced 2023-12-14 02:22:56 +01:00
44d6715d56
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).
19 lines
339 B
C++
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
|
|
};
|
|
}
|