Author: cazfi
Date: Sun Apr 26 17:40:48 2015
New Revision: 28882

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

See patch #6033

Modified:
    trunk/configure.ac
    trunk/m4/c99.m4

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

Modified: trunk/m4/c99.m4
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/m4/c99.m4?rev=28882&r1=28881&r2=28882&view=diff
==============================================================================
--- trunk/m4/c99.m4     (original)
+++ trunk/m4/c99.m4     Sun Apr 26 17:40:48 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