8#ifndef INCLUDED_BSLS_BYTEORDERUTIL
9#define INCLUDED_BSLS_BYTEORDERUTIL
101#include <bsls_byteorderutil_impl.h>
121 static unsigned char swapBytes(
unsigned char x);
122 static signed char swapBytes(
signed char x);
123#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY
128 static unsigned short swapBytes(
unsigned short x);
129#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
136 static unsigned int swapBytes(
unsigned int x);
138 static unsigned long swapBytes(
unsigned long x);
144 static unsigned short swapBytes16(
unsigned short x);
192#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY
218#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16)
219 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16(
short, x);
220#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16)
221 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16(
short, &x);
233#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16)
234 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16(
unsigned short, x);
235#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16)
236 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16(
unsigned short, &x);
242#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
249#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16)
250 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16(
char16_t, x);
251#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16)
252 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16(
char16_t, &x);
264#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32)
265 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32(
char32_t, x);
266#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32)
267 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32(
char32_t, &x);
280#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32)
281 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32(
int, x);
282#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32)
283 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32(
int, &x);
295#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32)
296 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32(
unsigned int, x);
297#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32)
298 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32(
unsigned int, &x);
333#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_64)
335#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P64)
336# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
337# pragma GCC diagnostic push
338# pragma GCC diagnostic ignored "-Wstrict-aliasing"
343# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
344# pragma GCC diagnostic pop
357#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_64)
359#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P64)
360# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
361# pragma GCC diagnostic push
362# pragma GCC diagnostic ignored "-Wstrict-aliasing"
367# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
368# pragma GCC diagnostic pop
381#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16)
382 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16(
unsigned short, x);
383#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16)
384 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16(
unsigned short, &x);
396#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32)
397 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32(
unsigned int, x);
398#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32)
399 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32(
unsigned int, &x);
411#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_64)
413#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P64)
414# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
415# pragma GCC diagnostic push
416# pragma GCC diagnostic ignored "-Wstrict-aliasing"
421# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
422# pragma GCC diagnostic pop
#define BSLS_BYTEORDERUTIL_IMPL_GENERICSWAP_32(dstType, x)
Definition bsls_byteorderutil_impl.h:537
#define BSLS_BYTEORDERUTIL_IMPL_GENERICSWAP_16(dstType, x)
Definition bsls_byteorderutil_impl.h:528
#define BSLS_BYTEORDERUTIL_IMPL_GENERICSWAP_64(dstType, x)
Definition bsls_byteorderutil_impl.h:548
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlt_iso8601util.h:707
Definition bsls_byteorderutil_impl.h:91
Definition bsls_byteorderutil.h:116
static Types::Uint64 swapBytes64(Types::Uint64 x)
Definition bsls_byteorderutil.h:407
static unsigned int swapBytes32(unsigned int x)
Definition bsls_byteorderutil.h:392
static bool swapBytes(bool x)
Definition bsls_byteorderutil.h:166
static unsigned short swapBytes16(unsigned short x)
Definition bsls_byteorderutil.h:377
unsigned long long Uint64
Definition bsls_types.h:139
long long Int64
Definition bsls_types.h:134