Print this page
5007142 Add ntohll and htonll to sys/byteorder.h
6717509 Need to use bswap/bswapq for byte swap of 64-bit integer on x32/x64
PSARC 2008/474
*** 18,28 ****
*
* CDDL HEADER END
*/
/*
! * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
--- 18,28 ----
*
* CDDL HEADER END
*/
/*
! * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
*** 38,49 ****
*/
#ifndef _SYS_BYTEORDER_H
#define _SYS_BYTEORDER_H
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/isa_defs.h>
#include <sys/int_types.h>
#if defined(__GNUC__) && defined(_ASM_INLINES) && \
(defined(__i386) || defined(__amd64))
--- 38,47 ----
*** 59,70 ****
--- 57,70 ----
*/
#if defined(_BIG_ENDIAN) && !defined(ntohl) && !defined(__lint)
/* big-endian */
#define ntohl(x) (x)
+ #define ntohll(x) (x)
#define ntohs(x) (x)
#define htonl(x) (x)
+ #define htonll(x) (x)
#define htons(x) (x)
#elif !defined(ntohl) /* little-endian */
#ifndef _IN_PORT_T
*** 86,95 ****
--- 86,99 ----
extern in_addr_t htonl(in_addr_t);
extern in_port_t htons(in_port_t);
extern in_addr_t ntohl(in_addr_t);
extern in_port_t ntohs(in_port_t);
#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) || defined(_XPG5) */
+ #if !(defined(_XPG4_2) || defined(_XPG5)) || defined(__EXTENSIONS__)
+ extern uint64_t htonll(uint64_t);
+ extern uint64_t ntohll(uint64_t);
+ #endif /* !(_XPG4_2||_XPG5) || __EXTENSIONS__ */
#endif
#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
/*