From d5ab5336aa30994d72e5cfad2a590670097b3e68 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 12 Jun 2023 13:48:39 -0400 Subject: [PATCH] pathbuilder: Avoid trouble with sincos The Windows builds seem to have problem with this handling of sincos(), so do it the same way we do it elsewere, by defining _sincos(). --- gsk/gskpathbuilder.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/gsk/gskpathbuilder.c b/gsk/gskpathbuilder.c index bd783a10f7..feb44b57b3 100644 --- a/gsk/gskpathbuilder.c +++ b/gsk/gskpathbuilder.c @@ -19,6 +19,8 @@ #include "config.h" +#include + #include "gskpathbuilder.h" #include "gskpathprivate.h" @@ -854,16 +856,18 @@ arc_segment (GskPathBuilder *self, cy + sin_phi * x3 + cos_phi * y3); } -#ifndef HAVE_SINCOS static inline void -sincos (double angle, - double *y, - double *x) +_sincos (double angle, + double *y, + double *x) { +#ifdef HAVE_SINCOS + sincos (angle, y, x); +#else *x = cos (angle); *y = sin (angle); -} #endif +} void gsk_path_builder_svg_arc_to (GskPathBuilder *self, @@ -912,7 +916,7 @@ gsk_path_builder_svg_arc_to (GskPathBuilder *self, y2 = y; phi = x_axis_rotation * M_PI / 180.0; - sincos (phi, &sin_phi, &cos_phi); + _sincos (phi, &sin_phi, &cos_phi); rx = fabs (rx); ry = fabs (ry); @@ -975,7 +979,7 @@ gsk_path_builder_svg_arc_to (GskPathBuilder *self, n_segs = ceil (fabs (delta_theta / (M_PI_2 + 0.001))); d_theta = delta_theta / n_segs; theta = theta1; - sincos (theta1, &sin_th1, &cos_th1); + _sincos (theta1, &sin_th1, &cos_th1); th_half = d_theta / 2; t = (8.0 / 3.0) * sin (th_half / 2) * sin (th_half / 2) / sin (th_half); @@ -986,7 +990,7 @@ gsk_path_builder_svg_arc_to (GskPathBuilder *self, theta1 = theta + d_theta; sin_th0 = sin_th1; cos_th0 = cos_th1; - sincos (theta1, &sin_th1, &cos_th1); + _sincos (theta1, &sin_th1, &cos_th1); arc_segment (self, cx, cy, rx, ry, sin_phi, cos_phi,