Use HAVE_SYS_TIME_H and TIME_WITH_SYS_TIME from autoconf where possible

This commit is contained in:
Darryl L. Miles 2024-10-12 13:57:08 +01:00 committed by R. Timothy Edwards
parent 957904a389
commit 046401cbd8
17 changed files with 63 additions and 10 deletions

View File

@ -28,9 +28,15 @@ static const char rcsid[] __attribute__ ((unused)) ="$Header: /usr/cvsroot/magic
#include <ctype.h> #include <ctype.h>
#include <sys/types.h> #include <sys/types.h>
#include <arpa/inet.h> /* for htons() */ #include <arpa/inet.h> /* for htons() */
#include <time.h> /* since C89 */ #ifdef TIME_WITH_SYS_TIME
#ifdef HAVE_SYS_TIME_H # include <sys/time.h>
#include <sys/time.h> # include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif #endif
#include "utils/magic.h" #include "utils/magic.h"

View File

@ -38,10 +38,15 @@ static const char rcsid[] __attribute__ ((unused)) ="$Header: /usr/cvsroot/magic
#include <ctype.h> #include <ctype.h>
#include <sys/types.h> #include <sys/types.h>
#include <arpa/inet.h> /* for htons() */ #include <arpa/inet.h> /* for htons() */
#if defined(SYSV) || defined(EMSCRIPTEN) #ifdef TIME_WITH_SYS_TIME
#include <time.h> # include <sys/time.h>
# include <time.h>
#else #else
#include <sys/time.h> # ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif #endif
#include "utils/magic.h" #include "utils/magic.h"

View File

@ -40,8 +40,16 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#endif #endif
#include <sys/stat.h> #include <sys/stat.h>
#include <time.h> #ifdef TIME_WITH_SYS_TIME
#include <sys/time.h> # include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifdef HAVE_PATHS_H #ifdef HAVE_PATHS_H
#include <paths.h> #include <paths.h>

View File

@ -28,7 +28,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include "tcltk/tclmagic.h" #include "tcltk/tclmagic.h"
#include "utils/magic.h" #include "utils/magic.h"

View File

@ -23,7 +23,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <sys/resource.h> #include <sys/resource.h>
#if defined(SYSV) || defined(EMSCRIPTEN) #if defined(SYSV) || defined(EMSCRIPTEN)
#include <sys/param.h> #include <sys/param.h>

View File

@ -14,7 +14,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <signal.h> #include <signal.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/keysym.h> #include <X11/keysym.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>

View File

@ -53,7 +53,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/types.h> #include <sys/types.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <errno.h> #include <errno.h>
#include <ctype.h> #include <ctype.h>

View File

@ -24,7 +24,9 @@ static const char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magi
#include <strings.h> #include <strings.h>
#include <errno.h> #include <errno.h>
#include <stdarg.h> #include <stdarg.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <math.h> /* for roundf() function, if std=c99 */ #include <math.h> /* for roundf() function, if std=c99 */
#include "tcltk/tclmagic.h" #include "tcltk/tclmagic.h"

View File

@ -24,7 +24,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <sys/resource.h> #include <sys/resource.h>
#include "utils/magic.h" #include "utils/magic.h"

View File

@ -20,7 +20,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#endif /* not lint */ #endif /* not lint */
#include <stdio.h> #include <stdio.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/times.h> #include <sys/times.h>
#include <ctype.h> #include <ctype.h>

View File

@ -26,9 +26,17 @@ static char rcsid[] __attribute__ ((unused)) ="$Header: /usr/cvsroot/magic-8.0/t
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h>
#include <signal.h> #include <signal.h>
#include <time.h> #ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#include "tcltk/tclmagic.h" #include "tcltk/tclmagic.h"
#include "utils/magsgtty.h" #include "utils/magsgtty.h"

View File

@ -23,7 +23,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <ctype.h> #include <ctype.h>

View File

@ -29,7 +29,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <sys/types.h> #include <sys/types.h>
#include <sys/times.h> #include <sys/times.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include "tcltk/tclmagic.h" #include "tcltk/tclmagic.h"
#include "utils/main.h" #include "utils/main.h"

View File

@ -24,7 +24,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <sys/types.h> #include <sys/types.h>
#include <sys/times.h> #include <sys/times.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>

View File

@ -25,7 +25,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <unistd.h> /* for getpid() */ #include <unistd.h> /* for getpid() */
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <fcntl.h> #include <fcntl.h>
#include "tcltk/tclmagic.h" #include "tcltk/tclmagic.h"

View File

@ -23,7 +23,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/times.h> #include <sys/times.h>
#include <sys/stat.h> #include <sys/stat.h>

View File

@ -23,7 +23,9 @@ static char rcsid[] __attribute__ ((unused)) = "$Header: /usr/cvsroot/magic-8.0/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/times.h> #include <sys/times.h>