Commit 5098decb authored by Kirill Smelkov's avatar Kirill Smelkov
Browse files

fmt: Adjust to support MSVC

- there is no __attribute__ on that compiler
- sadly va_start is rejected to work on reference:

    z:\home\kirr\src\tools\go\pygo-win\BuildTools\vc\tools\msvc\14.35.32215\include\vadefs.h(194): error C2338: static_assert failed: 'va_start argument must not have reference type and must not be parenthesized'
    golang/fmt.cpp(53): note: see reference to class template instantiation '__vcrt_assert_va_start_is_not_reference<const golang::string &>' being compiled

  -> change format from string& to be string in sprintf.

  Probably it should be ok in practice from performance point of view because
  string contains only pointer to data, not the data itself.
parent 22a597a0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment