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)
 {