<commit_before># --------------------------------------------------------------
# Test for compiler with broken errno_t.  This is currently only known
# to affect GCC 5.2.0 on OSX Yosemite and above.  It seems to be
# possible to workaround the issue by declaring an errno_t type of our
# own as necessary.
# --------------------------------------------------------------
AC_DEFUN([CHECK_FOR_BROKEN_ERRNO_T],
[
  # Try to compile a test program that exhibits the error.
  AC_LANG_PUSH([C++])

  AC_MSG_CHECKING([if compiler has working errno_t declaration])

  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  namespace Foo {
  @%:@include <errno.h>
  }
  @%:@include <cstring>
  ]], [[
  ]])],[
    AC_MSG_RESULT(yes)
  ],[
    errno_t_works=no
    AC_MSG_RESULT(no)
  ])

  # If errno_t does not work, verify that "typedef int errno_t;" fixes it.
  if (test x$errno_t_works = xno); then
    AC_MSG_CHECKING([if errno_t typedef fixes the issue])

    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    namespace Foo {
    @%:@include <errno.h>
    }
    typedef int errno_t; // the fix
    @%:@include <cstring>
    ]], [[
    ]])],[
      typedef_errno_t_fixes_issue=yes
      AC_MSG_RESULT(yes)
    ],[
      AC_MSG_RESULT(no)
    ])
  fi

  AC_LANG_POP([C++])

  # If the compiler has the errno_t issue and the typedef fixes it, set the #define
  if (test "x$errno_t_works" = "xno" -a "x$typedef_errno_t_fixes_issue" = "xyes"); then
    AC_DEFINE(COMPILER_HAS_BROKEN_ERRNO_T, 1, [define if the compiler has a broken errno_t])
  fi

  # On the other hand, if the compiler has the errno_t issue and the typedef *doesn't* fix it, error out.
  if (test "x$errno_t_works" = "xno" -a "x$typedef_errno_t_fixes_issue" = "x"); then
    AC_MSG_ERROR([Compiler has the errno_t issue, but typedef does not fix it.  This
                  compiler will most likely not be able to build libmesh correctly.])
  fi
])<commit_msg>Update configure test for errno.h issue.<commit_after># --------------------------------------------------------------
# Test for compiler which does not support namespace-wrapped inclusion
# of errno.h.  This is currently only known to affect GCC 5.2.0 on OSX
# Yosemite and above.  One can work around the issue by simply
# including errno.h separately, outside of any namespace.
# --------------------------------------------------------------
AC_DEFUN([CHECK_FOR_BROKEN_ERRNO_T],
[
  # Try to compile a test program that exhibits the error.
  AC_LANG_PUSH([C++])

  AC_MSG_CHECKING([if errno.h can be wrapped in namespace])

  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  namespace Foo {
  @%:@include <errno.h>
  }
  @%:@include <cstring>
  ]], [[
  ]])],[
    AC_MSG_RESULT(yes)
  ],[
    errno_t_works=no
    AC_MSG_RESULT(no)
  ])

  # If that test failed, verify that including the header outside of any namespace fixes the issue.
  if (test x$errno_t_works = xno); then
    AC_MSG_CHECKING([if workaround fixes the issue])

    AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
    @%:@include <errno.h> // the fix
    namespace Foo {
    @%:@include <errno.h>
    }
    @%:@include <cstring>
    ]], [[
    ]])],[
      typedef_errno_t_fixes_issue=yes
      AC_MSG_RESULT(yes)
    ],[
      AC_MSG_RESULT(no)
    ])
  fi

  AC_LANG_POP([C++])

  # If the compiler has the issue and the workaround fixes it, set the #define
  if (test "x$errno_t_works" = "xno" -a "x$typedef_errno_t_fixes_issue" = "xyes"); then
    AC_DEFINE(COMPILER_HAS_BROKEN_ERRNO_T, 1, [define if errno.h cannot be included in a namespace])
  fi

  # On the other hand, if the compiler has the issue and the workaround *doesn't* fix it, error out.
  if (test "x$errno_t_works" = "xno" -a "x$typedef_errno_t_fixes_issue" = "x"); then
    AC_MSG_ERROR([Cannot work around errno.h inclusion issue.  This
                  compiler will most likely not be able to build libmesh correctly.])
  fi
])
{'fraction_non_alphanumeric': 0.16770347330222912, 'fraction_numerical': 0.002073613271124935, 'mean_word_length': 2.6717411988582302, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '7413768', 'n_tokens_mistral': 1364, 'n_tokens_neox': 1277, 'n_words': 390}