Skip to content
Snippets Groups Projects
Commit d33a11f1 authored by sdegrande's avatar sdegrande
Browse files

Fix compilation of libTUIO.a with mingw64

parent 7d5dd6d4
No related branches found
No related tags found
No related merge requests found
...@@ -44,7 +44,12 @@ SIMULATOR_OBJECTS = SimpleSimulator.o ...@@ -44,7 +44,12 @@ SIMULATOR_OBJECTS = SimpleSimulator.o
COMMON_TUIO_SOURCES = ./TUIO/TuioTime.cpp ./TUIO/TuioPoint.cpp ./TUIO/TuioContainer.cpp ./TUIO/TuioObject.cpp ./TUIO/TuioCursor.cpp ./TUIO/TuioBlob.cpp ./TUIO/TuioDispatcher.cpp ./TUIO/TuioManager.cpp ./TUIO/OneEuroFilter.cpp COMMON_TUIO_SOURCES = ./TUIO/TuioTime.cpp ./TUIO/TuioPoint.cpp ./TUIO/TuioContainer.cpp ./TUIO/TuioObject.cpp ./TUIO/TuioCursor.cpp ./TUIO/TuioBlob.cpp ./TUIO/TuioDispatcher.cpp ./TUIO/TuioManager.cpp ./TUIO/OneEuroFilter.cpp
SERVER_TUIO_SOURCES = ./TUIO/TuioServer.cpp ./TUIO/UdpSender.cpp ./TUIO/TcpSender.cpp ./TUIO/WebSockSender.cpp ./TUIO/FlashSender.cpp SERVER_TUIO_SOURCES = ./TUIO/TuioServer.cpp ./TUIO/UdpSender.cpp ./TUIO/TcpSender.cpp ./TUIO/WebSockSender.cpp ./TUIO/FlashSender.cpp
CLIENT_TUIO_SOURCES = ./TUIO/TuioClient.cpp ./TUIO/OscReceiver.cpp ./TUIO/UdpReceiver.cpp ./TUIO/TcpReceiver.cpp CLIENT_TUIO_SOURCES = ./TUIO/TuioClient.cpp ./TUIO/OscReceiver.cpp ./TUIO/UdpReceiver.cpp ./TUIO/TcpReceiver.cpp
OSC_SOURCES = ./oscpack/osc/OscTypes.cpp ./oscpack/osc/OscOutboundPacketStream.cpp ./oscpack/osc/OscReceivedElements.cpp ./oscpack/osc/OscPrintReceivedElements.cpp ./oscpack/ip/posix/NetworkingUtils.cpp ./oscpack/ip/posix/UdpSocket.cpp OSC_SOURCES = ./oscpack/osc/OscTypes.cpp ./oscpack/osc/OscOutboundPacketStream.cpp ./oscpack/osc/OscReceivedElements.cpp ./oscpack/osc/OscPrintReceivedElements.cpp
ifneq (,$(findstring MINGW64_NT, $(PLATFORM)))
OSC_SOURCES += ./oscpack/ip/win32/NetworkingUtils.cpp ./oscpack/ip/win32/UdpSocket.cpp
else
OSC_SOURCES += ./oscpack/ip/posix/NetworkingUtils.cpp ./oscpack/ip/posix/UdpSocket.cpp
endif
COMMON_TUIO_OBJECTS = $(COMMON_TUIO_SOURCES:.cpp=.o) COMMON_TUIO_OBJECTS = $(COMMON_TUIO_SOURCES:.cpp=.o)
SERVER_TUIO_OBJECTS = $(SERVER_TUIO_SOURCES:.cpp=.o) SERVER_TUIO_OBJECTS = $(SERVER_TUIO_SOURCES:.cpp=.o)
......
...@@ -20,8 +20,10 @@ ...@@ -20,8 +20,10 @@
#define INCLUDED_LIBEXPORT_H #define INCLUDED_LIBEXPORT_H
#ifdef WIN32 #ifdef WIN32
#ifndef __MINGW64__
#pragma warning(disable: 4251) // disable annoying template exporting warnings #pragma warning(disable: 4251) // disable annoying template exporting warnings
#pragma warning(disable: 4275) // disable warning caused by not exported OSC classes #pragma warning(disable: 4275) // disable warning caused by not exported OSC classes
#endif
#ifdef LIB_EXPORT #ifdef LIB_EXPORT
#define LIBDECL __declspec(dllexport) #define LIBDECL __declspec(dllexport)
......
...@@ -37,7 +37,11 @@ ...@@ -37,7 +37,11 @@
#include <winsock2.h> // this must come first to prevent errors with MSVC7 #include <winsock2.h> // this must come first to prevent errors with MSVC7
#include <windows.h> #include <windows.h>
#ifdef __MINGW64__
#include <sys/time.h>
#else
#include <mmsystem.h> // for timeGetTime() #include <mmsystem.h> // for timeGetTime()
#endif
#ifndef WINCE #ifndef WINCE
#include <signal.h> #include <signal.h>
...@@ -340,7 +344,13 @@ class SocketReceiveMultiplexer::Implementation{ ...@@ -340,7 +344,13 @@ class SocketReceiveMultiplexer::Implementation{
double GetCurrentTimeMs() const double GetCurrentTimeMs() const
{ {
#ifndef WINCE #ifndef WINCE
#ifdef __MINGW64__
struct timeval t;
gettimeofday(&t, 0);
return ((double)t.tv_sec*1000.0) + ((double)t.tv_usec/1000.0);
#else
return timeGetTime(); // FIXME: bad choice if you want to run for more than 40 days return timeGetTime(); // FIXME: bad choice if you want to run for more than 40 days
#endif
#else #else
return 0; return 0;
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment