Private
Public Access
2
0

maa_init: fix constructor attribute in maa_init and add working example

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-05-16 09:43:01 +01:00
parent 554505b640
commit 9e823b7f1d
4 changed files with 12 additions and 9 deletions

View File

@@ -39,14 +39,13 @@ maa_get_version()
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.