GRU - Generic Reusable Utilities
gru_time_portable.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Otavio Piske <angusyoung@gmail.com>.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
21 #ifndef GRU_TIME_PORTABLE_H
22 #define GRU_TIME_PORTABLE_H
23 
24 #if !defined(_WIN32) && !defined(_WIN64)
25 #include <sys/time.h>
26 #else
27 #include <windows.h>
28 #endif
29 
30 #include "common/gru_portable.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 #if (!defined __linux__ && !defined __APPLE__)
37 gru_export int
38  gru_time_timersub(struct timeval *start, struct timeval *end, struct timeval *result);
39 
40 #define timersub(start, end, result) gru_time_timersub(start, end, result)
41 #endif
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 
47 #endif /* GRU_TIME_PORTABLE_H */
#define gru_export
Definition: gru_portable.h:19
gru_export int gru_time_timersub(struct timeval *start, struct timeval *end, struct timeval *result)
Portable, non-Linux, time utilities.
Definition: gru_time_portable.c:24