deps.labjack: support building for windows
The only pthread functionality this seems to use is mutexes, which are (fortunately) theoretically trivial to wrap for windows. This compiles, though it is not clear if it actually works correctly.
This commit is contained in:
13
deps/labjack/ljacklm/libljacklm/ljacklm.c
vendored
13
deps/labjack/ljacklm/libljacklm/ljacklm.c
vendored
@@ -23,7 +23,14 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#if defined(LJACKLM_USE_WINDOWS_MUTEX_SHIM)
|
||||
#include <windows.h>
|
||||
#include "windows_mutex_shim.h"
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif // LJACKLM_USE_WINDOWS_MUTEX_SHIM
|
||||
|
||||
#include "labjackusb.h"
|
||||
|
||||
|
||||
@@ -286,7 +293,9 @@ long GetU12Information( HANDLE hDevice,
|
||||
long *fcddMaxSize,
|
||||
long *hvcMaxSize);
|
||||
|
||||
#if !defined(LJACKLM_USE_WINDOWS_MUTEX_SHIM)
|
||||
unsigned long GetTickCount( void);
|
||||
#endif
|
||||
|
||||
|
||||
__attribute__((constructor))
|
||||
@@ -7266,6 +7275,7 @@ long GetU12Information( HANDLE hDevice,
|
||||
}
|
||||
|
||||
|
||||
#if !defined(LJACKLM_USE_WINDOWS_MUTEX_SHIM)
|
||||
//======================================================================
|
||||
//GetTickCount: Implementation of GetTickCount() for Unix. Returns the
|
||||
// current time, expressed as millisconds since the Epoch
|
||||
@@ -7276,3 +7286,4 @@ unsigned long GetTickCount( void)
|
||||
gettimeofday(&tv, NULL);
|
||||
return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user