--- src/bson/bson-config.h.orig 2023-01-07 06:38:44.000000000 +0800 +++ src/bson/bson-config.h 2023-07-15 07:44:47.000000000 +0800 @@ -8,31 +8,35 @@ #define BSON_HAVE_ATOMIC_64_ADD_AND_FETCH 0 /* sparc is big endian */ #include -#ifdef _BIG_ENDIAN +#define BSON_BYTE_ORDER 4321 +#elif defined(__APPLE__) && defined(__POWERPC__) +#define BSON_BYTE_ORDER 4321 +#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) #define BSON_BYTE_ORDER 4321 #else #define BSON_BYTE_ORDER 1234 #endif -#else -/* for everyone else */ -#define BSON_BYTE_ORDER 1234 + #define BSON_HAVE_STRNLEN 1 #define BSON_HAVE_ATOMIC_32_ADD_AND_FETCH 1 #define BSON_HAVE_ATOMIC_64_ADD_AND_FETCH 1 #if !defined (__FreeBSD__) && !defined (__OpenBSD__) #define BSON_HAVE_SYSCALL_TID 1 #endif -#endif /* Fix for snow leopard */ #ifdef __APPLE__ #define BSON_HAVE_REALLOCF 1 #define BSON_HAVE_STRLCPY 1 -#include +#include #ifndef MAC_OS_X_VERSION_10_8 #undef BSON_HAVE_STRNLEN #define BSON_HAVE_STRNLEN 0 #endif +#ifdef __ppc__ +#undef BSON_HAVE_ATOMIC_64_ADD_AND_FETCH +#define BSON_HAVE_ATOMIC_64_ADD_AND_FETCH 0 +#endif #endif /* --- src/Makevars.in.orig 2025-03-18 04:23:25.000000000 +0800 +++ src/Makevars.in 2025-03-18 16:23:26.000000000 +0800 @@ -40,7 +40,7 @@ mongoc/mongoc-cluster-aws.o mongoc/mongoc-generation-map.o mongoc/mongoc-timeout.o \ mongoc/mongoc-server-monitor.o mongoc/mongoc-topology-background-monitoring.o common/common-thread.o \ mongoc/mongoc-optional.o mongoc/mongoc-server-api.o mongoc/mongoc-http.o mongoc/mongoc-ocsp-cache.o \ - mongoc/mongoc-shared.o mongoc/mongoc-ts-pool.o utf8proc/utf8proc.o \ + mongoc/mongoc-shared.o mongoc/mongoc-ts-pool.o utf8proc/utf8proc.o common/common-atomic.o \ mongoc/mongoc-structured-log.o mongoc/mongoc-log-and-monitor-private.o common/common-oid.o common/common-json.o common/common-string.o LIBKMS=kms/hexlify.o kms/kms_kv_list.o kms/kms_request.o \