Page 1 of 1

where is ssize_t defined?

Posted: 10 Jul 2015 21:49
by mangokm40
I downloaded the latest source for 3.0.0 and the file "libvlc_media.h" has a type "ssize_t" being used on line 306.

I can't find where this type is defined. I thought it might be a typo for "size_t", but the comments say "...strictly positive
number...". Maybe the 's' at the beginning is for "strictly"?

Re: where is ssize_t defined?

Posted: 11 Jul 2015 15:09
by fabsther
Hi,

Basicaly size_t is standard in C++ for an size value, as an alias to unsigned int.
ssize_t is in fact signed size_t, so a simple int that allow you to return negative value on error...

Re: where is ssize_t defined?

Posted: 13 Jul 2015 15:08
by mangokm40
Thank you. I thought size_t was a C standard. However, I'd never used ssize_t. Is it also a C (or C++) standard?
Do you know where it is defined? I changed the function to return int, for now. I'm just wondering if I'm missing a
definition file or if the nightly for 3.0.0 is missing something. Maybe I shouldn't care yet. :)

Re: where is ssize_t defined?

Posted: 15 Jul 2015 23:11
by Jean-Baptiste Kempf
ssize_t is POSIX, not C99, IIRC. Aliasing it to unsigned int will work.