Closed dlegaultbbry closed 1 year ago
On platforms which have stdbool.h and the true/false as macros, things like below cause issues
p11_attr.c: In function 'pkcs11_addattr_bool': p11_attr.c:126:18: error: expected identifier or '(' before numeric constant static CK_BBOOL true = CK_TRUE; ^~~~ p11_attr.c:127:18: error: expected identifier or '(' before numeric constant static CK_BBOOL false = CK_FALSE; ^~~~~ p11_attr.c:128:37: error: lvalue required as unary '&' operand pkcs11_addattr(tmpl, type, value ? &true : &false, sizeof(CK_BBOOL)); ^ p11_attr.c:128:45: error: lvalue required as unary '&' operand pkcs11_addattr(tmpl, type, value ? &true : &false, sizeof(CK_BBOOL));
Maybe convert these to _false and _true or some other name to avoid name clashes?
Using _true/_false is common practice. Do you want to submit a PR with such changes?
_true
_false
I can do that. I'll setup everything and send something in the next few days.
On platforms which have stdbool.h and the true/false as macros, things like below cause issues
Maybe convert these to _false and _true or some other name to avoid name clashes?