[vlc-devel] [PATCH 1/3] OS/2: Include sys/types.h in vlc_common.h
remi at remlab.net
Sun Aug 26 19:09:30 CEST 2012
On Saturday 25 August 2012, Måns Rullgård wrote:
> > Well, I don't mind elevating <sys/types.h> to the same rank of as
> > <inttypes.h> and <stdbool.h>. But then all the redundant inclusions
> > should probably be removed from the code base...
> sys/types.h is POSIX while the other two you mention are C99, so there
> is a difference there. However, ssize_t is only specified by POSIX, and
> there it is to be defined by sys/types.h. Hence code using ssize_t not
> only can, but should include sys/types.h.
While <sys/types.h> and ssize_t are indeed not "fully" portable, they
constitute the only reasonable way to represent a signed integer for the size
of data (int is theoretically too small on some platforms). Also, they are
available not only in POSIX but also Mingw. So I think it would be reasonable
to consider <sys/types.h> so basic that it could be included in
VLC is written to the common subset of POSIX and Mingw - plus some easy to
replace POSIX, BSD and/or GNU functions. Since VLC requires preemptive
multithreading and run-time linking, C99 is not sufficient anyway.
Anyway, <vlc_configuration.h> is always included, so it makes no difference
whether <sys/types.h> is included from <vlc_common.h> or <vlc_configuration.h>.
Nevertheless, I'd very much like a patch to include <vlc_configuration.h>
explicitly and remove it from <vlc_common.h>
More information about the vlc-devel