where is ssize_t defined?

This forum is about all development around libVLC.
mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

where is ssize_t defined?

Postby mangokm40 » 10 Jul 2015 21:49

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"?

fabsther
Blank Cone
Blank Cone
Posts: 13
Joined: 04 Jun 2015 16:32

Re: where is ssize_t defined?

Postby fabsther » 11 Jul 2015 15:09

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...

mangokm40
Cone that earned his stripes
Cone that earned his stripes
Posts: 130
Joined: 20 May 2010 20:00

Re: where is ssize_t defined?

Postby mangokm40 » 13 Jul 2015 15:08

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. :)

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: where is ssize_t defined?

Postby Jean-Baptiste Kempf » 15 Jul 2015 23:11

ssize_t is POSIX, not C99, IIRC. Aliasing it to unsigned int will work.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 26 guests