Skip to content
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
17 changes: 14 additions & 3 deletions xid_device_driver/CedrusAssert.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
# define _putenv putenv
#endif // defined(__APPLE__)

#if defined(__linux__)
# include <stdlib.h>
# define _putenv putenv
#endif // defined(__linux__)

namespace Cedrus
{
// break into the debugger
Expand All @@ -23,9 +28,11 @@ namespace Cedrus
DebugBreak();
#elif defined(__APPLE__)
raise(SIGTRAP);
#elif defined(__linux__)
raise(SIGTRAP);
#else
// TODO
#endif // Win/Apple
// TODO (TODONE now that linux is included?)
#endif // Win/Apple/linux
}

inline void OptionToContinue
Expand Down Expand Up @@ -274,7 +281,11 @@ namespace Cedrus
Cedrus::Ced_Fail_Mac( msg, __FILE__, __LINE__, __func__ )


#else
# elif defined(__linux__)
# define CEDRUS_DISABLE_ASSERT 1 // UGLY HACK! TODO fix for linux
# define CEDRUS_ASSERT(cond, msg)
# define CEDRUS_FAIL(msg)
#else
// TODO
#endif // Win/Apple

Expand Down
4 changes: 4 additions & 0 deletions xid_device_driver/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@

#include "constants.h"

#if defined(__linux__)
#include <cstring>
#endif

Cedrus::Connection::Connection(
const DWORD location,
DWORD port_speed,
Expand Down
4 changes: 4 additions & 0 deletions xid_device_driver/Connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
# include <windows.h>
# define SLEEP_FUNC Sleep
# define SLEEP_INC 1
#elif defined(__linux__)
# include <unistd.h>
# define SLEEP_FUNC usleep
# define SLEEP_INC 1000
#endif

#include <chrono>
Expand Down
4 changes: 4 additions & 0 deletions xid_device_driver/ResponseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
#include "DeviceConfig.h"
#include "constants.h"

#if defined(__linux__)
#include <cstring>
#endif

Cedrus::ResponseManager::ResponseManager(std::shared_ptr<const DeviceConfig> devConfig )
: m_BytesInBuffer(0),
m_XIDPacketIndex(INVALID_PACKET_INDEX),
Expand Down
4 changes: 4 additions & 0 deletions xid_device_driver/XIDDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
#include <iomanip>
#include <locale>

#if defined(__linux__)
#include <cstring>
#endif


Cedrus::XIDDevice::XIDDevice(std::shared_ptr<Connection> xidCon, std::shared_ptr<const DeviceConfig> devConfig)
: m_linesState(0),
Expand Down
5 changes: 5 additions & 0 deletions xid_device_driver/XIDDeviceScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@

#include "XIDDevice.h"

#if defined(__linux__)
#include <cstring>
#endif


std::shared_ptr<Cedrus::XIDDevice> CreateDevice
(
const int productID, // d2 value
Expand Down
3 changes: 3 additions & 0 deletions xid_device_driver/XidDriverImpExpDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#elif defined(_WIN32)
# define CEDEXP __declspec(dllexport)
# define CEDIMP __declspec(dllimport)
#elif defined(__linux__)
# define CEDEXP __attribute__ ((visibility("default")))
# define CEDIMP __attribute__ ((visibility("default")))
#endif

#define CEDRUS_XIDDRIVER_IMPORTEXPORT CEDEXP