Variable type "small"

I'm not sure what's going here:
1
2
3
4
struct buttonSize
{
	static const int small = 0;
};


VS2008 keeps telling me:
-"int" followed by "char" is illegal
-syntax error "="
-unexpected token preceding ';'

If I change the variable "small" to anything else it works, it simply won't compile when the variable is named "small". Is "small" already a type of variable I'm not aware of? Visual Studio doesn't seem to show that it is.
I get no error compiling the above snippet in VS2008.
I admittedly didn't think to try it in an empty project, I just tested all my dependencies and it turns out including windows.h was messing it up. Kinda odd, however I'm not about to dig through every windows API file to determine why it won't allow "small" as a variable.

EDIT: I know why: http://stackoverflow.com/questions/28380733/syntax-errors-after-including-windows-h

"small" is defined as a macro in windows.h, and

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

fixes it
Last edited on
You should also #define NOMINMAX
I use SFML for graphics and window handling, I like simplicity (and I'm lazy), so I actually don't need much from Windows anyway.
One of the nice things about SFML is that it's portable. So you actually shouldn't be using <Windows.h> at all since it destroys your portability.

What do you need it for? Odds are you can probably do the same thing with SFML.
Last edited on
I kept changing what libraries I was using for graphics. I started with Windows and Direct2D then kept switching around until I got to SFML. It was just old, unused stuff I never cleaned out.
Topic archived. No new replies allowed.