<commit_before>dnl @synopsis AX_LIB_EVENT([MINIMUM-VERSION])
dnl
dnl Test for the libevent library of a particular version (or newer).
dnl
dnl If no path to the installed libevent is given, the macro will first try
dnl using no -I or -L flags, then searches under /usr, /usr/local, /opt,
dnl and /opt/libevent.
dnl If these all fail, it will try the $LIBEVENT_ROOT environment variable.
dnl
dnl This macro requires that #include <sys/types.h> works and defines u_char.
dnl
dnl This macro calls:
dnl   AC_SUBST(LIBEVENT_CPPFLAGS)
dnl   AC_SUBST(LIBEVENT_LDFLAGS)
dnl   AC_SUBST(LIBEVENT_LIBS)
dnl
dnl And (if libevent is found):
dnl   AC_DEFINE(HAVE_LIBEVENT)
dnl
dnl It also leaves the shell variables "success" and "ax_have_libevent"
dnl set to "yes" or "no".
dnl
dnl NOTE: This macro does not currently work for cross-compiling,
dnl       but it can be easily modified to allow it.  (grep "cross").
dnl
dnl @category InstalledPackages
dnl @category C
dnl @version 2007-09-12
dnl @license AllPermissive
dnl
dnl Copyright (C) 2009 <NAME>
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.

dnl Input: ax_libevent_path, WANT_LIBEVENT_VERSION
dnl Output: success=yes/no
AC_DEFUN([AX_LIB_EVENT_DO_CHECK],
         [
          # Save our flags.
          CPPFLAGS_SAVED="$CPPFLAGS"
          LDFLAGS_SAVED="$LDFLAGS"
          LIBS_SAVED="$LIBS"
          LD_LIBRARY_PATH_SAVED="$LD_LIBRARY_PATH"

          # Set our flags if we are checking a specific directory.
          if test -n "$ax_libevent_path" ; then
            LIBEVENT_CPPFLAGS="-I$ax_libevent_path/include"
            LIBEVENT_LDFLAGS="-L$ax_libevent_path/lib"
            LD_LIBRARY_PATH="$ax_libevent_path/lib:$LD_LIBRARY_PATH"
          else
            LIBEVENT_CPPFLAGS=""
            LIBEVENT_LDFLAGS=""
          fi

          # Required flag for libevent.
          LIBEVENT_LIBS="-levent"

          # Prepare the environment for compilation.
          CPPFLAGS="$CPPFLAGS $LIBEVENT_CPPFLAGS"
          LDFLAGS="$LDFLAGS $LIBEVENT_LDFLAGS"
          LIBS="$LIBS $LIBEVENT_LIBS"
          export CPPFLAGS
          export LDFLAGS
          export LIBS
          export LD_LIBRARY_PATH

          success=no

          # Compile, link, and run the program.  This checks:
          # - event.h is available for including.
          # - event_get_version() is available for linking.
          # - The event version string is lexicographically greater
          #   than the required version.
          AC_LANG_PUSH([C])
          dnl This can be changed to AC_LINK_IFELSE if you are cross-compiling,
          dnl but then the version cannot be checked.
          AC_RUN_IFELSE([AC_LANG_PROGRAM([[
          #include <sys/types.h>
          #include <event.h>
          ]], [[
          const char* lib_version = event_get_version();
          const char* wnt_version = "$WANT_LIBEVENT_VERSION";
          for (;;) {
            /* If we reached the end of the want version.  We have it. */
            if (*wnt_version == '\0' || *wnt_version == '-') {
              return 0;
            }
            /* If the want version continues but the lib version does not, */
            /* we are missing a letter.  We don't have it. */
            if (*lib_version == '\0' || *lib_version == '-') {
              return 1;
            }
            /* In the 1.4 version numbering style, if there are more digits */
            /* in one version than the other, that one is higher. */
            int lib_digits;
            for (lib_digits = 0;
                lib_version[lib_digits] >= '0' &&
                lib_version[lib_digits] <= '9';
                lib_digits++)
              ;
            int wnt_digits;
            for (wnt_digits = 0;
                wnt_version[wnt_digits] >= '0' &&
                wnt_version[wnt_digits] <= '9';
                wnt_digits++)
              ;
            if (lib_digits > wnt_digits) {
              return 0;
            }
            if (lib_digits < wnt_digits) {
              return 1;
            }<commit_msg>THRIFT-916 do not mix declarations and code issue detected with -Werror<commit_after>dnl @synopsis AX_LIB_EVENT([MINIMUM-VERSION])
dnl
dnl Test for the libevent library of a particular version (or newer).
dnl
dnl If no path to the installed libevent is given, the macro will first try
dnl using no -I or -L flags, then searches under /usr, /usr/local, /opt,
dnl and /opt/libevent.
dnl If these all fail, it will try the $LIBEVENT_ROOT environment variable.
dnl
dnl This macro requires that #include <sys/types.h> works and defines u_char.
dnl
dnl This macro calls:
dnl   AC_SUBST(LIBEVENT_CPPFLAGS)
dnl   AC_SUBST(LIBEVENT_LDFLAGS)
dnl   AC_SUBST(LIBEVENT_LIBS)
dnl
dnl And (if libevent is found):
dnl   AC_DEFINE(HAVE_LIBEVENT)
dnl
dnl It also leaves the shell variables "success" and "ax_have_libevent"
dnl set to "yes" or "no".
dnl
dnl NOTE: This macro does not currently work for cross-compiling,
dnl       but it can be easily modified to allow it.  (grep "cross").
dnl
dnl @category InstalledPackages
dnl @category C
dnl @version 2007-09-12
dnl @license AllPermissive
dnl
dnl Copyright (C) 2009 <NAME>
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.

dnl Input: ax_libevent_path, WANT_LIBEVENT_VERSION
dnl Output: success=yes/no
AC_DEFUN([AX_LIB_EVENT_DO_CHECK],
         [
          # Save our flags.
          CPPFLAGS_SAVED="$CPPFLAGS"
          LDFLAGS_SAVED="$LDFLAGS"
          LIBS_SAVED="$LIBS"
          LD_LIBRARY_PATH_SAVED="$LD_LIBRARY_PATH"

          # Set our flags if we are checking a specific directory.
          if test -n "$ax_libevent_path" ; then
            LIBEVENT_CPPFLAGS="-I$ax_libevent_path/include"
            LIBEVENT_LDFLAGS="-L$ax_libevent_path/lib"
            LD_LIBRARY_PATH="$ax_libevent_path/lib:$LD_LIBRARY_PATH"
          else
            LIBEVENT_CPPFLAGS=""
            LIBEVENT_LDFLAGS=""
          fi

          # Required flag for libevent.
          LIBEVENT_LIBS="-levent"

          # Prepare the environment for compilation.
          CPPFLAGS="$CPPFLAGS $LIBEVENT_CPPFLAGS"
          LDFLAGS="$LDFLAGS $LIBEVENT_LDFLAGS"
          LIBS="$LIBS $LIBEVENT_LIBS"
          export CPPFLAGS
          export LDFLAGS
          export LIBS
          export LD_LIBRARY_PATH

          success=no

          # Compile, link, and run the program.  This checks:
          # - event.h is available for including.
          # - event_get_version() is available for linking.
          # - The event version string is lexicographically greater
          #   than the required version.
          AC_LANG_PUSH([C])
          dnl This can be changed to AC_LINK_IFELSE if you are cross-compiling,
          dnl but then the version cannot be checked.
          AC_RUN_IFELSE([AC_LANG_PROGRAM([[
          #include <sys/types.h>
          #include <event.h>
          ]], [[
          const char* lib_version = event_get_version();
          const char* wnt_version = "$WANT_LIBEVENT_VERSION";
          int lib_digits;
          int wnt_digits;
          for (;;) {
            /* If we reached the end of the want version.  We have it. */
            if (*wnt_version == '\0' || *wnt_version == '-') {
              return 0;
            }
            /* If the want version continues but the lib version does not, */
            /* we are missing a letter.  We don't have it. */
            if (*lib_version == '\0' || *lib_version == '-') {
              return 1;
            }
            /* In the 1.4 version numbering style, if there are more digits */
            /* in one version than the other, that one is higher. */
            for (lib_digits = 0;
                lib_version[lib_digits] >= '0' &&
                lib_version[lib_digits] <= '9';
                lib_digits++)
              ;
            for (wnt_digits = 0;
                wnt_version[wnt_digits] >= '0' &&
                wnt_version[wnt_digits] <= '9';
                wnt_digits++)
              ;
            if (lib_digits > wnt_digits) {
              return 0;
            }
            if (lib_digits < wnt_digits) {
              return 1;
            }
{'fraction_non_alphanumeric': 0.0832141154029566, 'fraction_numerical': 0.006556986170720076, 'mean_word_length': 2.0898710865561694, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '885157', 'n_tokens_mistral': 2620, 'n_tokens_neox': 2500, 'n_words': 812}