Private
Public Access
2
0

mraa.c: stop ctor running in scripting languages

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-07-01 17:05:57 +01:00
parent 437e26781c
commit eec08ac97b
2 changed files with 11 additions and 8 deletions

View File

@@ -177,13 +177,13 @@ typedef struct {
*
* @return Result of operation
*/
#ifndef SWIG
#if (defined SWIGPYTHON) || (defined SWIG)
mraa_result_t mraa_init();
#else
// this sets a compiler attribute (supported by GCC & clang) to have mraa_init()
// be called as a constructor make sure your libc supports this! uclibc needs
// to be compiled with UCLIBC_CTOR_DTOR
mraa_result_t mraa_init() __attribute__((constructor));
#else
mraa_result_t mraa_init();
#endif
/**