On Sep 16, 2016 2:34 PM, "Gregg Reynolds" <dev at mobileink.com> wrote: > > On Sep 16, 2016 11:36 AM, "Dave Thaler via iotivity-dev" < iotivity-dev at lists.iotivity.org> wrote: > > > > Thiago wrote: > > > Ah, I understand now. Yes, indeed, this is a bug and should be fixed. The > > > code should have: > > > > > > #if !defined(OC_ROUTING_EP) && !defined(OC_ROUTING_GW) # error > > > One of OC_ROUTING_EP and OC_ROUTING_GW should be defined #endif > > > > > > Alternatively, we should drop the need for the EP #define and just assume > > > everything is an endpoint, unless OC_ROUTING_GW is set. > > > > I much prefer the alternative. Apps shouldn't have to do defines to get default behavior. > > me too. but what happens if my stack is compiled with GW but my app code is EP? I'd like to have this caught at compile time. not sure how. >
howsabout this in ocstack.c: #ifdef OC_ROUTING_GW ... OCInit_gw ... #else ... OCInit ... #endif this would force the app code to use the correct init fn. gregg > gregg -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20160916/33e6e3ad/attachment.html>
