Closed JKRhb closed 2 years ago
FMPOV, if a static inline function is not working, I would just replace it by a non-static variant without #ifdef .
(My C summit was 30 years ago, so I don't know, if "static inline" works for shared libraries as well and just requires some compiler switches.)
I think this is more to do with backwards binary API comparability. You have a compiled application using a .so shared library. Library is updated, but application is not re-complied. Application fails because dtls_write() is no longer there.
My 2 cents.
About this function:
ifdef
. About backwards binary API compatibility in general:
dtls_handler_t
, and will then require to keep the old API as it is and additional add new ones. Not that this is not impossible, but FMPOV, I prefer to spend my time in other topics, which have a better pay off.LGTM
While https://github.com/eclipse/tinydtls/pull/159 made a very useful addition by introducing
dtls_writev
, it madedtls_write
unusable in shared libraries by turning it into astatic inline
function. This PR proposes reintroducingdtls_write
as a "regular" function when not building for an RTOS (Contiki, RIOT, or Zephyr), making it available in shared libraries again.Using a doxygen member group, it should be possible to reuse the documentation for both function variants, reducing redundancy.