It seems that somewhere inside the #include hierarchy the symbol ERROR
is #defined to cause this code to fail.
Renaming ERROR to something else avoids this problem.

I do not know where ERROR is occuring. But it is certainly not a good idea to have an enumeration name be a common all-uppercase name.


That's true. But still, having commonly named MACROs introduced by a 3rd-party header is even less ideal. 
Adi