From 390b32f32c166ff8e5a04390cca75247993be73c Mon Sep 17 00:00:00 2001 From: Fred Wright Date: Sat, 21 Jan 2017 00:53:50 -0800 Subject: Initial edit and use of new os_compat.c. This change: 1) Makes a few comment-only edits to os_compat.c. 2) Updates the build procedure to use os_compat.c in libgps and in the Python extensions. 3) Deletes the now-obsolete clock_gettime.c, daemon.c, and strl.c. TESTED: Ran "scons build-all check" on OSX 10.9 and Ubuntu 14. --- os_compat.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'os_compat.c') diff --git a/os_compat.c b/os_compat.c index f7c23839..95b38579 100644 --- a/os_compat.c +++ b/os_compat.c @@ -1,10 +1,20 @@ /* - * Simulate ANSI/POSIX conformance on platforms that don't have it - * - * This file is Copyright (c) 2010 by the GPSD project + * This file is Copyright (c) 2017 by the GPSD project * BSD terms apply: see the file COPYING in the distribution root for details. + * + * This file contains functions to deal with compatibility issues across OSes. + * + * The initial version of this file is a near-verbatim concatenation of the + * following three source files: + * clock_gettime.c + * daemon.c + * strl.c + * History of this code prior to the creation of this file can be found + * in the histories of those files. */ +/* Simulate ANSI/POSIX clock_gettime() on platforms that don't have it */ + #include #include @@ -31,7 +41,10 @@ int clock_gettime(clockid_t clk_id UNUSED, struct timespec *ts) } #endif /* HAVE_CLOCK_GETTIME */ -/* end */ +/* End of clock_gettime section */ + +/* Simulate Linux/BSD daemon() on platforms that don't have it */ + #include #include #include @@ -79,11 +92,10 @@ int daemon(int nochdir, int noclose) #endif /* HAVE_DAEMON */ -// end -/* - * This file is Copyright (c) 2010 by the GPSD project - * BSD terms apply: see the file COPYING in the distribution root for details. - */ +/* End of daemon section */ + +/* Provide BSD strlcat()/strlcpy() on platforms that don't have it */ + #include #include /* for time_t */ #include "gpsd_config.h" @@ -228,3 +240,5 @@ size_t strlcpy(char *dst, const char *src, size_t siz) } #endif /* __UNUSED__ */ #endif /* HAVE_STRLCPY */ + +/* End of strlcat()/strlcpy() section */ -- cgit v1.2.1