Skip to content

Commit

Permalink
fixed mingw compilation error
Browse files Browse the repository at this point in the history
MinGW does not have the <sys/wait.h> header. Use CMake to check header's existence.
  • Loading branch information
sergiud committed Oct 31, 2019
1 parent 5792d60 commit a58ba77
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ check_include_file (sys/stat.h HAVE_SYS_STAT_H)
check_include_file (sys/syscall.h HAVE_SYS_SYSCALL_H)
check_include_file (sys/time.h HAVE_SYS_TIME_H)
check_include_file (sys/types.h HAVE_SYS_TYPES_H)
check_include_file (sys/wait.h HAVE_SYS_WAIT_H)
check_include_file (sys/utsname.h HAVE_SYS_UTSNAME_H)
check_include_file (syscall.h HAVE_SYSCALL_H)
check_include_file (syslog.h HAVE_SYSLOG_H)
Expand Down
3 changes: 3 additions & 0 deletions src/config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine HAVE_SYS_TYPES_H ${HAVE_SYS_TYPES_H}

/* Define to 1 if you have the <sys/wait.h> header file. */
#cmakedefine HAVE_SYS_WAIT_H ${HAVE_SYS_WAIT_H}

/* Define to 1 if you have the <sys/ucontext.h> header file. */
#cmakedefine HAVE_SYS_UCONTEXT_H

Expand Down
4 changes: 3 additions & 1 deletion src/logging_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <sys/wait.h>
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif

#include <iomanip>
#include <iostream>
Expand Down

0 comments on commit a58ba77

Please sign in to comment.