mirror of
https://github.com/YosysHQ/nextpnr.git
synced 2026-09-03 03:14:00 +02:00
make GUI compile on MSVC
This commit is contained in:
+2
-2
@@ -28,7 +28,7 @@ THE SOFTWARE.
|
||||
#include <memory>
|
||||
#include "ParseMessage.h"
|
||||
|
||||
class ParseListener;
|
||||
struct ParseListener;
|
||||
|
||||
/**
|
||||
Helps chunk lines of Python code into compilable statements.
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
// return if there was an error
|
||||
bool initializeIndent(const std::string& str);
|
||||
};
|
||||
friend class BlockParseState;
|
||||
friend struct BlockParseState;
|
||||
|
||||
struct BracketParseState : public ParseState
|
||||
{
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ void PythonConsole::parseEvent( const ParseMessage& message )
|
||||
}
|
||||
|
||||
// interpret valid user input
|
||||
int errorCode;
|
||||
int errorCode = 0;
|
||||
std::string res;
|
||||
if ( message.message.size() )
|
||||
res = pyinterpreter_execute( message.message, &errorCode );
|
||||
|
||||
+2
-2
@@ -38,9 +38,9 @@ static std::list<std::string> m_suggestions;
|
||||
|
||||
template <typename... Args> std::string string_format(const std::string &format, Args... args)
|
||||
{
|
||||
size_t size = std::snprintf(nullptr, 0, format.c_str(), args...) + 1; // Extra space for '\0'
|
||||
size_t size = snprintf(nullptr, 0, format.c_str(), args...) + 1; // Extra space for '\0'
|
||||
std::unique_ptr<char[]> buf(new char[size]);
|
||||
std::snprintf(buf.get(), size, format.c_str(), args...);
|
||||
snprintf(buf.get(), size, format.c_str(), args...);
|
||||
return std::string(buf.get(), buf.get() + size - 1); // We don't want the '\0' inside
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user