mirror of https://github.com/eclipse/paho.mqtt.c
Fix compilation errors on test2 due to multiple symbol redefinitions
Signed-off-by: Otavio Rodolfo Piske <opiske@redhat.com>
This commit is contained in:
parent
81357e97a8
commit
7a66543ec2
|
|
@ -4,6 +4,10 @@ SET(MQTT_TEST_BROKER "tcp://localhost:1883" CACHE STRING "Hostname of a test MQT
|
|||
SET(MQTT_SSL_HOSTNAME "localhost" CACHE STRING "Hostname of a test SSL MQTT broker to use")
|
||||
|
||||
|
||||
IF (WIN32)
|
||||
ADD_DEFINITIONS(/DCMAKE_BUILD)
|
||||
ENDIF()
|
||||
|
||||
ADD_EXECUTABLE(
|
||||
test1
|
||||
test1.c
|
||||
|
|
|
|||
12
test/test2.c
12
test/test2.c
|
|
@ -32,8 +32,15 @@
|
|||
#include <errno.h>
|
||||
#define WINAPI
|
||||
#else
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#if !defined(CMAKE_BUILD)
|
||||
/*
|
||||
* These causes the cmake build to fail. In order to prevent affecting
|
||||
* other builds, remove them only from CMAKE-related builds
|
||||
*/
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#endif // CMAKE_BUILD
|
||||
#define MAXHOSTNAMELEN 256
|
||||
#define EAGAIN WSAEWOULDBLOCK
|
||||
#define EINTR WSAEINTR
|
||||
|
|
@ -42,6 +49,7 @@
|
|||
#define ENOTCONN WSAENOTCONN
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#define setenv(a, b, c) _putenv_s(a, b)
|
||||
|
||||
#endif
|
||||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
|
||||
|
|
|
|||
Loading…
Reference in New Issue