Bug 5315

Summary: 6.41 Win32 Build is broken w/ VC++ 6.0 SP6 s_triangle.c (C99 syntax abuse)
Product: Mesa Reporter: Kyle Hamilton <aerowolf>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: high    
Version: 6.4   
Hardware: x86 (IA32)   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:

Description Kyle Hamilton 2005-12-11 09:16:02 UTC
The build of Mesa on VC++ 6.0 SP6 is broken in src\mesa\swrast\s_triangle.c.

I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2275: 'GLuint' :
illegal use of this type as an expression
  ../../../../include\GL/gl.h(155) : see declaration of 'GLuint'
I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2146: syntax error
: missing ';' before identifier 'i'
I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2065: 'i' :
undeclared identifier
I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2275: 'GLuint' :
illegal use of this type as an expression
  ../../../../include\GL/gl.h(155) : see declaration of 'GLuint'
I:\mesa\Mesa-6.4.1\src\mesa\swrast\s_tritemp.h(1159) : error C2146: syntax error
: missing ';' before identifier 'i'


I have traced these all to the abuse of C99 syntax, specifically in the
RENDER_SPAN() macro that is defined before one of the inclusions of s_tritemp.h.  

To fix: In any macro that defines a local variable (such as GLuint i;), always
surround the macro expansion with braces to create a sub-block.  (This is at
s_triangle.c, with locations at lines 165, 216, and 916.)
Comment 1 Brian Paul 2005-12-13 02:22:23 UTC
Already fixed in CVS.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.