Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
Re: [Freeciv-Dev] MFC patches
Home

Re: [Freeciv-Dev] MFC patches

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Andy Black <ablack@xxxxxxxxxxxxxx>
Cc: Freeciv Developer Mailing List <freeciv-dev@xxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] MFC patches
From: Mitch Davis <mjd@xxxxxxxxxx>
Date: Fri, 02 Jul 1999 11:57:25 +1000

Andy Black wrote:
> 
> >Please also start preprocessor directives in the first column, some
> >very old cpp's don't accept them otherwise.
> 
> common/log.c has that problem (indented preprocessor directives), or are
> you refering to nested directives?

What he's referring to is that some compilers don't like
preprocessor directives where the # is not the very first character
on the line.

Here's your code:

> -#if IS_BETA_VERSION
> +#if (defined(GENERATING68K) || defined(GENERATINGPPC)) /* mac alternate
> beta */
> +  #if IS_BETA_VERSION
> +    con_write(C_COMMENT,"This is an alpha/beta version of MacFreeciv. "
> +            " This is based on the 1.8.0 Version of the Freeciv code. "
> +            " Send error/bug reports to :%s"
> +            " Visit
> http://www.geocities.com/SiliconValley/Orchard/8738/MFC/index.html\n";
> +            "for new versions of this project",MAILING_LIST);
> +  #endif
> +#else
> +  #if IS_BETA_VERSION
>    con_write(C_COMMENT, "Freeciv 1.8 will be released "
>             "third week of March at %s", WEBSITE_URL);
> +  #endif
>  #endif
> +

You can nest directives, and you can indent them, but the # must
be the first char, eg,

#if (defined(GENERATING68K) || defined(GENERATINGPPC)) /* mac
#  if IS_BETA_VERSION
....
#  endif
#else
#  if IS_BETA_VERSION
....
#  endif
#endif

Hope this helps.

Regards,

Mitch.
--
| mailto:mjd@xxxxxxxxxx       | Not the official view of: |
| mailto:mjd@xxxxxxxxxxxxxxxx | Australian Calculator Opn |
| Certified Linux Evangelist! | Hewlett Packard Australia |

NOTE: HP Australia are having significant problems with their
NOTE: mail system at the moment, both with sending and receiving.
NOTE: It's not safe to assume your mail gets to me :-(

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