mirror of
https://github.com/stefanberger/libtpms
synced 2026-08-11 19:26:27 +00:00
tpm2: fix undefined behavior of macro expansion
Fix the preprocessor warning: macro expansion producing 'defined' has undefined behavior Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
parent
a433bf1217
commit
1bd13f5bb5
@ -90,7 +90,16 @@ typedef struct sequenceMethods {
|
||||
SMAC_DATA_METHOD data;
|
||||
SMAC_END_METHOD end;
|
||||
} SMAC_METHODS;
|
||||
#define SMAC_IMPLEMENTED (defined TPM_CC_MAC || defined TPM_CC_MAC_Start)
|
||||
|
||||
#if 0 /* libtpms changed begin (undefined behavior of macro expansion) */
|
||||
# define SMAC_IMPLEMENTED (defined TPM_CC_MAC || defined TPM_CC_MAC_Start)
|
||||
#else
|
||||
# if defined TPM_CC_MAC || defined TPM_CC_MAC_Start
|
||||
# define SMAC_IMPLEMENTED 1
|
||||
# else
|
||||
# define SMAC_IMPLEMENTED 0
|
||||
# endif
|
||||
#endif /* libtpms changed end */
|
||||
|
||||
/* These definitions are here because the SMAC state is in the union of hash states. */
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user