This produces the following warning 
src/engine/enginesync.h:40:28: warning: parameter 'value' set but not used [-Wunused-but-set-parameter]

It seams to be a false positive, but I am not sure if the code does what you desire.
Maybe you should make helper function for converting the enum value by value or just use macros #define