[m-dev.] diff: MR_int_leastN_t
Zoltan Somogyi
zs at cs.mu.OZ.AU
Mon Aug 23 16:57:03 AEST 1999
This is the part of my earlier diff for using our own MR_ prefixed versions
of int_leastN_t and friends. It has a bit more changes than the earlier diff.
The reason is that I tested whether my earlier changes were sufficient
by doing separate "mmake realclean"s in the affected directories and checking
for errors in the rebuild, but of course mmake realclean does not remove object
files in the runtime and trace directories like I thought. When I did force
all files to be recompiled, a few more things to be fixed came to my attention.
However, all these extra things are minor, so there is no burning need for a
second review.
------------
Use our own MR_ prefixed variants of int_leastN_t.
configure.in:
Do not test for inttypes.h, stdint.h, or sys/types.h; check
for at-least-given-sized integers directly.
runtime/mercury_conf.h.in:
runtime/mercury_types.h:
Always use our own MR_int_leastN_t types; do not include inttypes.h,
stdint.h or sys/types.h.
runtime/mercury_bootstrap.h:
Add #defines mapping e.g. int_least8_t to MR_int_least8_t, since
C sources generated by previous compiler versions may have them.
runtime/mercury_stack_layout.h:
trace/mercury_trace.c:
Add the MR_ prefix where necessary.
compiler/llds_out.m:
Add the MR_ prefix to references to int_leastN_t.
Zoltan.
cvs diff: Diffing .
Index: configure.in
===================================================================
RCS file: /home/mercury1/repository/mercury/configure.in,v
retrieving revision 1.177
diff -u -b -r1.177 configure.in
--- configure.in 1999/07/20 21:29:37 1.177
+++ configure.in 1999/08/18 10:14:40
@@ -675,130 +675,8 @@
fi
fi
#-----------------------------------------------------------------------------#
-AC_CHECK_HEADER(sys/types.h, HAVE_SYS_TYPES_H=1)
-AC_CHECK_HEADER(inttypes.h, HAVE_INTTYPES_H=1)
-AC_CHECK_HEADER(stdint.h, HAVE_STDINT_H=1)
-
-# On some systems, e.g. SGI IRIX 5.2, you can include
-# <inttypes.h>, or <sys/types.h>, but not both!
-
-if test "$HAVE_INTTYPES_H" = 1 && test "$HAVE_SYS_TYPES_H" = 1; then
- AC_CACHE_VAL(mercury_cv_inttypes_compat,
- AC_MSG_CHECKING(whether inttypes.h is compatible with sys/types.h)
- AC_TRY_COMPILE([
- #include <inttypes.h>
- #include <sys/types.h>
- ],
- [],
- [mercury_cv_inttypes_compat=yes], [mercury_cv_inttypes_compat=no]))
- AC_MSG_RESULT($mercury_cv_inttypes_compat)
-
- # If <inttypes.h> is not compatible with <sys/types.h>, then
- # don't use it.
- if test "$mercury_cv_inttypes_compat" = no; then
- HAVE_INTTYPES_H=0
- fi
-fi
-
-if test "$HAVE_SYS_TYPES_H" = 1; then
- AC_DEFINE(HAVE_SYS_TYPES)
-fi
-if test "$HAVE_INTTYPES_H" = 1; then
- AC_DEFINE(HAVE_INTTYPES)
-fi
-if test "$HAVE_STDINT_H" = 1; then
- AC_DEFINE(HAVE_STDINT)
-fi
-
-#-----------------------------------------------------------------------------#
-AC_MSG_CHECKING(for intptr_t)
-AC_CACHE_VAL(mercury_cv_have_intptr_t,
- AC_TRY_COMPILE([
- #ifdef HAVE_STDINT
- #include <stdint.h>
- #endif
- #ifdef HAVE_INTTYPES
- #include <inttypes.h>
- #endif
- #ifdef HAVE_SYS_TYPES
- #include <sys/types.h>
- #endif
- ], [
- changequote(<<,>>)
-
- /* test the existence of the types */
- intptr_t foo;
- uintptr_t bar;
-
- /* check that they have the right size */
- #define ASSERTION \
- (sizeof(intptr_t) == sizeof(void *) && \
- sizeof(uintptr_t) == sizeof(void *))
-
- /* this forces a compile error if ASSERTION is false */
- int array[ASSERTION ? 1 : -1];
-
- changequote([,])
- ],
- [mercury_cv_have_intptr_t=yes],
- [mercury_cv_have_intptr_t=no])
-)
-AC_MSG_RESULT($mercury_cv_have_intptr_t)
-if test "$mercury_cv_have_intptr_t" = yes; then
- AC_DEFINE(MR_HAVE_INTPTR_T)
-fi
-#-----------------------------------------------------------------------------#
-AC_MSG_CHECKING(for int_leastN_t)
-AC_CACHE_VAL(mercury_cv_have_int_leastN_t,
- AC_TRY_COMPILE([
- #ifdef HAVE_STDINT
- #include <stdint.h>
- #endif
- #ifdef HAVE_INTTYPES
- #include <inttypes.h>
- #endif
- #ifdef HAVE_SYS_TYPES
- #include <sys/types.h>
- #endif
- #include <limits.h> /* for CHAR_BIT */
- ], [
- changequote(<<,>>)
-
- /* test the existence of the types */
- int_least8_t foo8;
- uint_least8_t bar8;
- int_least16_t foo16;
- uint_least16_t bar16;
- int_least32_t foo32;
- uint_least32_t bar32;
-
- /* check that they have the right size */
- #define ASSERTION \
- (sizeof(int_least8_t) * CHAR_BIT >= 8 && \
- sizeof(uint_least8_t) * CHAR_BIT >= 8 && \
- sizeof(int_least16_t) * CHAR_BIT >= 16 && \
- sizeof(uint_least16_t) * CHAR_BIT >= 16 && \
- sizeof(int_least32_t) * CHAR_BIT >= 32 && \
- sizeof(uint_least32_t) * CHAR_BIT >= 32)
-
- /* this forces a compile error if ASSERTION is false */
- int array[ASSERTION ? 1 : -1];
-
- changequote([,])
- ],
- [mercury_cv_have_int_leastN_t=yes],
- [mercury_cv_have_int_leastN_t=no])
-)
-AC_MSG_RESULT($mercury_cv_have_int_leastN_t)
-if test "$mercury_cv_have_int_leastN_t" = yes; then
- AC_DEFINE(MR_HAVE_INT_LEASTN_T)
-fi
-#-----------------------------------------------------------------------------#
-if test "$mercury_cv_have_intptr_t" = yes; then
- true
-else
- AC_MSG_CHECKING(for an integer type with the same size as a pointer)
- AC_CACHE_VAL(mercury_cv_word_type,
+AC_MSG_CHECKING(for an integer type with the same size as a pointer)
+AC_CACHE_VAL(mercury_cv_word_type,
AC_TRY_RUN([
#include <stdio.h>
int main() {
@@ -826,8 +704,8 @@
[mercury_cv_word_type=`cat conftest.tags`],
[mercury_cv_word_type=unknown],
[mercury_cv_word_type=unknown])
- )
- if test "$mercury_cv_word_type" = unknown; then
+)
+if test "$mercury_cv_word_type" = unknown; then
AC_TRY_RUN([
#include <stdio.h>
int main() {
@@ -849,18 +727,14 @@
[mercury_cv_word_type=`cat conftest.tags`],
[mercury_cv_word_type=unknown],
[mercury_cv_word_type=unknown])
- fi
- AC_MSG_RESULT($mercury_cv_word_type)
- AC_DEFINE_UNQUOTED(MR_WORD_TYPE, $mercury_cv_word_type)
- MR_WORD_TYPE=$mercury_cv_word_type
- AC_SUBST(MR_WORD_TYPE)
-fi # ! have_int_ptr_t
+fi
+AC_MSG_RESULT($mercury_cv_word_type)
+AC_DEFINE_UNQUOTED(MR_WORD_TYPE, $mercury_cv_word_type)
+MR_WORD_TYPE=$mercury_cv_word_type
+AC_SUBST(MR_WORD_TYPE)
#-----------------------------------------------------------------------------#
-if test "$mercury_cv_have_int_leastN_t" = yes; then
- true
-else
- AC_MSG_CHECKING(for an integer type of at least 32 bits)
- AC_CACHE_VAL(mercury_cv_int_least32_type,
+AC_MSG_CHECKING(for an integer type of at least 64 bits)
+AC_CACHE_VAL(mercury_cv_int_least64_type,
AC_TRY_RUN([
#include <stdio.h>
#include <limits.h>
@@ -871,6 +745,68 @@
if (fp == NULL)
exit(1);
+ if (sizeof(int) * CHAR_BIT >= 64)
+ {
+ fprintf(fp, "int\n");
+ exit(0);
+ }
+
+ if (sizeof(long) * CHAR_BIT >= 64)
+ {
+ fprintf(fp, "long\n");
+ exit(0);
+ }
+
+ fprintf(fp, "unknown\n");
+ exit(1);
+ }],
+ [mercury_cv_int_least64_type=`cat conftest.tags`],
+ [mercury_cv_int_least64_type=unknown],
+ [mercury_cv_int_least64_type=unknown])
+)
+if test "$mercury_cv_int_least64_type" = unknown; then
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <limits.h>
+ int main() {
+ FILE *fp;
+
+ fp = fopen("conftest.tags", "w");
+ if (fp == NULL)
+ exit(1);
+
+ if (sizeof(long long) * CHAR_BIT >= 64)
+ {
+ fprintf(fp, "long long\n");
+ exit(0);
+ }
+
+ fprintf(fp, "unknown\n");
+ exit(1);
+ }],
+ [mercury_cv_int_least64_type=`cat conftest.tags`],
+ [mercury_cv_int_least64_type=unknown],
+ [mercury_cv_int_least64_type=unknown])
+fi
+AC_MSG_RESULT($mercury_cv_int_least64_type)
+if test "$mercury_cv_int_least64_type" != unknown; then
+ AC_DEFINE_UNQUOTED(MR_INT_LEAST64_TYPE, $mercury_cv_int_least64_type)
+ MR_INT_LEAST64_TYPE=$mercury_cv_int_least64_type
+ AC_SUBST(MR_INT_LEAST64_TYPE)
+fi
+#-----------------------------------------------------------------------------#
+AC_MSG_CHECKING(for an integer type of at least 32 bits)
+AC_CACHE_VAL(mercury_cv_int_least32_type,
+ AC_TRY_RUN([
+ #include <stdio.h>
+ #include <limits.h>
+ int main() {
+ FILE *fp;
+
+ fp = fopen("conftest.tags", "w");
+ if (fp == NULL)
+ exit(1);
+
if (sizeof(int) * CHAR_BIT >= 32)
{
fprintf(fp, "int\n");
@@ -889,14 +825,14 @@
[mercury_cv_int_least32_type=`cat conftest.tags`],
[mercury_cv_int_least32_type=unknown],
[mercury_cv_int_least32_type=unknown])
- )
- AC_MSG_RESULT($mercury_cv_int_least32_type)
- AC_DEFINE_UNQUOTED(MR_INT_LEAST32_TYPE, $mercury_cv_int_least32_type)
- MR_INT_LEAST32_TYPE=$mercury_cv_int_least32_type
- AC_SUBST(MR_INT_LEAST32_TYPE)
+)
+AC_MSG_RESULT($mercury_cv_int_least32_type)
+AC_DEFINE_UNQUOTED(MR_INT_LEAST32_TYPE, $mercury_cv_int_least32_type)
+MR_INT_LEAST32_TYPE=$mercury_cv_int_least32_type
+AC_SUBST(MR_INT_LEAST32_TYPE)
#-----------------------------------------------------------------------------#
- AC_MSG_CHECKING(for an integer type of at least 16 bits)
- AC_CACHE_VAL(mercury_cv_int_least16_type,
+AC_MSG_CHECKING(for an integer type of at least 16 bits)
+AC_CACHE_VAL(mercury_cv_int_least16_type,
AC_TRY_RUN([
#include <stdio.h>
#include <limits.h>
@@ -925,12 +861,11 @@
[mercury_cv_int_least16_type=`cat conftest.tags`],
[mercury_cv_int_least16_type=unknown],
[mercury_cv_int_least16_type=unknown])
- )
- AC_MSG_RESULT($mercury_cv_int_least16_type)
- AC_DEFINE_UNQUOTED(MR_INT_LEAST16_TYPE, $mercury_cv_int_least16_type)
- MR_INT_LEAST16_TYPE=$mercury_cv_int_least16_type
- AC_SUBST(MR_INT_LEAST16_TYPE)
-fi # ! have_int_leastN_t
+)
+AC_MSG_RESULT($mercury_cv_int_least16_type)
+AC_DEFINE_UNQUOTED(MR_INT_LEAST16_TYPE, $mercury_cv_int_least16_type)
+MR_INT_LEAST16_TYPE=$mercury_cv_int_least16_type
+AC_SUBST(MR_INT_LEAST16_TYPE)
#-----------------------------------------------------------------------------#
AC_MSG_CHECKING(the number of low tag bits available)
AC_CACHE_VAL(mercury_cv_low_tag_bits,
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/llds_out.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/llds_out.m,v
retrieving revision 1.118
diff -u -b -r1.118 llds_out.m
--- llds_out.m 1999/08/16 05:48:00 1.118
+++ llds_out.m 1999/08/23 06:18:39
@@ -2367,12 +2367,12 @@
:- pred output_llds_type(llds_type::in, io__state::di, io__state::uo) is det.
-output_llds_type(int_least8) --> io__write_string("int_least8_t").
-output_llds_type(uint_least8) --> io__write_string("uint_least8_t").
-output_llds_type(int_least16) --> io__write_string("int_least16_t").
-output_llds_type(uint_least16) --> io__write_string("uint_least16_t").
-output_llds_type(int_least32) --> io__write_string("int_least32_t").
-output_llds_type(uint_least32) --> io__write_string("uint_least32_t").
+output_llds_type(int_least8) --> io__write_string("MR_int_least8_t").
+output_llds_type(uint_least8) --> io__write_string("MR_uint_least8_t").
+output_llds_type(int_least16) --> io__write_string("MR_int_least16_t").
+output_llds_type(uint_least16) --> io__write_string("MR_uint_least16_t").
+output_llds_type(int_least32) --> io__write_string("MR_int_least32_t").
+output_llds_type(uint_least32) --> io__write_string("MR_uint_least32_t").
output_llds_type(bool) --> io__write_string("Integer").
output_llds_type(integer) --> io__write_string("Integer").
output_llds_type(unsigned) --> io__write_string("Unsigned").
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/exceptions
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing library
cvs diff: Diffing profiler
cvs diff: Diffing runtime
Index: runtime/mercury_bootstrap.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_bootstrap.h,v
retrieving revision 1.7
diff -u -b -r1.7 mercury_bootstrap.h
--- mercury_bootstrap.h 1999/08/12 09:58:48 1.7
+++ mercury_bootstrap.h 1999/08/20 07:05:31
@@ -15,6 +15,17 @@
#ifndef MERCURY_BOOTSTRAP_H
#define MERCURY_BOOTSTRAP_H
+#define uintptr_t MR_uintptr_t
+#define intptr_t MR_intptr_t
+#define uint_least64_t MR_uint_least64_t
+#define int_least64_t MR_int_least64_t
+#define uint_least32_t MR_uint_least32_t
+#define int_least32_t MR_int_least32_t
+#define uint_least16_t MR_uint_least16_t
+#define int_least16_t MR_int_least16_t
+#define uint_least8_t MR_uint_least8_t
+#define int_least8_t MR_int_least8_t
+
#ifndef MR_NO_BACKWARDS_COMPAT
/*
Index: runtime/mercury_conf.h.in
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_conf.h.in,v
retrieving revision 1.21
diff -u -b -r1.21 mercury_conf.h.in
--- mercury_conf.h.in 1999/05/31 18:25:27 1.21
+++ mercury_conf.h.in 1999/08/18 10:14:56
@@ -46,13 +46,13 @@
#undef MR_WORD_TYPE
/*
-** MR_INT_LEAST16_TYPE:
-** This must be a C integral type (e.g. short, int)
+** MR_INT_LEAST64_TYPE:
+** This must be a C integral type (e.g. int, long, long long)
** without any explicit signedness.
-** It ought to be at least 16 bits in size.
-** It may be bigger, but any bits beyond 16 are not used.
+** It ought to be at least 64 bits in size.
+** It may be bigger, but any bits beyond 64 are not used.
*/
-#undef MR_INT_LEAST16_TYPE
+#undef MR_INT_LEAST64_TYPE
/*
** MR_INT_LEAST32_TYPE:
@@ -64,6 +64,15 @@
#undef MR_INT_LEAST32_TYPE
/*
+** MR_INT_LEAST16_TYPE:
+** This must be a C integral type (e.g. short, int)
+** without any explicit signedness.
+** It ought to be at least 16 bits in size.
+** It may be bigger, but any bits beyond 16 are not used.
+*/
+#undef MR_INT_LEAST16_TYPE
+
+/*
** LOW_TAG_BITS: an integer, specifying the number of low-order tag bits
** we can use. Normally this is the base-2 log of the word size in bytes.
*/
@@ -92,9 +101,6 @@
** HAVE_SYS_PARAM we have <sys/param.h>
** HAVE_SYS_WAIT we have <sys/wait.h>
** HAVE_DLFCN_H we have <dlfcn.h>
-** HAVE_STDINT we have <stdint.h>
-** HAVE_INTTYPES we have <inttypes.h>
-** HAVE_SYS_TYPES we have <sys/types.h>
*/
#undef HAVE_SYS_SIGINFO
#undef HAVE_UCONTEXT
@@ -104,9 +110,6 @@
#undef HAVE_SYS_PARAM
#undef HAVE_SYS_WAIT
#undef HAVE_DLFCN_H
-#undef HAVE_STDINT
-#undef HAVE_INTTYPES
-#undef HAVE_SYS_TYPES
/*
** The following macros are defined iff the corresponding type
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.25
diff -u -b -r1.25 mercury_stack_layout.h
--- mercury_stack_layout.h 1999/05/28 05:29:09 1.25
+++ mercury_stack_layout.h 1999/08/18 10:32:14
@@ -42,7 +42,7 @@
** that we do not set the 1 bit unless we also set the 2 bit.
*/
-typedef int_least16_t MR_Determinism;
+typedef MR_int_least16_t MR_Determinism;
#define MR_DETISM_DET 6
#define MR_DETISM_SEMI 2
@@ -70,10 +70,11 @@
*/
/*
-** MR_Long_Lval is a uint_least32_t which describes an location. This includes
-** lvals such as stack slots, general registers, and special registers
-** such as succip, hp, etc, as well as locations whose address is given
-** as a typeinfo inside the type class info structure pointed to by an lval.
+** MR_Long_Lval is a MR_uint_least32_t which describes an location.
+** This includes lvals such as stack slots, general registers, and special
+** registers such as succip, hp, etc, as well as locations whose address is
+** given as a typeinfo inside the type class info structure pointed to by an
+** lval.
**
** What kind of location an MR_Long_Lval refers to is encoded using
** a low tag with MR_LONG_LVAL_TAGBITS bits; the type MR_Lval_Type describes
@@ -104,7 +105,7 @@
** which must be kept in sync with the constants and macros defined here.
*/
-typedef uint_least32_t MR_Long_Lval;
+typedef MR_uint_least32_t MR_Long_Lval;
typedef enum {
MR_LONG_LVAL_TYPE_R,
@@ -149,9 +150,9 @@
((Word) ((n) << MR_LONG_LVAL_TAGBITS) + MR_LONG_LVAL_TYPE_R)
/*
-** MR_Short_Lval is a uint_least8_t which describes an location. This includes
-** lvals such as stack slots and general registers that have small numbers,
-** and special registers such as succip, hp, etc.
+** MR_Short_Lval is a MR_uint_least8_t which describes an location. This
+** includes lvals such as stack slots and general registers that have small
+** numbers, and special registers such as succip, hp, etc.
**
** What kind of location an MR_Long_Lval refers to is encoded using
** a low tag with 2 bits; the type MR_Short_Lval_Type describes
@@ -168,7 +169,7 @@
** which must be kept in sync with the constants and macros defined here.
*/
-typedef uint_least8_t MR_Short_Lval;
+typedef MR_uint_least8_t MR_Short_Lval;
typedef enum {
MR_SHORT_LVAL_TYPE_R,
@@ -213,7 +214,7 @@
*/
typedef struct MR_Type_Param_Locns_Struct {
- uint_least32_t MR_tp_param_count;
+ MR_uint_least32_t MR_tp_param_count;
MR_Long_Lval MR_tp_param_locns[MR_VARIABLE_SIZED];
} MR_Type_Param_Locns;
@@ -230,8 +231,8 @@
*/
typedef struct MR_Var_Name_Struct {
- uint_least16_t MR_var_num;
- uint_least16_t MR_var_name_offset;
+ MR_uint_least16_t MR_var_num;
+ MR_uint_least16_t MR_var_name_offset;
} MR_Var_Name;
/*
@@ -265,11 +266,12 @@
#define MR_end_of_var_ptis(slvs) \
(&MR_var_pti((slvs), MR_all_desc_var_count(slvs)))
#define MR_long_desc_var_locn(slvs, i) \
- (((uint_least32_t *) MR_end_of_var_ptis(slvs))[(i)])
+ (((MR_uint_least32_t *) MR_end_of_var_ptis(slvs))[(i)])
#define MR_end_of_long_desc_var_locns(slvs) \
(&MR_long_desc_var_locn((slvs), MR_long_desc_var_count(slvs)))
#define MR_short_desc_var_locn(slvs, i) \
- (((uint_least8_t *) MR_end_of_long_desc_var_locns(slvs))[(i)])
+ (((MR_uint_least8_t *) \
+ MR_end_of_long_desc_var_locns(slvs))[(i)])
#define MR_name_if_present(module_layout, vars, i) \
(((vars)->MR_slvs_names == NULL) ? "" : \
@@ -351,7 +353,7 @@
/* stack traversal group */
Code *MR_sle_code_addr;
MR_Long_Lval MR_sle_succip_locn;
- int_least16_t MR_sle_stack_slots;
+ MR_int_least16_t MR_sle_stack_slots;
MR_Determinism MR_sle_detism;
/* proc id group */
@@ -362,8 +364,8 @@
*MR_sle_call_label;
struct MR_Module_Layout_Struct
*MR_sle_module_layout;
- int_least16_t MR_sle_maybe_from_full;
- int_least16_t MR_sle_maybe_decl_debug;
+ MR_int_least16_t MR_sle_maybe_from_full;
+ MR_int_least16_t MR_sle_maybe_decl_debug;
} MR_Stack_Layout_Entry;
#define MR_sle_user MR_sle_proc_id.MR_proc_user
Index: runtime/mercury_types.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_types.h,v
retrieving revision 1.17
diff -u -b -r1.17 mercury_types.h
--- mercury_types.h 1999/05/31 18:25:28 1.17
+++ mercury_types.h 1999/08/18 10:14:56
@@ -22,45 +22,41 @@
#include "mercury_conf.h"
/*
-** This section defines the relevant types from C9X's
-** <stdint.h> header, either by including that header,
-** or if necessary by emulating it ourselves, with some
-** help from the autoconfiguration script.
+** This section defines types similar to C9X's <stdint.h> header.
+** We do not use <stdint.h>, or the <inttypes.h> or <sys/types.h> files
+** that substitute for it on some systems because (a) some such files
+** do not define the types we need, and (b) some such files include
+** inline function definitions. The latter is a problem because we want to
+** reserve some real machine registers for Mercury abstract machine registers.
+** To be effective, the definitions of these global register variables
+** must precede all function definitions, and we want to put their
+** definitions after mercury_types.h.
*/
-#ifdef HAVE_STDINT
- #include <stdint.h>
-#endif
-#ifdef HAVE_INTTYPES
- #include <inttypes.h>
-#endif
-#ifdef HAVE_SYS_TYPES
- #include <sys/types.h>
-#endif
+typedef unsigned MR_WORD_TYPE MR_uintptr_t;
+typedef MR_WORD_TYPE MR_intptr_t;
-#ifndef MR_HAVE_INTPTR_T
- typedef unsigned MR_WORD_TYPE uintptr_t;
- typedef MR_WORD_TYPE intptr_t;
+#ifdef MR_INT_LEAST64_TYPE
+typedef unsigned MR_INT_LEAST64_TYPE MR_uint_least64_t;
+typedef MR_INT_LEAST64_TYPE MR_int_least64_t;
#endif
-#ifndef MR_HAVE_INT_LEASTN_T
- typedef unsigned MR_INT_LEAST32_TYPE uint_least32_t;
- typedef MR_INT_LEAST32_TYPE int_least32_t;
- typedef unsigned MR_INT_LEAST16_TYPE uint_least16_t;
- typedef MR_INT_LEAST16_TYPE int_least16_t;
- typedef unsigned char uint_least8_t;
- typedef signed char int_least8_t;
-#endif
+typedef unsigned MR_INT_LEAST32_TYPE MR_uint_least32_t;
+typedef MR_INT_LEAST32_TYPE MR_int_least32_t;
+typedef unsigned MR_INT_LEAST16_TYPE MR_uint_least16_t;
+typedef MR_INT_LEAST16_TYPE MR_int_least16_t;
+typedef unsigned char MR_uint_least8_t;
+typedef signed char MR_int_least8_t;
/*
** This section defines the basic types that we use.
** Note that we require sizeof(Word) == sizeof(Integer) == sizeof(Code*).
*/
-typedef uintptr_t Word;
-typedef intptr_t Integer;
-typedef uintptr_t Unsigned;
-typedef intptr_t Bool;
+typedef MR_uintptr_t Word;
+typedef MR_intptr_t Integer;
+typedef MR_uintptr_t Unsigned;
+typedef MR_intptr_t Bool;
/*
** `Code *' is used as a generic pointer-to-label type that can point
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.10
diff -u -b -r1.10 mercury_trace.c
--- mercury_trace.c 1999/05/28 05:29:39 1.10
+++ mercury_trace.c 1999/08/18 10:33:14
@@ -58,7 +58,7 @@
MR_Trace_Port port, Unsigned seqno, Unsigned depth,
const char *path, int max_r_num);
static Word MR_trace_find_input_arg(const MR_Stack_Layout_Label *label,
- Word *saved_regs, uint_least16_t var_num,
+ Word *saved_regs, MR_uint_least16_t var_num,
bool *succeeded);
/*
@@ -423,7 +423,7 @@
static Word
MR_trace_find_input_arg(const MR_Stack_Layout_Label *label, Word *saved_regs,
- uint_least16_t var_num, bool *succeeded)
+ MR_uint_least16_t var_num, bool *succeeded)
{
const MR_Stack_Layout_Vars *vars;
int i;
cvs diff: Diffing trial
cvs diff: Diffing util
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list