Use GNU make pattern rule in ld Makefile
[binutils-gdb.git] / gdbsupport / gdb_sys_time.h
blob6ea1ae769a4be6f056889c229157152c15bad386
1 /* Copyright (C) 2015-2023 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 #ifndef COMMON_GDB_SYS_TIME_H
19 #define COMMON_GDB_SYS_TIME_H
21 #include <sys/time.h>
23 /* On MinGW-w64, gnulib's sys/time.h replaces 'struct timeval' and
24 gettimeofday with versions that support 64-bit time_t, for POSIX
25 compliance. However, the gettimeofday replacement does not ever
26 return time_t values larger than 31-bit, as it simply returns the
27 system's gettimeofday's (signed) 32-bit result as (signed) 64-bit.
28 Because we don't really need the POSIX compliance, and it ends up
29 causing conflicts with other libraries we use that don't use gnulib
30 and thus work with the native struct timeval, such as Winsock2's
31 native 'select' and libiberty, simply undefine away gnulib's
32 replacements. */
33 #if GNULIB_defined_struct_timeval
34 # undef timeval
35 # undef gettimeofday
36 #endif
38 #endif /* COMMON_GDB_SYS_TIME_H */