Compare a given version number in the form major.minor.build.patch and see if one is less than the other
Yes, there is a cleaner way:

if (a.major != b.major) {
    *result = a.major &lt; b.major;
} else if (a.minor != b.minor) {
    *result = a.minor &lt; b.minor;
} else if (a.patch != b.patch) {
    *result = a.patch &lt; b.patch;
} else {
    *result = a.build &lt; b.build;
}
return OKAY;


I reordered patch to come before build since that's how it is usually done. If your version scheme is different from this, good luck.

Instead of unsigned char I would choose uint32_t so that your code can handle versions like 1.0.20190415. If you need to handle version numbers with millisecond timestamps, each version component would need to be uint64_t.