Skip to content

Instantly share code, notes, and snippets.

@rogerhub
Created November 27, 2020 18:05
Show Gist options
  • Save rogerhub/d0fa8f06bc30eedf671c49fe6d7a1eac to your computer and use it in GitHub Desktop.
Save rogerhub/d0fa8f06bc30eedf671c49fe6d7a1eac 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..46a29d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -447,6 +447,7 @@ if test no != "$with_posix_regex"; then
AC_CHECK_FUNCS(regcomp)
AC_MSG_CHECKING(if regcomp works)
AC_TRY_RUN([
+#include <stdlib.h>
#include <sys/types.h>
#include <regex.h>
main() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment