1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

linux build quick fix

This commit is contained in:
M0N7Y5 2024-08-27 05:48:22 +02:00
parent 5a31cc35ba
commit 81a2f95279
7 changed files with 3841 additions and 3828 deletions

View file

@ -299,6 +299,7 @@ void bf::System::Console::PutChar(char c)
void bf::System::Console::ReopenHandles()
{
#ifdef _MSC_VER
FILE* fDummy;
freopen_s(&fDummy, "CONOUT$", "w", stdout);
freopen_s(&fDummy, "CONOUT$", "w", stderr);
@ -310,6 +311,7 @@ void bf::System::Console::ReopenHandles()
SetStdHandle(STD_OUTPUT_HANDLE, hConOut);
SetStdHandle(STD_ERROR_HANDLE, hConOut);
SetStdHandle(STD_INPUT_HANDLE, hConIn);
#endif
}
void bf::System::Runtime::Init(int version, int flags, BfRtCallbacks* callbacks)

View file

@ -27,7 +27,6 @@ using IDE.util;
[AttributeUsage(.Method, .ReflectAttribute | .AlwaysIncludeTarget, ReflectUser = .All)]
struct IDECommandAttribute : Attribute
{
}
namespace IDE
@ -57,7 +56,6 @@ namespace IDE
class DeferredUserRequest
{
}
class DeferredShowPCLocation : DeferredUserRequest
@ -197,8 +195,10 @@ namespace IDE
public bool mWantShowOutput;
public OutputPanel mOutputPanel;
#if BF_PLATFORM_WINDOWS
public TerminalPanel mTerminalPanel;
public ConsolePanel mConsolePanel;
#endif
public ImmediatePanel mImmediatePanel;
public FindResultsPanel mFindResultsPanel;
public WatchPanel mAutoWatchPanel;
@ -428,7 +428,6 @@ namespace IDE
class OpenDebugConsoleCmd : ExecutionCmd
{
}
class StartDebugCmd : ExecutionCmd
@ -455,7 +454,6 @@ namespace IDE
public ~this()
{
}
}
@ -724,8 +722,10 @@ namespace IDE
RemoveAndDelete!(mProjectPanel);
RemoveAndDelete!(mClassViewPanel);
RemoveAndDelete!(mOutputPanel);
#if BF_PLATFORM_WINDOWS
RemoveAndDelete!(mTerminalPanel);
RemoveAndDelete!(mConsolePanel);
#endif
RemoveAndDelete!(mImmediatePanel);
RemoveAndDelete!(mFindResultsPanel);
RemoveAndDelete!(mAutoWatchPanel);
@ -830,8 +830,10 @@ namespace IDE
dlg(mProjectPanel);
dlg(mClassViewPanel);
dlg(mOutputPanel);
#if BF_PLATFORM_WINDOWS
dlg(mTerminalPanel);
dlg(mConsolePanel);
#endif
dlg(mImmediatePanel);
dlg(mFindResultsPanel);
dlg(mAutoWatchPanel);
@ -1260,7 +1262,6 @@ namespace IDE
changedList.Add(fileName);
}
}
});
WithSourceViewPanels(scope (sourceViewPanel) =>
{
@ -1331,7 +1332,8 @@ namespace IDE
void CloseTabs()
{
WithDocumentTabbedViewsOf(window, scope (tabbedView) => {
WithDocumentTabbedViewsOf(window, scope (tabbedView) =>
{
tabbedView.CloseTabs(false, true, true);
});
}
@ -1354,7 +1356,8 @@ namespace IDE
}
});
if (changedList.Count == 0) {
if (changedList.Count == 0)
{
CloseTabs();
return true;
}
@ -1904,7 +1907,6 @@ namespace IDE
SerializeWindow(sd, mMainWindow);
else
{
sd.Add("X", mRequestedWindowRect.mX);
sd.Add("Y", mRequestedWindowRect.mY);
sd.Add("Width", mRequestedWindowRect.mWidth);
@ -2591,7 +2593,6 @@ namespace IDE
[IDECommand]
void CollapseRedo()
{
}
[IDECommand]
@ -2609,7 +2610,6 @@ namespace IDE
[IDECommand]
void CollapseUndo()
{
}
[IDECommand]
@ -2981,8 +2981,6 @@ namespace IDE
LoadFailed();
default:
}
}
}
mWorkspace.Deserialize(data);
@ -3719,7 +3717,6 @@ namespace IDE
success &= SaveFile(projectSource);
}
}
});
for (var project in mWorkspace.mProjects)
{
@ -4979,11 +4976,9 @@ namespace IDE
#unwarn
if (var processBfCompileCmd = cmd as ProcessBfCompileCmd)
{
}
else if (var buildCompleteCmd = cmd as BuildCompletedCmd)
{
}
else
{
@ -5168,19 +5163,21 @@ namespace IDE
{
ShowPanel(mAutoWatchPanel, "Auto Watches");
}
[IDECommand]
public void ShowTerminal()
{
#if BF_PLATFORM_WINDOWS
ShowPanel(mTerminalPanel, "Terminal");
#endif
}
[IDECommand]
public void ShowConsole()
{
#if BF_PLATFORM_WINDOWS
ShowPanel(mConsolePanel, "Console");
#endif
}
[IDECommand]
public void ShowImmediatePanel()
{
@ -6006,7 +6003,6 @@ namespace IDE
sysMenu.Modify("&Continue", sysMenu.mHotKey, null, mDebugger.IsPaused());
else
sysMenu.Modify("&Start Debugging", sysMenu.mHotKey, null, mWorkspace.IsInitialized);
});
AddMenuItem(subMenu, "Start Wit&hout Debugging", "Start Without Debugging", new => UpdateMenuItem_DebugStopped_HasWorkspace);
AddMenuItem(subMenu, "Start With&out Compiling", "Start Without Compiling", new => UpdateMenuItem_DebugStopped_HasWorkspace);
@ -7043,7 +7039,6 @@ namespace IDE
public void UpdateRecentFilesMenuItems(List<String> filesList)
{
}
public void UpdateRecentDisplayedFilesMenuItems()
@ -8262,8 +8257,10 @@ namespace IDE
if (!evt.mKeyFlags.HeldKeys.HasFlag(.Alt))
{
#if BF_PLATFORM_WINDOWS
mConsolePanel.SysKeyDown(evt);
mTerminalPanel.SysKeyDown(evt);
#endif
}
if (evt.mHandled)
@ -8439,8 +8436,10 @@ namespace IDE
void SysKeyUp(KeyCode keyCode)
{
#if BF_PLATFORM_WINDOWS
mConsolePanel.SysKeyUp(keyCode);
mTerminalPanel.SysKeyUp(keyCode);
#endif
}
void ShowOpenFileInSolutionDialog()
@ -9060,17 +9059,14 @@ namespace IDE
protected virtual void BeefCompileStarted()
{
}
protected virtual void BeefCompileDone()
{
}
protected virtual void CompileDone(bool succeeded)
{
}
BuildCompletedCmd GetBuildCompletedCmd()
@ -9255,9 +9251,9 @@ namespace IDE
}
}
#if BF_PLATFORM_WINDOWS
if (let startDebugCmd = next as StartDebugCmd)
{
#if BF_PLATFORM_WINDOWS
if ((mSettings.mDebugConsoleKind == .Native) && (mSettings.mKeepNativeConsoleOpen))
{
if (!startDebugCmd.mConnectedToConsole)
@ -9319,9 +9315,8 @@ namespace IDE
}
}
}
#endif
}
#endif
defer delete next;
mExecutionQueue.RemoveAt(0);
@ -10578,7 +10573,6 @@ namespace IDE
newString.Append(".a\"");
default:
}
}
case "VSToolPath":
if (Workspace.PlatformType.GetPtrSizeByName(platformName) == 4)
@ -10740,7 +10734,6 @@ namespace IDE
}
}
}
}
public bool ResolveConfigString(String platformName, Workspace.Options workspaceOptions, Project project, Project.Options options, StringView configString, String errorContext, String outResult)
@ -10789,7 +10782,6 @@ namespace IDE
if (workspaceOptions.mToolsetType != .GNU)
clangOptions.Append("-gcodeview ");
}
else
clangOptions.Append("-g ");
@ -10905,7 +10897,6 @@ namespace IDE
if (!String.IsNullOrEmpty(options.mCOptions.mOtherCFlags))
clangOptions.Append(options.mCOptions.mOtherCFlags, " ");
}
}
static void QuoteIfNeeded(String str)
@ -11545,7 +11536,6 @@ namespace IDE
});
dialog.AddButton("No", new (evt) =>
{
});
dialog.PopupWindow(GetActiveWindow());
}
@ -11679,7 +11669,6 @@ namespace IDE
},
new (dlg) =>
{
});
dlg.PopupWindow(GetActiveWindow());
#else
@ -11866,7 +11855,6 @@ namespace IDE
},
new (dlg) =>
{
});
((DarkButton)dlg.mButtons[0]).Label = "Open Link";
dlg.PopupWindow(GetActiveWindow());
@ -12097,7 +12085,9 @@ namespace IDE
if (mSettings.mDebugConsoleKind == .Embedded)
{
ShowConsole();
#if BF_PLATFORM_WINDOWS
mConsolePanel.Attach();
#endif
}
if (mSettings.mDebugConsoleKind == .RedirectToImmediate)
@ -12112,8 +12102,10 @@ namespace IDE
if (!mDebugger.OpenFile(launchPath, targetPath, arguments, workingDir, envBlock, wasCompiled, workspaceOptions.mAllowHotSwapping, openFileFlags))
{
#if BF_PLATFORM_WINDOWS
if (!mSettings.mAlwaysEnableConsole)
mConsolePanel.Detach();
#endif
DeleteAndNullify!(mCompileAndRunStopwatch);
return false;
}
@ -12469,12 +12461,14 @@ namespace IDE
mClassViewPanel.mAutoDelete = false;
mOutputPanel = new OutputPanel(true);
mOutputPanel.mAutoDelete = false;
#if BF_PLATFORM_WINDOWS
mTerminalPanel = new TerminalPanel();
mTerminalPanel .Init();
mTerminalPanel.mAutoDelete = false;
mConsolePanel = new ConsolePanel();
mConsolePanel.Init();
mConsolePanel.mAutoDelete = false;
#endif
mImmediatePanel = new ImmediatePanel();
mImmediatePanel.mAutoDelete = false;
mFindResultsPanel = new FindResultsPanel();
@ -13594,7 +13588,6 @@ namespace IDE
if (addWidget != null)
mOutputPanel.AddInlineWidget(addWidget);
}
else if (infoPos != -1)
{
@ -13729,8 +13722,10 @@ namespace IDE
var disassemblyPanel = TryGetDisassemblyPanel(false);
if (disassemblyPanel != null)
disassemblyPanel.Disable();
#if BF_PLATFORM_WINDOWS
if (!mSettings.mAlwaysEnableConsole)
mConsolePanel.Detach();
#endif
mDebugger.DisposeNativeBreakpoints();
mDebugger.Detach();
mDebugger.mIsRunning = false;
@ -13884,10 +13879,12 @@ namespace IDE
{
if ((--mForegroundTargetCountdown == 0) && (mDebugger.mIsRunning))
{
#if BF_PLATFORM_WINDOWS
if (mConsolePanel.mBeefConAttachState case .Connected(let processId))
mDebugger.ForegroundTarget(processId);
else
mDebugger.ForegroundTarget(0);
#endif
}
}
@ -13952,7 +13949,7 @@ namespace IDE
DeleteAndNullify!(mLaunchData);
mErrorsPanel?.UpdateAlways();
#if BF_PLATFORM_WINDOWS
if ((mConsolePanel != null) && (mConsolePanel.mBeefConAttachState case .Attached(let consoleProcessId)))
{
if (!mDebugger.mIsRunning)
@ -13979,6 +13976,7 @@ namespace IDE
}
}
}
#endif
}
public void ShowPassOutput(BfPassInstance bfPassInstance)
@ -14265,7 +14263,6 @@ namespace IDE
changed = true;
}
}
}
else
changed = true;
@ -14277,7 +14274,6 @@ namespace IDE
}
}
}
});
}
}
@ -14321,7 +14317,6 @@ namespace IDE
},
new (dlg) =>
{
});
dialog.PopupWindow(GetActiveWindow());
hadChange = true;
@ -14756,7 +14751,6 @@ namespace IDE
Runtime.Assert(sourceViewPanel != null, "Source marked as modified with no SourceViewPanel");
}
}
});
}
@ -14787,7 +14781,7 @@ namespace IDE
{
RefreshRate = 60;
}
#if BF_PLATFORM_WINDOWS
if (mTerminalPanel != null)
{
// Detach terminal if the panel is closed
@ -14797,7 +14791,7 @@ namespace IDE
mTerminalPanel.Detach();
}
}
#endif
bool hasFocus = false;
for (let window in mWindows)
{
@ -14840,7 +14834,6 @@ namespace IDE
}
else if (IsCompiling)
{
}
else if (mDebugger.mIsRunning)
{
@ -14881,6 +14874,7 @@ namespace IDE
if (mScriptManager != null)
mScriptManager.Update();
#if BF_PLATFORM_WINDOWS
if (mConsolePanel != null)
{
if ((mSettings.mAlwaysEnableConsole) ||
@ -14889,7 +14883,7 @@ namespace IDE
else
mConsolePanel.Detach();
}
#endif
if (mTestManager != null)
{
mTestManager.Update();

View file

@ -14,7 +14,7 @@ using System.Threading;
using IDE.util;
namespace IDE.ui;
#if BF_PLATFORM_WINDOWS
class ConsolePanel : Panel
{
class View : Widget
@ -369,7 +369,9 @@ class ConsolePanel : Panel
public virtual void Init()
{
#if BF_PLATFORM_WINDOWS
mConsoleProvider = new WinNativeConsoleProvider();
#endif
}
public override void Serialize(StructuredData data)
@ -810,3 +812,4 @@ class ConsolePanel : Panel
mView.SetFocus();
}
}
#endif

View file

@ -83,8 +83,11 @@ namespace IDE.ui
data.GetString("Type", type);
Panel panel = null;
#if BF_PLATFORM_WINDOWS
if (type == "")
return gApp.mTerminalPanel;
#endif
if (type == "CallStackPanel")
panel = gApp.mCallStackPanel;
@ -98,7 +101,9 @@ namespace IDE.ui
}
else if (type == "TerminalPanel")
{
#if BF_PLATFORM_WINDOWS
panel = gApp.mTerminalPanel;
#endif
}
else if (type == "ImmediatePanel")
{
@ -168,11 +173,15 @@ namespace IDE.ui
}
else if (type == "TerminalPanel")
{
#if BF_PLATFORM_WINDOWS
panel = gApp.mTerminalPanel;
#endif
}
else if (type == "ConsolePanel")
{
#if BF_PLATFORM_WINDOWS
panel = gApp.mConsolePanel;
#endif
}
if (panel != null)

View file

@ -3047,8 +3047,10 @@ namespace IDE.ui
if (!path.IsWhiteSpace)
{
#if BF_PLATFORM_WINDOWS
gApp.ShowTerminal();
gApp.mTerminalPanel.OpenDirectory(path);
#endif
}
});
}

View file

@ -13,7 +13,7 @@ using Beefy.utils;
using IDE.util;
namespace IDE.ui;
#if BF_PLATFORM_WINDOWS
class TerminalPanel : ConsolePanel
{
public override void Serialize(StructuredData data)
@ -58,3 +58,4 @@ class TerminalPanel : ConsolePanel
consoleProvider.Attach();
}
}
#endif

View file

@ -8,6 +8,7 @@ using System.IO;
using System.Threading;
namespace IDE.util;
#if BF_PLATFORM_WINDOWS
class ConsoleProvider
{
public enum UpdateState
@ -1325,3 +1326,4 @@ class BeefConConsoleProvider : ConsoleProvider
mPipe.EndMessage();
}
}
#endif