Skip to content

Commit

Permalink
Fix gcc 13 compilation errors (ref #153)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadDeCoDeR committed Sep 7, 2024
1 parent 49e32b1 commit 4aa0680
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion neo/idlib/DataQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ bool idDataQueue< maxItems, maxBuffer >::Append( int sequence, const byte* b1, i
item.dataOffset = dataLength;
memcpy( data + dataLength, b1, b1Len );
dataLength += b1Len;
memcpy( data + dataLength, b2, b2Len );
if (b2 != __null) {
memcpy( data + dataLength, b2, b2Len );
}
dataLength += b2Len;
return true;
}
Expand Down
9 changes: 6 additions & 3 deletions neo/sys/sdl/sdl_glimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,11 @@ bool GLimp_Init( glimpParms_t parms )
{
int major = 3;
int minor = 3;
if (r_useOpenGL32.GetInteger() == 1) {
SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY );
} else {
SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE );
}
GLimp_GetSupportedVersion(&major, &minor);
if (major < 3 || major == 3 && minor < 3) {
common->FatalError("GLimp_Init: OpenGL version is not supported!\n");
Expand All @@ -256,7 +261,7 @@ bool GLimp_Init( glimpParms_t parms )

SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, major );
SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, minor );
SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY );


if( r_debugContext.GetBool() )
{
Expand All @@ -267,8 +272,6 @@ bool GLimp_Init( glimpParms_t parms )
if( r_useOpenGL32.GetInteger() > 1 )
{
glConfig.driverType = GLDRV_OPENGL32_CORE_PROFILE;

SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE );
}
// RB end

Expand Down

0 comments on commit 4aa0680

Please sign in to comment.