Good Morning Peter

Thank you changing xscreensaver-6.15/hacks/glx/platonicfolding.c from

static inline void get_sun_direction(double jd, float sun[4])
{
  double n, utc;
  double l, g, gr, lambda, lambdar, epsilon, epsilonr;
  double alpha, delta, eot, lat, lon;
  float latr, lonr;

  n = jd-2451545.0;
  utc = 24.0*modulo(jd-0.5,1.0);
  l = modulo(280.460+0.9856474*n,360.0);
  g = modulo(357.528+0.9856003*n,360.0);
  gr = rad(g);
  lambda = modulo(l+1.915*sin(gr)+0.020*sin(2.0*gr),360.0);
  epsilon = 23.439-0.0000004*n;
  lambdar = rad(lambda);
  epsilonr = rad(epsilon);
  alpha = modulo(deg(atan2(cos(epsilonr)*sin(lambdar),cos(lambdar))),360.0);
  delta = deg(asin(sin(epsilonr)*sin(lambdar)));
  eot = modulo(l-alpha+180.0,360.0)-180.0;
  lat = delta;
  lon = -15.0*(utc-12.0+eot*(4.0/60.0));
  latr = (float)rad(lat);
  lonr = (float)rad(lon);
  sun[0] = cosf(latr)*cosf(lonr);
  sun[1] = cosf(latr)*sinf(lonr);
  sun[2] = sinf(latr);
  sun[3] = 0.0f;
}

to

static inline void get_sun_direction(double jd, float thesun[4])
{
  double n, utc;
  double l, g, gr, lambda, lambdar, epsilon, epsilonr;
  double alpha, delta, eot, lat, lon;
  float latr, lonr;

  n = jd-2451545.0;
  utc = 24.0*modulo(jd-0.5,1.0);
  l = modulo(280.460+0.9856474*n,360.0);
  g = modulo(357.528+0.9856003*n,360.0);
  gr = rad(g);
  lambda = modulo(l+1.915*sin(gr)+0.020*sin(2.0*gr),360.0);
  epsilon = 23.439-0.0000004*n;
  lambdar = rad(lambda);
  epsilonr = rad(epsilon);
  alpha = modulo(deg(atan2(cos(epsilonr)*sin(lambdar),cos(lambdar))),360.0);
  delta = deg(asin(sin(epsilonr)*sin(lambdar)));
  eot = modulo(l-alpha+180.0,360.0)-180.0;
  lat = delta;
  lon = -15.0*(utc-12.0+eot*(4.0/60.0));
  latr = (float)rad(lat);
  lonr = (float)rad(lon);
  thesun[0] = cosf(latr)*cosf(lonr);
  thesun[1] = cosf(latr)*sinf(lonr);
  thesun[2] = sinf(latr);
  thesun[3] = 0.0f;
}

Allowed the GL screensavers to be built, however they crashed on execution changing the xscreensaver ./configure options to use --with-glx fixed the GL screensavers, apparently this was something also experienced by a BSD build which was corrected with the --with-glx so I decided to give it a try.

./configure --prefix=/opt/xscreensaver --with-glx

Kind Regards

Russell

On 2026-07-11 10:46, Peter Tribble wrote:
On Sat, Jul 11, 2026 at 10:37 AM russell via openindiana-discuss
<[email protected]> wrote:
Hi

Attempting to build xscreensaver using using gcc 10.4

$ CFLAGS="-Wimplicit-function-declaration -Wnested-externs" ./configure
--prefix=/opt/xscreensaver

Everything is fine until

...
platonicfolding.c:937:55: error: expected ';', ',' or ')' before numeric
constant
    937 | static inline void get_sun_direction(double jd, float sun[4])
        |  ^~~
The word "sun" is a predefined constant on Solaris and illumos, so
using it as a variable
name ends in disaster. Simply replace the "sun" there with any other
word (say, "xsun")
and the same replacement where the variable is used in the function,
and all will be well.

_______________________________________________
openindiana-discuss mailing list
[email protected]
https://openindiana.org/mailman/listinfo/openindiana-discuss

Reply via email to