#include <iostream>
using namespace std;
#define LK_STUCK_KEY 111
#define LK_SELFTEST_FAILED 112
static struct {
unsigned char value;
unsigned char *name;
} lk_response[] = {
#define RESPONSE(x) { .value = (x), .name = (unsigned char *)#x, }
RESPONSE(LK_STUCK_KEY),
RESPONSE(LK_SELFTEST_FAILED),
#undef RESPONSE
};
int main(int argc, char** argv)
{
printf("%d\n", lk_response[0].value);
printf("%d\n", lk_response[1].value);
printf("%s\n", lk_response[0].name);
printf("%s\n", lk_response[1].name);
return 0;
}
using namespace std;
#define LK_STUCK_KEY 111
#define LK_SELFTEST_FAILED 112
static struct {
unsigned char value;
unsigned char *name;
} lk_response[] = {
#define RESPONSE(x) { .value = (x), .name = (unsigned char *)#x, }
RESPONSE(LK_STUCK_KEY),
RESPONSE(LK_SELFTEST_FAILED),
#undef RESPONSE
};
int main(int argc, char** argv)
{
printf("%d\n", lk_response[0].value);
printf("%d\n", lk_response[1].value);
printf("%s\n", lk_response[0].name);
printf("%s\n", lk_response[1].name);
return 0;
}