Author: cazfi
Date: Wed Dec 17 22:46:11 2014
New Revision: 27335

URL: http://svn.gna.org/viewcvs/freeciv?rev=27335&view=rev
Log:
Made fcintl.h and shared.h not to depend on fc_config.h, but only at 
freeciv_config.h that
can be included to external projects.

Reported by Zakri Kneebone <i1abnrk>

See bug #23001

Modified:
    trunk/configure.ac
    trunk/gen_headers/freeciv_config.h.in
    trunk/utility/fcintl.h
    trunk/utility/shared.h

Modified: trunk/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/configure.ac?rev=27335&r1=27334&r2=27335&view=diff
==============================================================================
--- trunk/configure.ac  (original)
+++ trunk/configure.ac  Wed Dec 17 22:46:11 2014
@@ -515,6 +515,10 @@
 PODOMAINS="freeciv nations ruledit"
 
 AM_GNU_GETTEXT([external], [need-ngettext])
+
+if test "x$USE_NLS" = "xyes" ; then
+  AC_DEFINE([FREECIV_ENABLE_NLS], [1], [Native language support enabled])
+fi
 
 PKG_PROG_PKG_CONFIG
 PKG_CHECK_MODULES([CURL], [libcurl >= 7.9.7],,
@@ -1071,8 +1075,10 @@
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS([fcntl.h sys/time.h sys/types.h unistd.h sys/utsname.h \
-                  sys/file.h libintl.h signal.h strings.h execinfo.h \
-                  libgen.h locale.h])
+                  sys/file.h signal.h strings.h execinfo.h \
+                  libgen.h])
+AC_CHECK_HEADERS([locale.h], [AC_DEFINE([FREECIV_HAVE_LOCALE_H], [1], 
[locale.h available])])
+AC_CHECK_HEADERS([libintl.h], [AC_DEFINE([FREECIV_HAVE_LIBINTL_H], [1], 
[libint.h available])])
 AC_HEADER_STDBOOL
 dnl Avoid including the unix emulation layer if we build mingw executables
 dnl There would be type conflicts between winsock and bsd/unix includes

Modified: trunk/gen_headers/freeciv_config.h.in
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/gen_headers/freeciv_config.h.in?rev=27335&r1=27334&r2=27335&view=diff
==============================================================================
--- trunk/gen_headers/freeciv_config.h.in       (original)
+++ trunk/gen_headers/freeciv_config.h.in       Wed Dec 17 22:46:11 2014
@@ -32,4 +32,13 @@
 /* Has thread condition variable implementation */
 #undef FREECIV_HAVE_THREAD_COND
 
+/* Native language support enabled */
+#undef FREECIV_ENABLE_NLS
+
+/* locale.h available */
+#undef FREECIV_HAVE_LOCALE_H
+
+/* libintl.h available */
+#undef FREECIV_HAVE_LIBINTL_H
+
 #endif /* FC__FREECIV_CONFIG_H */

Modified: trunk/utility/fcintl.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/fcintl.h?rev=27335&r1=27334&r2=27335&view=diff
==============================================================================
--- trunk/utility/fcintl.h      (original)
+++ trunk/utility/fcintl.h      Wed Dec 17 22:46:11 2014
@@ -17,24 +17,20 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#ifdef HAVE_CONFIG_H
-#ifndef FC_CONFIG_H             /* this should be defined in fc_config.h */
-#error Files including fcintl.h should also include fc_config.h directly
-#endif
-#endif
+#include "freeciv_config.h"
 
-#ifdef HAVE_LOCALE_H
+#ifdef FREECIV_HAVE_LOCALE_H
 #include <locale.h>
 #endif
 
 #include "shared.h" /* bool */
 
-#ifdef ENABLE_NLS
+#ifdef FREECIV_ENABLE_NLS
 
 /* Include libintl.h only if nls enabled.
  * It defines some wrapper macros that
  * we don't want defined when nls is disabled. */
-#ifdef HAVE_LIBINTL_H
+#ifdef FREECIV_HAVE_LIBINTL_H
 #include <libintl.h>
 #endif
 
@@ -48,7 +44,7 @@
 /* Ruledit */
 #define R__(String) dgettext("freeciv-ruledit", String)
 
-#else  /* ENABLE_NLS */
+#else  /* FREECIV_ENABLE_NLS */
 
 /* Core freeciv */
 #define _(String) (String)
@@ -67,7 +63,7 @@
 #define textdomain(Domain)
 #define bindtextdomain(Package, Directory)
 
-#endif /* ENABLE_NLS */
+#endif /* FREECIV_ENABLE_NLS */
 
 /* This provides an untranslated version of Q_ that allows the caller to
  * get access to the original string.  This may be needed for comparisons,

Modified: trunk/utility/shared.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/shared.h?rev=27335&r1=27334&r2=27335&view=diff
==============================================================================
--- trunk/utility/shared.h      (original)
+++ trunk/utility/shared.h      Wed Dec 17 22:46:11 2014
@@ -24,12 +24,6 @@
 /* utility */
 #include "log.h"
 #include "support.h" /* bool, fc__attribute */
-
-#ifdef HAVE_CONFIG_H
-#ifndef FC_CONFIG_H  /* this should be defined in fc_config.h */
-#error Files including fcintl.h should also include fc_config.h directly
-#endif
-#endif
 
 /* Changing these will break network compatability! */
 #define MAX_LEN_ADDR     256   /* see also MAXHOSTNAMELEN and RFC 1123 2.1 */


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to