Skip to content

Commit

Permalink
Fix the Linux build.
Browse files Browse the repository at this point in the history
  • Loading branch information
dGr8LookinSparky committed Jul 13, 2020
1 parent 7d98239 commit 5135fa2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/engine/qcommon/q_shared.cpp
Expand Up @@ -1893,18 +1893,18 @@ bool Com_sprintf( valueType* dest, size_t size, pointer fmt, ... )
if( len >= size )
{
#ifdef DEBUG
Com_Printf( "ERROR! %s: destination buffer overflow of len %i, size %i\n"
Com_Printf( "ERROR! %s: destination buffer overflow of len %i, size %lu\n"
"Input was: %s", __FUNCTION__, len, size, dest );
return false;
#else
Com_Printf( "ERROR! %s: destination buffer overflow of len %i, size %i\n"
Com_Printf( "ERROR! %s: destination buffer overflow of len %i, size %lu\n"
"Input was: %s", __FUNCTION__, len, size, dest );
#endif
}

if( len == -1 )
{
Com_Printf( "Com_sprintf: overflow of %i bytes buffer\n", size );
Com_Printf( "Com_sprintf: overflow of %lu bytes buffer\n", size );
return false;
}

Expand Down Expand Up @@ -2411,6 +2411,7 @@ void VectorMatrixMultiply( const vec3_t p, vec3_t m[ 3 ], vec3_t out )
out[ 2 ] = m[ 0 ][ 2 ] * p[ 0 ] + m[ 1 ][ 2 ] * p[ 1 ] + m[ 2 ][ 2 ] * p[ 2 ];
}

#if defined(_MSC_VER)
/*
=============
Q_vsnprintf
Expand All @@ -2428,6 +2429,7 @@ sint Q_vsnprintf( valueType* str, size_t size, pointer format, va_list ap )

return retval;
}
#endif

#ifndef Q3MAP2
bool StringContainsWord( pointer haystack, pointer needle )
Expand Down
7 changes: 7 additions & 0 deletions src/engine/qcommon/q_shared.h
Expand Up @@ -750,7 +750,14 @@ bool SkipBracedSection( valueType** program );
bool SkipBracedSection_Depth( valueType** program, sint depth ); // start at given depth if already
void SkipRestOfLine( valueType** data );

#if defined (_MSC_VER)
// vsnprintf is ISO/IEC 9899:1999
// abstracting this to make it portable
sint Q_vsnprintf( valueType* str, size_t size, pointer format, va_list args );
#else // not using MSVC
#define Q_vsnprintf vsnprintf
#endif

bool Com_sprintf( valueType* dest, size_t size, pointer fmt, ... );

// mode parm for FS_FOpenFile
Expand Down

0 comments on commit 5135fa2

Please sign in to comment.