WindowsVS Build 2022 - 'type cast': cannot convert from 'cairo_uint64_t' to 'cairo_int64_t'
Looks like an issue with cairo-wideint-type-private.h for compiling in VS Target on Windows.
v.1.17.4 / v.1.17.8 tested
On initial observation just looks like missing the MSC_VER due to IF preprocessor there being valid for stdint as well https://gitlab.freedesktop.org/cairo/cairo/-/blob/master/src/cairo-wideint-type-private.h#L51
#if HAVE_STDINT_H
# include <stdint.h>
#elif HAVE_INTTYPES_H
# include <inttypes.h>
#elif HAVE_SYS_INT_TYPES_H
# include <sys/int_types.h>
#elif defined(_MSC_VER)
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
# ifndef HAVE_UINT64_T
# define HAVE_UINT64_T 1
# endif
#else
#error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, etc.)
#endif
Proposed solution:
#if HAVE_STDINT_H
# include <stdint.h>
#elif HAVE_INTTYPES_H
# include <inttypes.h>
#elif HAVE_SYS_INT_TYPES_H
# include <sys/int_types.h>
#else
#error Cannot find definitions for fixed-width integral types (uint8_t, uint32_t, etc.)
#endif
#if defined(_MSC_VER)
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
# ifndef HAVE_UINT64_T
# define HAVE_UINT64_T 1
# endif
#endif
Note I am using Cmake variables to build this and the full build. CMakeFiles I have updated from ancient CMakePorts/cairo for the new versions. This can be viewed at https://github.com/danoli3/cairo I'll push a PR with the minimal Cmake files for this repo shortly