IDE reorders code using structs, enums?

It still does.

Code in the .h file is compiled according to the file extension of the file(s) that #include the header. A header file is never compiled as a standalone source file.

I see you opened a dedicated topic for that question: