diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-10-21 14:57:00 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-10-21 14:57:00 +0300 |
commit | 489ef007bec398c3b7b628325b225c3a015922cf (patch) | |
tree | 7d1d5b1ea2c55d608f8697377776b9777fa622be /storage/innobase/include/mach0data.h | |
parent | d10c42b42541deed899dd1d1e04b69475339196c (diff) | |
parent | d5bcccdabbf1a23c75ab4ee0c14149eb6ed27d98 (diff) | |
download | mariadb-git-489ef007bec398c3b7b628325b225c3a015922cf.tar.gz |
Merge 10.3 into 10.4
Diffstat (limited to 'storage/innobase/include/mach0data.h')
-rw-r--r-- | storage/innobase/include/mach0data.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/storage/innobase/include/mach0data.h b/storage/innobase/include/mach0data.h index 3d0e48253eb..7b776759a67 100644 --- a/storage/innobase/include/mach0data.h +++ b/storage/innobase/include/mach0data.h @@ -315,6 +315,28 @@ mach_read_from_n_little_endian( const byte* buf, /*!< in: from where to read */ ulint buf_size) /*!< in: from how many bytes to read */ MY_ATTRIBUTE((warn_unused_result)); + + +/** Reads a 64 bit stored in big endian format +@param buf From where to read +@return uint64_t */ +UNIV_INLINE +uint64_t +mach_read_uint64_little_endian(const byte* buf) +{ +#ifdef WORDS_BIGENDIAN + return + uint64_t(buf[0]) | uint64_t(buf[1]) << 8 | + uint64_t(buf[2]) << 16 | uint64_t(buf[3]) << 24 | + uint64_t(buf[4]) << 32 | uint64_t(buf[5]) << 40 | + uint64_t(buf[6]) << 48 | uint64_t(buf[7]) << 56; +#else + uint64_t n; + memcpy(&n, buf, sizeof(uint64_t)); + return n; +#endif +} + /*********************************************************//** Writes a ulint in the little-endian format. */ UNIV_INLINE |