Skip to content

Commit 3d0b021

Browse files
committed
Drop sys/time.h and unistd.h
1 parent 44e9877 commit 3d0b021

8 files changed

Lines changed: 4 additions & 10 deletions

File tree

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if test x$openmp = xtrue ; then
5454
fi
5555

5656
# Checks for header files.
57-
AC_CHECK_HEADERS([inttypes.h stdint.h sys/time.h unistd.h])
57+
AC_CHECK_HEADERS([inttypes.h stdint.h])
5858

5959
# Checks for typedefs, structures, and compiler characteristics.
6060
AC_C_INLINE

src/fglm/fglm_core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include<stdlib.h>
2727
#include<string.h>
2828
#include<stdint.h>
29-
#include<unistd.h>
3029
#include<time.h>
3130
/* for timing functions */
3231
#include "../neogb/tools.h"

src/msolve/msolve-data.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include "../neogb/data.h"
2525
#include<flint/fmpz.h>
2626
#include<flint/fmpq.h>
27-
#include <unistd.h>
2827
#include <string.h>
2928
#include <getopt.h>
3029
#include <ctype.h>

src/neogb/tools.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ double cputime(void)
3232
/* wall time */
3333
double realtime(void)
3434
{
35-
struct timeval t;
36-
gettimeofday(&t, NULL);
35+
struct timespec t;
36+
timespec_get(&t, TIME_UTC);
3737
t.tv_sec -= (2017 - 1970)*3600*24*365;
38-
return (1. + (double)t.tv_usec + ((double)t.tv_sec*1000000.)) / 1000000.;
38+
return (1. + (double)t.tv_nsec + ((double)t.tv_sec*1000000000.)) / 1000000000.;
3939
}
4040

4141
static void construct_trace(

src/neogb/tools.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#define GB_TOOLS_H
2323

2424
#include <time.h>
25-
#include <sys/time.h>
2625
#include "data.h"
2726

2827
/* cpu time */

src/usolve/tests.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include<stdio.h>
2222
#include<stdlib.h>
23-
#include <unistd.h>
2423
#include<gmp.h>
2524
#include<math.h>
2625
#include<time.h>

src/usolve/univmultiply.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include <stdio.h>
2222
#include <stdlib.h>
23-
#include <unistd.h>
2423
#include <gmp.h>
2524
#include <math.h>
2625
#include <time.h>

src/usolve/utils.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
#include <stdio.h>
2222
#include <stdlib.h>
23-
#include <unistd.h>
2423
#include <time.h>
2524
#include <math.h>
2625
#include "../msolve/streams.h"

0 commit comments

Comments
 (0)