diff options
author | Clifford Wolf <clifford@clifford.at> | 2014-10-11 10:46:50 +0200 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2014-10-11 10:46:50 +0200 |
commit | 7df8cbe2a9d48dbccb4a2c665e4087ed4f1514a8 (patch) | |
tree | 8546ccc2d9e9726adf3b597f7fbbbc35d0ac303b | |
parent | 0a651f112fe62fdf86e4b288988a9ed9ac90068d (diff) | |
download | yosys-7df8cbe2a9d48dbccb4a2c665e4087ed4f1514a8.tar.gz yosys-7df8cbe2a9d48dbccb4a2c665e4087ed4f1514a8.tar.bz2 yosys-7df8cbe2a9d48dbccb4a2c665e4087ed4f1514a8.zip |
Not using std::to_string in ezsat (problems with mingw)
-rw-r--r-- | libs/ezsat/ezsat.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libs/ezsat/ezsat.cc b/libs/ezsat/ezsat.cc index 754691f7b..54a6e9c71 100644 --- a/libs/ezsat/ezsat.cc +++ b/libs/ezsat/ezsat.cc @@ -669,8 +669,11 @@ std::vector<int> ezSAT::vec_var(int numBits) std::vector<int> ezSAT::vec_var(std::string name, int numBits) { std::vector<int> vec; - for (int i = 0; i < numBits; i++) - vec.push_back(VAR(name + "[" + std::to_string(i) + "]")); + for (int i = 0; i < numBits; i++) { + char buf[64]; + snprintf(buf, 64, " [%d]", i); + vec.push_back(VAR(name + buf)); + } return vec; } @@ -1195,7 +1198,7 @@ void ezSAT::printDIMACS(FILE *f, bool verbose) const fprintf(f, "c mapping of variables to expressions:\n"); for (int i = 0; i < int(cnfExpressionVariables.size()); i++) if (cnfExpressionVariables[i] != 0) - fprintf(f, "c %*d: %s\n", digits, cnfExpressionVariables[i], to_string(-i-1).c_str()); + fprintf(f, "c %*d: %d\n", digits, cnfExpressionVariables[i], -i-1); if (mode_keep_cnf()) { fprintf(f, "c\n"); @@ -1242,8 +1245,11 @@ static std::string expression2str(const std::pair<ezSAT::OpId, std::vector<int>> #undef X } text += ":"; - for (auto it : data.second) - text += " " + std::to_string(it); + for (auto it : data.second) { + char buf[64]; + snprintf(buf, 64, " %d", it); + text += buf; + } return text; } |