Replace #ifdef with #if defined() and #elif with #elif defined() as it
should only test if it is defined or not.
/* See LICENSE file for copyright and license details. */
#include <err.h>
#include <stdio.h>
/* See LICENSE file for copyright and license details. */
#include <err.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
#include <limits.h>
#include <string.h>
+#elif defined(__OpenBSD__)
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
const char *
battery_perc(const char *bat)
{
const char *
battery_perc(const char *bat)
{
int perc;
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s%s%s", "/sys/class/power_supply/", bat, "/capacity");
return (pscanf(path, "%i", &perc) == 1) ?
bprintf("%d", perc) : NULL;
int perc;
char path[PATH_MAX];
snprintf(path, sizeof(path), "%s%s%s", "/sys/class/power_supply/", bat, "/capacity");
return (pscanf(path, "%i", &perc) == 1) ?
bprintf("%d", perc) : NULL;
+#elif defined(__OpenBSD__)
struct apm_power_info apm_info;
int fd;
struct apm_power_info apm_info;
int fd;
const char *
battery_power(const char *bat)
{
const char *
battery_power(const char *bat)
{
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include "../util.h"
#include <stdio.h>
#include "../util.h"
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
#include <err.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <err.h>
#include <ifaddrs.h>
#include <netdb.h>
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include "../util.h"
#include <stdio.h>
#include "../util.h"
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
#include <err.h>
#include <stdio.h>
#include <string.h>
#include <err.h>
#include <stdio.h>
#include <string.h>
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include "../util.h"
#include <stdio.h>
#include "../util.h"
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
+#elif defined(__OpenBSD__)
#include <sys/sysctl.h>
#include <sys/time.h>
#endif
#include <sys/sysctl.h>
#include <sys/time.h>
#endif
int h;
int m;
int uptime = 0;
int h;
int m;
int uptime = 0;
struct sysinfo info;
sysinfo(&info);
uptime = info.uptime;
struct sysinfo info;
sysinfo(&info);
uptime = info.uptime;
+#elif defined(__OpenBSD__)
int mib[2];
size_t size;
time_t now;
int mib[2];
size_t size;
time_t now;
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
#include <err.h>
#include <fcntl.h>
#include <sys/soundcard.h>
#include <err.h>
#include <fcntl.h>
#include <sys/soundcard.h>
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
#include <err.h>
#include <ifaddrs.h>
#include <linux/wireless.h>
#include <err.h>
#include <ifaddrs.h>
#include <linux/wireless.h>