mastercomfig / tf2-patches

Team Fortress 2, but with a lot of fixes, QoL improvements and performance optimizations!
Other
221 stars 27 forks source link

`Q_snprintf` was not declared in this scope; did you mean `V_snprintf`? #615

Closed clubby789 closed 1 year ago

clubby789 commented 2 years ago

Description

When building TC2 as described in the README, I get a number of errors related to Q_snprintf not being declared.

Checklist

Reproduction

  1. Clone the repo
  2. Run ./build.sh

Setup Details

Client Settings

clubby789 commented 2 years ago
In file included from vpc.h:24,
                 from macros.cpp:7:
../../public/tier1/fmtstr.h: In member function ‘void CNumStr::SetInt8(int8)’:
../../public/tier1/fmtstr.h:326:57: error: ‘Q_snprintf’ was not declared in this scope; did you mean ‘V_snprintf’?
  326 |         inline void SetInt8( int8 n8 )                  { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%d", (int32)n8 ); }
      |                                                         ^~~~~~~~~~
      |                                                         V_snprintf
../../public/tier1/fmtstr.h: In member function ‘void CNumStr::SetUint8(uint8)’:
../../public/tier1/fmtstr.h:327:58: error: ‘Q_snprintf’ was not declared in this scope; did you mean ‘V_snprintf’?
  327 |         inline void SetUint8( uint8 un8 )               { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%d", (int32)un8 ); }
      |                                                          ^~~~~~~~~~
      |                                                          V_snprintf
../../public/tier1/fmtstr.h: In member function ‘void CNumStr::SetInt16(int16)’:
../../public/tier1/fmtstr.h:328:58: error: ‘Q_snprintf’ was not declared in this scope; did you mean ‘V_snprintf’?
  328 |         inline void SetInt16( int16 n16 )               { Q_snprintf( m_szBuf, sizeof(m_szBuf), "%d", (int32)n16 ); }
      |                                                          ^~~~~~~~~~
      |                                                          V_snprintf

This continues for several hundred lines, all in fmtstr.h. The Q_.... macros are gated behind #if !defined( VSTDLIB_BACKWARD_COMPAT )