Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions osal/win32/osal.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,23 +130,23 @@ void osal_free(void *ptr)
free(ptr);
}

int osal_thread_create(void **thandle, int stacksize, void *func, void *param)
int osal_thread_create(void *thandle, int stacksize, void *func, void *param)
{
*thandle = CreateThread(NULL, stacksize, func, param, 0, NULL);
*(void **)thandle = CreateThread(NULL, stacksize, func, param, 0, NULL);
Copy link
Contributor

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;
}

if(!thandle)
{
return 0;
}
return 1;
}

int osal_thread_create_rt(void **thandle, int stacksize, void *func, void *param)
int osal_thread_create_rt(void *thandle, int stacksize, void *func, void *param)
{
int ret;
ret = osal_thread_create(thandle, stacksize, func, param);
if (ret)
{
ret = SetThreadPriority(*thandle, THREAD_PRIORITY_TIME_CRITICAL);
ret = SetThreadPriority(*(void **)thandle, THREAD_PRIORITY_TIME_CRITICAL);
}
return ret;
}
1 change: 1 addition & 0 deletions osal/win32/osal_win32.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
} \
} while (0)

struct timezone;
int osal_gettimeofday (struct timeval *tv, struct timezone *tz);
Copy link
Contributor

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


#endif
1 change: 0 additions & 1 deletion oshw/win32/oshw.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ uint16 oshw_ntohs (uint16 network)
ec_adaptert * oshw_find_adapters (void)
{
int i = 0;
int ret = 0;
pcap_if_t *alldevs;
pcap_if_t *d;
ec_adaptert * adapter;
Expand Down
2 changes: 1 addition & 1 deletion oshw/win32/wpcap/Include/pcap-stdinc.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include <io.h>

#ifndef __MINGW32__
#include "IP6_misc.h"
#include "ip6_misc.h"
#endif

#define caddr_t char*
Expand Down