OS X: Make param section generation compatible

This commit is contained in:
Lorenz Meier 2015-09-11 21:58:32 +02:00
parent 4178910509
commit 31e5697cea
1 changed files with 10 additions and 2 deletions

View File

@ -52,8 +52,10 @@ src = """
// DO NOT EDIT
// This file is autogenerated from paramaters.xml
static const
static const
#ifndef __PX4_DARWIN
__attribute__((used, section("__param")))
#endif
struct px4_parameters_t px4_parameters_impl = {
"""
i=0
@ -79,7 +81,13 @@ src += """
%d
};
extern const struct px4_parameters_t px4_parameters __attribute__((alias("px4_parameters_impl")));
#ifdef __PX4_DARWIN
#define ___param__attributes ;
#else
#define ___param__attributes __attribute__((alias("px4_parameters_impl")));
#endif
extern const struct px4_parameters_t px4_parameters ___param__attributes
""" % i
fp_header.write(header)