Skip to content

Commit

Permalink
ax_fsevents_have_file_events.m4: update to check support for FSEventS…
Browse files Browse the repository at this point in the history
…treamSetDispatchQueue
  • Loading branch information
emcrisostomo committed Jun 16, 2022
1 parent 32ecd36 commit fa17fdc
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions m4/ax_fsevents_have_file_events.m4
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
#
# DESCRIPTION
#
# This macro checks if the macOS FSEvents API supports file events.
# This macro checks if the macOS FSEvents API supports file events, and if it
# supports the FSEventStreamSetDispatchQueue function.
#
# If it does, define the ax_cv_fsevents_have_file_events environment variable to
# "yes" and define HAVE_FSEVENTS_FILE_EVENTS.
# If the FSEvents API is supported, the ax_cv_fsevents_have_file_events environment
# variable is defined and set to "yes", and the HAVE_FSEVENTS_FILE_EVENTS symbol is
# defined.
#
# If the FSEventStreamSetDispatchQueue function is supported, the
# ax_cv_fsevents_have_fseventstreamsetdispatchqueue environment variable is
# defined and set to "yes", and the HAVE_FSEVENTS_FILE_EVENTS symbol is defined.
#
# CONTRIBUTING
#
Expand All @@ -21,14 +27,14 @@
#
# LICENSE
#
# Copyright (c) 2014-2021 Enrico M. Crisostomo <[email protected]>
# Copyright (c) 2014-2022 Enrico M. Crisostomo <[email protected]>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

#serial 1
#serial 2

AC_DEFUN([AX_FSEVENTS_HAVE_FILE_EVENTS],
[AC_CACHE_CHECK(
Expand All @@ -43,11 +49,30 @@ AC_DEFUN([AX_FSEVENTS_HAVE_FILE_EVENTS],
[ax_cv_fsevents_have_file_events=yes],
[ax_cv_fsevents_have_file_events=no]
)
AC_LANG_POP([C])])
AC_LANG_POP([C])])
AC_CACHE_CHECK(
[for FSEventStreamSetDispatchQueue in macOS FSEvents API],
ax_cv_fsevents_have_fseventstreamsetdispatchqueue,
[dnl
AC_LANG_PUSH([C])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include <CoreServices/CoreServices.h>],
[FSEventStreamSetDispatchQueue(NULL, NULL);]
)],
[ax_cv_fsevents_have_fseventstreamsetdispatchqueue=yes],
[ax_cv_fsevents_have_fseventstreamsetdispatchqueue=no]
)
AC_LANG_POP([C])])
if test x"$ax_cv_fsevents_have_file_events" = "xyes"
then
AC_DEFINE(HAVE_FSEVENTS_FILE_EVENTS,
1,
[Define if the file events are supported by macOS FSEvents API.])
fi
if test x"$ax_cv_fsevents_have_fseventstreamsetdispatchqueue" = "xyes"
then
AC_DEFINE(HAVE_FSEVENTS_FSEVENTSTREAMSETDISPATCHQUEUE,
1,
[Define if the FSEventStreamSetDispatchQueue function is supported by macOS FSEvents API.])
fi
])

0 comments on commit fa17fdc

Please sign in to comment.