Skip to content

Commit

Permalink
update mongo-c-driver-1.26.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Apr 24, 2024
1 parent b46343a commit 6d4d1dc
Show file tree
Hide file tree
Showing 250 changed files with 38,734 additions and 6,393 deletions.
9 changes: 5 additions & 4 deletions src/Makevars.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PKG_CPPFLAGS=-I. -Icommon -Ikms \
PKG_CPPFLAGS=-I. -Icommon -Ikms -Iutf8proc \
-D_XOPEN_SOURCE=700 -D_DEFAULT_SOURCE \
-DKMS_MESSAGE_ENABLE_CRYPTO -DKMS_MESSAGE_ENABLE_CRYPTO_LIBCRYPTO \
-DBSON_COMPILATION -DMONGOC_COMPILATION -DOPENSSL_SUPPRESS_DEPRECATED @cflags@

Expand Down Expand Up @@ -29,8 +30,8 @@ LIBMONGOC=mongoc/mongoc-array.o common/common-b64.o mongoc/mongoc-buffer.o \
mongoc/mongoc-stream-tls-openssl.o mongoc/mongoc-stream-tls-openssl-bio.o \
mongoc/mongoc-cluster-sasl.o mongoc/mongoc-cmd.o \
mongoc/mongoc-change-stream.o mongoc/mongoc-client-session.o mongoc/mongoc-cluster-cyrus.o \
mongoc/mongoc-compression.o mongoc/mongoc-cyrus.o mongoc/mongoc-write-command-legacy.o \
mongoc/mongoc-linux-distro-scanner.o mongoc/mongoc-stream-file.o \
mongoc/mongoc-compression.o mongoc/mongoc-cyrus.o \
mongoc/mongoc-linux-distro-scanner.o mongoc/mongoc-stream-file.o mongoc/mcd-rpc.o mongoc/mongoc-deprioritized-servers.o \
mongoc/mongoc-opts.o mongoc/mongoc-opts-helpers.o \
mongoc/mongoc-cursor-cmd.o mongoc/mongoc-cursor-cmd-deprecated.o \
mongoc/mongoc-cursor-find.o mongoc/mongoc-cursor-find-cmd.o mongoc/mongoc-cursor-find-opquery.o \
Expand All @@ -39,7 +40,7 @@ LIBMONGOC=mongoc/mongoc-array.o common/common-b64.o mongoc/mongoc-buffer.o \
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
mongoc/mongoc-shared.o mongoc/mongoc-ts-pool.o utf8proc/utf8proc.o

LIBKMS=kms/hexlify.o kms/kms_crypto_windows.o kms/kms_kv_list.o kms/kms_request.o \
kms/kms_response.o kms/kms_b64.o kms/kms_crypto_libcrypto.o kms/kms_decrypt_request.o kms/kms_message.o \
Expand Down
14 changes: 8 additions & 6 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
PKG_CPPFLAGS = \
-I. -Icommon -Ikms \
-I. -Icommon -Ikms -Iutf8proc \
-DBSON_COMPILATION -DMONGOC_COMPILATION \
-DMONGOC_ENABLE_SSL_SECURE_CHANNEL -DMONGOC_ENABLE_CRYPTO_CNG \
-DKMS_MESSAGE_ENABLE_CRYPTO -DKMS_MESSAGE_ENABLE_CRYPTO_CNG \
-DMONGOC_HAVE_SASL_CLIENT_DONE -D__USE_MINGW_ANSI_STDIO
-DMONGOC_HAVE_SASL_CLIENT_DONE -D__USE_MINGW_ANSI_STDIO \
-DKMS_MESSAGE_LITTLE_ENDIAN -DUTF8PROC_STATIC

PKG_LIBS = \
-L. -Lmongoc -lstatmongoc \
Expand Down Expand Up @@ -35,9 +36,9 @@ LIBMONGOC=mongoc/mongoc-array.o common/common-b64.o mongoc/mongoc-buffer.o \
mongoc/mongoc-read-concern.o mongoc/mongoc-secure-channel.o mongoc/mongoc-apm.o \
mongoc/mongoc-crypto.o mongoc/mongoc-crypto-common-crypto.o mongoc/mongoc-crypto-cng.o mongoc/mongoc-handshake.o \
mongoc/mongoc-stream-tls-secure-channel.o \
mongoc/mongoc-cluster-sasl.o mongoc/mongoc-cmd.o mongoc/mongoc-stream-file.o \
mongoc/mongoc-cluster-sasl.o mongoc/mongoc-cmd.o mongoc/mongoc-stream-file.o mongoc/mcd-rpc.o mongoc/mongoc-deprioritized-servers.o \
mongoc/mongoc-change-stream.o mongoc/mongoc-client-session.o \
mongoc/mongoc-compression.o mongoc/mongoc-write-command-legacy.o \
mongoc/mongoc-compression.o \
mongoc/mongoc-sspi.o mongoc/mongoc-cluster-sspi.o mongoc/mongoc-queue.o \
mongoc/mongoc-opts.o mongoc/mongoc-opts-helpers.o \
mongoc/mongoc-cursor-cmd.o mongoc/mongoc-cursor-cmd-deprecated.o \
Expand All @@ -47,12 +48,13 @@ LIBMONGOC=mongoc/mongoc-array.o common/common-b64.o mongoc/mongoc-buffer.o \
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
mongoc/mongoc-shared.o mongoc/mongoc-ts-pool.o utf8proc/utf8proc.o

LIBKMS=kms/hexlify.o kms/kms_crypto_windows.o kms/kms_kv_list.o kms/kms_request.o \
kms/kms_response.o kms/kms_b64.o kms/kms_crypto_libcrypto.o kms/kms_decrypt_request.o kms/kms_message.o \
kms/kms_request_opt.o kms/kms_response_parser.o kms/kms_caller_identity_request.o \
kms/kms_encrypt_request.o kms/kms_port.o kms/kms_request_str.o kms/sort.o
kms/kms_encrypt_request.o kms/kms_port.o kms/kms_request_str.o kms/sort.o \
kms/kms_kmip_response_parser.o

STATLIB = mongoc/libstatmongoc.a

Expand Down
2 changes: 1 addition & 1 deletion src/bson/bcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <stdio.h>

#include "bcon.h"
#include "bson-config.h"
#include <bson/bson-config.h>

/* These stack manipulation macros are used to manage append recursion in
* bcon_append_ctx_va(). They take care of some awkward dereference rules (the
Expand Down
2 changes: 1 addition & 1 deletion src/bson/bcon.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @brief BCON (BSON C Object Notation) Declarations
*/

#include "bson-prelude.h"
#include <bson/bson-prelude.h>

/* Copyright 2009-2013 MongoDB, Inc.
*
Expand Down
6 changes: 4 additions & 2 deletions src/bson/bson-atomic.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/


#include "bson-atomic.h"
#include <bson/bson-atomic.h>

#ifdef BSON_OS_UNIX
/* For sched_yield() */
Expand All @@ -25,7 +25,9 @@
int32_t
bson_atomic_int_add (volatile int32_t *p, int32_t n)
{
return n + bson_atomic_int32_fetch_add (p, n, bson_memory_order_seq_cst);
return n + bson_atomic_int32_fetch_add ((DECL_ATOMIC_INTEGRAL_INT32 *) p,
n,
bson_memory_order_seq_cst);
}

int64_t
Expand Down
16 changes: 11 additions & 5 deletions src/bson/bson-atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

#include "bson-prelude.h"
#include <bson/bson-prelude.h>


#ifndef BSON_ATOMIC_H
#define BSON_ATOMIC_H


#include "bson-config.h"
#include "bson-compat.h"
#include "bson-macros.h"
#include <bson/bson-config.h>
#include <bson/bson-compat.h>
#include <bson/bson-macros.h>

#ifdef _MSC_VER
#include <intrin.h>
Expand All @@ -47,7 +47,8 @@ enum bson_memory_order {
#define MSVC_MEMORDER_SUFFIX(X)
#endif

#if defined(USE_LEGACY_GCC_ATOMICS) || (!defined(__clang__) && __GNUC__ == 4)
#if defined(USE_LEGACY_GCC_ATOMICS) || \
(!defined(__clang__) && __GNUC__ == 4) || defined(__xlC__)
#define BSON_USE_LEGACY_GCC_ATOMICS
#else
#undef BSON_USE_LEGACY_GCC_ATOMICS
Expand All @@ -61,6 +62,7 @@ enum bson_memory_order {
#ifdef BSON_USE_LEGACY_GCC_ATOMICS
#undef BSON_IF_GNU_LIKE
#define BSON_IF_GNU_LIKE(...)
#define BSON_IF_MSVC(...)
#define BSON_IF_GNU_LEGACY_ATOMICS(...) __VA_ARGS__
#else
#define BSON_IF_GNU_LEGACY_ATOMICS(...)
Expand Down Expand Up @@ -379,6 +381,10 @@ DECL_ATOMIC_INTEGRAL (int, int, )
#endif
#endif

#ifndef DECL_ATOMIC_INTEGRAL_INT32
#define DECL_ATOMIC_INTEGRAL_INT32 int32_t
#endif

BSON_EXPORT (int64_t)
_bson_emul_atomic_int64_fetch_add (int64_t volatile *val,
int64_t v,
Expand Down
29 changes: 3 additions & 26 deletions src/bson/bson-clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,16 @@
* limitations under the License.
*/


#ifdef __APPLE__
#include <mach/clock.h>
#include <mach/mach.h>
#include <mach/mach_time.h>
#include <sys/time.h>
#endif


#include "bson-config.h"
#include "bson-compat.h"
#include <bson/bson-config.h>
#include <bson/bson-compat.h>


#if defined(BSON_HAVE_CLOCK_GETTIME)
#include <time.h>
#include <sys/time.h>
#endif

#include "bson-clock.h"

#include <bson/bson-clock.h>

/*
*--------------------------------------------------------------------------
Expand Down Expand Up @@ -125,19 +115,6 @@ bson_get_monotonic_time (void)
* int64_t to avoid truncation. */
clock_gettime (CLOCK_MONOTONIC, &ts);
return (((int64_t) ts.tv_sec * 1000000) + (ts.tv_nsec / 1000));
#elif defined(__APPLE__)
static mach_timebase_info_data_t info = {0};
static double ratio = 0.0;

if (!info.denom) {
/* the value from mach_absolute_time () * info.numer / info.denom
* is in nano seconds. So we have to divid by 1000.0 to get micro
* seconds*/
mach_timebase_info (&info);
ratio = (double) info.numer / (double) info.denom / 1000.0;
}

return mach_absolute_time () * ratio;
#elif defined(_WIN32)
/* Despite it's name, this is in milliseconds! */
int64_t ticks = GetTickCount64 ();
Expand Down
8 changes: 4 additions & 4 deletions src/bson/bson-clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/

#include "bson-prelude.h"
#include <bson/bson-prelude.h>


#ifndef BSON_CLOCK_H
#define BSON_CLOCK_H


#include "bson-compat.h"
#include "bson-macros.h"
#include "bson-types.h"
#include <bson/bson-compat.h>
#include <bson/bson-macros.h>
#include <bson/bson-types.h>


BSON_BEGIN_DECLS
Expand Down
6 changes: 3 additions & 3 deletions src/bson/bson-cmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
* limitations under the License.
*/

#include "bson-prelude.h"
#include <bson/bson-prelude.h>


#ifndef BSON_CMP_H
#define BSON_CMP_H


#include "bson-compat.h" /* ssize_t */
#include "bson-macros.h" /* BSON_CONCAT */
#include <bson/bson-compat.h> /* ssize_t */
#include <bson/bson-macros.h> /* BSON_CONCAT */

#include <limits.h>
#include <stdbool.h>
Expand Down
Loading

0 comments on commit 6d4d1dc

Please sign in to comment.