Skip to content

PHPC-2263: Detect strerror_r() implementation #1451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions scripts/autotools/libbson/FindDependencies.m4
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,22 @@ AC_CACHE_CHECK([whether PTHREAD_ONCE_INIT needs braces],
if test "$bson_cv_need_braces_on_pthread_once_init" = yes; then
AC_SUBST(BSON_PTHREAD_ONCE_INIT_NEEDS_BRACES, 1)
fi

# Check for strerror_r()

old_CPPFLAGS="$CPPFLAGS"
dnl PHP 8.2+ defines _GNU_SOURCE by default
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if test "$PHP_MONGODB_PHP_VERSION_ID" -ge "80200"; then
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
fi
AC_FUNC_STRERROR_R
Copy link
Member Author

@jmikola jmikola Aug 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CPPFLAGS="$old_CPPFLAGS"

dnl AC_FUNC_STRERROR_R defines HAVE_DECL_STRERROR_R and STRERROR_R_CHAR_P but we
dnl need to set BSON_HAVE_XSI_STRERROR_R for libbson. The macro result is cached
dnl in $ac_cv_func_strerror_r_char_p so check that directly.
if test "$ac_cv_func_strerror_r_char_p" = "yes"; then
AC_SUBST(BSON_HAVE_XSI_STRERROR_R, 0)
else
AC_SUBST(BSON_HAVE_XSI_STRERROR_R, 1)
fi
2 changes: 1 addition & 1 deletion src/libmongoc
Submodule libmongoc updated 118 files