aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorPaul Eggert2018-09-16 21:24:04 -0700
committerPaul Eggert2018-09-16 21:28:08 -0700
commit295bacba61bd681798b55599551116db197b3388 (patch)
tree167fe2864edc58f5f847c6a64133ad3463201986 /lib-src
parent75ab41d00d97c4de1ca343ce5273d1aad4975f37 (diff)
downloademacs-295bacba61bd681798b55599551116db197b3388.tar.gz
emacs-295bacba61bd681798b55599551116db197b3388.zip
Move current_timespec decl to timespec.h
This change was motivated by the desire to remove the weird dependency of lib-src/profile.o on src/systime.h. profile.c included systime.h only for current_timespec, and this inclusion required systime.h to have #ifdef emacs in multiple places and complicated further changes I have in mind. The current_timespec decl belongs in timespec.h anyway, and the main effect of this change is to move it there. * lib-src/profile.c (INLINE): Remove. Include timespec.h, not systime.h. * lib/gettime.c (gettime): Prefer clock_gettime to nanotime, and don’t worry about it failing on a CLOCK_REALTIME arg. POSIX requires it to succeed and I don’t know of any counterexamples where the fallbacks would work. (current_timespec): Move here from src/systime.h. Nowadays it seems to be better to not have this function be inline. * lib/timespec.h: Include arg-nonnull.h. (current_timespec): New declaration. (gettime, settime): Declare args to be nonnull. * lib/gettime.c, lib/timespec.h: Copy from Gnulib. * src/systime.h: Simplify by assuming ‘emacs’ is defined, which it always is now. (current_timespec): Move to lib/timespec.h.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/profile.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib-src/profile.c b/lib-src/profile.c
index cccdfbc7c84..649eb04b374 100644
--- a/lib-src/profile.c
+++ b/lib-src/profile.c
@@ -30,14 +30,13 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
30 ** operations: reset_watch, get_time 30 ** operations: reset_watch, get_time
31 */ 31 */
32 32
33#define INLINE EXTERN_INLINE
34#include <config.h> 33#include <config.h>
35 34
36#include <inttypes.h> 35#include <inttypes.h>
37#include <stdlib.h> 36#include <stdlib.h>
38 37
39#include <intprops.h> 38#include <intprops.h>
40#include <systime.h> 39#include <timespec.h>
41#include <unlocked-io.h> 40#include <unlocked-io.h>
42 41
43static struct timespec TV1; 42static struct timespec TV1;