lib: Use #define instead of 'static const' for constants

Fixes build errors when using GCC older than v8.1
2 jobs for gcc7-fixes in 1 minute and 16 seconds (queued for 1 second)
Status Name Job ID Coverage
  Container
passed container_fedora #11249146

00:00:23

 
  Build
passed build_on_fedora #11249147

00:00:53