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

Adding linux compatibility #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,13 @@ $RECYCLE.BIN/
Network Trash Folder
Temporary Items
.apdisk

# ==========================
# Linux
# ==========================

#Object code generated during test compilations
*.o

#qmake path
.qmake.stash
2 changes: 1 addition & 1 deletion EosSyncLib/EosOsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void EosOsc::Recv(EosTcp &tcp, unsigned int timeoutMS, CMD_Q &cmdQ)
// shift away processed data
m_InputBuffer.size -= totalSize;
if(m_InputBuffer.size != 0)
memcpy(m_InputBuffer.data, &m_InputBuffer.data[totalSize], m_InputBuffer.size);
memmove(m_InputBuffer.data, &m_InputBuffer.data[totalSize], m_InputBuffer.size);
}
else
{
Expand Down
43 changes: 43 additions & 0 deletions EosSyncLib/EosSyncLib.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
TEMPLATE = app
TARGET = ../../bin/EosSyncTest
INCLUDEPATH += .
CONFIG += debug

# Input
HEADERS += EosLog.h \
EosOsc.h \
EosSyncLib.h \
EosTcp.h \
EosTimer.h \
EosUdp.h \
OSCParser.h
SOURCES += EosLog.cpp \
EosOsc.cpp \
EosSyncLib.cpp \
EosTcp.cpp \
EosTimer.cpp \
EosUdp.cpp \
main.cpp \
OSCParser.cpp

win32 {
HEADERS += EosTcp_Win.h \
EosUdp_Win.h
SOURCES += EosTcp_Win.cpp \
EosUdp_Win.cpp
}

macx {
HEADERS += EosTcp_Mac.h \
EosUdp_Mac.h
SOURCES += EosTcp_Mac.cpp \
EosUdp_Mac.cpp
}

unix {
HEADERS += EosTcp_Nix.h \
EosUdp_Nix.h
SOURCES += EosTcp_Nix.cpp \
EosUdp_Nix.cpp
}

14 changes: 10 additions & 4 deletions EosSyncLib/EosTcp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@

#ifdef WIN32
#include "EosTcp_Win.h"
#else
#elif defined TARGET_OS_MAC
#include "EosTcp_Mac.h"
#elif defined __linux__
#include "EosTcp_Nix.h"
#endif

////////////////////////////////////////////////////////////////////////////////
Expand All @@ -43,7 +45,7 @@ void EosTcp::SetLogPrefix(const char *name, const char *ip, unsigned short port,
else
logPrefix.clear();

size_t maxLen = strlen("255.255.255.255");
size_t maxLen = std::string("255.255.255.255").length();
if(logPrefix.size() > maxLen)
logPrefix.resize(maxLen);

Expand Down Expand Up @@ -71,8 +73,10 @@ EosTcp* EosTcp::Create()
{
#ifdef WIN32
return (new EosTcp_Win());
#else
#elif defined TARGET_OS_MAC
return (new EosTcp_Mac());
#elif defined __linux__
return (new EosTcp_Nix());
#endif
}

Expand All @@ -89,8 +93,10 @@ EosTcpServer* EosTcpServer::Create()
{
#ifdef WIN32
return (new EosTcpServer_Win());
#else
#elif defined TARGET_OS_MAC
return (new EosTcpServer_Mac());
#elif defined __linux__
return (new EosTcpServer_Nix());
#endif
}

Expand Down
Loading