Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2004:
[Freeciv-Dev] Re: (PR#9391) #error condition for config.h in shared.h
Home

[Freeciv-Dev] Re: (PR#9391) #error condition for config.h in shared.h

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#9391) #error condition for config.h in shared.h
From: "Jason Dorje Short" <jdorje@xxxxxxxxxxx>
Date: Wed, 14 Jul 2004 11:44:46 -0700
Reply-to: rt@xxxxxxxxxxx

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

Jason Dorje Short wrote:
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=9391 >
> 
> This patch adds an #error check into shared.h to make sure that config.h 
> is included.  This is the same as the check in fcintl.h.  All .c files 
> must include config.h or there are big impossible-to-find problems.


Index: utility/shared.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/utility/shared.h,v
retrieving revision 1.126
diff -u -r1.126 shared.h
--- utility/shared.h    18 May 2004 16:29:30 -0000      1.126
+++ utility/shared.h    14 Jul 2004 18:38:51 -0000
@@ -16,6 +16,12 @@
 #include <stdlib.h>            /* size_t */
 #include <string.h>            /* memset */
 
+#ifdef HAVE_CONFIG_H
+#ifndef FC_CONFIG_H            /* this should be defined in config.h */
+#error Files including fcintl.h should also include config.h directly
+#endif
+#endif
+
 #if __BEOS__
 #include <posix/be_prim.h>
 #define __bool_true_false_are_defined 1

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] Re: (PR#9391) #error condition for config.h in shared.h, Jason Dorje Short <=