small cleanup in src/compat .h and .cpp

- add license header
- fix include guards
- fix indentation
Merge pull request #4379 from Diapolo/cleanup_compat

small cleanup in src/compat .h and .cpp