Skip to content

gettimeofday require "sys/time.h" include on macOS - #103

Open
bsergean wants to merge 1 commit into
giltene:masterfrom
bsergean:patch-1
Open

gettimeofday require "sys/time.h" include on macOS#103
bsergean wants to merge 1 commit into
giltene:masterfrom
bsergean:patch-1

Conversation

@bsergean

Copy link
Copy Markdown

On Linux sys/time.h exists and contains gettimeofday, so no need to put an ifdef guard around the include.

On Linux sys/time.h exists and contains gettimeofday, so no need to put an ifdef guard around the include.
@Thomasdezeeuw

Copy link
Copy Markdown

Hit the same problem and can confirm that this fixes the problem.

@ashatch

ashatch commented Jan 31, 2021

Copy link
Copy Markdown

Also hit this problem and the fix above works on OSX 10.15.7.

@jmealo

jmealo commented Mar 13, 2021

Copy link
Copy Markdown

Hit this today.

Comment thread src/script.c
#include "http_parser.h"
#include "stats.h"
#include "zmalloc.h"
#include "sys/time.h"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since sys/time.h is a system header, I think it would be "more correct" to use
#include <sys/time.h> in this case

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On top of @mseri comments, it should be moved to above line 5.

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.

7 participants