Commit d34b3f77 authored by Jose Fonseca's avatar Jose Fonseca

cmake: Target C99.

GCC 5.x and 4.x have different defaults, so it's better to explicitly
specify the target C standard to keep builds consistent.
Reviewed-by: default avatarRoland Scheidegger <sroland@vmware.com>
parent 5b106419
......@@ -224,6 +224,12 @@ if (NOT MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
ENDIF (CXX_COMPILER_FLAG_WALL)
# Target C99. GCC's default is gnu11 for 5.0 and newer, gnu89 for
# older versions.
check_c_compiler_flag ("-std=gnu99" C_COMPILER_FLAG_STD_GNU99)
if (C_COMPILER_FLAG_STD_GNU99)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
endif ()
# MSVC does not support C99 variable length arrays
CHECK_C_COMPILER_FLAG("-Werror=vla" C_COMPILER_FLAG_WEVLA)
IF (C_COMPILER_FLAG_WEVLA)
......
......@@ -973,8 +973,6 @@ leave_state(enum states state, const char *line)
void
process_shader(GLenum target, unsigned num_shaders, GLuint *shaders)
{
unsigned i;
if (num_shaders == 0)
return;
......@@ -983,7 +981,7 @@ process_shader(GLenum target, unsigned num_shaders, GLuint *shaders)
glProgramParameteri(prog, GL_PROGRAM_SEPARABLE, GL_TRUE);
}
for (i = 0; i < num_shaders; i++) {
for (unsigned i = 0; i < num_shaders; i++) {
glAttachShader(prog, shaders[i]);
}
......
Markdown is supported
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