More warnings eliminated on windows
This commit is contained in:
parent
57d765acd9
commit
414bf7238d
3 changed files with 6 additions and 6 deletions
|
@ -21,7 +21,7 @@ configure_file (
|
||||||
#
|
#
|
||||||
if (UNIX)
|
if (UNIX)
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -Wno-unused-parameter -fprofile-arcs -ftest-coverage -O0 -pthread -DDEBUG=1")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wextra -Wno-unused-parameter -fprofile-arcs -ftest-coverage -O0 -pthread -DDEBUG=1")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wno-unused-parameter -fvisibility=hidden -fvisibility-inlines-hidden -Os -pthread")
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -Wno-unused-parameter -fvisibility=hidden -Os -pthread")
|
||||||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-lgcov")
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-lgcov")
|
||||||
endif() # UNIX
|
endif() # UNIX
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
|
|
||||||
/* Sadly we have to have a Windows-ism here */
|
/* Sadly we have to have a Windows-ism here */
|
||||||
#if MSVC
|
#if MSVC
|
||||||
typedef uint32_t (__stdcall *PlatformTask)(void *context);
|
typedef unsigned long (__stdcall *PlatformTask)(void *context);
|
||||||
|
|
||||||
// Use this to define the PlatformTask callback functions to be cross platform
|
// Use this to define the PlatformTask callback functions to be cross platform
|
||||||
#define PlatformTaskFunc(_name) uint32_t __stdcall _name(void *context)
|
#define PlatformTaskFunc(_name) unsigned long __stdcall _name(void *context)
|
||||||
#else
|
#else
|
||||||
typedef void *(*PlatformTask)(void *context);
|
typedef void *(*PlatformTask)(void *context);
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ PlatformTaskFunc(timer_task) {
|
||||||
|
|
||||||
PlatformStatusCode platform_init(MQTTHandle *handle) {
|
PlatformStatusCode platform_init(MQTTHandle *handle) {
|
||||||
handle->platform = (PlatformData *)calloc(1, sizeof(struct _PlatformData));
|
handle->platform = (PlatformData *)calloc(1, sizeof(struct _PlatformData));
|
||||||
handle->platform->sock = -1;
|
handle->platform->sock = INVALID_SOCKET;
|
||||||
handle->platform->timer_task = -1;
|
handle->platform->timer_task = -1;
|
||||||
if (!handle->platform) {
|
if (!handle->platform) {
|
||||||
return PlatformStatusError;
|
return PlatformStatusError;
|
||||||
|
@ -257,10 +257,10 @@ PlatformStatusCode platform_write(MQTTHandle *handle, Buffer *buffer) {
|
||||||
|
|
||||||
PlatformStatusCode platform_disconnect(MQTTHandle *handle) {
|
PlatformStatusCode platform_disconnect(MQTTHandle *handle) {
|
||||||
PlatformData *p = handle->platform;
|
PlatformData *p = handle->platform;
|
||||||
if (p->sock >= 0) {
|
if (p->sock != INVALID_SOCKET) {
|
||||||
closesocket(p->sock);
|
closesocket(p->sock);
|
||||||
WSACleanup();
|
WSACleanup();
|
||||||
p->sock = -1;
|
p->sock = INVALID_SOCKET;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PlatformStatusOk;
|
return PlatformStatusOk;
|
||||||
|
|
Loading…
Reference in a new issue