From e14f918e63e3673ba80f8b9e1e6fb5c2ef2958a8 Mon Sep 17 00:00:00 2001 From: Julien Fischer Date: Sun, 3 Dec 2023 00:19:48 +1100 Subject: [PATCH] Delete MR_HAVE_STDINT_H. The configure script currently contains a check for the presence of the C99 header stdint.h. This is redundant since (1) *all* C compilers that are currently capable of compiling Mercury support C99 and (2) most #includes of stdint.h in the Mercury system are not, and have never been, protected by the MR_HAVE_STDINT_H anyway. configure.ac: runtime/mercury_conf.h.in: Do not check for stdint.h. runtime/mercury_std.h: Delete the one remaining use of the MR_HAVE_STDINT_H macro. --- configure.ac | 2 +- runtime/mercury_conf.h.in | 4 +--- runtime/mercury_std.h | 9 ++------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/configure.ac b/configure.ac index af31e073d..7f0c3b98a 100644 --- a/configure.ac +++ b/configure.ac @@ -1484,7 +1484,7 @@ MERCURY_CHECK_FOR_HEADERS( \ sys/types.h sys/stat.h fcntl.h termios.h sys/ioctl.h \ sys/resource.h sys/stropts.h windows.h dirent.h getopt.h malloc.h \ semaphore.h pthread.h time.h spawn.h fenv.h sys/mman.h sys/sem.h \ - sched.h utmpx.h dispatch/dispatch.h stdint.h sys/select.h ) + sched.h utmpx.h dispatch/dispatch.h sys/select.h ) if test "$MR_HAVE_UCONTEXT_H" != 1; then MERCURY_CHECK_FOR_HEADERS(sys/ucontext.h) diff --git a/runtime/mercury_conf.h.in b/runtime/mercury_conf.h.in index 63e43cb36..b847ffce1 100644 --- a/runtime/mercury_conf.h.in +++ b/runtime/mercury_conf.h.in @@ -1,7 +1,7 @@ // vim: ts=4 sw=4 expandtab // Copyright (C) 1995-2003, 2005-2012 The University of Melbourne. -// Copyright (C) 2013-2021 The Mercury team. +// Copyright (C) 2013-2021, 2023 The Mercury team. // This file is distributed under the terms specified in COPYING.LIB. // mercury_conf.h.in defines various configuration parameters. @@ -150,7 +150,6 @@ // MR_HAVE_UTMPX_H we have // MR_HAVE_SYS_RESOURCE_H we have // MR_HAVE_DISPATCH_DISPATCH_H we have -// MR_HAVE_STDINT_H we have // MR_HAVE_SYS_SELECT_H we have #undef MR_HAVE_SYS_SIGINFO_H @@ -184,7 +183,6 @@ #undef MR_HAVE_UTMPX_H #undef MR_HAVE_SYS_RESOURCE_H #undef MR_HAVE_DISPATCH_DISPATCH_H -#undef MR_HAVE_STDINT_H #undef MR_HAVE_SYS_SELECT_H // MR_HAVE_POSIX_TIMES is defined if we have the POSIX diff --git a/runtime/mercury_std.h b/runtime/mercury_std.h index 3c953549b..7e44c6102 100644 --- a/runtime/mercury_std.h +++ b/runtime/mercury_std.h @@ -1,7 +1,7 @@ // vim: ts=4 sw=4 expandtab ft=c // Copyright (C) 1993-1995, 1997-2005, 2011-2012 The University of Melbourne. -// Copyright (C) 2014, 2016-2019, 2021 The Mercury team. +// Copyright (C) 2014, 2016-2019, 2021-2023 The Mercury team. // This file is distributed under the terms specified in COPYING.LIB. // std.h - "standard" [sic] definitions for C: @@ -15,12 +15,7 @@ // even if the system libraries we include below it define any functions. #include "mercury_regs.h" - -#if defined(MR_HAVE_STDINT_H) - #include -#else - #error "Mercury requires a system that provides stdint.h" -#endif +#include // On Windows we need to define _CRT_RAND_S *before* stdlib.h is included, // otherwise the declaration for rand_s() will not be visible.