meson: fix SIZEOF_OFF_T when cross-compiling with Meson >= 1.3.0

https://mesonbuild.com/Release-notes-for-1-3-0.html#clarify-of-implicitlyincluded-headers-in-clike-compiler-checks

With only stddef.h, off_t is not defined, so when cross-compiling SIZEOF_OFF_T is -1.
We now use sys/types.h which should define off_t.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7217>
This commit is contained in:
Loïc Yhuel 2024-07-23 15:32:22 +02:00
parent c35302a071
commit 13034cc63f

View file

@ -214,7 +214,7 @@ cdata.set('SIZEOF_INT', cc.sizeof('int'))
cdata.set('SIZEOF_LONG', cc.sizeof('long'))
cdata.set('SIZEOF_SHORT', cc.sizeof('short'))
cdata.set('SIZEOF_VOIDP', cc.sizeof('void*'))
cdata.set('SIZEOF_OFF_T', cc.sizeof('off_t'))
cdata.set('SIZEOF_OFF_T', cc.sizeof('off_t', prefix : '#include<sys/types.h>'))
have_rtld_noload = cc.has_header_symbol('dlfcn.h', 'RTLD_NOLOAD')
cdata.set('HAVE_RTLD_NOLOAD', have_rtld_noload)