Default options for widgets / layouts / themes now OK on VC++

This commit is contained in:
Bertrand Songis
2016-03-10 18:42:04 +01:00
parent 62df9831d8
commit c521fce20b
8 changed files with 27 additions and 19 deletions
+9 -3
View File
@@ -34,16 +34,22 @@ struct Zone
#define LEN_ZONE_OPTION_STRING 8
union ZoneOptionValue
{
bool boolValue;
uint32_t unsignedValue;
int32_t signedValue;
bool boolValue;
char stringValue[LEN_ZONE_OPTION_STRING];
};
#if defined(_MSC_VER)
#define OPTION_DEFAULT_VALUE(...)
#define OPTION_DEFAULT_VALUE_UNSIGNED(x) { uint32_t(x) }
#define OPTION_DEFAULT_VALUE_SIGNED(x) { uint32_t(x) }
#define OPTION_DEFAULT_VALUE_BOOL(x) { uint32_t(x) }
#define OPTION_DEFAULT_VALUE_STRING(...) { *((ZoneOptionValue *)(const char []) __VA_ARGS__) }
#else
#define OPTION_DEFAULT_VALUE(...) __VA_ARGS__
#define OPTION_DEFAULT_VALUE_UNSIGNED(x) { .unsignedValue = (x) }
#define OPTION_DEFAULT_VALUE_SIGNED(x) { .signedValue = (x) }
#define OPTION_DEFAULT_VALUE_BOOL(x) { .boolValue = (x) }
#define OPTION_DEFAULT_VALUE_STRING(...) { .stringValue = __VA_ARGS__}
#endif
struct ZoneOption