mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
fix compilation on older C++ compilers
This commit is contained in:
parent
4561eead1e
commit
cf799763cb
3 changed files with 38 additions and 26 deletions
|
@ -105,8 +105,9 @@ protected:
|
|||
for (int k = 0; k < fharmonics_len; k++) {
|
||||
double freq = fharmonics[k];
|
||||
std::complex<double> coeff = in[k];
|
||||
std::complex<double> om = 2.0i * M_PI * freq * time;
|
||||
|
||||
value += coeff * std::exp(2i * M_PI * freq * time);
|
||||
value += coeff * std::exp(om);
|
||||
}
|
||||
|
||||
*out = std::real(value);
|
||||
|
|
|
@ -614,33 +614,40 @@ int rtp_netem_fds(struct node *n, int fds[])
|
|||
return m;
|
||||
}
|
||||
|
||||
struct plugin p = {
|
||||
.name = "rtp",
|
||||
struct plugin p;
|
||||
|
||||
__attribute__((constructor(110)))
|
||||
static void register_plugin() {
|
||||
p.name = "rtp";
|
||||
#ifdef WITH_NETEM
|
||||
.description = "real-time transport protocol (libre, libnl3 netem support)",
|
||||
p.description = "real-time transport protocol (libre, libnl3 netem support)";
|
||||
#else
|
||||
.description = "real-time transport protocol (libre)",
|
||||
p.description = "real-time transport protocol (libre)";
|
||||
#endif
|
||||
.type = PLUGIN_TYPE_NODE,
|
||||
.node = {
|
||||
.vectorize = 0,
|
||||
.size = sizeof(struct rtp),
|
||||
.type = {
|
||||
.start = rtp_type_start,
|
||||
.stop = rtp_type_stop
|
||||
},
|
||||
.init = rtp_init,
|
||||
.parse = rtp_parse,
|
||||
.print = rtp_print,
|
||||
.start = rtp_start,
|
||||
.stop = rtp_stop,
|
||||
.read = rtp_read,
|
||||
.write = rtp_write,
|
||||
.reverse = rtp_reverse,
|
||||
.poll_fds = rtp_poll_fds,
|
||||
.netem_fds = rtp_netem_fds
|
||||
}
|
||||
};
|
||||
p.type = PLUGIN_TYPE_NODE;
|
||||
p.node.vectorize = 0;
|
||||
p.node.size = sizeof(struct rtp);
|
||||
p.node.type.start = rtp_type_start;
|
||||
p.node.type.stop = rtp_type_stop;
|
||||
p.node.init = rtp_init;
|
||||
p.node.parse = rtp_parse;
|
||||
p.node.print = rtp_print;
|
||||
p.node.start = rtp_start;
|
||||
p.node.stop = rtp_stop;
|
||||
p.node.read = rtp_read;
|
||||
p.node.write = rtp_write;
|
||||
p.node.reverse = rtp_reverse;
|
||||
p.node.poll_fds = rtp_poll_fds;
|
||||
p.node.netem_fds = rtp_netem_fds;
|
||||
|
||||
vlist_push(&plugins, &p);
|
||||
}
|
||||
|
||||
__attribute__((destructor(110)))
|
||||
static void deregister_plugin() {
|
||||
if (plugins.state != STATE_DESTROYED)
|
||||
vlist_remove_all(&plugins, &p);
|
||||
}
|
||||
|
||||
} /* extern C */
|
||||
|
||||
|
|
|
@ -183,7 +183,11 @@ int main(int argc, char *argv[])
|
|||
|
||||
const char *format = "villas.human"; /** @todo hardcoded for now */
|
||||
|
||||
struct node n = { .name = nullptr, .state = STATE_DESTROYED };
|
||||
struct node n;
|
||||
n.state = STATE_DESTROYED;
|
||||
n.in.state = STATE_DESTROYED;
|
||||
n.out.state = STATE_DESTROYED;
|
||||
|
||||
struct io io = { .state = STATE_DESTROYED };
|
||||
struct pool q = { .state = STATE_DESTROYED };
|
||||
struct sample *t;
|
||||
|
|
Loading…
Add table
Reference in a new issue