From 498f90fc7f0a574b477badf3899cbbad9fcf54fb Mon Sep 17 00:00:00 2001
From: Botond Baranyi <botond.baranyi@ericsson.com>
Date: Fri, 2 Oct 2020 10:38:02 +0200
Subject: [PATCH] Reinserted function pointer conversion for Cygwin (Bug
 565893)

Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com>
Change-Id: Ic84c01eeb47d4d93559154d7d24a65b334501657
---
 core/DebuggerUI.cc | 4 ++++
 mctr2/cli/Cli.cc   | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/core/DebuggerUI.cc b/core/DebuggerUI.cc
index 0cb245bd6..e12e1de2e 100644
--- a/core/DebuggerUI.cc
+++ b/core/DebuggerUI.cc
@@ -221,8 +221,12 @@ void TTCN_Debugger_UI::init()
   // read history from file, don't bother if it does not exist
   read_history(ttcn3_history_filename);
   // set our own command completion function
+#ifdef WIN32
+  rl_completion_entry_function = (Function*)complete_command;
+#else
   rl_completion_entry_function = complete_command;
 #endif
+#endif
 }
 
 void TTCN_Debugger_UI::clean_up()
diff --git a/mctr2/cli/Cli.cc b/mctr2/cli/Cli.cc
index fe80aab7b..c88388adf 100644
--- a/mctr2/cli/Cli.cc
+++ b/mctr2/cli/Cli.cc
@@ -372,7 +372,11 @@ int Cli::interactiveMode()
   // Read history from file, don't bother if it does not exist!
   read_history(ttcn3_history_filename);
   // Set our own command completion function
+#ifdef WIN32
+  rl_completion_entry_function = (Function*)completeCommand;
+#else
   rl_completion_entry_function = completeCommand;
+#endif
   // Override rl_getc() in order to detect shell mode
   rl_getc_function = getcWithShellDetection;
 
-- 
GitLab