diff options
author | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
---|---|---|
committer | Devtools Arcadia <[email protected]> | 2022-02-07 18:08:42 +0300 |
commit | 1110808a9d39d4b808aef724c861a2e1a38d2a69 (patch) | |
tree | e26c9fed0de5d9873cce7e00bc214573dc2195b7 /library/cpp/protobuf/util/pb_utils.h |
intermediate changes
ref:cde9a383711a11544ce7e107a78147fb96cc4029
Diffstat (limited to 'library/cpp/protobuf/util/pb_utils.h')
-rw-r--r-- | library/cpp/protobuf/util/pb_utils.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/library/cpp/protobuf/util/pb_utils.h b/library/cpp/protobuf/util/pb_utils.h new file mode 100644 index 00000000000..9e9a110b48b --- /dev/null +++ b/library/cpp/protobuf/util/pb_utils.h @@ -0,0 +1,11 @@ +#pragma once + +#define UPDATE_PB_FIELD_MAX(PBMESS, FIELD, VAL) \ + if ((VAL) > (PBMESS).Get##FIELD()) { \ + (PBMESS).Set##FIELD(VAL); \ + } + +#define UPDATE_OPT_PB_FIELD_MAX(PBMESS, FIELD, VAL) \ + if (!(PBMESS).Has##FIELD() || ((VAL) > (PBMESS).Get##FIELD())) { \ + (PBMESS).Set##FIELD(VAL); \ + } |