Skip to content
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

Include sys/types.h for ssize_t #207

Merged
merged 1 commit into from Jun 8, 2022
Merged

Include sys/types.h for ssize_t #207

merged 1 commit into from Jun 8, 2022

Conversation

jubalh
Copy link
Member

@jubalh jubalh commented May 30, 2022

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.

src/tls.c Outdated Show resolved Hide resolved
@pasis
Copy link
Member

pasis commented May 31, 2022

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

@sjaeckel
Copy link
Member

ssize_t is not a linux or other system specific. Just include <stddef.h> - 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
Copy link
Member Author

jubalh commented Jun 8, 2022

I included unistd.h in the non win32 case.

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` or `unistd.h`.
@sjaeckel sjaeckel merged commit f0383d5 into strophe:master Jun 8, 2022
@jubalh jubalh deleted the ssize_t branch June 8, 2022 12:37
@sjaeckel sjaeckel added this to the 0.12.1 milestone Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants