Skip to content

Commit

Permalink
fix(*): fixed Missing YDLIDAR_API for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
yangfuyuan committed Jan 29, 2021
1 parent 9ee3b09 commit 28b9708
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(ydlidar_sdk C CXX)
# version
set(YDLIDAR_SDK_VERSION_MAJOR 1)
set(YDLIDAR_SDK_VERSION_MINOR 0)
set(YDLIDAR_SDK_VERSION_PATCH 2)
set(YDLIDAR_SDK_VERSION_PATCH 3)
set(YDLIDAR_SDK_VERSION ${YDLIDAR_SDK_VERSION_MAJOR}.${YDLIDAR_SDK_VERSION_MINOR}.${YDLIDAR_SDK_VERSION_PATCH})

##########################################################
Expand Down
5 changes: 3 additions & 2 deletions core/common/ydlidar_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <core/base/typedef.h>
#include <core/base/utils.h>
#ifdef __cplusplus
extern "C" {
#endif
Expand Down Expand Up @@ -225,11 +226,11 @@ typedef struct {
* @brief initialize LaserFan
* @param to_init
*/
void LaserFanInit(LaserFan *to_init);
YDLIDAR_API void LaserFanInit(LaserFan *to_init);
/**
* Destroy an instance of LaserFan points
*/
void LaserFanDestroy(LaserFan *to_destroy);
YDLIDAR_API void LaserFanDestroy(LaserFan *to_destroy);

#ifdef __cplusplus
}
Expand Down
8 changes: 4 additions & 4 deletions src/CYdLidar.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,22 +1097,22 @@ namespace ydlidar {
/**
* @brief system signal initialize
*/
void os_init();
YDLIDAR_API void os_init();
/**
* @brief Whether system signal is initialized.
* @return
*/
bool os_isOk();
YDLIDAR_API bool os_isOk();
/**
* @brief shutdown system signal
*/
void os_shutdown();
YDLIDAR_API void os_shutdown();

/**
* @brief lidarPortList
* @return
*/
std::map<std::string, std::string> lidarPortList();
YDLIDAR_API std::map<std::string, std::string> lidarPortList();

}

Expand Down
34 changes: 18 additions & 16 deletions src/ydlidar_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ extern "C" {
* @note call ::lidarDestroy destroy
* @return created instance
*/
YDLidar *lidarCreate(void);
YDLIDAR_API YDLidar *lidarCreate(void);

/**
* @brief Destroy Lidar instance by ::lidarCreate create
* @param lidar CYdLidar instance
*/
void lidarDestroy(YDLidar **lidar);
YDLIDAR_API void lidarDestroy(YDLidar **lidar);

/**
* @brief set lidar properties
Expand Down Expand Up @@ -124,7 +124,8 @@ void lidarDestroy(YDLidar **lidar);
* @return true if the Property is set successfully, otherwise false.
* @see LidarProperty
*/
bool setlidaropt(YDLidar *lidar, int optname, const void *optval, int optlen);
YDLIDAR_API bool setlidaropt(YDLidar *lidar, int optname, const void *optval,
int optlen);

/**
* @brief get lidar property
Expand Down Expand Up @@ -185,76 +186,77 @@ bool setlidaropt(YDLidar *lidar, int optname, const void *optval, int optlen);
* @return true if the Property is get successfully, otherwise false.
* @see LidarProperty
*/
bool getlidaropt(YDLidar *lidar, int optname, void *optval, int optlen);
YDLIDAR_API bool getlidaropt(YDLidar *lidar, int optname, void *optval,
int optlen);

/**
* Return SDK's version information in a numeric form.
* @param version Pointer to a version for returning the version information.
*/
void GetSdkVersion(char *version);
YDLIDAR_API void GetSdkVersion(char *version);

/**
* Initialize the SDK.
* @return true if successfully initialized, otherwise false.
*/
bool initialize(YDLidar *lidar);
YDLIDAR_API bool initialize(YDLidar *lidar);

/**
* @brief Return LiDAR's version information in a numeric form.
* @param version Pointer to a version structure for returning the version information.
*/
void GetLidarVersion(YDLidar *lidar, LidarVersion *version);
YDLIDAR_API void GetLidarVersion(YDLidar *lidar, LidarVersion *version);

/**
* Start the device scanning routine which runs on a separate thread.
* @return true if successfully started, otherwise false.
*/
bool turnOn(YDLidar *lidar);
YDLIDAR_API bool turnOn(YDLidar *lidar);

/**
* @brief Get the LiDAR Scan Data. turnOn is successful before doProcessSimple scan data.
* @param[in] lidar LiDAR instance
* @param[out] outscan LiDAR Scan Data
* @return true if successfully started, otherwise false.
*/
bool doProcessSimple(YDLidar *lidar, LaserFan *outscan);
YDLIDAR_API bool doProcessSimple(YDLidar *lidar, LaserFan *outscan);
/**
* @brief Stop the device scanning thread and disable motor.
* @return true if successfully Stoped, otherwise false.
*/
bool turnOff(YDLidar *lidar);
YDLIDAR_API bool turnOff(YDLidar *lidar);
/**
* @brief Uninitialize the SDK and Disconnect the LiDAR.
*/
void disconnecting(YDLidar *lidar);
YDLIDAR_API void disconnecting(YDLidar *lidar);

/**
* @brief Get the last error information of a (socket or serial)
* @return a human-readable description of the given error information
* or the last error information of a (socket or serial)
*/
const char *DescribeError(YDLidar *lidar);
YDLIDAR_API const char *DescribeError(YDLidar *lidar);

/**
* @brief initialize system signals
*/
void os_init();
YDLIDAR_API void os_init();
/**
* @brief isOk
* @return true if successfully initialize, otherwise false.
*/
bool os_isOk();
YDLIDAR_API bool os_isOk();
/**
* @brief os_shutdown
*/
void os_shutdown();
YDLIDAR_API void os_shutdown();

/**
* @brief get lidar serial port
* @param ports serial port lists
* @return valid port number
*/
int lidarPortList(LidarPort *ports);
YDLIDAR_API int lidarPortList(LidarPort *ports);

#ifdef __cplusplus
}
Expand Down

0 comments on commit 28b9708

Please sign in to comment.