Vala `size_t` does not match C `size_t` on Mingw64
Vala size_t
is mapped to gsize
. On MSYS, this maps to long long int
(8 bytes).
But on MSYS, size_t
is long int
, which is also 8 bytes, but GCC doesn't like it and complains that the type is incompatible.
Use case: I am trying to implement a C API in Vala, so the Vala-generated C is compiled with a handwritten C header file.
My workaround was to copy the definitions for size_t
and ssize_t
from posix.vapi
into my project (since by they are only available from 'posix.vapi' in the 'posix' profile).
I guess that the current definitions may be entrenched enough that they can't be changed, but it would be good to document this problem somewhere.
Edited by Reuben Thomas