From 8c59ba29b0f90cc69788e2f71afd132ef3bd8047 Mon Sep 17 00:00:00 2001 From: Benn Snyder Date: Sat, 22 Mar 2014 19:14:40 -0400 Subject: [PATCH] wrappers/c_sync: Add dllexport to sync API - fixes #315 Signed-off-by: Benn Snyder --- wrappers/c_sync/libfreenect_sync.h | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/wrappers/c_sync/libfreenect_sync.h b/wrappers/c_sync/libfreenect_sync.h index 568e59cf..516c421d 100644 --- a/wrappers/c_sync/libfreenect_sync.h +++ b/wrappers/c_sync/libfreenect_sync.h @@ -28,11 +28,26 @@ #include "libfreenect.h" #include + +/// If Win32, export all functions for DLL usage +#ifndef _WIN32 + #define FREENECTAPI_SYNC /**< DLLExport information for windows, set to nothing on other platforms */ +#else + /**< DLLExport information for windows, set to nothing on other platforms */ + #ifdef __cplusplus + #define FREENECTAPI_SYNC extern "C" __declspec(dllexport) + #else + // this is required when building from a Win32 port of gcc without being + // forced to compile all of the library files (.c) with g++... + #define FREENECTAPI_SYNC __declspec(dllexport) + #endif +#endif + #ifdef __cplusplus extern "C" { #endif -int freenect_sync_get_video(void **video, uint32_t *timestamp, int index, freenect_video_format fmt); +FREENECTAPI_SYNC int freenect_sync_get_video(void **video, uint32_t *timestamp, int index, freenect_video_format fmt); /* Synchronous video function, starts the runloop if it isn't running The returned buffer is valid until this function is called again, after which the buffer must not @@ -49,7 +64,7 @@ int freenect_sync_get_video(void **video, uint32_t *timestamp, int index, freene */ -int freenect_sync_get_depth(void **depth, uint32_t *timestamp, int index, freenect_depth_format fmt); +FREENECTAPI_SYNC int freenect_sync_get_depth(void **depth, uint32_t *timestamp, int index, freenect_depth_format fmt); /* Synchronous depth function, starts the runloop if it isn't running The returned buffer is valid until this function is called again, after which the buffer must not @@ -65,7 +80,7 @@ int freenect_sync_get_depth(void **depth, uint32_t *timestamp, int index, freene Nonzero on error. */ -int freenect_sync_set_tilt_degs(int angle, int index); +FREENECTAPI_SYNC int freenect_sync_set_tilt_degs(int angle, int index); /* Tilt function, starts the runloop if it isn't running Args: @@ -76,7 +91,7 @@ int freenect_sync_set_tilt_degs(int angle, int index); Nonzero on error. */ -int freenect_sync_get_tilt_state(freenect_raw_tilt_state **state, int index); +FREENECTAPI_SYNC int freenect_sync_get_tilt_state(freenect_raw_tilt_state **state, int index); /* Tilt state function, starts the runloop if it isn't running Args: @@ -87,7 +102,7 @@ int freenect_sync_get_tilt_state(freenect_raw_tilt_state **state, int index); Nonzero on error. */ -int freenect_sync_set_led(freenect_led_options led, int index); +FREENECTAPI_SYNC int freenect_sync_set_led(freenect_led_options led, int index); /* Led function, starts the runloop if it isn't running Args: @@ -99,7 +114,7 @@ int freenect_sync_set_led(freenect_led_options led, int index); */ -void freenect_sync_stop(void); +FREENECTAPI_SYNC void freenect_sync_stop(void); #ifdef __cplusplus } #endif