From fb4bd742805ad510aa813c322045875e72f05eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otac=C3=ADlio=20de=20Ara=C3=BAjo=20Ramos=20Neto?= Date: Mon, 24 May 2021 08:46:29 +0800 Subject: sysutils/xosview: Fix build for aarch64 and other archs PR: 255922 --- sysutils/xosview/files/patch-bsd_kernel.cc | 50 ++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 sysutils/xosview/files/patch-bsd_kernel.cc (limited to 'sysutils/xosview/files/patch-bsd_kernel.cc') diff --git a/sysutils/xosview/files/patch-bsd_kernel.cc b/sysutils/xosview/files/patch-bsd_kernel.cc new file mode 100644 index 000000000000..4fb5fe787e4f --- /dev/null +++ b/sysutils/xosview/files/patch-bsd_kernel.cc @@ -0,0 +1,50 @@ +--- bsd/kernel.cc.orig 2021-05-16 03:48:22 UTC ++++ bsd/kernel.cc +@@ -48,8 +48,10 @@ static int maxcpus = 1; + #include + #include + #include ++#if defined(__amd64__) || defined(__i386__) + #include + #endif ++#endif + + #if defined(XOSVIEW_NETBSD) + #include +@@ -1558,6 +1560,7 @@ BSDHasBattery() { + #else // XOSVIEW_FREEBSD || XOSVIEW_DFBSD + int fd; + if ( (fd = open(ACPIDEV, O_RDONLY)) == -1 ) { ++ #if defined(__amd64__) || defined(__i386__) + // No ACPI -> try APM + if ( (fd = open(APMDEV, O_RDONLY)) == -1 ) + return false; +@@ -1569,6 +1572,9 @@ BSDHasBattery() { + if (aip.ai_batt_stat == 0xff || aip.ai_batt_life == 0xff) + return false; + return true; ++ #else ++ return false; ++ #endif + } + + union acpi_battery_ioctl_arg battio; +@@ -1717,6 +1723,7 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) + /* Adapted from acpiconf and apm. */ + int fd; + if ( (fd = open(ACPIDEV, O_RDONLY)) == -1 ) { ++ #if defined(__amd64__) || defined(__i386__) + // No ACPI -> try APM + if ( (fd = open(APMDEV, O_RDONLY)) == -1 ) + err(EX_OSFILE, "could not open %s or %s", ACPIDEV, APMDEV); +@@ -1740,6 +1747,10 @@ BSDGetBatteryInfo(int *remaining, unsigned int *state) + else + *state = XOSVIEW_BATT_NONE; + return; ++ #else ++ *state = XOSVIEW_BATT_NONE; ++ return; ++ #endif + } + // ACPI + union acpi_battery_ioctl_arg battio; -- cgit v1.2.3