File tree Expand file tree Collapse file tree 2 files changed +23
-21
lines changed Expand file tree Collapse file tree 2 files changed +23
-21
lines changed Original file line number Diff line number Diff line change 1212#include <stdio.h>
1313#include <string.h>
1414
15- #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
16- # include <time.h>
17- #else
18- # include <sys/time.h>
19- #endif
20-
21- static int64_t gettime_i64 (void ) {
22- #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
23- /* C11 way to get wallclock time */
24- struct timespec tv ;
25- if (!timespec_get (& tv , TIME_UTC )) {
26- fputs ("timespec_get failed!" , stderr );
27- exit (EXIT_FAILURE );
28- }
29- return (int64_t )tv .tv_nsec / 1000 + (int64_t )tv .tv_sec * 1000000LL ;
30- #else
31- struct timeval tv ;
32- gettimeofday (& tv , NULL );
33- return (int64_t )tv .tv_usec + (int64_t )tv .tv_sec * 1000000LL ;
34- #endif
35- }
15+ #include "util.h"
3616
3717#define FP_EXP (6)
3818#define FP_MULT (1000000LL)
Original file line number Diff line number Diff line change @@ -45,6 +45,28 @@ static void print_buf_plain(const unsigned char *buf, size_t len) {
4545 printf ("\n}\n" );
4646}
4747
48+ #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
49+ # include <time.h>
50+ #else
51+ # include <sys/time.h>
52+ #endif
53+
54+ static int64_t gettime_i64 (void ) {
55+ #if (defined(_MSC_VER ) && _MSC_VER >= 1900 )
56+ /* C11 way to get wallclock time */
57+ struct timespec tv ;
58+ if (!timespec_get (& tv , TIME_UTC )) {
59+ fputs ("timespec_get failed!" , stderr );
60+ exit (EXIT_FAILURE );
61+ }
62+ return (int64_t )tv .tv_nsec / 1000 + (int64_t )tv .tv_sec * 1000000LL ;
63+ #else
64+ struct timeval tv ;
65+ gettimeofday (& tv , NULL );
66+ return (int64_t )tv .tv_usec + (int64_t )tv .tv_sec * 1000000LL ;
67+ #endif
68+ }
69+
4870# if (!defined(__STDC_VERSION__ ) || (__STDC_VERSION__ < 199901L ) )
4971# if SECP256K1_GNUC_PREREQ (2 ,7 )
5072# define SECP256K1_INLINE __inline__
You can’t perform that action at this time.
0 commit comments