Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
auto.def: fix detection of endian related functions
Baptiste Daroussin committed 1 year ago
commit e6bd0fb27a4de8c216621108bf81f655bf4da9ac
parent 1ccf0a0
2 files changed +20 -6
modified auto.def
@@ -220,11 +220,14 @@ cc-check-includes link.h machine/endian.h osreldate.h readpassphrase.h \
cc-check-includes dirent.h sys/sockio.h

#endian stuff
-
foreach header [list endian.h sys/endian.h machine/endian.h] {
-
	if {[cc-check-includes $header]} {
-
		cc-with [list -includes $header] {
-
			cc-check-decls be16dec be16enc be32dec be32enc be64dec be64enc \
-
				le16dec le16enc le32dec le32enc le64dec le64enc
+
foreach fct [list be16dec be16enc be32dec be32enc be64dec be64enc le16dec le16enc le32dec le32enc le64dec le64enc] {
+
	foreach header [list endian.h sys/endian.h machine/endian.h] {
+
		if {[cc-check-includes $header]} {
+
			cc-with [list -includes $header] {
+
				if {[cc-check-decls $fct]} {
+
					break
+
				}
+
			}
		}
	}
}
modified libpkg/binfmt_macho.c
@@ -23,7 +23,17 @@
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

-
#include <endian_util.h>
+
#ifdef HAVE_CONFIG_H
+
#include "pkg_config.h"
+
#endif
+

+
#ifdef HAVE_SYS_ENDIAN_H
+
#include <sys/endian.h>
+
#elif HAVE_ENDIAN_H
+
#include <endian.h>
+
#elif HAVE_MACHINE_ENDIAN_H
+
#include <machine/endian.h>
+
#endif
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -31,6 +41,7 @@
#include <string.h>
#include <unistd.h>

+
#include <bsd_compat.h>
#include "private/binfmt_macho.h"

/**