[m-rev.] diff: delete MR_HAVE_STDINT_H

Julien Fischer jfischer at opturion.com
Sun Dec 3 00:10:25 AEDT 2023


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.

Julien.

diff --git a/configure.ac b/configure.ac
index af31e07..7f0c3b9 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 63e43cb..b847ffc 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 <utmpx.h>
  //  MR_HAVE_SYS_RESOURCE_H  we have <sys/resource.h>
  //  MR_HAVE_DISPATCH_DISPATCH_H we have <dispatch/dispatch.h>
-//  MR_HAVE_STDINT_H        we have <stdint.h>
  //  MR_HAVE_SYS_SELECT_H    we have <sys/select.h>

  #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 3c95354..7e44c61 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 <stdint.h>
-#else
-    #error "Mercury requires a system that provides stdint.h"
-#endif
+#include <stdint.h>

  // On Windows we need to define _CRT_RAND_S *before* stdlib.h is included,
  // otherwise the declaration for rand_s() will not be visible.


More information about the reviews mailing list