Sun Aug 14 21:05:32 2022 UTC ()
gtk4: don't clash with builtin sincos(3)


(tnn)
diff -r1.5 -r1.6 pkgsrc/x11/gtk4/distinfo
diff -r0 -r1.1 pkgsrc/x11/gtk4/patches/patch-demos_gtk-demo_gtkgears.c

cvs diff -r1.5 -r1.6 pkgsrc/x11/gtk4/distinfo (expand / switch to unified diff)

--- pkgsrc/x11/gtk4/distinfo 2022/07/29 16:08:20 1.5
+++ pkgsrc/x11/gtk4/distinfo 2022/08/14 21:05:32 1.6
@@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
1$NetBSD: distinfo,v 1.5 2022/07/29 16:08:20 wiz Exp $ 1$NetBSD: distinfo,v 1.6 2022/08/14 21:05:32 tnn Exp $
2 2
3BLAKE2s (gtk-4.6.6.tar.xz) = 520d6e0edc306ef03691c57e499f1a98ea094bbe30bfe3d731487e8833776758 3BLAKE2s (gtk-4.6.6.tar.xz) = 520d6e0edc306ef03691c57e499f1a98ea094bbe30bfe3d731487e8833776758
4SHA512 (gtk-4.6.6.tar.xz) = b743d99029d7d51db19396641023eefd5d25bbacbd89ad6660d43e382b26fe6cc5e9ce8f0dbb3f4ac7d2143db617ea0c2e2d3cc8926fc93d735eb76ffb2f8309 4SHA512 (gtk-4.6.6.tar.xz) = b743d99029d7d51db19396641023eefd5d25bbacbd89ad6660d43e382b26fe6cc5e9ce8f0dbb3f4ac7d2143db617ea0c2e2d3cc8926fc93d735eb76ffb2f8309
5Size (gtk-4.6.6.tar.xz) = 23085304 bytes 5Size (gtk-4.6.6.tar.xz) = 23085304 bytes
 6SHA1 (patch-demos_gtk-demo_gtkgears.c) = f09912bb4bef8589f694d4ed1a4744afe422ccbd
6SHA1 (patch-meson.build) = 89b91ba48b35baafb35598d3dd82577de8fc424c 7SHA1 (patch-meson.build) = 89b91ba48b35baafb35598d3dd82577de8fc424c

File Added: pkgsrc/x11/gtk4/patches/patch-demos_gtk-demo_gtkgears.c
$NetBSD: patch-demos_gtk-demo_gtkgears.c,v 1.1 2022/08/14 21:05:32 tnn Exp $

Don't clash with builtin sincos(3).
Needed because we disabled the sincos(3) test in meson.build.

--- demos/gtk-demo/gtkgears.c.orig	2022-07-02 18:38:25.000000000 +0000
+++ demos/gtk-demo/gtkgears.c
@@ -48,14 +48,12 @@
 #define VERTICES_PER_TOOTH 34
 #define GEAR_VERTEX_STRIDE 6
 
-#ifndef HAVE_SINCOS
 static void
-sincos (double x, double *_sin, double *_cos)
+static_sincos (double x, double *_sin, double *_cos)
 {
   *_sin = sin (x);
   *_cos = cos (x);
 }
-#endif
 
 /**
  * Struct describing the vertices in triangle strip
@@ -306,11 +304,11 @@ create_gear (GLfloat inner_radius,
     struct point p[7];
 
     /* Calculate needed sin/cos for various angles */
-    sincos(i * 2.0 * G_PI / teeth + da * 0, &s[0], &c[0]);
-    sincos(i * 2.0 * M_PI / teeth + da * 1, &s[1], &c[1]);
-    sincos(i * 2.0 * M_PI / teeth + da * 2, &s[2], &c[2]);
-    sincos(i * 2.0 * M_PI / teeth + da * 3, &s[3], &c[3]);
-    sincos(i * 2.0 * M_PI / teeth + da * 4, &s[4], &c[4]);
+    static_sincos(i * 2.0 * G_PI / teeth + da * 0, &s[0], &c[0]);
+    static_sincos(i * 2.0 * M_PI / teeth + da * 1, &s[1], &c[1]);
+    static_sincos(i * 2.0 * M_PI / teeth + da * 2, &s[2], &c[2]);
+    static_sincos(i * 2.0 * M_PI / teeth + da * 3, &s[3], &c[3]);
+    static_sincos(i * 2.0 * M_PI / teeth + da * 4, &s[4], &c[4]);
 
     GEAR_POINT(p[0], r2, 1);
     GEAR_POINT(p[1], r2, 2);
@@ -519,7 +517,7 @@ void perspective(GLfloat *m, GLfloat fov
    identity(tmp);
 
    deltaZ = zFar - zNear;
-   sincos(radians, &sine, &cosine);
+   static_sincos(radians, &sine, &cosine);
 
    if ((deltaZ == 0) || (sine == 0) || (aspect == 0))
       return;