From: Ludwig Nussel <ludwig.nus...@suse.de>

libapm and apm.h are not necessarily available on Linux either so make it work
without.
---
 wmbattery/apm.h       |  2 +-
 wmbattery/wmbattery.c | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/wmbattery/apm.h b/wmbattery/apm.h
index 381b7f7..fc2428e 100644
--- a/wmbattery/apm.h
+++ b/wmbattery/apm.h
@@ -37,7 +37,7 @@
 #define BATTERY_TIME_UNKNOWN        (-1)
 #endif /* AC_LINE_STATUS_ON */
 
-#if defined (HAVE_MACHINE_APM_BIOS_H) || defined (HAVE_I386_APMVAR_H) /* BSD */
+#if !defined(HAVE_APM_H)
 typedef struct {
        const char driver_version[10];
        int apm_version_major;
diff --git a/wmbattery/wmbattery.c b/wmbattery/wmbattery.c
index 8f9cbb5..1d45d65 100644
--- a/wmbattery/wmbattery.c
+++ b/wmbattery/wmbattery.c
@@ -148,6 +148,16 @@ int apm_exists(void)
        return apm_read(&i);
 }
 #endif
+#if !defined(HAVE_APM_H)
+int apm_read(apm_info *i)
+{
+       return -1;
+}
+int apm_exists(void)
+{
+       return -1;
+}
+#endif
 
 int apm_change(apm_info *cur)
 {
-- 
2.1.0


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to