Make the -1 a part of the type ?
That's the reasonable thing to do but, unfortunately, it would cause a lot of problems (there are already a number of things indexed using that enumeration, adding a -1 is disruptive.)
btw and fwiw this is typical for c code: using (positive) enums then use -1 to indicate that the enum was invalid (mostly done when returning result codes) thus it is not wise to translate c-enums to Pascal enums especially since c-code has the tendency to skip a few numbers as well (though that can (now) be done in/with FPC as well).
That's what it is, the actual code is a port from C. The C code doesn't declare an "invalid" element/constant because it doesn't need it but, I extended the functionality and the extension needs an invalid value indicator.
Looks like I'll have to initialize the variable in the code instead of the declaration.
Thank you, I appreciate the help.
@Thaddy,
I tried your suggestion and the compiler still emitted an error.