Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
* Detects running platform and attempts to use included pinmap
* @return maa_result_t maa result
*/
+#ifndef SWIG
+// this sets a compiler attribute (supported by GCC & clang) to have maa_init()
+// be called as a constructor make sure your libc supports this! uclibc needs
+// to be compiled with UCLIBC_CTOR_DTOR
+maa_result_t maa_init() __attribute__((constructor));
+#else
maa_result_t maa_init();
+#endif
/** Check GPIO
*
int main ()
{
- maa_init();
maa_aio_context adc_a0;
uint16_t adc_value = 0;
find_package (SWIG)
if (SWIG_FOUND)
- set (CMAKE_C_FLAGS -DSWIG=${SWIG_FOUND})
- set (CMAKE_CXX_CFLAGS -DSWIG=${SWIG_FOUND})
include (${SWIG_USE_FILE})
add_subdirectory (python)
return gVERSION;
}
-#ifndef SWIG
-// this sets a compiler attribute (supported by GCC & clang) to have maa_init()
-// be called as a constructor make sure your libc supports this! uclibc needs
-// to be compiled with UCLIBC_CTOR_DTOR
-maa_result_t maa_init() __attribute__((constructor));
-#endif
+#ifdef SWIG
maa_result_t
maa_init()
+#else
+maa_result_t __attribute__((constructor))
+maa_init()
+#endif
{
/** Once more board definitions have been added,
* A method for detecting them will need to be devised.