8#ifndef INCLUDED_BSLS_BYTEORDERUTIL
9#define INCLUDED_BSLS_BYTEORDERUTIL
101#include <bsls_byteorderutil_impl.h>
119 static unsigned char swapBytes(
unsigned char x);
120 static signed char swapBytes(
signed char x);
121#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY
126 static unsigned short swapBytes(
unsigned short x);
127#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
132 static unsigned int swapBytes(
unsigned int x);
136 static unsigned long swapBytes(
unsigned long x);
142 static unsigned short swapBytes16(
unsigned short x);
190#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY
216#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16)
217 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16(
short, x);
218#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16)
219 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16(
short, &x);
231#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16)
232 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16(
unsigned short, x);
233#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16)
234 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16(
unsigned short, &x);
240#ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
247#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16)
248 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16(
char16_t, x);
249#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16)
250 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16(
char16_t, &x);
262#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32)
263 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32(
char32_t, x);
264#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32)
265 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32(
char32_t, &x);
278#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32)
279 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32(
int, x);
280#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32)
281 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32(
int, &x);
293#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32)
294 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32(
unsigned int, x);
295#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32)
296 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32(
unsigned int, &x);
331#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_64)
333#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P64)
334# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
335# pragma GCC diagnostic push
336# pragma GCC diagnostic ignored "-Wstrict-aliasing"
341# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
342# pragma GCC diagnostic pop
355#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_64)
357#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P64)
358# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
359# pragma GCC diagnostic push
360# pragma GCC diagnostic ignored "-Wstrict-aliasing"
365# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
366# pragma GCC diagnostic pop
379#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16)
380 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_16(
unsigned short, x);
381#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16)
382 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P16(
unsigned short, &x);
394#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32)
395 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_32(
unsigned int, x);
396#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32)
397 BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P32(
unsigned int, &x);
409#if defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_64)
411#elif defined(BSLS_BYTEORDERUTIL_IMPL_CUSTOMSWAP_P64)
412# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
413# pragma GCC diagnostic push
414# pragma GCC diagnostic ignored "-Wstrict-aliasing"
419# ifdef BSLS_PLATFORM_HAS_PRAGMA_GCC_DIAGNOSTIC
420# 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)
Definition bsls_ident.h:195
Definition bdlt_iso8601util.h:691
Definition bsls_byteorderutil_impl.h:91
Definition bsls_byteorderutil.h:114
static Types::Uint64 swapBytes64(Types::Uint64 x)
Definition bsls_byteorderutil.h:405
static unsigned int swapBytes32(unsigned int x)
Definition bsls_byteorderutil.h:390
static bool swapBytes(bool x)
Definition bsls_byteorderutil.h:164
static unsigned short swapBytes16(unsigned short x)
Definition bsls_byteorderutil.h:375
unsigned long long Uint64
Definition bsls_types.h:137
long long Int64
Definition bsls_types.h:132