Add version check to C code