• Kirill Smelkov's avatar
    fmt: Adjust to support MSVC · 5098decb
    Kirill Smelkov authored
    - 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.
    5098decb
fmt.h 5.26 KB