eclipse / tinydtls

Eclipse tinydtls
https://projects.eclipse.org/projects/iot.tinydtls
Other
105 stars 58 forks source link

dtls: redefine `dtls_write` without `static inline` #162

Closed JKRhb closed 2 years ago

JKRhb commented 2 years ago

While https://github.com/eclipse/tinydtls/pull/159 made a very useful addition by introducing dtls_writev, it made dtls_write unusable in shared libraries by turning it into a static inline function. This PR proposes reintroducing dtls_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.

boaks commented 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.)

mrdeep1 commented 2 years ago

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.

boaks commented 2 years ago

My 2 cents.

About this function:

About backwards binary API compatibility in general:

boaks commented 2 years ago

LGTM