Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2004:
[Freeciv-Dev] Re: (PR#8239) Speclist generator
Home

[Freeciv-Dev] Re: (PR#8239) Speclist generator

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#8239) Speclist generator
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Tue, 23 Mar 2004 06:23:37 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=8239 >

On Tue, 23 Mar 2004, Raimar Falke wrote:
> Wrong word. I mean that all functions and types for a certain
> object/class (like city) are all in the same file.

Well. From a programmer's perspective, there is no difference. Both are
included. From the compiler's perspective, I don't see much difference,
either.

(Except perhaps that a generator'ed speclist header file is much easier to
read than speclist.h)

> > > That we should ban macros and inline functions from the header files.
> >
> > Then where do we put them?
>
> Make all normal functions and put them in the .c file. And yes I
> exclude things like iterate here which have to be macros.

I must be missing something. Don't inline functions have to be implemented
in a header file if they are to be used in several files?

> > It is a bit complicated. The core problem is that you can neither
> > conditionally define a macro nor expand macros in a macro name.
>
> Both are possible. See CHECK_MAP_POS and SPECLIST_PASTE. The latter
> isn't beautiful but possible.

Ugh. What I meant to write is: can neither define a macro that defines a
macro nor define macros names containing macros.

Now, SPECLIST_PASTE is a really clever hack. However, it has some
limitations. Let me get back to that.

  - Per




[Prev in Thread] Current Thread [Next in Thread]