Move platforms around, most of POSIX will be common implementation

This commit is contained in:
Paul Hollinsky
2018-09-20 14:40:24 -04:00
parent 8435efb039
commit ef8d764aa6
17 changed files with 43 additions and 27 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
#if defined _WIN32
#include "platform/windows/include/devices.h"
#elif defined __linux__
#include "platform/linux/include/devices.h"
#elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#include "platform/posix/include/devices.h"
#else
#error "This platform is not supported by the devices driver, please add a definition!"
#endif
+2 -2
View File
@@ -3,8 +3,8 @@
#if defined _WIN32
#include "platform/windows/include/dynamiclib.h"
#elif defined __linux__
#include "platform/linux/include/dynamiclib.h"
#elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#include "platform/posix/include/dynamiclib.h"
#else
#warning "This platform is not supported by the dynamic library driver"
#endif
+2 -2
View File
@@ -5,8 +5,8 @@
#if defined _WIN32
#include "platform/windows/include/ftdi.h"
#elif defined __linux__
#include "platform/linux/include/ftdi.h"
#elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#include "platform/posix/include/ftdi.h"
#else
#warning "This platform is not supported by the FTDI driver"
#endif
+2 -2
View File
@@ -3,8 +3,8 @@
#if defined _WIN32
#include "platform/windows/include/pcap.h"
// #elif defined __linux__
// #include "platform/linux/include/ftdi.h"
// #elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
// #include "platform/posix/include/ftdi.h"
#else
#warning "This platform is not supported by the PCAP driver"
#endif
+2 -2
View File
@@ -5,8 +5,8 @@
#if defined _WIN32
#include "platform/windows/include/stm32.h"
#elif defined __linux__
#include "platform/linux/include/stm32.h"
#elif defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
#include "platform/posix/include/stm32.h"
#else
#warning "This platform is not supported by the STM32 driver"
#endif
@@ -0,0 +1,6 @@
#ifndef __DYNAMICLIB_DARWIN_H_
#define __DYNAMICLIB_DARWIN_H_
#define icsneoDynamicLibraryLoad() dlopen("/home/paulywog/Code/icsneonext/build/libicsneoc.dylib", RTLD_LAZY)
#endif
@@ -1,4 +1,3 @@
#include "platform/linux/include/ftdi.h"
#include "platform/include/ftdi.h"
#include <iostream>
#include <stdio.h>
@@ -1,5 +1,5 @@
#ifndef __DEVICES_LINUX_H_
#define __DEVICES_LINUX_H_
#ifndef __DEVICES_POSIX_H_
#define __DEVICES_POSIX_H_
#include "device/neoobd2pro/include/neoobd2pro.h"
#include "device/neovifire/include/neovifire.h"
@@ -1,8 +1,14 @@
#ifndef __DYNAMICLIB_H_LINUX_
#define __DYNAMICLIB_H_LINUX_
#ifndef __DYNAMICLIB_POSIX_H_
#define __DYNAMICLIB_POSIX_H_
#include <dlfcn.h>
#ifdef __APPLE__
#include "platform/posix/darwin/include/dynamiclib.h"
#else
#include "platform/posix/linux/include/dynamiclib.h"
#endif
// Nothing special is needed to export
#define DLLExport
@@ -12,7 +18,6 @@
#define ICSNEO_DESTRUCTOR
// #endif
#define icsneoDynamicLibraryLoad() dlopen("/media/paulywog/Windows 10/Users/phollinsky/Code/icsneonext/build/libicsneoc.so", RTLD_LAZY)
#define icsneoDynamicLibraryGetFunction(handle, func) dlsym(handle, func)
#define icsneoDynamicLibraryClose(handle) (dlclose(handle) == 0)
@@ -1,5 +1,5 @@
#ifndef __FTDI_H_LINUX_
#define __FTDI_H_LINUX_
#ifndef __FTDI_POSIX_H_
#define __FTDI_POSIX_H_
#include <vector>
#include <memory>
@@ -1,5 +1,5 @@
#ifndef __STM32_LINUX_H_
#define __STM32_LINUX_H_
#ifndef __STM32_POSIX_H_
#define __STM32_POSIX_H_
#include "communication/include/icommunication.h"
#include "device/include/neodevice.h"
@@ -0,0 +1,6 @@
#ifndef __DYNAMICLIB_LINUX_H_
#define __DYNAMICLIB_LINUX_H_
#define icsneoDynamicLibraryLoad() dlopen("/home/paulywog/Code/icsneonext/build/libicsneoc.so", RTLD_LAZY)
#endif
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef __DYNAMICLIB_H_WINDOWS_
#define __DYNAMICLIB_H_WINDOWS_
#ifndef __DYNAMICLIB_WINDOWS_H_
#define __DYNAMICLIB_WINDOWS_H_
#include <Windows.h>
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef __REGISTRY_H_WINDOWS_
#define __REGISTRY_H_WINDOWS_
#ifndef __REGISTRY_WINDOWS_H_
#define __REGISTRY_WINDOWS_H_
#include <Windows.h>
#include <string>
+2 -2
View File
@@ -1,5 +1,5 @@
#ifndef __VCP_H_WINDOWS_
#define __VCP_H_WINDOWS_
#ifndef __VCP_WINDOWS_H_
#define __VCP_WINDOWS_H_
#include <vector>
#include <string>