openbsd-ports/x11/icewm/patches/apm-patch-src_aapm_cc
ajacoutot 39737f0c6c - add apm support _only_ for archs supporting it ; no need to bump
PKGNAME as for apm capable archs, nothing changes and for the others, it
didn't build

noticed by sturm@, thanks!

ok sturm@
2006-11-10 09:31:28 +00:00

31 lines
954 B
Plaintext

$OpenBSD: apm-patch-src_aapm_cc,v 1.1 2006/11/10 09:31:28 ajacoutot Exp $
--- src/aapm.cc.orig Tue Oct 24 12:38:18 2006
+++ src/aapm.cc Tue Oct 24 12:39:12 2006
@@ -34,7 +34,7 @@
#include <machine/apm_bios.h>
#endif
-#ifdef __NetBSD__
+#if defined __NetBSD__ || defined __OpenBSD__
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -64,7 +64,7 @@ static YColor *taskBarBg = 0;
void ApmStr(char *s, bool Tool) {
#ifdef __FreeBSD__
struct apm_info ai;
-#elif defined __NetBSD__
+#elif defined __NetBSD__ || defined __OpenBSD__
struct apm_power_info ai;
#else
char buf[80];
@@ -105,7 +105,7 @@ void ApmStr(char *s, bool Tool) {
BATlife = ai.ai_batt_life;
BATtime = ai.ai_batt_time == 0 ? -1 : ai.ai_batt_time;
strcpy(units, "sec");
-#elif defined __NetBSD__
+#elif defined __NetBSD__ || defined __OpenBSD__
memset(&ai, 0, sizeof(ai));
if (ioctl(fd, APM_IOC_GETPOWER, &ai) == -1)
{