wmbattery: make it work without libapm

libapm and apm.h are not necessarily available on Linux either so make it work
without.
This commit is contained in:
Ludwig Nussel 2015-01-17 08:41:12 -06:00 committed by Carlos R. Mafra
parent 8345c9ca76
commit bdc9f33956
2 changed files with 11 additions and 1 deletions

View file

@ -37,7 +37,7 @@
#define BATTERY_TIME_UNKNOWN (-1) #define BATTERY_TIME_UNKNOWN (-1)
#endif /* AC_LINE_STATUS_ON */ #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 { typedef struct {
const char driver_version[10]; const char driver_version[10];
int apm_version_major; int apm_version_major;

View file

@ -148,6 +148,16 @@ int apm_exists(void)
return apm_read(&i); return apm_read(&i);
} }
#endif #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) int apm_change(apm_info *cur)
{ {