Mercurial > gnulib
annotate m4/printf-posix.m4 @ 17363:5a51fb7777a9
sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin
Problem reported by Marco Atzeri in
<http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>.
* lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]:
Simply delegate to the system <sys/select.h> in this case too.
Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only
if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to
be needed on Solaris either.
* lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]:
Simply delgate to the system <sys/time.h> in this case.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 19 Mar 2013 09:08:47 -0700 |
parents | e542fd46ad6f |
children | 344018b6e5d7 |
rev | line source |
---|---|
13579
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
1 # printf-posix.m4 serial 6 (gettext-0.18.2) |
17249
e542fd46ad6f
maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents:
16201
diff
changeset
|
2 dnl Copyright (C) 2003, 2007, 2009-2013 Free Software Foundation, Inc. |
5659
be44f23226e0
Update from GNU gettext 0.14.2.
Bruno Haible <bruno@clisp.org>
parents:
5008
diff
changeset
|
3 dnl This file is free software; the Free Software Foundation |
be44f23226e0
Update from GNU gettext 0.14.2.
Bruno Haible <bruno@clisp.org>
parents:
5008
diff
changeset
|
4 dnl gives unlimited permission to copy and/or distribute it, |
be44f23226e0
Update from GNU gettext 0.14.2.
Bruno Haible <bruno@clisp.org>
parents:
5008
diff
changeset
|
5 dnl with or without modifications, as long as this notice is preserved. |
4894
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 dnl From Bruno Haible. |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 dnl Test whether the printf() function supports POSIX/XSI format strings with |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 dnl positions. |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 AC_DEFUN([gt_PRINTF_POSIX], |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 [ |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 AC_REQUIRE([AC_PROG_CC]) |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings], |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 gt_cv_func_printf_posix, |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 [ |
13579
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
17 AC_RUN_IFELSE( |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
18 [AC_LANG_SOURCE([[ |
4894
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 #include <stdio.h> |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 #include <string.h> |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 /* The string "%2$d %1$d", with dollar characters protected from the shell's |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 dollar expansion (possibly an autoconf bug). */ |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' }; |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 static char buf[100]; |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 int main () |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 { |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 sprintf (buf, format, 33, 55); |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 return (strcmp (buf, "55 33") != 0); |
13579
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
29 }]])], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
30 [gt_cv_func_printf_posix=yes], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
31 [gt_cv_func_printf_posix=no], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
32 [ |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
33 AC_EGREP_CPP([notposix], [ |
8469 | 34 #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ |
4894
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 notposix |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 #endif |
13579
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
37 ], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
38 [gt_cv_func_printf_posix="guessing no"], |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
39 [gt_cv_func_printf_posix="guessing yes"]) |
da9779900713
Modernize AC_TRY_RUN invocations.
Bruno Haible <bruno@clisp.org>
parents:
13087
diff
changeset
|
40 ]) |
4894
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 ]) |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
42 case $gt_cv_func_printf_posix in |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
43 *yes) |
11007
f6cba5a556ce
many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents:
10979
diff
changeset
|
44 AC_DEFINE([HAVE_POSIX_PRINTF], [1], |
4894
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
45 [Define if your printf() function supports format strings with positions.]) |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
46 ;; |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
47 esac |
ef4500f50409
fprintf() test, from gettext-0.13.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
48 ]) |