From 0b1cdbb9be404bc1f4d7ec802a79e49a690aab7d Mon Sep 17 00:00:00 2001 From: Laurent Pierru Date: Wed, 8 Aug 2018 22:50:42 +0200 Subject: [PATCH 1/7] fix the build on FreeBSD 10 (old one) --- common/testing/Makefile.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/common/testing/Makefile.mk b/common/testing/Makefile.mk index 3ac481b4c7..e1d11eeac5 100644 --- a/common/testing/Makefile.mk +++ b/common/testing/Makefile.mk @@ -6,5 +6,6 @@ noinst_LTLIBRARIES += common/testing/libolatesting.la \ common_testing_libolatesting_la_SOURCES = \ common/testing/MockUDPSocket.cpp \ common/testing/TestUtils.cpp +common_testing_libolatesting_la_CXXFLAGS = $(COMMON_TESTING_PROTOBUF_FLAGS) common_testing_libtestmain_la_SOURCES = common/testing/GenericTester.cpp endif From 041f660f5bc341247d2747e7386e9ab86545631e Mon Sep 17 00:00:00 2001 From: Laurent Pierru Date: Wed, 8 Aug 2018 23:07:42 +0200 Subject: [PATCH 2/7] fix configure on FreeBSD 10.4 and 11.2 --- config/resolv.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/resolv.m4 b/config/resolv.m4 index 8b7974f6e1..c7a67c3b78 100644 --- a/config/resolv.m4 +++ b/config/resolv.m4 @@ -27,7 +27,7 @@ AC_CHECK_HEADERS([resolv.h]) am_save_LDFLAGS="$LDFLAGS" RESOLV_LIBS="" -acx_resolv_libs="-lresolv -resolv" +acx_resolv_libs="-lresolv -resolv -lc" for lib in $acx_resolv_libs; do acx_resolv_ok=no LDFLAGS="$am_save_LDFLAGS $lib" From 36e00eeb1ba0a4e87902487983253ee3cfd19c23 Mon Sep 17 00:00:00 2001 From: Laurent Pierru Date: Thu, 9 Aug 2018 00:05:00 +0200 Subject: [PATCH 3/7] fix AutoStart build on FreeBSD 10.4 and 11.2 --- ola/AutoStart.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ola/AutoStart.cpp b/ola/AutoStart.cpp index 12e15def46..6418bb3db9 100644 --- a/ola/AutoStart.cpp +++ b/ola/AutoStart.cpp @@ -110,7 +110,11 @@ TCPSocket *ConnectToServer(unsigned short port) { // Try to start the server, we pass --daemon (fork into background) and // --syslog (log to syslog). execlp("olad", "olad", "--daemon", "--syslog", - reinterpret_cast(NULL)); + #ifdef __FreeBSD__ + reinterpret_cast(0)); + #else + reinterpret_cast(NULL)); + #endif // __FreeBSD__ OLA_WARN << "Failed to exec: " << strerror(errno); _exit(1); } From b7e3b9925ef0826b529f53077c5f5e6fc5223dd7 Mon Sep 17 00:00:00 2001 From: Laurent Pierru Date: Sat, 11 Aug 2018 19:23:47 +0200 Subject: [PATCH 4/7] Revert "fix the build on FreeBSD 10 (old one)" This reverts commit 0b1cdbb9be404bc1f4d7ec802a79e49a690aab7d. --- common/testing/Makefile.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/common/testing/Makefile.mk b/common/testing/Makefile.mk index e1d11eeac5..3ac481b4c7 100644 --- a/common/testing/Makefile.mk +++ b/common/testing/Makefile.mk @@ -6,6 +6,5 @@ noinst_LTLIBRARIES += common/testing/libolatesting.la \ common_testing_libolatesting_la_SOURCES = \ common/testing/MockUDPSocket.cpp \ common/testing/TestUtils.cpp -common_testing_libolatesting_la_CXXFLAGS = $(COMMON_TESTING_PROTOBUF_FLAGS) common_testing_libtestmain_la_SOURCES = common/testing/GenericTester.cpp endif From ad017c31d1f75ae0cc38b0a8d8b9da6453834368 Mon Sep 17 00:00:00 2001 From: Laurent Pierru Date: Sat, 11 Aug 2018 22:49:20 +0200 Subject: [PATCH 5/7] fix tests on FreeBSD 10.4 and 11.2 (reinterpret_cast NULL not allowed) --- common/web/JsonTest.cpp | 36 ++++++++++++++++++--- ola/AutoStart.cpp | 4 +-- olad/plugin_api/UniverseTest.cpp | 54 ++++++++++++++++++++++++++------ 3 files changed, 78 insertions(+), 16 deletions(-) diff --git a/common/web/JsonTest.cpp b/common/web/JsonTest.cpp index c1fd2152ce..a52a8d5649 100644 --- a/common/web/JsonTest.cpp +++ b/common/web/JsonTest.cpp @@ -556,7 +556,12 @@ void JsonTest::testLookups() { JsonString string1("foo"); OLA_ASSERT_EQ(reinterpret_cast(&string1), string1.LookupElement(empty_pointer)); - OLA_ASSERT_EQ(reinterpret_cast(NULL), + + #ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), + #else + OLA_ASSERT_EQ(reinterpret_cast(NULL), + #endif // __FreeBSD__ string1.LookupElement(invalid_pointer)); // Now try an object @@ -571,7 +576,12 @@ void JsonTest::testLookups() { object.LookupElement(empty_pointer)); OLA_ASSERT_EQ(reinterpret_cast(name_value), object.LookupElement(name_pointer)); - OLA_ASSERT_EQ(reinterpret_cast(NULL), + + #ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), + #else + OLA_ASSERT_EQ(reinterpret_cast(NULL), + #endif // __FreeBSD__ object.LookupElement(invalid_pointer)); // Now try an array @@ -591,17 +601,33 @@ void JsonTest::testLookups() { OLA_ASSERT_EQ(reinterpret_cast(array), array->LookupElement(empty_pointer)); - OLA_ASSERT_EQ(reinterpret_cast(NULL), + + #ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), + #else + OLA_ASSERT_EQ(reinterpret_cast(NULL), + #endif // __FreeBSD__ array->LookupElement(invalid_pointer)); + OLA_ASSERT_EQ(reinterpret_cast(string2), array->LookupElement(first)); OLA_ASSERT_EQ(reinterpret_cast(string3), array->LookupElement(middle)); OLA_ASSERT_EQ(reinterpret_cast(string4), array->LookupElement(last)); - OLA_ASSERT_EQ(reinterpret_cast(NULL), + + #ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), + #else + OLA_ASSERT_EQ(reinterpret_cast(NULL), + #endif // __FreeBSD__ array->LookupElement(one_past_last)); - OLA_ASSERT_EQ(reinterpret_cast(NULL), + + #ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), + #else + OLA_ASSERT_EQ(reinterpret_cast(NULL), + #endif // __FreeBSD__ array->LookupElement(invalid)); // now a nested case diff --git a/ola/AutoStart.cpp b/ola/AutoStart.cpp index 6418bb3db9..42fa5b9f93 100644 --- a/ola/AutoStart.cpp +++ b/ola/AutoStart.cpp @@ -111,9 +111,9 @@ TCPSocket *ConnectToServer(unsigned short port) { // --syslog (log to syslog). execlp("olad", "olad", "--daemon", "--syslog", #ifdef __FreeBSD__ - reinterpret_cast(0)); + reinterpret_cast(0)); #else - reinterpret_cast(NULL)); + reinterpret_cast(NULL)); #endif // __FreeBSD__ OLA_WARN << "Failed to exec: " << strerror(errno); _exit(1); diff --git a/olad/plugin_api/UniverseTest.cpp b/olad/plugin_api/UniverseTest.cpp index 563fd24176..6081b8c628 100644 --- a/olad/plugin_api/UniverseTest.cpp +++ b/olad/plugin_api/UniverseTest.cpp @@ -632,7 +632,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_UNKNOWN_UID, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ // ok, now try something that returns a response from the port request = new ola::rdm::RDMGetRequest( @@ -654,7 +658,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_TIMEOUT, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ // now try a broadcast fan out UID vendorcast_uid = UID::VendorcastAddress(0x7a70); @@ -683,7 +691,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_WAS_BROADCAST, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ // now confirm that if one of the ports fails to send, we see this response request = new ola::rdm::RDMGetRequest( @@ -707,7 +719,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_FAILED_TO_SEND, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ // DUB responses are slightly different request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0); @@ -727,7 +743,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_DUB_RESPONSE, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ // now check that we still get a RDM_DUB_RESPONSE even if one port returns an // RDM_TIMEOUT @@ -744,7 +764,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_DUB_RESPONSE, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ // and the same again but the second port returns // RDM_PLUGIN_DISCOVERY_NOT_SUPPORTED @@ -761,7 +785,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_DUB_RESPONSE, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ // now the first port returns a RDM_TIMEOUT request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0); @@ -777,7 +805,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_TIMEOUT, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ // finally if neither ports support the DUB, we should return that request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0); @@ -793,7 +825,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_PLUGIN_DISCOVERY_NOT_SUPPORTED, - reinterpret_cast(NULL))); + #ifdef __FreeBSD__ + reinterpret_cast(0))); + #else + reinterpret_cast(NULL))); + #endif // __FreeBSD__ universe->RemovePort(&port1); universe->RemovePort(&port2); From cfb27abbb2318a57ed4468a4bb00adc4ea593fa1 Mon Sep 17 00:00:00 2001 From: Laurent Pierru Date: Sun, 12 Aug 2018 13:05:31 +0200 Subject: [PATCH 6/7] better indentation on some #ifdef __FreeBSD__ --- common/network/PosixInterfacePicker.cpp | 14 ++++++------ common/web/JsonTest.cpp | 30 ++++++++++++------------- ola/AutoStart.cpp | 10 ++++----- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/common/network/PosixInterfacePicker.cpp b/common/network/PosixInterfacePicker.cpp index 16c09bef39..edc6e05c3d 100644 --- a/common/network/PosixInterfacePicker.cpp +++ b/common/network/PosixInterfacePicker.cpp @@ -38,7 +38,7 @@ #endif // HAVE_SYS_SOCKET_H #include #ifdef HAVE_NETINET_IN_H -#include // Required by FreeBSD + #include // Required by FreeBSD #endif // HAVE_NETINET_IN_H #include #include @@ -222,11 +222,11 @@ vector PosixInterfacePicker::GetInterfaces( if (ioctl(sd, SIOCGIFINDEX, &ifrcopy) < 0) { OLA_WARN << "ioctl error " << strerror(errno); } else { -#ifdef __FreeBSD__ - interface.index = ifrcopy.ifr_index; -#else - interface.index = ifrcopy.ifr_ifindex; -#endif // SIOCGIFINDEX + #ifdef __FreeBSD__ + interface.index = ifrcopy.ifr_index; + #else + interface.index = ifrcopy.ifr_ifindex; + #endif // __FreeBSD__ } } #elif defined(HAVE_IF_NAMETOINDEX) @@ -235,7 +235,7 @@ vector PosixInterfacePicker::GetInterfaces( if (index != 0) { interface.index = index; } -#endif // defined(HAVE_IF_NAMETOINDEX) +#endif // SIOCGIFINDEX /* ok, if that all failed we should prob try and use sysctl to work out the * broadcast and hardware addresses diff --git a/common/web/JsonTest.cpp b/common/web/JsonTest.cpp index a52a8d5649..08365647c8 100644 --- a/common/web/JsonTest.cpp +++ b/common/web/JsonTest.cpp @@ -558,11 +558,11 @@ void JsonTest::testLookups() { string1.LookupElement(empty_pointer)); #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), + OLA_ASSERT_EQ(reinterpret_cast(0), #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), + OLA_ASSERT_EQ(reinterpret_cast(NULL), #endif // __FreeBSD__ - string1.LookupElement(invalid_pointer)); + string1.LookupElement(invalid_pointer)); // Now try an object JsonString *name_value = new JsonString("simon"); @@ -578,11 +578,11 @@ void JsonTest::testLookups() { object.LookupElement(name_pointer)); #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), + OLA_ASSERT_EQ(reinterpret_cast(0), #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), + OLA_ASSERT_EQ(reinterpret_cast(NULL), #endif // __FreeBSD__ - object.LookupElement(invalid_pointer)); + object.LookupElement(invalid_pointer)); // Now try an array JsonArray *array = new JsonArray(); @@ -603,11 +603,11 @@ void JsonTest::testLookups() { array->LookupElement(empty_pointer)); #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), + OLA_ASSERT_EQ(reinterpret_cast(0), #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), + OLA_ASSERT_EQ(reinterpret_cast(NULL), #endif // __FreeBSD__ - array->LookupElement(invalid_pointer)); + array->LookupElement(invalid_pointer)); OLA_ASSERT_EQ(reinterpret_cast(string2), array->LookupElement(first)); @@ -617,18 +617,18 @@ void JsonTest::testLookups() { array->LookupElement(last)); #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), + OLA_ASSERT_EQ(reinterpret_cast(0), #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), + OLA_ASSERT_EQ(reinterpret_cast(NULL), #endif // __FreeBSD__ - array->LookupElement(one_past_last)); + array->LookupElement(one_past_last)); #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), + OLA_ASSERT_EQ(reinterpret_cast(0), #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), + OLA_ASSERT_EQ(reinterpret_cast(NULL), #endif // __FreeBSD__ - array->LookupElement(invalid)); + array->LookupElement(invalid)); // now a nested case object.AddValue("pets", array); diff --git a/ola/AutoStart.cpp b/ola/AutoStart.cpp index 42fa5b9f93..268f17963d 100644 --- a/ola/AutoStart.cpp +++ b/ola/AutoStart.cpp @@ -110,11 +110,11 @@ TCPSocket *ConnectToServer(unsigned short port) { // Try to start the server, we pass --daemon (fork into background) and // --syslog (log to syslog). execlp("olad", "olad", "--daemon", "--syslog", - #ifdef __FreeBSD__ - reinterpret_cast(0)); - #else - reinterpret_cast(NULL)); - #endif // __FreeBSD__ + #ifdef __FreeBSD__ + reinterpret_cast(0)); + #else + reinterpret_cast(NULL)); + #endif // __FreeBSD__ OLA_WARN << "Failed to exec: " << strerror(errno); _exit(1); } From 58ea98add98941fc432abda7e50de7fc73f0c4d3 Mon Sep 17 00:00:00 2001 From: Laurent Pierru Date: Sun, 12 Aug 2018 16:50:12 +0200 Subject: [PATCH 7/7] fix indentation on all #ifdef __FreeBSD__ --- common/network/PosixInterfacePicker.cpp | 10 +-- common/web/JsonTest.cpp | 62 ++++++++--------- ola/AutoStart.cpp | 10 +-- olad/plugin_api/UniverseTest.cpp | 90 ++++++++++++------------- 4 files changed, 86 insertions(+), 86 deletions(-) diff --git a/common/network/PosixInterfacePicker.cpp b/common/network/PosixInterfacePicker.cpp index a51cd2a6c8..a85d996dc3 100644 --- a/common/network/PosixInterfacePicker.cpp +++ b/common/network/PosixInterfacePicker.cpp @@ -222,11 +222,11 @@ vector PosixInterfacePicker::GetInterfaces( if (ioctl(sd, SIOCGIFINDEX, &ifrcopy) < 0) { OLA_WARN << "ioctl error " << strerror(errno); } else { - #ifdef __FreeBSD__ - interface.index = ifrcopy.ifr_index; - #else - interface.index = ifrcopy.ifr_ifindex; - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + interface.index = ifrcopy.ifr_index; +#else + interface.index = ifrcopy.ifr_ifindex; +#endif // __FreeBSD__ } } #elif defined(HAVE_IF_NAMETOINDEX) diff --git a/common/web/JsonTest.cpp b/common/web/JsonTest.cpp index 08365647c8..75ecf32c06 100644 --- a/common/web/JsonTest.cpp +++ b/common/web/JsonTest.cpp @@ -557,12 +557,12 @@ void JsonTest::testLookups() { OLA_ASSERT_EQ(reinterpret_cast(&string1), string1.LookupElement(empty_pointer)); - #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), - #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), - #endif // __FreeBSD__ - string1.LookupElement(invalid_pointer)); +#ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), +#else + OLA_ASSERT_EQ(reinterpret_cast(NULL), +#endif // __FreeBSD__ + string1.LookupElement(invalid_pointer)); // Now try an object JsonString *name_value = new JsonString("simon"); @@ -577,12 +577,12 @@ void JsonTest::testLookups() { OLA_ASSERT_EQ(reinterpret_cast(name_value), object.LookupElement(name_pointer)); - #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), - #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), - #endif // __FreeBSD__ - object.LookupElement(invalid_pointer)); +#ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), +#else + OLA_ASSERT_EQ(reinterpret_cast(NULL), +#endif // __FreeBSD__ + object.LookupElement(invalid_pointer)); // Now try an array JsonArray *array = new JsonArray(); @@ -602,12 +602,12 @@ void JsonTest::testLookups() { OLA_ASSERT_EQ(reinterpret_cast(array), array->LookupElement(empty_pointer)); - #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), - #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), - #endif // __FreeBSD__ - array->LookupElement(invalid_pointer)); +#ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), +#else + OLA_ASSERT_EQ(reinterpret_cast(NULL), +#endif // __FreeBSD__ + array->LookupElement(invalid_pointer)); OLA_ASSERT_EQ(reinterpret_cast(string2), array->LookupElement(first)); @@ -616,19 +616,19 @@ void JsonTest::testLookups() { OLA_ASSERT_EQ(reinterpret_cast(string4), array->LookupElement(last)); - #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), - #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), - #endif // __FreeBSD__ - array->LookupElement(one_past_last)); - - #ifdef __FreeBSD__ - OLA_ASSERT_EQ(reinterpret_cast(0), - #else - OLA_ASSERT_EQ(reinterpret_cast(NULL), - #endif // __FreeBSD__ - array->LookupElement(invalid)); +#ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), +#else + OLA_ASSERT_EQ(reinterpret_cast(NULL), +#endif // __FreeBSD__ + array->LookupElement(one_past_last)); + +#ifdef __FreeBSD__ + OLA_ASSERT_EQ(reinterpret_cast(0), +#else + OLA_ASSERT_EQ(reinterpret_cast(NULL), +#endif // __FreeBSD__ + array->LookupElement(invalid)); // now a nested case object.AddValue("pets", array); diff --git a/ola/AutoStart.cpp b/ola/AutoStart.cpp index 268f17963d..89fa51f115 100644 --- a/ola/AutoStart.cpp +++ b/ola/AutoStart.cpp @@ -110,11 +110,11 @@ TCPSocket *ConnectToServer(unsigned short port) { // Try to start the server, we pass --daemon (fork into background) and // --syslog (log to syslog). execlp("olad", "olad", "--daemon", "--syslog", - #ifdef __FreeBSD__ - reinterpret_cast(0)); - #else - reinterpret_cast(NULL)); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0)); +#else + reinterpret_cast(NULL)); +#endif // __FreeBSD__ OLA_WARN << "Failed to exec: " << strerror(errno); _exit(1); } diff --git a/olad/plugin_api/UniverseTest.cpp b/olad/plugin_api/UniverseTest.cpp index 6081b8c628..faedd01bb4 100644 --- a/olad/plugin_api/UniverseTest.cpp +++ b/olad/plugin_api/UniverseTest.cpp @@ -632,11 +632,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_UNKNOWN_UID, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ // ok, now try something that returns a response from the port request = new ola::rdm::RDMGetRequest( @@ -658,11 +658,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_TIMEOUT, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ // now try a broadcast fan out UID vendorcast_uid = UID::VendorcastAddress(0x7a70); @@ -691,11 +691,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_WAS_BROADCAST, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ // now confirm that if one of the ports fails to send, we see this response request = new ola::rdm::RDMGetRequest( @@ -719,11 +719,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_FAILED_TO_SEND, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ // DUB responses are slightly different request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0); @@ -743,11 +743,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_DUB_RESPONSE, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ // now check that we still get a RDM_DUB_RESPONSE even if one port returns an // RDM_TIMEOUT @@ -764,11 +764,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_DUB_RESPONSE, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ // and the same again but the second port returns // RDM_PLUGIN_DISCOVERY_NOT_SUPPORTED @@ -785,11 +785,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_DUB_RESPONSE, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ // now the first port returns a RDM_TIMEOUT request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0); @@ -805,11 +805,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_TIMEOUT, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ // finally if neither ports support the DUB, we should return that request = NewDiscoveryUniqueBranchRequest(source_uid, uid1, uid2, 0); @@ -825,11 +825,11 @@ void UniverseTest::testRDMSend() { &UniverseTest::ConfirmRDM, __LINE__, ola::rdm::RDM_PLUGIN_DISCOVERY_NOT_SUPPORTED, - #ifdef __FreeBSD__ - reinterpret_cast(0))); - #else - reinterpret_cast(NULL))); - #endif // __FreeBSD__ +#ifdef __FreeBSD__ + reinterpret_cast(0))); +#else + reinterpret_cast(NULL))); +#endif // __FreeBSD__ universe->RemovePort(&port1); universe->RemovePort(&port2);