Skip to content

Commit

Permalink
Get rid of including sys/user.h on macOS
Browse files Browse the repository at this point in the history
LIST_HEAD in ccan/list conflicts with sys/queue.h.

```
./ccan/list/list.h:75:9: warning: 'LIST_HEAD' macro redefined [-Wmacro-redefined]
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/queue.h:465:9: note: previous definition is here
        ^
```
  • Loading branch information
nobu committed May 6, 2021
1 parent b655a3f commit 921d8ac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2727,7 +2727,10 @@ main(int argc, char *argv[])
test x$rb_cv_fork_with_pthread = xyes || AC_DEFINE(CANNOT_FORK_WITH_PTHREAD)
])

AC_CHECK_HEADERS([sys/user.h])
AS_CASE([$target_os],
[darwin*], [ac_cv_header_sys_user_h=yes], dnl LIST_HEAD conflicts with sys/queue.h
[AC_CHECK_HEADERS([sys/user.h])]
)
AS_IF([test "x$ac_cv_func_mmap:$ac_cv_header_sys_user_h" = xyes:yes], [
AC_CACHE_CHECK([PAGE_SIZE is defined], rb_cv_page_size,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
Expand Down

0 comments on commit 921d8ac

Please sign in to comment.