Building glew from scratch using mingw on Windows

I'm trying to build glew from the git repository but it gives me compiler errors when compiling glew.c. 

After I've managed to setup a developer environment with msys but I'm getting the following compiling errors

In file included from src/glew.c:32:
include/GL/glew.h:1197: error: expected identifier or '(' before numeric constant
include/GL/glew.h:1272: warning: return type defaults to 'int'
include/GL/glew.h: In function 'GLEW_GET_VAR':
include/GL/glew.h:1272: error: expected declaration specifiers before numeric constant
include/GL/glew.h:1487: error: storage class specified for parameter 'GLDEBUGPROCAMD'
include/GL/glew.h:1489: error: expected ')' before 'callback'
include/GL/glew.h:1490: error: storage class specified for parameter 'PFNGLDEBUGMESSAGEENABLEAMDPROC'
include/GL/glew.h:1491: error: storage class specified for parameter 'PFNGLDEBUGMESSAGEINSERTAMDPROC'
include/GL/glew.h:1492: error: storage class specified for parameter 'PFNGLGETDEBUGMESSAGELOGAMDPROC'
include/GL/glew.h:1520: error: storage class specified for parameter 'PFNGLBLENDEQUATIONINDEXEDAMDPROC'
include/GL/glew.h:1521: error: storage class specified for parameter 'PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC'
include/GL/glew.h:1522: error: storage class specified for parameter 'PFNGLBLENDFUNCINDEXEDAMDPROC'
include/GL/glew.h:1523: error: storage class specified for parameter 'PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC'
include/GL/glew.h:1539: error: storage class specified for parameter 'PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC'
include/GL/glew.h:1540: error: storage class specified for parameter 'PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC'

among other things. I suspect this is a problem with the code source generation step. 

I'll try with cygwin, but I'd like to know if this is a known issue. I also try to build using the VC10 project but it gives me the same erros.

--
Anyday, anytime.

http://www.capimlokura.com.br

Thales Luis Rodrigues Sabino
TLuisRS