Open JojoEffect opened 2 years ago
Protobuf offers these functionalities:
Different versions of protobuf may generate slightly different structures even if the same proto definition file is used. This has implications if these structures are shared between applications (e.g. using gRPC).
Also, best practice requires that generated protobuf structures and headers are not being checked into source control, only the proto definition files. This means that every time somebody wants to compile and run the user code, protobuf needs to re-generate the structures and headers, if they are not yet present. As a result, the protobuf compiler (protoc) becomes a compile time requirement because without the generated files, the user code will not compile. Problems can occur, if the user code was implemented against an API generated by a different version of protoc. For this reason, protobuf checks the variable PROTOBUF_VERSION
and prints these errors:
This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer headers. Please update your headers.
This file was generated by an older version of protoc which is incompatible with your Protocol Buffer headers. Please regenerate this file with a newer version of protoc.
In general, protobuf tries to keep API compatibility between versions, so a tight version match is not needed. However, it is still recommended to use similar protobuf versions for code generation.
For this reason, I think we need to agree on a protobuf version to use in this project.
int initRTMutex(pthread_mutex_t *mutex) { pthread_mutexattr_t mutexAttr; pthread_mutexattr_init(&mutexAttr); pthread_mutexattr_setpshared(&mutexAttr, PTHREAD_PROCESS_SHARED); pthread_mutexattr_setrobust_np(&mutexAttr, PTHREAD_MUTEX_ROBUST_NP); pthread_mutexattr_setprotocol(&mutexAttr, PTHREAD_PRIO_INHERIT); pthread_mutex_init(mutex, &mutexAttr); }