Commit c3f4f901 authored by Tollef Fog Heen's avatar Tollef Fog Heen

Merge r3439: Endianness optimisation

Try to get the endianess optimization working, by including an assortment
of possibly relevant headers and only go with the fast path if we have
credible information that this is a big-endian platform.



git-svn-id: http://www.varnish-cache.org/svn/branches/2.0@3639 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent afde7c10
......@@ -70,11 +70,13 @@ AC_SUBST(LIBM)
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_HEADER_TIME
AC_CHECK_HEADERS([sys/endian.h])
AC_CHECK_HEADERS([sys/filio.h])
AC_CHECK_HEADERS([sys/mount.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([sys/statvfs.h])
AC_CHECK_HEADERS([sys/vfs.h])
AC_CHECK_HEADERS([endian.h])
AC_CHECK_HEADERS([netinet/in.h])
AC_CHECK_HEADERS([pthread_np.h])
AC_CHECK_HEADERS([stddef.h])
......
......@@ -26,10 +26,22 @@
* From: $FreeBSD: head/lib/libmd/sha256c.c 154479 2006-01-17 15:35:57Z phk $
*/
#include <stdint.h>
#include "config.h"
#include <stdint.h>
#include <string.h>
#ifdef HAVE_ENDIAN_H
#include <endian.h>
#define BYTE_ORDER __BYTE_ORDER
#define BIG_ENDIAN __BIG_ENDIAN
#endif
#ifdef HAVE_SYS_ENDIAN_H
#include <sys/endian.h>
#define BYTE_ORDER _BYTE_ORDER
#define BIG_ENDIAN _BIG_ENDIAN
#endif
#include "vsha256.h"
#if defined(BYTE_ORDER) && BYTE_ORDER == BIG_ENDIAN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment