sfio: remove 'SF_ERROR'
When doing some unrelated refactoring, Windows compile errors emerge:
sfsetbuf.c
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(322,9):
error C2059: syntax error: 'constant'
[C:\GitLab-Runner\builds\graphviz\graphviz\build\lib\sfio\sfio.vcxproj]
Some investigation leads us to a guess¹ that oaidl.h contains:
typedef /* [v1_enum] */
enum tagSF_TYPE
{
SF_ERROR = VT_ERROR,
SF_I1 = VT_I1,
SF_I2 = VT_I2,
SF_I4 = VT_I4,
SF_I8 = VT_I8,
SF_BSTR = VT_BSTR,
SF_UNKNOWN = VT_UNKNOWN,
SF_DISPATCH = VT_DISPATCH,
SF_VARIANT = VT_VARIANT,
SF_RECORD = VT_RECORD,
SF_HAVEIID = ( VT_UNKNOWN | VT_RESERVED )
} SF_TYPE; // Line 319
673b9f1a7dbde9c9cc5d9a2a22ee835a08ab40ab tried to work around this in the past.
But there remained a foot gun. If you (possibly transitively) included sfio.h
but did not include sfhdr.h, you could end up facing this error.
Surprising as it may seem, nothing in the code base checks for `SF_ERROR`. So a
cleaner solution that removes the problem in perpetuity is to remove our
`SF_ERROR`. Note that `SF_FLAGS` does not need to be adjusted because `SF_ERROR`
was not a public flag.
Gitlab: fixes #2301
¹ https://stackoverflow.com/questions/
13827599/oaidl-h319-error-c2057-expected-constant-expression