2828#include "libfreenect.h"
2929#include <stdint.h>
3030
31+
32+ /// If Win32, export all functions for DLL usage
33+ #ifndef _WIN32
34+ #define FREENECTAPI_SYNC /**< DLLExport information for windows, set to nothing on other platforms */
35+ #else
36+ /**< DLLExport information for windows, set to nothing on other platforms */
37+ #ifdef __cplusplus
38+ #define FREENECTAPI_SYNC extern "C" __declspec(dllexport)
39+ #else
40+ // this is required when building from a Win32 port of gcc without being
41+ // forced to compile all of the library files (.c) with g++...
42+ #define FREENECTAPI_SYNC __declspec(dllexport)
43+ #endif
44+ #endif
45+
3146#ifdef __cplusplus
3247extern "C" {
3348#endif
3449
35- int freenect_sync_get_video (void * * video , uint32_t * timestamp , int index , freenect_video_format fmt );
50+ FREENECTAPI_SYNC int freenect_sync_get_video (void * * video , uint32_t * timestamp , int index , freenect_video_format fmt );
3651/* Synchronous video function, starts the runloop if it isn't running
3752
3853 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
4964*/
5065
5166
52- int freenect_sync_get_depth (void * * depth , uint32_t * timestamp , int index , freenect_depth_format fmt );
67+ FREENECTAPI_SYNC int freenect_sync_get_depth (void * * depth , uint32_t * timestamp , int index , freenect_depth_format fmt );
5368/* Synchronous depth function, starts the runloop if it isn't running
5469
5570 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
6580 Nonzero on error.
6681*/
6782
68- int freenect_sync_set_tilt_degs (int angle , int index );
83+ FREENECTAPI_SYNC int freenect_sync_set_tilt_degs (int angle , int index );
6984/* Tilt function, starts the runloop if it isn't running
7085
7186 Args:
@@ -76,7 +91,7 @@ int freenect_sync_set_tilt_degs(int angle, int index);
7691 Nonzero on error.
7792*/
7893
79- int freenect_sync_get_tilt_state (freenect_raw_tilt_state * * state , int index );
94+ FREENECTAPI_SYNC int freenect_sync_get_tilt_state (freenect_raw_tilt_state * * state , int index );
8095/* Tilt state function, starts the runloop if it isn't running
8196
8297 Args:
@@ -87,7 +102,7 @@ int freenect_sync_get_tilt_state(freenect_raw_tilt_state **state, int index);
87102 Nonzero on error.
88103*/
89104
90- int freenect_sync_set_led (freenect_led_options led , int index );
105+ FREENECTAPI_SYNC int freenect_sync_set_led (freenect_led_options led , int index );
91106/* Led function, starts the runloop if it isn't running
92107
93108 Args:
@@ -99,7 +114,7 @@ int freenect_sync_set_led(freenect_led_options led, int index);
99114*/
100115
101116
102- void freenect_sync_stop (void );
117+ FREENECTAPI_SYNC void freenect_sync_stop (void );
103118#ifdef __cplusplus
104119}
105120#endif
0 commit comments