Skip to content

Commit 2b2e0be

Browse files
authored
PHPC-2477: Remove unused libmongoc and libbson constants (#1768)
* PHPC-2477: BSON_HAVE_ATOMIC constants are obsolete CDRIVER-4124 removed BSON_HAVE_ATOMIC_32_ADD_AND_FETCH and BSON_HAVE_ATOMIC_64_ADD_AND_FETCH * PHPC-2477: BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES is obsolete CDRIVER-2694 removed BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES * PHPC-2477: BSON_HAVE_REALLOCF is obsolete BSON_HAVE_REALLOCF was no longer used when libbson was vendored in CDRIVER-2416 * PHPC-2477: BSON_HAVE_SYSCALL_TID is obsolete CDRIVER-2771 removed outstanding references to BSON_HAVE_SYSCALL_TID * PHPC-2477: BSON_NEEDS_SET_OUTPUT_FORMAT is obsolete * PHPC-2477: BSON_HAVE_DECIMAL128 is obsolete * PHPC-2477: BSON_HAVE_ARC4RANDOM_BUF is obsolete * PHPC-2477: MONGOC_ENABLE_SASL_GSSAPI is obsolete CDRIVER-2654 removed MONGOC_ENABLE_SASL_GSSAPI. PHPC-2312 removed it from Autotools, but it was left behind in config.w32. * PHPC-2477: MONGOC_HAVE_WEAK_SYMBOLS is obsolete CDRIVER-2600 removed MONGOC_HAVE_WEAK_SYMBOLS
1 parent 2585be4 commit 2b2e0be

File tree

5 files changed

+1
-116
lines changed

5 files changed

+1
-116
lines changed

config.m4

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ if test "$PHP_MONGODB" != "no"; then
338338
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/CheckHost.m4)
339339
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/PlatformFlags.m4)
340340

341-
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/CheckAtomics.m4)
342341
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/CheckHeaders.m4)
343342
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/Endian.m4)
344343
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libbson/FindDependencies.m4)
@@ -352,7 +351,6 @@ if test "$PHP_MONGODB" != "no"; then
352351
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/Endian.m4)
353352
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/FindDependencies.m4)
354353
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/Versions.m4)
355-
m4_include(PHP_MONGODB_BASEDIR/scripts/autotools/libmongoc/WeakSymbols.m4)
356354

357355
dnl This include modifies the value of $PHP_MONGODB_CLIENT_SIDE_ENCRYPTION to "yes"
358356
dnl or "no" depending on whether dependencies for libmongocrypt are fulfilled

config.w32

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -130,28 +130,16 @@ if (PHP_MONGODB != "no") {
130130
BSON_OS: 2,
131131
BSON_HAVE_STDBOOL_H: 0,
132132
BSON_HAVE_STRINGS_H: 0,
133-
BSON_HAVE_ATOMIC_32_ADD_AND_FETCH: 0,
134-
BSON_HAVE_ATOMIC_64_ADD_AND_FETCH: 0,
135-
BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES: 0,
136133
BSON_HAVE_CLOCK_GETTIME: 0,
137134
BSON_HAVE_STRNLEN: 0,
138135
BSON_HAVE_SNPRINTF: 0,
139136
BSON_HAVE_STRLCPY: 0,
140-
BSON_HAVE_REALLOCF: 0,
141-
BSON_NEEDS_SET_OUTPUT_FORMAT: 0,
142137
BSON_HAVE_TIMESPEC: 0,
143138
BSON_EXTRA_ALIGN: 0,
144-
BSON_HAVE_SYSCALL_TID: 0,
145-
BSON_HAVE_DECIMAL128: 0,
146139
BSON_HAVE_GMTIME_R: 0,
147-
BSON_HAVE_RAND_R: 0,
148-
BSON_HAVE_ARC4RANDOM_BUF: 0
140+
BSON_HAVE_RAND_R: 0
149141
};
150142

151-
if (CHECK_FUNC_IN_HEADER("stdio.h", "_set_output_format")) {
152-
bson_opts.BSON_NEEDS_SET_OUTPUT_FORMAT = 1;
153-
}
154-
155143
mongodb_generate_header(
156144
configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-config.h.in",
157145
configure_module_dirname + "/src/libmongoc/src/libbson/src/bson/bson-config.h",
@@ -187,7 +175,6 @@ if (PHP_MONGODB != "no") {
187175
MONGOC_ENABLE_MONGODB_AWS_AUTH: 0,
188176
MONGOC_ENABLE_SASL: 0,
189177
MONGOC_ENABLE_SASL_CYRUS: 0,
190-
MONGOC_ENABLE_SASL_GSSAPI: 0,
191178
MONGOC_ENABLE_SASL_SSPI: 0,
192179
MONGOC_ENABLE_SRV: 0,
193180
MONGOC_ENABLE_RDTSCP: 0,
@@ -196,7 +183,6 @@ if (PHP_MONGODB != "no") {
196183
MONGOC_HAVE_SASL_CLIENT_DONE: 0,
197184
MONGOC_HAVE_SCHED_GETCPU: 0,
198185
MONGOC_HAVE_SOCKLEN: 1,
199-
MONGOC_HAVE_WEAK_SYMBOLS: 0,
200186
MONGOC_NO_AUTOMATIC_GLOBALS: 1,
201187
MONGOC_SOCKET_ARG2: "struct sockaddr",
202188
MONGOC_SOCKET_ARG3: "socklen_t",

scripts/autotools/libbson/CheckAtomics.m4

Lines changed: 0 additions & 23 deletions
This file was deleted.

scripts/autotools/libbson/FindDependencies.m4

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -13,46 +13,6 @@ if test "$bson_cv_have_strnlen" = yes; then
1313
AC_SUBST(BSON_HAVE_STRNLEN, 1)
1414
fi
1515

16-
# Check for reallocf() (BSD/Darwin)
17-
AC_SUBST(BSON_HAVE_REALLOCF, 0)
18-
AC_CACHE_CHECK([for reallocf],
19-
bson_cv_have_reallocf,
20-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
21-
#include <stdlib.h>
22-
int reallocf () { return 0; }
23-
]])],
24-
[bson_cv_have_reallocf=no],
25-
[bson_cv_have_reallocf=yes])])
26-
if test "$bson_cv_have_reallocf" = yes; then
27-
AC_SUBST(BSON_HAVE_REALLOCF, 1)
28-
fi
29-
30-
# Check for syscall()
31-
AC_SUBST(BSON_HAVE_SYSCALL_TID, 0)
32-
AC_CACHE_CHECK([for syscall],
33-
bson_cv_have_syscall_tid,
34-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
35-
#include <unistd.h>
36-
#include <sys/syscall.h>
37-
int syscall () { return 0; }
38-
]])],
39-
[bson_cv_have_syscall_tid=no],
40-
[bson_cv_have_syscall_tid=yes])])
41-
if test "$bson_cv_have_syscall_tid" = yes -a "$os_darwin" != "yes"; then
42-
AC_CACHE_CHECK([for SYS_gettid],
43-
bson_cv_have_sys_gettid_tid,
44-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
45-
#include <unistd.h>
46-
#include <sys/syscall.h>
47-
int gettid () { return SYS_gettid; }
48-
]])],
49-
[bson_cv_have_sys_gettid_tid=yes],
50-
[bson_cv_have_sys_gettid_tid=no])])
51-
if test "$bson_cv_have_sys_gettid_tid" = yes; then
52-
AC_SUBST(BSON_HAVE_SYSCALL_TID, 1)
53-
fi
54-
fi
55-
5616
# Check for snprintf()
5717
AC_SUBST(BSON_HAVE_SNPRINTF, 0)
5818
AC_CHECK_FUNC(snprintf, [AC_SUBST(BSON_HAVE_SNPRINTF, 1)])
@@ -79,10 +39,6 @@ AC_CHECK_FUNC(gmtime_r, [AC_SUBST(BSON_HAVE_GMTIME_R, 1)])
7939
AC_SUBST(BSON_HAVE_RAND_R, 0)
8040
AC_CHECK_FUNC(rand_r, [AC_SUBST(BSON_HAVE_RAND_R, 1)])
8141

82-
# Check for arc4random_buf()
83-
AC_SUBST(BSON_HAVE_ARC4RANDOM_BUF, 0)
84-
AC_CHECK_FUNC(arc4random_buf, [AC_SUBST(BSON_HAVE_ARC4RANDOM_BUF, 1)])
85-
8642
# Check for pthreads. We might need to make this better to handle mingw,
8743
# but I actually think it is okay to just check for it even though we will
8844
# use win32 primatives.
@@ -96,26 +52,3 @@ AX_PTHREAD([
9652
],[
9753
AC_MSG_ERROR([libbson requires pthreads on non-Windows platforms.])
9854
])
99-
100-
101-
# The following is borrowed from the guile configure script.
102-
#
103-
# On past versions of Solaris, believe 8 through 10 at least, you
104-
# had to write "pthread_once_t foo = { PTHREAD_ONCE_INIT };".
105-
# This is contrary to POSIX:
106-
# http://www.opengroup.org/onlinepubs/000095399/functions/pthread_once.html
107-
# Check here if this style is required.
108-
#
109-
# glibc (2.3.6 at least) works both with or without braces, so the
110-
# test checks whether it works without.
111-
#
112-
AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 0)
113-
AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
114-
bson_cv_need_braces_on_pthread_once_init,
115-
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <pthread.h>
116-
pthread_once_t foo = PTHREAD_ONCE_INIT;]])],
117-
[bson_cv_need_braces_on_pthread_once_init=no],
118-
[bson_cv_need_braces_on_pthread_once_init=yes])])
119-
if test "$bson_cv_need_braces_on_pthread_once_init" = yes; then
120-
AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 1)
121-
fi

scripts/autotools/libmongoc/WeakSymbols.m4

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)