Skip to content

Commit 7c253ad

Browse files
PatrickM-ZSeboasson
authored andcommitted
Fix building for Zephyr V3.6, QNX and other platforms that don't support single-source multicast and/or dynamic library loading
Signed-off-by: Patrick Masselink <patrick.masselink@zettascale.tech>
1 parent d52f544 commit 7c253ad

17 files changed

Lines changed: 325 additions & 130 deletions

File tree

‎ports/zephyr/README.md‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,36 @@
44
This directory contains some proof-of-concept applications that show how to build and use CycloneDDS on [Zephyr RTOS](https://www.zephyrproject.org) for a NXP X-S32Z27X-DC board.
55

66

7-
Getting Started with Zephyr information can be found [here](https://docs.zephyrproject.org/3.4.0/develop/getting_started/index.html)
8-
Documentation for the NXP X-S32Z27X-DC board can be found [here](https://docs.zephyrproject.org/3.4.0/boards/arm/s32z270dc2_r52/doc/index.html)
7+
Getting Started with Zephyr information can be found [here](https://docs.zephyrproject.org/3.6.0/develop/getting_started/index.html)
8+
Documentation for the NXP X-S32Z27X-DC board can be found [here](https://docs.zephyrproject.org/3.6.0/boards/arm/s32z270dc2_r52/doc/index.html)
99

1010
## Usage
1111
The applications can be treated similarly to other Zephyr sample applications.
1212
The `CMakeLists.txt` is currently set up to build some of the CycloneDDS examples or ddsperf but can be easily modified or extended for other application code.
1313

1414
:warning: While CycloneDDS can be built in-tree, it does not support multiple different builds. Therefore the CycloneDDS source directory needs to be cleaned in order to build for Zephyr and must not contain an in-tree build for eg. the host system. Alternatively, this directory with Zephyr examples can be copied outside the CycloneDDS source directory but that requires updating the `ExternalProject_Add` directive in `CMakeLists.txt` to point to the CycloneDDS source directory.
1515

16-
:warning: When building outside the Zephyr tree, `ZEPHYR_BASE` variable must be set. See [Application Development](https://docs.zephyrproject.org/3.4.0/develop/application/index.html) for more info.
16+
:warning: When building outside the Zephyr tree, `ZEPHYR_BASE` variable must be set. See [Application Development](https://docs.zephyrproject.org/3.6.0/develop/application/index.html) for more info.
1717

18-
:warning: A static IPv4/IPv6 address is defined in `prj.conf`. When running between two Zephyr nodes it is suggested to copy `prj.conf` to eg. `prj-host1.conf` and `prj-host2.conf`, updating the address as required and building with `-DCONF=prj-host1.conf` or `-DCONF=prj-host2.conf` respectively, as described in more detail [here](https://docs.zephyrproject.org/3.4.0/samples/net/eth_native_posix/README.html). A different approach is to enable DHCP client support in Zephyr (see [example](https://docs.zephyrproject.org/3.4.0/samples/net/dhcpv4_client/README.html)).
18+
:warning: A static IPv4/IPv6 address is defined in `prj.conf`. When running between two Zephyr nodes it is suggested to copy `prj.conf` to eg. `prj-host1.conf` and `prj-host2.conf`, updating the address as required and building with `-DCONF=prj-host1.conf` or `-DCONF=prj-host2.conf` respectively, as described in more detail [here](https://docs.zephyrproject.org/3.6.0/samples/net/eth_native_posix/README.html). A different approach is to enable DHCP client support in Zephyr (see [example](https://docs.zephyrproject.org/3.6.0/samples/net/dhcpv4_client/README.html)).
1919

2020
The `copy_examples.sh` script can be used to (manually) update the code from CycloneDDS examples and run `idlc` to generate types.
2121

22-
For example, to build Roundtrip Ping for the `s32z270dc2_rtu0_r52` target:
22+
For example, to build Roundtrip Ping for the NXP S32Z270-DC2 board:
2323
```
2424
$ west build -b s32z270dc2_rtu0_r52 . -- -DBUILD_ROUNDTRIP_PING=1
2525
```
2626
To build for qemu_x86, with ethernet support:
2727
```
2828
$ west build -b qemu_x86 . -- -DOVERLAY_CONFIG=overlay-e1000.conf -DBUILD_ROUNDTRIP_PING=1
2929
```
30+
:warning: In the current Zephyr v3.7.0 (draft) branch, board naming has been refactored and you should use `s32z2xxdc2/s32z270/rtu0`.
31+
3032
Command-line parameters for the example can be modified in `src/rountrip_main.c`
3133

3234
The CycloneDDS configuration in `config.xml` is automatically converted to a char array and available as environment variable to support the default behaviour of retrieving config from `CYCLONEDDS_URI`.
3335
Alternatively, [dds_create_domain_with_rawconfig](https://cyclonedds.io/docs/cyclonedds/latest/api/domain.html?#c.dds_create_domain_with_rawconfig) can be used without XML configuration data.
3436

3537
## Zephyr versions
36-
At the time of writing, CycloneDDS has been tested on Zephyr [v3.3.0](https://github.com/zephyrproject-rtos/zephyr/releases/tag/v3.3.0) and [v3.4.0](https://github.com/zephyrproject-rtos/zephyr/releases/tag/v3.4.0). However, for the NXP X-S32Z27X-DC board an issue exists in `v3.4.0` that can cause CycloneDDS to crash. This is fixed on the Zephyr main branch, therefore we suggest using [@143429](https://github.com/zephyrproject-rtos/zephyr/commit/14342969150a35f3c26afa513a4725bdec310799).
37-
38+
At the time of writing, CycloneDDS has been tested on Zephyr [v3.6.0](https://github.com/zephyrproject-rtos/zephyr/releases/tag/v3.6.0)
39+
To use CycloneDDS with the current (draft) V3.7.0 release, please replace `src/ddsrt/src/ifaddrs/zephyr/ifaddrs.c` with `ifaddrs-v3.7pre.c` which is compatible with the updated (IPv4) Networking APIs in Zephyr (though this code is in flux so YMMV).

‎ports/zephyr/prj.conf‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CONFIG_NEWLIB_LIBC=y
22
CONFIG_NEWLIB_LIBC_NANO=n
33
CONFIG_MAIN_STACK_SIZE=131072
4+
CONFIG_NET_HOSTNAME_ENABLE=y
45

56
CONFIG_POSIX_API=y
67

‎src/core/ddsc/src/dds__sysdef_model.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include "dds/dds.h"
1414
#include "dds/ddsi/ddsi_xqos.h"
15+
#include "dds/ddsrt/sockets.h"
1516

1617
#if defined (__cplusplus)
1718
extern "C" {

‎src/core/ddsc/tests/waitset.c‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ typedef struct thread_arg_t {
3838
static void waiting_thread_start(struct thread_arg_t *arg, dds_entity_t expected);
3939
static dds_return_t waiting_thread_expect_exit(struct thread_arg_t *arg);
4040

41-
static dds_entity_t participant, topic, writer, reader, waitset, publisher, subscriber, readcond;
41+
static dds_entity_t participant, topic, writer, reader, waitset, publisher, subscriber, rdcond;
4242

4343
static void ddsc_waitset_basic_init (void)
4444
{
@@ -71,8 +71,8 @@ static void ddsc_waitset_init (void)
7171
CU_ASSERT_FATAL (reader > 0);
7272
writer = dds_create_writer (publisher, topic, NULL, NULL);
7373
CU_ASSERT_FATAL (writer > 0);
74-
readcond = dds_create_readcondition (reader, mask);
75-
CU_ASSERT_FATAL (readcond > 0);
74+
rdcond = dds_create_readcondition (reader, mask);
75+
CU_ASSERT_FATAL (rdcond > 0);
7676
}
7777

7878
static void ddsc_waitset_fini (void)
@@ -140,7 +140,7 @@ CU_Theory((dds_entity_t par), ddsc_waitset_create, invalid_params, .init=ddsc_wa
140140
}
141141

142142
CU_TheoryDataPoints(ddsc_waitset_create, non_participants) = {
143-
CU_DataPoints(dds_entity_t*, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &readcond),
143+
CU_DataPoints(dds_entity_t*, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &rdcond),
144144
};
145145
CU_Theory((dds_entity_t *par), ddsc_waitset_create, non_participants, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
146146
{
@@ -199,8 +199,8 @@ CU_Theory((dds_entity_t ws, dds_attach_t a), ddsc_waitset_attach, invalid_waitse
199199
}
200200

201201
CU_TheoryDataPoints(ddsc_waitset_attach, non_waitsets) = {
202-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &readcond),
203-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &readcond),
202+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &rdcond),
203+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &rdcond),
204204
CU_DataPoints(dds_attach_t, (dds_attach_t)NULL, (dds_attach_t)&reader, (dds_attach_t)3, (dds_attach_t)0, (dds_attach_t)0, (dds_attach_t)0, (dds_attach_t)0),
205205
};
206206
CU_Theory((dds_entity_t *ws, dds_entity_t *e, dds_attach_t a), ddsc_waitset_attach, non_waitsets, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
@@ -261,8 +261,8 @@ CU_Theory ((int owner, int ok1, int ok2, int fail), ddsc_waitset_attach, scoping
261261
}
262262

263263
CU_TheoryDataPoints(ddsc_waitset_attach_detach, valid_entities) = {
264-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &readcond),
265-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &readcond),
264+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &rdcond),
265+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &rdcond),
266266
CU_DataPoints(dds_attach_t, (dds_attach_t)NULL, (dds_attach_t)&reader, (dds_attach_t)3, (dds_attach_t)3, (dds_attach_t)3, (dds_attach_t)3, (dds_attach_t)3, (dds_attach_t)3),
267267
};
268268
CU_Theory((dds_entity_t *ws, dds_entity_t *e, dds_attach_t a), ddsc_waitset_attach_detach, valid_entities, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
@@ -318,8 +318,8 @@ CU_Theory((dds_entity_t ws), ddsc_waitset_detach, invalid_waitsets, .init=ddsc_w
318318
}
319319

320320
CU_TheoryDataPoints(ddsc_waitset_detach, valid_entities) = {
321-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &readcond),
322-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &readcond),
321+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &rdcond),
322+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &waitset, &publisher, &subscriber, &rdcond),
323323
};
324324
CU_Theory((dds_entity_t *ws, dds_entity_t *e), ddsc_waitset_detach, valid_entities, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
325325
{
@@ -338,7 +338,7 @@ CU_Theory((dds_entity_t *ws, dds_entity_t *e), ddsc_waitset_detach, valid_entiti
338338

339339
CU_Test(ddsc_waitset_attach_detach, various, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
340340
{
341-
const dds_entity_t es[] = { readcond, writer, reader, topic, publisher, subscriber, waitset, participant };
341+
const dds_entity_t es[] = { rdcond, writer, reader, topic, publisher, subscriber, waitset, participant };
342342
dds_return_t ret;
343343
for (size_t i = 0; i < sizeof (es) / sizeof (es[0]); i++)
344344
{
@@ -354,7 +354,7 @@ CU_Test(ddsc_waitset_attach_detach, various, .init=ddsc_waitset_init, .fini=ddsc
354354

355355
CU_Test(ddsc_waitset_attach_detach, combinations, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
356356
{
357-
const dds_entity_t entities[] = { readcond, writer, reader, topic, publisher, subscriber, waitset, participant };
357+
const dds_entity_t entities[] = { rdcond, writer, reader, topic, publisher, subscriber, waitset, participant };
358358
const uint32_t count = (uint32_t) (sizeof (entities) / sizeof (entities[0]));
359359
dds_return_t ret;
360360
dds_entity_t es[MAX_ENTITIES_CNT];
@@ -447,7 +447,7 @@ CU_Test(ddsc_waitset_delete_attached, reader, .init=ddsc_waitset_init, .fini=dds
447447
{
448448
dds_entity_t es[MAX_ENTITIES_CNT];
449449
dds_return_t ret;
450-
ret = dds_waitset_attach (waitset, readcond, 0);
450+
ret = dds_waitset_attach (waitset, rdcond, 0);
451451
CU_ASSERT_FATAL (ret == 0);
452452
ret = dds_waitset_attach (waitset, reader, 1);
453453
CU_ASSERT_FATAL (ret == 0);
@@ -462,7 +462,7 @@ CU_Test(ddsc_waitset_delete_attached, various, .init=ddsc_waitset_init, .fini=dd
462462
{
463463
// order matters: deleting the reader will also delete readcond; deleting pub/sub will delete wr/rd
464464
// this order should be ok, but the number of alive entities will dwindle
465-
const dds_entity_t es[] = { readcond, writer, reader, topic, publisher, subscriber };
465+
const dds_entity_t es[] = { rdcond, writer, reader, topic, publisher, subscriber };
466466
dds_return_t ret;
467467
for (size_t i = 0; i < sizeof (es) / sizeof (es[0]); i++)
468468
{
@@ -490,7 +490,7 @@ CU_Theory((dds_entity_t ws), ddsc_waitset_set_trigger, invalid_params, .init=dds
490490
}
491491

492492
CU_TheoryDataPoints(ddsc_waitset_set_trigger, non_waitsets) = {
493-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &readcond),
493+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &rdcond),
494494
};
495495
CU_Theory((dds_entity_t *ws), ddsc_waitset_set_trigger, non_waitsets, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
496496
{
@@ -517,7 +517,7 @@ CU_Theory((dds_entity_t ws), ddsc_waitset_wait, invalid_waitsets, .init=ddsc_wai
517517
}
518518

519519
CU_TheoryDataPoints(ddsc_waitset_wait, non_waitsets) = {
520-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &readcond),
520+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &rdcond),
521521
};
522522
CU_Theory((dds_entity_t *ws), ddsc_waitset_wait, non_waitsets, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
523523
{
@@ -558,7 +558,7 @@ CU_Theory((dds_entity_t ws), ddsc_waitset_wait_until, invalid_waitsets, .init=dd
558558
}
559559

560560
CU_TheoryDataPoints(ddsc_waitset_wait_until, non_waitsets) = {
561-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &readcond),
561+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &rdcond),
562562
};
563563
CU_Theory((dds_entity_t *ws), ddsc_waitset_wait_until, non_waitsets, .init=ddsc_waitset_init, .fini=ddsc_waitset_fini)
564564
{
@@ -653,7 +653,7 @@ CU_Theory((dds_entity_t ws), ddsc_waitset_get_entities, invalid_params, .init=dd
653653
}
654654

655655
CU_TheoryDataPoints(ddsc_waitset_get_entities, non_waitsets) = {
656-
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &readcond),
656+
CU_DataPoints(dds_entity_t*, &participant, &topic, &writer, &reader, &publisher, &subscriber, &rdcond),
657657
};
658658
CU_Theory((dds_entity_t *ws), ddsc_waitset_get_entities, non_waitsets, .init=ddsc_waitset_attached_init, .fini=ddsc_waitset_attached_fini)
659659
{
@@ -721,10 +721,10 @@ CU_Test(ddsc_waitset_triggering, on_reader, .init=ddsc_waitset_attached_init, .f
721721
CU_Test(ddsc_waitset_triggering, on_readcondition, .init=ddsc_waitset_attached_init, .fini=ddsc_waitset_attached_fini)
722722
{
723723
dds_return_t ret;
724-
ret = dds_waitset_attach (waitset, readcond, readcond);
724+
ret = dds_waitset_attach (waitset, rdcond, rdcond);
725725
CU_ASSERT_FATAL (ret == 0);
726-
check_waitset_trigger (readcond, cw_trig_write);
727-
ret = dds_waitset_detach (waitset, readcond);
726+
check_waitset_trigger (rdcond, cw_trig_write);
727+
ret = dds_waitset_detach (waitset, rdcond);
728728
CU_ASSERT_FATAL (ret == 0);
729729
}
730730

‎src/core/ddsi/src/ddsi_endpoint.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ void ddsi_rebuild_writer_addrset (struct ddsi_writer *wr)
213213
ELOGDISC (wr, " (burst size %"PRIu32" rexmit %"PRIu32")\n", wr->init_burst_size_limit, wr->rexmit_burst_size_limit);
214214
}
215215

216+
#ifdef DDS_HAS_SSM
216217
static bool nwpart_includes_ssm_enabled_interfaces (const struct ddsi_domaingv *gv, const struct ddsi_config_networkpartition_listelem *np)
217218
ddsrt_nonnull ((1));
218219

@@ -241,6 +242,7 @@ static bool nwpart_includes_ssm_enabled_interfaces (const struct ddsi_domaingv *
241242
return false;
242243
}
243244
}
245+
#endif
244246

245247
static void writer_get_alive_state_locked (struct ddsi_writer *wr, struct ddsi_alive_state *st)
246248
{

‎src/core/ddsi/src/ddsi_nwinterfaces.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,10 @@ int ddsi_gather_network_interfaces (struct ddsi_domaingv *gv)
573573
flagpos += snprintf (flagstr + flagpos, sizeof (flagstr) - (size_t) flagpos, "%sspdp", (flagpos > 0) ? "," : "");
574574
if (gv->interfaces[i].allow_multicast & DDSI_AMC_ASM)
575575
flagpos += snprintf (flagstr + flagpos, sizeof (flagstr) - (size_t) flagpos, "%sasm", (flagpos > 0) ? "," : "");
576+
#ifdef DDS_HAS_SSM
576577
if (gv->interfaces[i].allow_multicast & DDSI_AMC_SSM)
577578
flagpos += snprintf (flagstr + flagpos, sizeof (flagstr) - (size_t) flagpos, "%sssm", (flagpos > 0) ? "," : "");
579+
#endif
578580
(void) flagpos;
579581
GVLOG (DDS_LC_CONFIG, "%s%s (index %"PRIu32" priority %"PRId32" mc {%s})",
580582
(i == 0) ? "" : ", ", gv->interfaces[i].name, gv->interfaces[i].if_index, gv->interfaces[i].priority,

‎src/core/ddsi/src/ddsi_sertype.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ uint32_t ddsi_sertype_compute_serdata_basehash (const struct ddsi_serdata_ops *o
222222

223223
uint16_t ddsi_sertype_get_native_enc_identifier (uint32_t enc_version, uint32_t enc_format)
224224
{
225-
#define CONCAT_(a,b) (a ## b)
226-
#define CONCAT(id,suffix) CONCAT_(id,suffix)
225+
#define ENC_CONCAT_(a,b) (a ## b)
226+
#define ENC_CONCAT(id,suffix) ENC_CONCAT_(id,suffix)
227227

228228
#if (DDSRT_ENDIAN == DDSRT_LITTLE_ENDIAN)
229229
#define SUFFIX _LE
@@ -235,20 +235,20 @@ uint16_t ddsi_sertype_get_native_enc_identifier (uint32_t enc_version, uint32_t
235235
{
236236
case DDSI_RTPS_CDR_ENC_VERSION_1:
237237
if (enc_format == DDSI_RTPS_CDR_ENC_FORMAT_PL)
238-
return CONCAT(DDSI_RTPS_PL_CDR, SUFFIX);
239-
return CONCAT(DDSI_RTPS_CDR, SUFFIX);
238+
return ENC_CONCAT(DDSI_RTPS_PL_CDR, SUFFIX);
239+
return ENC_CONCAT(DDSI_RTPS_CDR, SUFFIX);
240240
case DDSI_RTPS_CDR_ENC_VERSION_2:
241241
if (enc_format == DDSI_RTPS_CDR_ENC_FORMAT_PL)
242-
return CONCAT(DDSI_RTPS_PL_CDR2, SUFFIX);
242+
return ENC_CONCAT(DDSI_RTPS_PL_CDR2, SUFFIX);
243243
if (enc_format == DDSI_RTPS_CDR_ENC_FORMAT_DELIMITED)
244-
return CONCAT(DDSI_RTPS_D_CDR2, SUFFIX);
245-
return CONCAT(DDSI_RTPS_CDR2, SUFFIX);
244+
return ENC_CONCAT(DDSI_RTPS_D_CDR2, SUFFIX);
245+
return ENC_CONCAT(DDSI_RTPS_CDR2, SUFFIX);
246246
default:
247247
abort (); /* unsupported */
248248
}
249249
#undef SUFFIX
250-
#undef CONCAT
251-
#undef CONCAT_
250+
#undef ENC_CONCAT
251+
#undef ENC_CONCAT_
252252
}
253253

254254
uint16_t ddsi_sertype_extensibility_enc_format (enum dds_cdr_type_extensibility type_extensibility)

‎src/core/ddsi/src/ddsi_udp.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,11 @@ static int joinleave_asm_mcgroup (ddsrt_socket_t socket, int join, const ddsi_lo
718718
struct ipv6_mreq ipv6mreq;
719719
memset (&ipv6mreq, 0, sizeof (ipv6mreq));
720720
ipv6mreq.ipv6mr_multiaddr = mcip.a6.sin6_addr;
721+
#if __ZEPHYR__
722+
ipv6mreq.ipv6mr_ifindex = interf ? interf->if_index : 0;
723+
#else
721724
ipv6mreq.ipv6mr_interface = interf ? interf->if_index : 0;
725+
#endif
722726
rc = ddsrt_setsockopt (socket, IPPROTO_IPV6, join ? IPV6_JOIN_GROUP : IPV6_LEAVE_GROUP, &ipv6mreq, sizeof (ipv6mreq));
723727
}
724728
else

‎src/core/ddsi/tests/wraddrset.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,11 @@ static void ddsi_wraddrset_some_cases (int casenumber, int cost, bool wr_psmx, c
220220
// something else
221221
ddsi_add_xlocator_to_addrset (&gv, rd_as, &(ddsi_xlocator_t){ .conn = &fake_conn, .c = psmxloc[i] });
222222
}
223+
#if DDS_HAS_SSM
223224
ddsi_new_proxy_reader (&gv, &rdppguid[i][j], &rdguid, rd_as, &plist_rd, ddsrt_time_wallclock (), 1, false);
225+
#else
226+
ddsi_new_proxy_reader (&gv, &rdppguid[i][j], &rdguid, rd_as, &plist_rd, ddsrt_time_wallclock (), 1);
227+
#endif
224228
assert (ddsi_entidx_lookup_proxy_reader_guid (gv.entity_index, &rdguid));
225229
ddsi_unref_addrset (rd_as);
226230
}

‎src/ddsrt/include/dds/ddsrt/dynlib.h‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include "dds/ddsrt/retcode.h"
1818
#include "dds/ddsrt/attributes.h"
1919

20-
#if DDSRT_HAVE_DYNLIB
21-
2220
#if defined (__cplusplus)
2321
extern "C" {
2422
#endif
@@ -64,11 +62,13 @@ ddsrt_dlopen(
6462
bool translate,
6563
ddsrt_dynlib_t *handle) ddsrt_nonnull_all;
6664

65+
#if DDSRT_HAVE_DYNLIB
6766
dds_return_t
6867
ddsrt_platform_dlopen(
6968
const char *name,
7069
bool translate,
7170
ddsrt_dynlib_t *handle) ddsrt_nonnull_all;
71+
#endif
7272

7373
/**
7474
* @brief Close the library.
@@ -92,9 +92,11 @@ dds_return_t
9292
ddsrt_dlclose(
9393
ddsrt_dynlib_t handle);
9494

95+
#if DDSRT_HAVE_DYNLIB
9596
dds_return_t
9697
ddsrt_platform_dlclose(
9798
ddsrt_dynlib_t handle);
99+
#endif
98100

99101
/**
100102
* @brief Get the memory address of a symbol.
@@ -121,11 +123,13 @@ ddsrt_dlsym(
121123
const char *symbol,
122124
void **address);
123125

126+
#if DDSRT_HAVE_DYNLIB
124127
dds_return_t
125128
ddsrt_platform_dlsym(
126129
ddsrt_dynlib_t handle,
127130
const char *symbol,
128131
void **address);
132+
#endif
129133

130134
/**
131135
* @brief Get the most recent library related error.
@@ -154,15 +158,15 @@ ddsrt_dlerror(
154158
char *buf,
155159
size_t buflen);
156160

161+
#if DDSRT_HAVE_DYNLIB
157162
dds_return_t
158163
ddsrt_platform_dlerror(
159164
char *buf,
160165
size_t buflen);
166+
#endif
161167

162168
#if defined (__cplusplus)
163169
}
164170
#endif
165171

166-
#endif /* DDSRT_HAVE_DYNLIB */
167-
168172
#endif /* DDSRT_DYNLIB_H */

0 commit comments

Comments
 (0)