Add bswap64()
This commit is contained in:
@@ -272,6 +272,14 @@ AC_FIND_FUNC_NO_LIBS(bswap32,,
|
|||||||
#include <sys/bswap.h>
|
#include <sys/bswap.h>
|
||||||
#endif],0)
|
#endif],0)
|
||||||
|
|
||||||
|
AC_FIND_FUNC_NO_LIBS(bswap64,,
|
||||||
|
[#ifdef HAVE_SYS_TYPES_H
|
||||||
|
#include <sys/types.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_BSWAP_H
|
||||||
|
#include <sys/bswap.h>
|
||||||
|
#endif],0)
|
||||||
|
|
||||||
AC_FIND_FUNC_NO_LIBS(pidfile,util,
|
AC_FIND_FUNC_NO_LIBS(pidfile,util,
|
||||||
[#ifdef HAVE_UTIL_H
|
[#ifdef HAVE_UTIL_H
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
|
@@ -34,6 +34,23 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include "roken.h"
|
#include "roken.h"
|
||||||
|
|
||||||
|
#ifndef HAVE_BSWAP64
|
||||||
|
|
||||||
|
ROKEN_LIB_FUNCTION uint64_t ROKEN_LIB_CALL
|
||||||
|
bswap64 (uint64_t val)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(val & 0xffULL) << 56 |
|
||||||
|
(val & 0xff00ULL) << 40 |
|
||||||
|
(val & 0xff0000ULL) << 24 |
|
||||||
|
(val & 0xff000000ULL) << 8 |
|
||||||
|
(val & 0xff00000000ULL) >> 8 |
|
||||||
|
(val & 0xff0000000000ULL) >> 24 |
|
||||||
|
(val & 0xff000000000000ULL) >> 40 |
|
||||||
|
(val & 0xff00000000000000ULL) >> 56 ;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_BSWAP32
|
#ifndef HAVE_BSWAP32
|
||||||
|
|
||||||
ROKEN_LIB_FUNCTION unsigned int ROKEN_LIB_CALL
|
ROKEN_LIB_FUNCTION unsigned int ROKEN_LIB_CALL
|
||||||
|
@@ -765,6 +765,11 @@ ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL pidfile (const char*);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_BSWAP64
|
||||||
|
#define bswap64 rk_bswap64
|
||||||
|
ROKEN_LIB_FUNCTION uint64_t ROKEN_LIB_CALL bswap64(uint64_t);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_BSWAP32
|
#ifndef HAVE_BSWAP32
|
||||||
#define bswap32 rk_bswap32
|
#define bswap32 rk_bswap32
|
||||||
ROKEN_LIB_FUNCTION unsigned int ROKEN_LIB_CALL bswap32(unsigned int);
|
ROKEN_LIB_FUNCTION unsigned int ROKEN_LIB_CALL bswap32(unsigned int);
|
||||||
|
@@ -38,6 +38,7 @@ HEIMDAL_ROKEN_1.0 {
|
|||||||
rk_base64_encode;
|
rk_base64_encode;
|
||||||
rk_bswap16;
|
rk_bswap16;
|
||||||
rk_bswap32;
|
rk_bswap32;
|
||||||
|
rk_bswap64;
|
||||||
rk_cgetent;
|
rk_cgetent;
|
||||||
rk_cgetstr;
|
rk_cgetstr;
|
||||||
rk_cloexec;
|
rk_cloexec;
|
||||||
|
Reference in New Issue
Block a user