Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the error "use of undeclared identifier 'WIFEXITED'" by adding #include <sys/wait.h> #2353

Closed
wants to merge 1 commit into from
Closed

Fix the error "use of undeclared identifier 'WIFEXITED'" by adding #include <sys/wait.h> #2353

wants to merge 1 commit into from

Conversation

yurivict
Copy link
Contributor

We appreciate your contributing to Verilator. If this is your first commit, please add your name to docs/CONTRIBUTORS, and read our contributing guidelines in docs/CONTRIBUTING.adoc.

@wsnyder
Copy link
Member

wsnyder commented May 23, 2020

I suspect this header isn't in windows, so needs to be included under sys/time.h in the ifdef.

Also please add your github name to docs/CONTRIBUTORS - you'll get a test failure soon otherwise.

@yurivict
Copy link
Contributor Author

I've updated the pull request.

@wsnyder
Copy link
Member

wsnyder commented May 23, 2020

Thanks. Pushed this manually to avoid the dist test issue.

@poucotm
Copy link

poucotm commented Jun 14, 2020

Hi, I think the patch is needed also for windows (Mingw). The same errors occur when compiling for windows. I added codes below with reference to sys/wait.h

V3Os.cpp :

// clang-format off
#if defined(_WIN32) || defined(__MINGW32__)
# include <windows.h>   // LONG for bcrypt.h on MINGW
# include <bcrypt.h>  // BCryptGenRandom
# include <chrono>
# include <direct.h>  // mkdir
# include <psapi.h>   // GetProcessMemoryInfo
# include <thread>
# ifndef WIFEXITED
#  define WIFEXITED(w)    (((w) & 0xff) == 0)
#  define WIFSIGNALED(w)  (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
#  define WIFSTOPPED(w)   (((w) & 0xff) == 0x7f)
#  define WEXITSTATUS(w)  (((w) >> 8) & 0xff)
#  define WTERMSIG(w) ((w) & 0x7f)
#  define WSTOPSIG    WEXITSTATUS
# endif
#else
# include <sys/time.h>
# include <sys/wait.h> // Needed on FreeBSD for WIFEXITED
# include <unistd.h>  // usleep
#endif
// clang-format on

@wsnyder
Copy link
Member

wsnyder commented Jun 14, 2020

@poucotm are you saying an additional include of sys/wait.h is needed? If so could you please consider making a pull request with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants