memononen/fontstash

Can't compile example under VS2010

elaverick opened this issue · 2 comments

Downloaded both GLFW and Fontstash. Run premake4 vs2010 to generate project files.
Set paths to GLFW in VS Directories tab on the project.
Compile and get the following errors:
Warning 17 warning C4024: 'fons__blur' : different types for formal and actual parameter 2 684
Warning 13 warning C4024: 'stbtt_MakeGlyphBitmap' : different types for formal and actual parameter 2 665
Warning 12 warning C4047: 'function' : 'unsigned char *' differs in levels of indirection from 'int' 665
Warning 16 warning C4047: 'function' : 'unsigned char *' differs in levels of indirection from 'int' 684
Warning 3 warning C4047: 'return' : 'void *' differs in levels of indirection from 'int' 212
Warning 20 warning C4133: 'function' : incompatible types - from 'int *' to 'float *' 818
Warning 23 warning C4133: 'function' : incompatible types - from 'int *' to 'float *' 821
Error 6 error C2065: 'alpha' : undeclared identifier 568
Error 7 error C2065: 'alpha' : undeclared identifier 569
Error 8 error C2065: 'alpha' : undeclared identifier 570
Error 9 error C2065: 'alpha' : undeclared identifier 571
Error 15 error C2065: 'bdst' : undeclared identifier 684
Error 53 error C2065: 'black' : undeclared identifier 258
Error 49 error C2065: 'blue' : undeclared identifier 194
Error 47 error C2065: 'brown' : undeclared identifier 170
Error 11 error C2065: 'dst' : undeclared identifier 665
Error 27 error C2065: 'font' : undeclared identifier 940
Error 29 error C2065: 'font' : undeclared identifier 943
Error 32 error C2065: 'font' : undeclared identifier 945
Error 35 error C2065: 'font' : undeclared identifier 947
Error 41 error C2065: 'h' : undeclared identifier 57
Error 31 error C2065: 'isize' : undeclared identifier 943
Error 34 error C2065: 'isize' : undeclared identifier 945
Error 37 error C2065: 'isize' : undeclared identifier 947
Error 2 error C2065: 'ptr' : undeclared identifier 212
Error 40 error C2065: 'w' : undeclared identifier 57
Error 46 error C2065: 'white' : undeclared identifier 165
Error 48 error C2065: 'white' : undeclared identifier 175
Error 50 error C2065: 'white' : undeclared identifier 203
Error 51 error C2065: 'white' : undeclared identifier 216
Error 52 error C2065: 'white' : undeclared identifier 249
Error 54 error C2065: 'white' : undeclared identifier 263
Error 19 error C2065: 'width' : undeclared identifier 818
Error 21 error C2065: 'width' : undeclared identifier 819
Error 22 error C2065: 'width' : undeclared identifier 821
Error 24 error C2065: 'width' : undeclared identifier 822
Error 1 error C2143: syntax error : missing ';' before 'type' 210
Error 4 error C2143: syntax error : missing ';' before 'type' 566
Error 5 error C2143: syntax error : missing ';' before 'type' 567
Error 10 error C2143: syntax error : missing ';' before 'type' 664
Error 14 error C2143: syntax error : missing ';' before 'type' 683
Error 18 error C2143: syntax error : missing ';' before 'type' 813
Error 25 error C2143: syntax error : missing ';' before 'type' 938
Error 26 error C2143: syntax error : missing ';' before 'type' 939
Error 38 error C2143: syntax error : missing ';' before 'type' 50
Error 39 error C2143: syntax error : missing ';' before 'type' 51
Error 42 error C2143: syntax error : missing ';' before 'type' 143
Error 43 error C2143: syntax error : missing ';' before 'type' 144
Error 44 error C2143: syntax error : missing ';' before 'type' 145
Error 45 error C2143: syntax error : missing ';' before 'type' 146
Error 30 error C2223: left of '->ascender' must point to struct/union 943
Error 28 error C2223: left of '->data' must point to struct/union 940
Error 33 error C2223: left of '->descender' must point to struct/union 945
Error 36 error C2223: left of '->lineh' must point to struct/union 947

If I move all the variable declarations to the start of the functions rather than part way through and remove the inline from one of the function declarations it seems to compile ok.
I think this is due to VS2010 not supporting C99 standards.

Makes sense. Do you mind making a pull request to fix those issues?