message: verilog preproc: fix __FILE__ replace all for windows
diff: @@ -11,8 +11,6 @@ using namespace antlr4;
  MacroDef__LINE__::MacroDef__LINE__() :
  aMacroDef("__line__") {
  }
  -// [TODO] MacroDef__LINE__, MacroDef__FILE__ are showing the position in current file
  -// See chapter 22.13 __FILE__ and __LINE__ of system verilog 2012 spec.
  std::string MacroDef__LINE__::replace(std::vector<std::string> unused(args),
  bool args_specified, VerilogPreproc*unused(pp),
  antlr4::ParserRuleContext *ctx) {
  @@ -37,7 +35,15 @@ std::string MacroDef__FILE__::replace(std::vector<std::string> unused(args),
  }
  string replacement = "\"" + pp->_tokens.getSourceName() + "\"";
  #if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
  - replacement = replacement.replace("\\","\\\\");
  + auto replace_all = [](std::string &data, const std::string &to_search,
  + const std::string &replace_str) {
  + size_t pos = data.find(to_search);
  + while (pos != std::string::npos) {
  + data.replace(pos, to_search.size(), replace_str);
  + pos = data.find(to_search, pos + replace_str.size());
  + }
  + };
  + replace_all(replacement, "\\", "\\\\");
  #endif
  return replacement;
  }
  