I'm calling into a C library from Swift. I ran into an issue when building on Linux:
error: cannot find 'WGPU_WHOLE_SIZE' in scope
WGPU_WHOLE_SIZE is a constant defined in the C library like so:
#define WGPU_WHOLE_SIZE UINT64_MAX
And tracing UINT64_MAX to /usr/include/stdint.h, I noticed it is defined like so:
# if __WORDSIZE == 64
# define __INT64_C(c) c ## L
# define __UINT64_C(c) c ## UL
# else
# define __INT64_C(c) c ## LL
# define __UINT64_C(c) c ## ULL
# endif
# define UINT64_MAX (__UINT64_C(18446744073709551615))
My guess is that Swift cannot process this particular macro, though I'm surprised I haven't come across this issue before.
I can probably get around this by defining UINT64_MAX myself before importing the C library. But I was wondering if this is expected behavior?