diff options
Diffstat (limited to 'src/include/btmem.h')
-rw-r--r-- | src/include/btmem.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/include/btmem.h b/src/include/btmem.h index cfbd87f0cae..ee495c52fc8 100644 --- a/src/include/btmem.h +++ b/src/include/btmem.h @@ -62,6 +62,23 @@ struct __wt_page_header { #define WT_PAGE_HEADER_SIZE 28 /* + * __wt_page_header_byteswap -- + * Handle big- and little-endian transformation of a page header. + */ +static inline void +__wt_page_header_byteswap(WT_PAGE_HEADER *dsk) +{ +#ifdef WORDS_BIGENDIAN + dsk->recno = __wt_bswap64(dsk->recno); + dsk->write_gen = __wt_bswap64(dsk->write_gen); + dsk->mem_size = __wt_bswap32(dsk->mem_size); + dsk->u.entries = __wt_bswap32(dsk->u.entries); +#else + WT_UNUSED(dsk); +#endif +} + +/* * The block-manager specific information immediately follows the WT_PAGE_HEADER * structure. */ |