diff acinclude.m4 @ 328:51bb530a100c

2003-12-7 Brian Masney <masneyb@gftp.org> * configure.in acinclude.m4 lib/misc.c - added AC_INTL_PRINTF macro. If the printf family of functions supports %'ld, then HAVE_INTL_PRINTF will be defined. The appropriate version of insert_commas() can be used.
author masneyb
date Sun, 07 Dec 2003 17:25:13 +0000
parents cf4098008615
children 532eb171d5c2
line wrap: on
line diff
--- a/acinclude.m4	Fri Dec 05 00:22:06 2003 +0000
+++ b/acinclude.m4	Sun Dec 07 17:25:13 2003 +0000
@@ -116,8 +116,8 @@
 
 # serial 1
 
-# This function is derived from
-# http://savannah.gnu.org/cgi-bin/viewcvs/gcc/gcc/libjava/configure.in?rev=1.142.2.7&content-type=text/vnd.viewcvs-markup
+dnl This function is derived from
+dnl http://savannah.gnu.org/cgi-bin/viewcvs/gcc/gcc/libjava/configure.in?rev=1.142.2.7&content-type=text/vnd.viewcvs-markup
 
 AC_DEFUN(AC_TYPE_SOCKLEN_T,
   [AC_MSG_CHECKING([for socklen_t in sys/socket.h])
@@ -129,3 +129,28 @@
       AC_MSG_RESULT(no)])
   ])
 
+# serial 1
+
+dnl This macro checks to see if the printf family of functions supports the
+dnl %'ld format.
+
+dnl Brian Masney <masneyb@gftp.org>
+
+dnl 
+AC_DEFUN(AC_INTL_PRINTF,
+  [AC_MSG_CHECKING([whether the printf family of functions supports %'ld])
+   AC_TRY_RUN([#include <stdio.h>
+               #include <string.h>
+
+               int main(void) {
+                 char buf[20];
+                 sprintf (buf, "%'ld", (long) 1);
+                 if (strchr ('1', buf) == NULL)
+                   return (1);
+                 return (0);
+               }],
+    [AC_DEFINE(HAVE_INTL_PRINTF,1,Define if printf supports %'ld)
+     AC_MSG_RESULT(yes)],
+    [AC_MSG_RESULT(no)])
+  ])
+