Skip to content

Instantly share code, notes, and snippets.

@rogerhub
Created November 27, 2020 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerhub/1a474213c9f9039377e919776cd1e97e to your computer and use it in GitHub Desktop.
Save rogerhub/1a474213c9f9039377e919776cd1e97e to your computer and use it in GitHub Desktop.
diff --git a/configure b/configure
index f137cf1..13b04f0 100755
--- a/configure
+++ b/configure
@@ -6275,9 +6275,10 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+#include <stdlib.h>
#include <sys/types.h>
#include <regex.h>
-main() {
+int main() {
regex_t patbuf;
exit (regcomp (&patbuf, "/hello/", 0) != 0);
}
diff --git a/configure.ac b/configure.ac
index 7fc81d4..a1689d9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -448,8 +448,9 @@ if test no != "$with_posix_regex"; then
AC_MSG_CHECKING(if regcomp works)
AC_TRY_RUN([
#include <sys/types.h>
+#include <sys/types.h>
#include <regex.h>
-main() {
+int main() {
regex_t patbuf;
exit (regcomp (&patbuf, "/hello/", 0) != 0);
}],regcomp_works=yes,regcomp_works=no,AC_DEFINE(CHECK_REGCOMP))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment