strophe / libstrophe

A simple, lightweight C library for writing XMPP clients
http://strophe.im/libstrophe
Other
401 stars 163 forks source link

Include sys/types.h for ssize_t #207

Closed jubalh closed 2 years ago

jubalh commented 2 years ago

When compiling on buildroot I get: src/tls.c:235:28: error: ‘ssize_t’ undeclared (first use in this function); did you mean ‘size_t’?

To have this POSIX type available we will need to include sys/types.h on Linux. Unsure about other systems.

pasis commented 2 years ago

ssize_t is not a linux or other system specific. Just include - I believe it should be there.

sjaeckel commented 2 years ago

ssize_t is not a linux or other system specific. Just include - I believe it should be there.

apparently POSIX isn't sure where it wants to typedef it ...

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html#tag_13_77_03_05

so please #include <unistd.h> unconditionally

jubalh commented 2 years ago

I included unistd.h in the non win32 case.