mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-13 07:34:50 +00:00
o Further improve detection of FreeBSD optimized byteswap routines
o No PORTREVISION bump
This commit is contained in:
parent
0855a80d01
commit
8f24b0985f
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=69837
@ -1,21 +1,26 @@
|
||||
--- include/ogle_endian.h.orig Thu Oct 10 12:20:03 2002
|
||||
+++ include/ogle_endian.h Thu Oct 10 12:21:47 2002
|
||||
@@ -39,6 +39,18 @@
|
||||
#elif defined(HAVE_SYS_ENDIAN_H) && !defined(__FreeBSD__)
|
||||
--- include/ogle_endian.h.orig Thu Oct 4 00:41:49 2001
|
||||
+++ include/ogle_endian.h Sun Nov 10 17:12:23 2002
|
||||
@@ -29,6 +29,9 @@
|
||||
# define FROM_BE_32(x) (x)
|
||||
#else
|
||||
|
||||
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
|
||||
+#include <sys/param.h>
|
||||
+#endif
|
||||
|
||||
#if defined(HAVE_BYTESWAP_H)
|
||||
# include <byteswap.h>
|
||||
@@ -39,6 +42,13 @@
|
||||
#elif defined(HAVE_SYS_ENDIAN_H)
|
||||
# include <sys/endian.h>
|
||||
# define FROM_BE_32(x) (swap32(x))
|
||||
+#elif defined(__FreeBSD__)
|
||||
+# if defined(HAVE_SYS_ENDIAN_H) && __FreeBSD_version >= 500000
|
||||
+# include <sys/endian.h>
|
||||
+# define FROM_BE_32(x) (bswap32(x))
|
||||
+# else
|
||||
+# define _KERNEL
|
||||
+# define I486_CPU /* Will crash unless 486+ */
|
||||
+# include <machine/endian.h>
|
||||
+# undef _KERNEL
|
||||
+# undef I486_CPU
|
||||
+# define FROM_BE_32(x) (ntohl(x))
|
||||
+# endif
|
||||
#else
|
||||
# warning "No accelerated byte swap found. Using slow c version."
|
||||
# include <inttypes.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- include/ogle_endian.h.orig Thu Oct 4 00:41:49 2001
|
||||
+++ include/ogle_endian.h Thu Oct 10 12:08:36 2002
|
||||
@@ -36,7 +36,7 @@
|
||||
--- include/ogle_endian.h.orig Sun Nov 10 17:13:10 2002
|
||||
+++ include/ogle_endian.h Sun Nov 10 17:13:29 2002
|
||||
@@ -36,6 +36,9 @@
|
||||
#elif defined(HAVE_SYS_BSWAP_H)
|
||||
# include <sys/bswap.h>
|
||||
# define FROM_BE_32(x) (bswap32(x))
|
||||
@ -8,4 +8,6 @@
|
||||
+#elif defined(HAVE_SYS_ENDIAN_H) && !defined(__FreeBSD__)
|
||||
# include <sys/endian.h>
|
||||
# define FROM_BE_32(x) (swap32(x))
|
||||
#else
|
||||
+#elif defined(HAVE_SYS_ENDIAN_H) && defined(__FreeBSD__) && __FreeBSD_version >= 470000
|
||||
+# include <sys/endian.h>
|
||||
+# define FROM_BE_32(x) (be32toh(x))
|
||||
|
@ -1,21 +1,26 @@
|
||||
--- include/ogle_endian.h.orig Thu Oct 10 12:20:03 2002
|
||||
+++ include/ogle_endian.h Thu Oct 10 12:21:47 2002
|
||||
@@ -39,6 +39,18 @@
|
||||
#elif defined(HAVE_SYS_ENDIAN_H) && !defined(__FreeBSD__)
|
||||
--- include/ogle_endian.h.orig Thu Oct 4 00:41:49 2001
|
||||
+++ include/ogle_endian.h Sun Nov 10 17:12:23 2002
|
||||
@@ -29,6 +29,9 @@
|
||||
# define FROM_BE_32(x) (x)
|
||||
#else
|
||||
|
||||
+#if (defined(__unix__) || defined(unix)) && !defined(USG)
|
||||
+#include <sys/param.h>
|
||||
+#endif
|
||||
|
||||
#if defined(HAVE_BYTESWAP_H)
|
||||
# include <byteswap.h>
|
||||
@@ -39,6 +42,13 @@
|
||||
#elif defined(HAVE_SYS_ENDIAN_H)
|
||||
# include <sys/endian.h>
|
||||
# define FROM_BE_32(x) (swap32(x))
|
||||
+#elif defined(__FreeBSD__)
|
||||
+# if defined(HAVE_SYS_ENDIAN_H) && __FreeBSD_version >= 500000
|
||||
+# include <sys/endian.h>
|
||||
+# define FROM_BE_32(x) (bswap32(x))
|
||||
+# else
|
||||
+# define _KERNEL
|
||||
+# define I486_CPU /* Will crash unless 486+ */
|
||||
+# include <machine/endian.h>
|
||||
+# undef _KERNEL
|
||||
+# undef I486_CPU
|
||||
+# define FROM_BE_32(x) (ntohl(x))
|
||||
+# endif
|
||||
#else
|
||||
# warning "No accelerated byte swap found. Using slow c version."
|
||||
# include <inttypes.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- include/ogle_endian.h.orig Thu Oct 4 00:41:49 2001
|
||||
+++ include/ogle_endian.h Thu Oct 10 12:08:36 2002
|
||||
@@ -36,7 +36,7 @@
|
||||
--- include/ogle_endian.h.orig Sun Nov 10 17:13:10 2002
|
||||
+++ include/ogle_endian.h Sun Nov 10 17:13:29 2002
|
||||
@@ -36,6 +36,9 @@
|
||||
#elif defined(HAVE_SYS_BSWAP_H)
|
||||
# include <sys/bswap.h>
|
||||
# define FROM_BE_32(x) (bswap32(x))
|
||||
@ -8,4 +8,6 @@
|
||||
+#elif defined(HAVE_SYS_ENDIAN_H) && !defined(__FreeBSD__)
|
||||
# include <sys/endian.h>
|
||||
# define FROM_BE_32(x) (swap32(x))
|
||||
#else
|
||||
+#elif defined(HAVE_SYS_ENDIAN_H) && defined(__FreeBSD__) && __FreeBSD_version >= 470000
|
||||
+# include <sys/endian.h>
|
||||
+# define FROM_BE_32(x) (be32toh(x))
|
||||
|
Loading…
Reference in New Issue
Block a user