Author: cazfi
Date: Sun Apr 26 17:40:55 2015
New Revision: 28883

URL: http://svn.gna.org/viewcvs/freeciv?rev=28883&view=rev
Log:
Added configure check that preprocessor __VA_ARGS__ handling works the way we 
expect.

See patch #6033

Modified:
    branches/S2_6/configure.ac
    branches/S2_6/m4/c99.m4

Modified: branches/S2_6/configure.ac
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/configure.ac?rev=28883&r1=28882&r2=28883&view=diff
==============================================================================
--- branches/S2_6/configure.ac  (original)
+++ branches/S2_6/configure.ac  Sun Apr 26 17:40:55 2015
@@ -480,6 +480,7 @@
 AM_PROG_CC_C_O
 AC_PROG_CXX
 FC_WORKING_CXX
+FC_C99_TOKEN_CONCENATION
 
 AC_CHECK_PROG(UNAME,uname,uname,:)
 

Modified: branches/S2_6/m4/c99.m4
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/m4/c99.m4?rev=28883&r1=28882&r2=28883&view=diff
==============================================================================
--- branches/S2_6/m4/c99.m4     (original)
+++ branches/S2_6/m4/c99.m4     Sun Apr 26 17:40:55 2015
@@ -83,3 +83,19 @@
     AC_MSG_ERROR([A compiler supporting C99's stdint.h is required])
   fi
 ])
+
+# Check that token concenation works as we expect
+#
+AC_DEFUN([FC_C99_TOKEN_CONCENATION],
+[
+AC_CACHE_CHECK([whether preprocessor token concenation works],
+  [ac_cv_c99_token_concenation],
+  [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define COMBINE(a, b) a ## b
+  #define CALLER(...) COMBINE(, __VA_ARGS__)]],
+    [[CALLER();
+    char *text = CALLER("string");]])],
+  [ac_cv_c99_token_concenation=yes],[ac_cv_c99_token_concenation=no])])
+  if test "x${ac_cv_c99_token_concenation}" != "xyes" ; then
+    AC_MSG_ERROR([A preprocessor supporting token concenation is required])
+  fi
+])


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

Reply via email to