Skip to content

Commit

Permalink
Update to fix broken MacOS build
Browse files Browse the repository at this point in the history
"Call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations" compile error
  • Loading branch information
sjanzou committed May 4, 2023
1 parent 4e0a4ca commit 6ee2660
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nlopt/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
# include <windows.h>
#endif

// header needed to build on MacOS "Call to undeclared function 'gettimeofday'; ISO C99 and later do not support implicit function declarations" compile error
int gettimeofday(struct timeval * __restrict, void * __restrict);

/* return time in seconds since some arbitrary point in the past */
double nlopt_seconds(void)
{
Expand Down

0 comments on commit 6ee2660

Please sign in to comment.