common: c++ link error if multiple files include header
Header only C++ function definitions need to be static to avoid linking issues when including the header multiple times. Signed-off-by: Kurt Eckhardt <kurte@rockisland.com> Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
committed by
Brendan Le Foll
parent
d734a661fd
commit
0f2329bd95
@@ -44,7 +44,7 @@ namespace mraa {
|
|||||||
*
|
*
|
||||||
* @return libmraa version (e.g. v0.4.0-20-gb408207)
|
* @return libmraa version (e.g. v0.4.0-20-gb408207)
|
||||||
*/
|
*/
|
||||||
std::string getVersion()
|
inline std::string getVersion()
|
||||||
{
|
{
|
||||||
std::string ret = mraa_get_version();
|
std::string ret = mraa_get_version();
|
||||||
return ret;
|
return ret;
|
||||||
@@ -59,7 +59,7 @@ std::string getVersion()
|
|||||||
* @param priority Value from typically 0 to 99
|
* @param priority Value from typically 0 to 99
|
||||||
* @return The priority value set
|
* @return The priority value set
|
||||||
*/
|
*/
|
||||||
int setPriority(const unsigned int priority)
|
inline int setPriority(const unsigned int priority)
|
||||||
{
|
{
|
||||||
return mraa_set_priority(priority);
|
return mraa_set_priority(priority);
|
||||||
}
|
}
|
||||||
@@ -69,7 +69,7 @@ int setPriority(const unsigned int priority)
|
|||||||
*
|
*
|
||||||
* @return mraa_platform_t Platform type enum
|
* @return mraa_platform_t Platform type enum
|
||||||
*/
|
*/
|
||||||
mraa_platform_t getPlatformType()
|
inline mraa_platform_t getPlatformType()
|
||||||
{
|
{
|
||||||
return mraa_get_platform_type();
|
return mraa_get_platform_type();
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ mraa_platform_t getPlatformType()
|
|||||||
*
|
*
|
||||||
* @param result the result to print
|
* @param result the result to print
|
||||||
*/
|
*/
|
||||||
void printError(mraa_result_t result)
|
inline void printError(mraa_result_t result)
|
||||||
{
|
{
|
||||||
mraa_result_print(result);
|
mraa_result_print(result);
|
||||||
}
|
}
|
||||||
@@ -91,7 +91,7 @@ void printError(mraa_result_t result)
|
|||||||
* @param mode the mode to be tested.
|
* @param mode the mode to be tested.
|
||||||
* @return boolean if the mode is supported, 0=false.
|
* @return boolean if the mode is supported, 0=false.
|
||||||
*/
|
*/
|
||||||
bool pinModeTest(int pin, mraa_pinmodes_t mode)
|
inline bool pinModeTest(int pin, mraa_pinmodes_t mode)
|
||||||
{
|
{
|
||||||
return (bool) mraa_pin_mode_test(pin,mode);
|
return (bool) mraa_pin_mode_test(pin,mode);
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ bool pinModeTest(int pin, mraa_pinmodes_t mode)
|
|||||||
*
|
*
|
||||||
* @return raw bits being read from kernel module. Zero if no ADC
|
* @return raw bits being read from kernel module. Zero if no ADC
|
||||||
*/
|
*/
|
||||||
unsigned int adcRawBits()
|
inline unsigned int adcRawBits()
|
||||||
{
|
{
|
||||||
return mraa_adc_raw_bits();
|
return mraa_adc_raw_bits();
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ unsigned int adcRawBits()
|
|||||||
*
|
*
|
||||||
* @return return actual bit size the adc value should be understood as.
|
* @return return actual bit size the adc value should be understood as.
|
||||||
*/
|
*/
|
||||||
unsigned int adcSupportedBits()
|
inline unsigned int adcSupportedBits()
|
||||||
{
|
{
|
||||||
return mraa_adc_supported_bits();
|
return mraa_adc_supported_bits();
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ unsigned int adcSupportedBits()
|
|||||||
*
|
*
|
||||||
* @return Result of operation
|
* @return Result of operation
|
||||||
*/
|
*/
|
||||||
mraa_result_t setLogLevel(int level)
|
inline mraa_result_t setLogLevel(int level)
|
||||||
{
|
{
|
||||||
return mraa_set_log_level(level);
|
return mraa_set_log_level(level);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user