pb_utils.h 390 B

1234567891011
  1. #pragma once
  2. #define UPDATE_PB_FIELD_MAX(PBMESS, FIELD, VAL) \
  3. if ((VAL) > (PBMESS).Get##FIELD()) { \
  4. (PBMESS).Set##FIELD(VAL); \
  5. }
  6. #define UPDATE_OPT_PB_FIELD_MAX(PBMESS, FIELD, VAL) \
  7. if (!(PBMESS).Has##FIELD() || ((VAL) > (PBMESS).Get##FIELD())) { \
  8. (PBMESS).Set##FIELD(VAL); \
  9. }