Need to include stddef.h for it, so this would've worked:
if cc.has_type('ptrdiff_t', prefix: '#include <stddef.h>')
/* Have PTHREAD_PRIO_INHERIT. */
#mesondefine HAVE_PTHREAD_PRIO_INHERIT
-/* Define to 1 if the system has the type `ptrdiff_t'. */
-#mesondefine HAVE_PTRDIFF_T
-
/* Define if RDTSC is available */
#mesondefine HAVE_RDTSC
cdata.set('HAVE_CLOCK_GETTIME', 1)
endif
-if cc.has_type('ptrdiff_t')
- cdata.set('HAVE_PTRDIFF_T')
-endif
-
# We only want to use the __declspec(dllexport/import) dance in GST_EXPORT when
# building with MSVC
if cc.get_id() == 'msvc'