-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed some compilation errors when compiling using clang-cl.exe #560
base: master
Are you sure you want to change the base?
Conversation
osal/win32/osal_win32.h
Outdated
@@ -29,6 +29,7 @@ | |||
} \ | |||
} while (0) | |||
|
|||
struct timezone; | |||
int osal_gettimeofday (struct timeval *tv, struct timezone *tz); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The declaration of osal_gettimeofday can be removed hence no need to add forward declaration of struct timezone.
I believe osal_win32.h might be removed all together
osal/win32/osal.c
Outdated
{ | ||
*thandle = CreateThread(NULL, stacksize, func, param, 0, NULL); | ||
*(void **)thandle = CreateThread(NULL, stacksize, func, param, 0, NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to typecast it to PHANDLE instead of void ** , very much like the linux port
int osal_thread_create(void *thandle, int stacksize, void *func, void *param)
{
PHANDLE phandle = thandle;
*phandle = CreateThread(NULL, stacksize, func, param, 0, NULL);
if(*phandle != NULL)
{
return 0;
}
return 1;
}
int osal_thread_create_rt(void *thandle, int stacksize, void *func, void *param)
{
int ret;
PHANDLE phandle = thandle;
ret = osal_thread_create(phandle, stacksize, func, param);
if (ret)
{
ret = SetThreadPriority(*phandle, THREAD_PRIORITY_TIME_CRITICAL);
}
return ret;
}
@georg-emg , sorry for late response. Small suggestions and I don't have clang on windows so please test and give feedback. |
add suggested fix
@nakarlsson, suggested changes have been added and tested with clang. |
When compiling the osal sub directory under Windows using clang-cl.exe, some compiler errors occurred. This patch fixes these errors, so that SOEM can be built under Windows using clang-cl.