Skip to content

Commit

Permalink
Linux errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
vedpatil611 committed May 18, 2021
1 parent 1573c2f commit 5ec0e60
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion MLPlusPlus/src/NodeEditor/NodeEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void NodeEditor::renderEditor()
int ns[128] = { 0 };
ImNodes::GetSelectedNodes(ns);

for (auto& x = nodes.begin(); x != nodes.end();)
for (auto x = nodes.begin(); x != nodes.end();)
{
auto it = std::find(ns, ns + 128, (*x)->start_id);
//if ((*x)->start_id == 1) continue; // avoid deleting main function
Expand All @@ -225,7 +225,11 @@ void NodeEditor::renderEditor()
ImNodes::GetSelectedLinks(ls);

// delete selected links
#ifdef OS_LINUX
for (auto x = links.begin(); x < links.end();)
#elif OS_WINDOWS
for (auto& x = links.begin(); x < links.end();)
#endif
{
auto it = std::find(ls, ls + 128, (*x)->id);
if (it < ls + 128)
Expand Down
5 changes: 5 additions & 0 deletions MLPlusPlus/src/Utils/File.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#include "File.h"

#ifdef OS_LINUX
#include <string.h>
#include <stdio.h>
#endif

#include <memory>

const char* Utils::readFile(const char* filepath)
Expand Down
8 changes: 6 additions & 2 deletions premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,18 @@ project "MLPlusPlus"

filter "system:windows"
defines {
"OS_WINDOWS",
"_CRT_SECURE_NO_WARNINGS"
}
undefines {
"_DEBUG"
}

filter "system:linux"
links {
filter "system:linux or unix"
defines {
"OS_LINUX"
}
links {
"dl",
"pthread"
}
Expand Down

0 comments on commit 5ec0e60

Please sign in to comment.