Skip to content

Commit dd4e3d8

Browse files
authored
Merge pull request #420 from maxmind/greg/fix-bswap-macos-collision
Rename bswap32/bswap64 to mmdb_bswap32/mmdb_bswap64
2 parents a291335 + f2d236a commit dd4e3d8

4 files changed

Lines changed: 12 additions & 6 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.9...3.30)
22

33
project(maxminddb
44
LANGUAGES C
5-
VERSION 1.13.1
5+
VERSION 1.13.2
66
)
77
set(MAXMINDDB_SOVERSION 0.0.7)
88
set(CMAKE_C_STANDARD 99)

Changes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.13.2 - 2026-02-25
2+
3+
- Fixed a compilation failure on macOS 26 (Tahoe) where `sys/endian.h` defines
4+
`bswap32` and `bswap64` as macros, conflicting with our function declarations.
5+
Reported by Anton Melnikov. GitHub #419.
6+
17
## 1.13.1 - 2026-02-24
28

39
- Re-release for Ubuntu PPA. No code changes.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Process this file with autoconf to produce a configure script.
33

44
AC_PREREQ([2.63])
5-
AC_INIT([libmaxminddb], [1.13.1], [support@maxmind.com])
5+
AC_INIT([libmaxminddb], [1.13.2], [support@maxmind.com])
66
AC_CONFIG_SRCDIR([include/maxminddb.h])
77
AC_CONFIG_HEADERS([config.h include/maxminddb_config.h])
88

src/maxminddb.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ static int get_entry_data_list(const MMDB_s *const mmdb,
18041804
#define __has_builtin(x) 0
18051805
#endif
18061806

1807-
static inline uint32_t bswap32(uint32_t x) {
1807+
static inline uint32_t mmdb_bswap32(uint32_t x) {
18081808
#if defined(_MSC_VER)
18091809
return _byteswap_ulong(x);
18101810
#elif __has_builtin(__builtin_bswap32)
@@ -1815,7 +1815,7 @@ static inline uint32_t bswap32(uint32_t x) {
18151815
#endif
18161816
}
18171817

1818-
static inline uint64_t bswap64(uint64_t x) {
1818+
static inline uint64_t mmdb_bswap64(uint64_t x) {
18191819
#if defined(_MSC_VER)
18201820
return _byteswap_uint64(x);
18211821
#elif __has_builtin(__builtin_bswap64)
@@ -1837,7 +1837,7 @@ static float get_ieee754_float(const uint8_t *restrict p) {
18371837
memcpy(&i, p, sizeof(uint32_t));
18381838

18391839
#if MMDB_LITTLE_ENDIAN
1840-
i = bswap32(i);
1840+
i = mmdb_bswap32(i);
18411841
#endif
18421842

18431843
memcpy(&f, &i, sizeof(float));
@@ -1852,7 +1852,7 @@ static double get_ieee754_double(const uint8_t *restrict p) {
18521852
memcpy(&i, p, sizeof(uint64_t));
18531853

18541854
#if MMDB_LITTLE_ENDIAN
1855-
i = bswap64(i);
1855+
i = mmdb_bswap64(i);
18561856
#endif
18571857

18581858
memcpy(&d, &i, sizeof(double));

0 commit comments

Comments
 (0)