-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lwIP port assumes features that might not be available #18
Comments
Patches 000[2-4] are fine and have been applied. Patch 0001 has a typedef for ssize_t that causes errors on platforms where this is already defined. Moreover, the symbol _HAVE_SYS_TYPES_H is missing at least for platform POSIX. I have removed inclusion of sys/types.h from coap_bits.h -- maybe this helps? |
And finally: 489eb73 removed a bunch of ifdef HAVE* statements. If you don't HAVE those headers on your platform, what are you supposed to do? The library works just fine without them. Should we add a bunch of empty headers just because? |
Regarding your final remark: Efforts have started to split off |
Removing the platform-specific things from the public API is a wonderful idea. However, it should be done by defining a platform-neutral API first (intX_t uintX_t void * and structs/unions), migrating the whole thing to that API then deleting things obsoleted by it. Just my 2 cents. |
The patch was removing all these header files that clearly including POSIX platform related header files because without this removing you can't compile Contiki and other non POSIX platforms and we wouldn't provide useful public header files. Remind there is also *BSD and Hurd which use some different implementations for the network stack and such things needs to be done in detail for those platforms.
As Olaf stated, the public header files needs to be clean and no #ifdef HAVE_FOO checks can live there. Without usable public header files the library is useless at all. But there is a long way to go on, I have just have started the split of with my patch series in the past. It's difficult (for me) as I don't have much experience with Contiki oder LwIP for example and will probably break things there. Any help in more cleaning are really appreciated! libcoap is one of the most powerful COAP implementing C-libraries. But for a wide usage we have to ensure a big coverage for usability. |
libcoap LwIP support has been re-written in PR #884, and so this should no longer be an issue. |
-sys/types.h and errno.h are included but not used
-ssize_t is not actually used (functions using the type are not called/not implemented)
-IP address definition changed in recent versions of lwIP, there are macros for address classification
-lwIP provides random numbers and debug output that might wrap rand()/srand()/printf() (or not)
I have hit those issues trying to run libcoap on an embedded target that doesn't provide certain features, unlike lwIP-on-Linux. The attached patches should take care of it, and should work on lwIP 1.4.0 or newer (that's 2011).
patches.zip
The text was updated successfully, but these errors were encountered: