summaryrefslogtreecommitdiff
path: root/graphics/sane-backends/patches/patch-m4_byteorder.m4
blob: 1b9b3d8de351214ad0858419b0a09391f6ab798f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$NetBSD: patch-m4_byteorder.m4,v 1.2 2022/01/04 16:04:40 triaxx Exp $

Add SunOS byteorder needs.

--- m4/byteorder.m4.orig	2013-02-23 02:00:56.000000000 +0000
+++ m4/byteorder.m4
@@ -110,6 +110,20 @@ dnl Linux GLIBC
 EOF],
 
    [
+dnl SunOS
+  	AC_HAVE_SYMBOL(BSWAP_32,sys/byteorder.h,
+dnl sys/byteorder.h should already be implicitly included
+  	 [cat >> "$1" << EOF
+/* Define generic byte swapping functions */
+EOF
+cat >> "$1" << EOF
+#define swap16(x) BSWAP_16(x)
+#define swap32(x) BSWAP_32(x)
+#define swap64(x) BSWAP_64(x)
+
+EOF],
+
+   [
 dnl NetBSD
   	AC_HAVE_SYMBOL(bswap32,machine/endian.h,
     dnl We're already including machine/endian.h if this test succeeds
@@ -194,6 +208,7 @@ EOF
 EOF
 	fi
 ])
+])
   	  ])
     ])
   ])