mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
m4/guestfs-ocaml.m4: Check for caml_unix_error
In OCaml 5.0, unix_error was renamed caml_unix_error. If it's not available, define as unix_error, the old symbol name.
This commit is contained in:
2
common
2
common
Submodule common updated: c8e64b3ff0...30d3e92130
@@ -164,4 +164,9 @@ extern int accept4 (int sockfd, struct sockaddr *__restrict__ addr,
|
|||||||
extern int pipe2 (int pipefd[2], int flags);
|
extern int pipe2 (int pipefd[2], int flags);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef HAVE_CAML_UNIX_ERROR
|
||||||
|
/* For backwards compatibility with OCaml < 5.0 */
|
||||||
|
#define caml_unix_error unix_error
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* GUESTFS_INTERNAL_ALL_H_ */
|
#endif /* GUESTFS_INTERNAL_ALL_H_ */
|
||||||
|
|||||||
@@ -191,3 +191,19 @@ if test "x$INSTALL_OCAMLLIB" = "x"; then
|
|||||||
INSTALL_OCAMLLIB=$OCAMLLIB
|
INSTALL_OCAMLLIB=$OCAMLLIB
|
||||||
fi
|
fi
|
||||||
AC_SUBST([INSTALL_OCAMLLIB])
|
AC_SUBST([INSTALL_OCAMLLIB])
|
||||||
|
|
||||||
|
dnl Check if OCaml has caml_unix_error (added 2022, OCaml 5.0).
|
||||||
|
AC_MSG_CHECKING([for caml_unix_error])
|
||||||
|
cat >conftest.c <<'EOF'
|
||||||
|
#include <caml/mlvalues.h>
|
||||||
|
#include <caml/unixsupport.h>
|
||||||
|
int main () { char *p = (void *) caml_unix_error; return 0; }
|
||||||
|
EOF
|
||||||
|
AS_IF([$OCAMLC conftest.c >&AS_MESSAGE_LOG_FD 2>&1],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
AC_DEFINE([HAVE_CAML_UNIX_ERROR],[1],
|
||||||
|
[caml_unix_error found at compile time.])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
])
|
||||||
|
rm -f conftest.c conftest.o
|
||||||
|
|||||||
Reference in New Issue
Block a user