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

Macro _POSIX_C_SOURCE breaks compilation on macOS #267

Closed
disigma opened this issue Jun 8, 2021 · 1 comment
Closed

Macro _POSIX_C_SOURCE breaks compilation on macOS #267

disigma opened this issue Jun 8, 2021 · 1 comment

Comments

@disigma
Copy link

disigma commented Jun 8, 2021

The definition of macro _POSIX_C_SOURCE makes some types in macOS undefined.

#define _POSIX_C_SOURCE 200809L

I got the following compilation error messages:

/xxxx/usr/include/sys/ucred.h:101:2: error: unknown type name 'u_int'
        u_int   cr_version;             /* structure layout version */
        ^

See the https://stackoverflow.com/questions/15393905/c-pcap-library-unknown-types-error , the error is caused by definition of macro _POSIX_SOURCE.

Is it necessary to define this macro? Can it be removed?

@horgh
Copy link
Contributor

horgh commented Jun 8, 2021

Yeah, we want it.

Adding this to your code may work (I'm not sure):

#include <sys/types.h>

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

No branches or pull requests

2 participants