Fix build on macOS

This commit is contained in:
Pierre Pronchery 2021-02-08 01:48:01 +01:00
parent 7148c1862c
commit 193cadd68a
2 changed files with 5 additions and 3 deletions

View File

@ -152,8 +152,10 @@ static CPU * _cpu_init(PanelAppletHelper * helper, GtkWidget ** widget)
FALSE, 0);
}
cpu->timeout = g_timeout_add(timeout, _cpu_on_timeout, cpu);
#if defined(__FreeBSD__) || defined(__NetBSD__)
cpu->used = 0;
cpu->total = 0;
#endif
_cpu_on_timeout(cpu);
pango_font_description_free(desc);
gtk_widget_show_all(cpu->widget);

View File

@ -23,7 +23,7 @@
# include <sys/audioio.h>
#elif defined(__linux__)
# include <alsa/asoundlib.h>
#else
#elif !defined(__APPLE__)
# include <sys/soundcard.h>
#endif
#include <fcntl.h>
@ -348,7 +348,7 @@ static gdouble _volume_get(Volume * volume)
return ret;
ret = value;
ret /= volume->mixer_elem_max;
#else
#elif !defined(__APPLE__)
int value;
if(volume->fd < 0)
@ -417,7 +417,7 @@ int _volume_set(Volume * volume, gdouble value)
if(volume->mixer_elem == NULL)
return 0;
snd_mixer_selem_set_playback_volume_all(volume->mixer_elem, v);
#else
#elif !defined(__APPLE__)
int v = value * 100;
if(volume->fd < 0)