[m-dev.] for review: More runtime header reorganisation

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jul 27 19:48:59 AEST 1998


On 27-Jul-1998, Andrew Bromage <bromage at cs.mu.OZ.AU> wrote:
> 
> Another minor reorganisation for compatibility with FreeBSD headers.
> 
> mercury_type_info.h:
>         Move MR_ArrayType into mercury_library_types.h.
> 
> mercury_types.h:
>         Move MercuryFile into mercury_library_types.h.
> 
> mercury_library_types.h:
>         New file, intended for the declaration of C types which are
>         really the province of the library rather than the runtime, but
>         which the runtime still needs.
> 
> mercury_imp.h:
>         Import mercury_library_types.h.

Thanks, Andrew.  That looks good.  I do have a couple of comments, though.

One quibble is that the log message doesn't explain the real
rationale for the change, which is the following:

	- the global register declarations in mercury_regs.h must come
	  before any standard header files are #included,
	- the "mercury_regs.h" file needs `Word', etc. from "mercury_types.h",
	- hence "mercury_types.h" must not #include any standard header files;
	- in addition, the `MercuryFile' type needs `FILE' from <stdio.h>,
	- hence the `MercuryFile' type cannot be declared in "mercury_types.h".

I think you should add a comment to the top of mercury_types.h, 
similar to the ones in mercury_conf.h.in and mercury_conf_param.h,
so that this doesn't happen again:

	/*
	** IMPORTANT NOTE:
	** This file must not contain any #include statements,
	** other than the #include of "mercury_conf.h",
	** for reasons explained in mercury_imp.h.
	*/

My final comment is that you need to include the new header file
in the list of header files in the Mmakefile.

Can you please send another diff when you've addressed these comments?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list