Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2000:
[Freeciv-Dev] Use of config.h .
Home

[Freeciv-Dev] Use of config.h .

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Use of config.h .
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: 21 Sep 2000 20:38:10 +0200

In my host lookup patch, I've added a function

    int look_up_host(const char *, struct sockaddr_in *);

The problem with this prototype is that struct sockaddr_in is defined
in header file with an associated HAVE_FOO_H define to protect it from
inclusion on systems that don't have it.

Since many Freeciv source files don't include config.h, that define is
never set, which leads to the header not being included, which means
that struct sockaddr_in in not defined, which causes a warning from
GCC.  Whew.

I think that the easiest way to avoid this kind of trouble is to
include config.h in _all_ source files.  However, there are certainly
other ways to get around this, so I'd like to bring the issue up for
discussion.

-- 
Big Gaute (not to be confused with LG)
I'm losing my hair..did it go to ATLANTIC CITY??



[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Use of config.h ., Gaute B Strokkenes <=