Visual C++ compilation fixes

This commit is contained in:
Bertrand Songis
2016-03-10 22:39:51 +01:00
parent 64cd872055
commit 41a6e7c4ab
4 changed files with 12 additions and 9 deletions
+5 -5
View File
@@ -41,15 +41,15 @@ union ZoneOptionValue
};
#if defined(_MSC_VER)
#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__) }
#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_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__}
#define OPTION_DEFAULT_VALUE_STRING(...) { .stringValue = *(ZoneOptionValue *)(const char *)__VA_ARGS__ }
#endif
struct ZoneOption
+1 -1
View File
@@ -34,7 +34,7 @@ class TextWidget: public Widget
};
const ZoneOption TextWidget::options[] = {
{ "Text", ZoneOption::String, OPTION_DEFAULT_VALUE_STRING({ '\015', '\347', '\0', '\14', '\377', '\376', '\373', '\364' }) },
{ "Text", ZoneOption::String, OPTION_DEFAULT_VALUE_STRING("\015\347\0\14\377\376\373\364") },
{ "Color", ZoneOption::Color, OPTION_DEFAULT_VALUE_UNSIGNED(RED) },
{ "Size", ZoneOption::TextSize, OPTION_DEFAULT_VALUE_UNSIGNED(0) },
{ NULL, ZoneOption::Bool }
+5 -2
View File
@@ -48,7 +48,9 @@ const char *eepromFile = NULL;
FILE *fp = NULL;
int g_snapshot_idx = 0;
pthread_t main_thread_pid = 0;
#if !defined(CPUARM)
pthread_t main_thread_pid;
#endif
uint8_t main_thread_running = 0;
char * main_thread_error = NULL;
@@ -383,8 +385,9 @@ void StartSimu(bool tests)
void StopSimu()
{
main_thread_running = 0;
if (main_thread_pid)
#if !defined(CPUARM)
pthread_join(main_thread_pid, NULL);
#endif
}
#if defined(CPUARM)
+1 -1
View File
@@ -375,7 +375,7 @@ void eepromReadBlock (uint8_t * pointer_ram, uint32_t address, uint32_t size);
extern OS_MutexID audioMutex;
#define OS_FlagID uint32_t
#define OS_TID uint32_t
#define OS_TID pthread_t
#define OS_TCID uint32_t
#define OS_STK uint32_t