8#ifndef INCLUDED_BSLS_PLATFORMUTIL
9#define INCLUDED_BSLS_PLATFORMUTIL
152#ifdef BDE_OPENSOURCE_PUBLICATION
153#error "bsls_platformutil is deprecated"
203#ifndef BDE_OMIT_INTERNAL_DEPRECATED
249#if defined(BSLS_PLATFORM_CPU_X86_64)
252 #define BSLS_PLATFORMUTIL_IS_LITTLE_ENDIAN BSLS_PLATFORM_IS_LITTLE_ENDIAN
255#if defined(BSLS_PLATFORM_CPU_X86)
258 #define BSLS_PLATFORMUTIL_IS_LITTLE_ENDIAN \
259 BSLS_PLATFORM_IS_LITTLE_ENDIAN
262#if defined(BSLS_PLATFORM_CPU_ARM)
265 #define BSLS_PLATFORMUTIL_IS_LITTLE_ENDIAN \
266 BSLS_PLATFORM_IS_LITTLE_ENDIAN
269#if !defined(BSLS_PLATFORMUTIL_IS_LITTLE_ENDIAN)
272 #define BSLS_PLATFORMUTIL_IS_BIG_ENDIAN BSLS_PLATFORM_IS_BIG_ENDIAN
275#ifndef BDE_OMIT_INTERNAL_DEPRECATED
277#if defined(BSLS_PLATFORMUTIL_IS_BIG_ENDIAN)
278#define BSLS_PLATFORMUTIL_HTONL(x) (x)
279#define BSLS_PLATFORMUTIL_HTONS(x) (x)
280#define BSLS_PLATFORMUTIL_NTOHL(x) (x)
281#define BSLS_PLATFORMUTIL_NTOHS(x) (x)
287#if (defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VER_MAJOR >= 40300) \
288 || defined(BSLS_PLATFORM_CMP_CLANG)
289#define BSLS_PLATFORMUTIL_NTOHL(x) (unsigned) __builtin_bswap32(x)
291#define BSLS_PLATFORMUTIL_NTOHL(x) \
292 ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
293 (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
295#define BSLS_PLATFORMUTIL_HTONL(x) BSLS_PLATFORMUTIL_NTOHL(x)
296#define BSLS_PLATFORMUTIL_NTOHS(x) \
297 ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
298#define BSLS_PLATFORMUTIL_HTONS(x) BSLS_PLATFORMUTIL_NTOHS(x)
317#if defined(BSLS_PLATFORM_IS_LITTLE_ENDIAN)
318 return BSLS_PLATFORM_IS_LITTLE_ENDIAN;
327#if defined(BSLS_PLATFORM_IS_BIG_ENDIAN)
328 return BSLS_PLATFORM_IS_BIG_ENDIAN;
338 return ((size + BSLS_MAX_ALIGN - 1) / BSLS_MAX_ALIGN) * BSLS_MAX_ALIGN;
343#ifndef BDE_OPENSOURCE_PUBLICATION
354#if !defined(BSL_DOUBLE_UNDERSCORE_XLAT) || 1 == BSL_DOUBLE_UNDERSCORE_XLAT
356#ifdef BSLS_PLATFORMUTIL_IS_BIG_ENDIAN
357# define BSLS_PLATFORMUTIL__IS_BIG_ENDIAN BSLS_PLATFORMUTIL_IS_BIG_ENDIAN
359#ifdef BSLS_PLATFORMUTIL_IS_LITTLE_ENDIAN
360# define BSLS_PLATFORMUTIL__IS_LITTLE_ENDIAN BSLS_PLATFORMUTIL_IS_LITTLE_ENDIAN
362#define BSLS_PLATFORMUTIL__HTONL(x) BSLS_PLATFORMUTIL_HTONL(x)
363#define BSLS_PLATFORMUTIL__HTONS(x) BSLS_PLATFORMUTIL_HTONS(x)
364#define BSLS_PLATFORMUTIL__NTOHL(x) BSLS_PLATFORMUTIL_NTOHL(x)
365#define BSLS_PLATFORMUTIL__NTOHS(x) BSLS_PLATFORMUTIL_NTOHS(x)
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691
AlignmentToType< BSLS_MAX_ALIGNMENT >::Type MaxAlignedType
Definition bsls_alignmentutil.h:282
@ BSLS_MAX_ALIGNMENT
Definition bsls_alignmentutil.h:275
std::size_t UintPtr
Definition bsls_types.h:126
std::size_t size_type
Definition bsls_types.h:124
unsigned long long Uint64
Definition bsls_types.h:137
std::ptrdiff_t IntPtr
Definition bsls_types.h:130
long long Int64
Definition bsls_types.h:132