1 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/alloca.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/alloca.in.h
2 --- gtk-vnc-0.3.7.dan3/gnulib/lib/alloca.in.h 1970-01-01 01:00:00.000000000 +0100
3 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/alloca.in.h 2008-10-09 15:24:52.000000000 +0100
5 +/* Memory allocation on the stack.
7 + Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software
10 + This program is free software; you can redistribute it and/or modify it
11 + under the terms of the GNU Lesser General Public License as published
12 + by the Free Software Foundation; either version 2.1, or (at your option)
15 + This program is distributed in the hope that it will be useful,
16 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 + General Public License for more details.
20 + You should have received a copy of the GNU Lesser General Public
21 + License along with this program; if not, write to the Free Software
22 + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
25 +/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
26 + means there is a real alloca function. */
30 +/* alloca (N) returns a pointer to N bytes of memory
31 + allocated on the stack, which will last until the function returns.
32 + Use of alloca should be avoided:
33 + - inside arguments of function calls - undefined behaviour,
34 + - in inline functions - the allocation may actually last until the
35 + calling function returns,
36 + - for huge N (say, N >= 65536) - you never know how large (or small)
37 + the stack is, and when the stack cannot fulfill the memory allocation
38 + request, the program just crashes.
43 +# define alloca __builtin_alloca
45 +# define alloca __alloca
46 +# elif defined _MSC_VER
48 +# define alloca _alloca
49 +# elif defined __DECC && defined __VMS
50 +# define alloca __ALLOCA
56 +void *alloca (size_t);
60 +#endif /* _GL_ALLOCA_H */
61 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/arpa_inet.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/arpa_inet.in.h
62 --- gtk-vnc-0.3.7.dan3/gnulib/lib/arpa_inet.in.h 1970-01-01 01:00:00.000000000 +0100
63 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/arpa_inet.in.h 2008-10-09 15:24:52.000000000 +0100
65 +/* A GNU-like <arpa/inet.h>.
67 + Copyright (C) 2005-2006, 2008 Free Software Foundation, Inc.
69 + This program is free software; you can redistribute it and/or modify
70 + it under the terms of the GNU Lesser General Public License as published by
71 + the Free Software Foundation; either version 2.1, or (at your option)
74 + This program is distributed in the hope that it will be useful,
75 + but WITHOUT ANY WARRANTY; without even the implied warranty of
76 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
77 + GNU Lesser General Public License for more details.
79 + You should have received a copy of the GNU Lesser General Public License
80 + along with this program; if not, write to the Free Software Foundation,
81 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
83 +#ifndef _GL_ARPA_INET_H
85 +/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
87 +#include <sys/socket.h>
89 +#if @HAVE_ARPA_INET_H@
91 +@PRAGMA_SYSTEM_HEADER@
93 +/* The include_next requires a split double-inclusion guard. */
94 +# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
98 +#ifndef _GL_ARPA_INET_H
99 +#define _GL_ARPA_INET_H
101 +/* The definition of GL_LINK_WARNING is copied here. */
103 +#if @GNULIB_INET_NTOP@
104 +# if !@HAVE_DECL_INET_NTOP@
105 +/* Converts an internet address from internal format to a printable,
106 + presentable format.
107 + AF is an internet address family, such as AF_INET or AF_INET6.
108 + SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
110 + DST points to a buffer having room for CNT bytes.
111 + The printable representation of the address (in numeric form, not
112 + surrounded by [...], no reverse DNS is done) is placed in DST, and
113 + DST is returned. If an error occurs, the return value is NULL and
114 + errno is set. If CNT bytes are not sufficient to hold the result,
115 + the return value is NULL and errno is set to ENOSPC. A good value
118 + For more details, see the POSIX:2001 specification
119 + <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
120 +extern const char *inet_ntop (int af, const void *restrict src,
121 + char *restrict dst, socklen_t cnt);
123 +#elif defined GNULIB_POSIXCHECK
125 +# define inet_ntop(af,src,dst,cnt) \
126 + (GL_LINK_WARNING ("inet_ntop is unportable - " \
127 + "use gnulib module inet_ntop for portability"), \
128 + inet_ntop (af, src, dst, cnt))
131 +#if @GNULIB_INET_PTON@
132 +# if !@HAVE_DECL_INET_PTON@
133 +extern int inet_pton (int af, const char *restrict src, void *restrict dst);
135 +#elif defined GNULIB_POSIXCHECK
137 +# define inet_pton(af,src,dst) \
138 + (GL_LINK_WARNING ("inet_pton is unportable - " \
139 + "use gnulib module inet_pton for portability"), \
140 + inet_pton (af, src, dst))
143 +#endif /* _GL_ARPA_INET_H */
144 +#endif /* _GL_ARPA_INET_H */
145 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/asnprintf.c gtk-vnc-0.3.7.gnulib/gnulib/lib/asnprintf.c
146 --- gtk-vnc-0.3.7.dan3/gnulib/lib/asnprintf.c 1970-01-01 01:00:00.000000000 +0100
147 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/asnprintf.c 2008-10-09 15:24:52.000000000 +0100
149 +/* Formatted output to strings.
150 + Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
152 + This program is free software; you can redistribute it and/or modify
153 + it under the terms of the GNU Lesser General Public License as published by
154 + the Free Software Foundation; either version 2.1, or (at your option)
157 + This program is distributed in the hope that it will be useful,
158 + but WITHOUT ANY WARRANTY; without even the implied warranty of
159 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
160 + GNU Lesser General Public License for more details.
162 + You should have received a copy of the GNU Lesser General Public License along
163 + with this program; if not, write to the Free Software Foundation,
164 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
168 +/* Specification. */
169 +#include "vasnprintf.h"
174 +asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
179 + va_start (args, format);
180 + result = vasnprintf (resultbuf, lengthp, format, args);
184 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/dummy.c gtk-vnc-0.3.7.gnulib/gnulib/lib/dummy.c
185 --- gtk-vnc-0.3.7.dan3/gnulib/lib/dummy.c 1970-01-01 01:00:00.000000000 +0100
186 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/dummy.c 2008-10-09 15:24:52.000000000 +0100
188 +/* A dummy file, to prevent empty libraries from breaking builds.
189 + Copyright (C) 2004, 2007 Free Software Foundation, Inc.
191 + This program is free software: you can redistribute it and/or modify
192 + it under the terms of the GNU Lesser General Public License as published by
193 + the Free Software Foundation; either version 2.1 of the License, or
194 + (at your option) any later version.
196 + This program is distributed in the hope that it will be useful,
197 + but WITHOUT ANY WARRANTY; without even the implied warranty of
198 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
199 + GNU Lesser General Public License for more details.
201 + You should have received a copy of the GNU Lesser General Public License
202 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
204 +/* Some systems, reportedly OpenBSD and Mac OS X, refuse to create
205 + libraries without any object files. You might get an error like:
207 + > ar cru .libs/libgl.a
208 + > ar: no archive members specified
210 + Compiling this file, and adding its object file to the library, will
211 + prevent the library from being empty. */
213 +/* Some systems, such as Solaris with cc 5.0, refuse to work with libraries
214 + that don't export any symbol. You might get an error like:
217 + > ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a
219 + Compiling this file, and adding its object file to the library, will
220 + prevent the library from exporting no symbols. */
223 +/* This declaration ensures that the library will export at least 1 symbol. */
224 +int gl_dummy_symbol;
226 +/* This declaration is solely to ensure that after preprocessing
227 + this file is never empty. */
230 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/errno.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/errno.in.h
231 --- gtk-vnc-0.3.7.dan3/gnulib/lib/errno.in.h 1970-01-01 01:00:00.000000000 +0100
232 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/errno.in.h 2008-10-09 15:24:52.000000000 +0100
234 +/* A POSIX-like <errno.h>.
236 + Copyright (C) 2008 Free Software Foundation, Inc.
238 + This program is free software; you can redistribute it and/or modify
239 + it under the terms of the GNU Lesser General Public License as published by
240 + the Free Software Foundation; either version 2.1, or (at your option)
243 + This program is distributed in the hope that it will be useful,
244 + but WITHOUT ANY WARRANTY; without even the implied warranty of
245 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
246 + GNU Lesser General Public License for more details.
248 + You should have received a copy of the GNU Lesser General Public License
249 + along with this program; if not, write to the Free Software Foundation,
250 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
254 +@PRAGMA_SYSTEM_HEADER@
256 +/* The include_next requires a split double-inclusion guard. */
257 +#@INCLUDE_NEXT@ @NEXT_ERRNO_H@
263 +/* On native Windows platforms, many macros are not defined. */
264 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
266 +/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */
267 +# define EWOULDBLOCK EAGAIN
269 +/* Values >= 100 seem safe to use. */
270 +# define ETXTBSY 100
271 +# define GNULIB_defined_ETXTBSY 1
273 +/* These are intentionally the same values as the WSA* error numbers, defined
274 + in <winsock2.h>. */
275 +# define EINPROGRESS 10036
276 +# define EALREADY 10037
277 +# define ENOTSOCK 10038
278 +# define EDESTADDRREQ 10039
279 +# define EMSGSIZE 10040
280 +# define EPROTOTYPE 10041
281 +# define ENOPROTOOPT 10042
282 +# define EPROTONOSUPPORT 10043
283 +# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
284 +# define EOPNOTSUPP 10045
285 +# define EPFNOSUPPORT 10046 /* not required by POSIX */
286 +# define EAFNOSUPPORT 10047
287 +# define EADDRINUSE 10048
288 +# define EADDRNOTAVAIL 10049
289 +# define ENETDOWN 10050
290 +# define ENETUNREACH 10051
291 +# define ENETRESET 10052
292 +# define ECONNABORTED 10053
293 +# define ECONNRESET 10054
294 +# define ENOBUFS 10055
295 +# define EISCONN 10056
296 +# define ENOTCONN 10057
297 +# define ESHUTDOWN 10058 /* not required by POSIX */
298 +# define ETOOMANYREFS 10059 /* not required by POSIX */
299 +# define ETIMEDOUT 10060
300 +# define ECONNREFUSED 10061
301 +# define ELOOP 10062
302 +# define EHOSTDOWN 10064 /* not required by POSIX */
303 +# define EHOSTUNREACH 10065
304 +# define EPROCLIM 10067 /* not required by POSIX */
305 +# define EUSERS 10068 /* not required by POSIX */
306 +# define EDQUOT 10069
307 +# define ESTALE 10070
308 +# define EREMOTE 10071 /* not required by POSIX */
309 +# define GNULIB_defined_ESOCK 1
314 +/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
315 + EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
316 +# if @EMULTIHOP_HIDDEN@
317 +# define EMULTIHOP @EMULTIHOP_VALUE@
318 +# define GNULIB_defined_EMULTIHOP 1
320 +# if @ENOLINK_HIDDEN@
321 +# define ENOLINK @ENOLINK_VALUE@
322 +# define GNULIB_defined_ENOLINK 1
324 +# if @EOVERFLOW_HIDDEN@
325 +# define EOVERFLOW @EOVERFLOW_VALUE@
326 +# define GNULIB_defined_EOVERFLOW 1
330 +/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
331 + EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
332 + Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
333 + HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
335 + Note: When one of these systems defines some of these macros some day,
336 + binaries will have to be recompiled so that they recognizes the new
337 + errno values from the system. */
340 +# define ENOMSG 2000
341 +# define GNULIB_defined_ENOMSG 1
346 +# define GNULIB_defined_EIDRM 1
350 +# define ENOLINK 2002
351 +# define GNULIB_defined_ENOLINK 1
355 +# define EPROTO 2003
356 +# define GNULIB_defined_EPROTO 1
360 +# define EMULTIHOP 2004
361 +# define GNULIB_defined_EMULTIHOP 1
365 +# define EBADMSG 2005
366 +# define GNULIB_defined_EBADMSG 1
370 +# define EOVERFLOW 2006
371 +# define GNULIB_defined_EOVERFLOW 1
375 +# define ENOTSUP 2007
376 +# define GNULIB_defined_ENOTSUP 1
380 +# define ECANCELED 2008
381 +# define GNULIB_defined_ECANCELED 1
385 +#endif /* _GL_ERRNO_H */
386 +#endif /* _GL_ERRNO_H */
387 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/float+.h gtk-vnc-0.3.7.gnulib/gnulib/lib/float+.h
388 --- gtk-vnc-0.3.7.dan3/gnulib/lib/float+.h 1970-01-01 01:00:00.000000000 +0100
389 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/float+.h 2008-10-09 15:24:52.000000000 +0100
391 +/* Supplemental information about the floating-point formats.
392 + Copyright (C) 2007 Free Software Foundation, Inc.
393 + Written by Bruno Haible <bruno@clisp.org>, 2007.
395 + This program is free software; you can redistribute it and/or modify
396 + it under the terms of the GNU Lesser General Public License as published by
397 + the Free Software Foundation; either version 2.1, or (at your option)
400 + This program is distributed in the hope that it will be useful,
401 + but WITHOUT ANY WARRANTY; without even the implied warranty of
402 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
403 + GNU Lesser General Public License for more details.
405 + You should have received a copy of the GNU Lesser General Public License
406 + along with this program; if not, write to the Free Software Foundation,
407 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
409 +#ifndef _FLOATPLUS_H
410 +#define _FLOATPLUS_H
415 +/* Number of bits in the mantissa of a floating-point number, including the
418 +# define FLT_MANT_BIT FLT_MANT_DIG
419 +# define DBL_MANT_BIT DBL_MANT_DIG
420 +# define LDBL_MANT_BIT LDBL_MANT_DIG
421 +#elif FLT_RADIX == 4
422 +# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
423 +# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
424 +# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
425 +#elif FLT_RADIX == 16
426 +# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
427 +# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
428 +# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
431 +/* Bit mask that can be used to mask the exponent, as an unsigned number. */
432 +#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
433 +#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
434 +#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
436 +/* Number of bits used for the exponent of a floating-point number, including
437 + the exponent's sign. */
438 +#define FLT_EXP_BIT \
439 + (FLT_EXP_MASK < 0x100 ? 8 : \
440 + FLT_EXP_MASK < 0x200 ? 9 : \
441 + FLT_EXP_MASK < 0x400 ? 10 : \
442 + FLT_EXP_MASK < 0x800 ? 11 : \
443 + FLT_EXP_MASK < 0x1000 ? 12 : \
444 + FLT_EXP_MASK < 0x2000 ? 13 : \
445 + FLT_EXP_MASK < 0x4000 ? 14 : \
446 + FLT_EXP_MASK < 0x8000 ? 15 : \
447 + FLT_EXP_MASK < 0x10000 ? 16 : \
448 + FLT_EXP_MASK < 0x20000 ? 17 : \
449 + FLT_EXP_MASK < 0x40000 ? 18 : \
450 + FLT_EXP_MASK < 0x80000 ? 19 : \
451 + FLT_EXP_MASK < 0x100000 ? 20 : \
452 + FLT_EXP_MASK < 0x200000 ? 21 : \
453 + FLT_EXP_MASK < 0x400000 ? 22 : \
454 + FLT_EXP_MASK < 0x800000 ? 23 : \
455 + FLT_EXP_MASK < 0x1000000 ? 24 : \
456 + FLT_EXP_MASK < 0x2000000 ? 25 : \
457 + FLT_EXP_MASK < 0x4000000 ? 26 : \
458 + FLT_EXP_MASK < 0x8000000 ? 27 : \
459 + FLT_EXP_MASK < 0x10000000 ? 28 : \
460 + FLT_EXP_MASK < 0x20000000 ? 29 : \
461 + FLT_EXP_MASK < 0x40000000 ? 30 : \
462 + FLT_EXP_MASK <= 0x7fffffff ? 31 : \
464 +#define DBL_EXP_BIT \
465 + (DBL_EXP_MASK < 0x100 ? 8 : \
466 + DBL_EXP_MASK < 0x200 ? 9 : \
467 + DBL_EXP_MASK < 0x400 ? 10 : \
468 + DBL_EXP_MASK < 0x800 ? 11 : \
469 + DBL_EXP_MASK < 0x1000 ? 12 : \
470 + DBL_EXP_MASK < 0x2000 ? 13 : \
471 + DBL_EXP_MASK < 0x4000 ? 14 : \
472 + DBL_EXP_MASK < 0x8000 ? 15 : \
473 + DBL_EXP_MASK < 0x10000 ? 16 : \
474 + DBL_EXP_MASK < 0x20000 ? 17 : \
475 + DBL_EXP_MASK < 0x40000 ? 18 : \
476 + DBL_EXP_MASK < 0x80000 ? 19 : \
477 + DBL_EXP_MASK < 0x100000 ? 20 : \
478 + DBL_EXP_MASK < 0x200000 ? 21 : \
479 + DBL_EXP_MASK < 0x400000 ? 22 : \
480 + DBL_EXP_MASK < 0x800000 ? 23 : \
481 + DBL_EXP_MASK < 0x1000000 ? 24 : \
482 + DBL_EXP_MASK < 0x2000000 ? 25 : \
483 + DBL_EXP_MASK < 0x4000000 ? 26 : \
484 + DBL_EXP_MASK < 0x8000000 ? 27 : \
485 + DBL_EXP_MASK < 0x10000000 ? 28 : \
486 + DBL_EXP_MASK < 0x20000000 ? 29 : \
487 + DBL_EXP_MASK < 0x40000000 ? 30 : \
488 + DBL_EXP_MASK <= 0x7fffffff ? 31 : \
490 +#define LDBL_EXP_BIT \
491 + (LDBL_EXP_MASK < 0x100 ? 8 : \
492 + LDBL_EXP_MASK < 0x200 ? 9 : \
493 + LDBL_EXP_MASK < 0x400 ? 10 : \
494 + LDBL_EXP_MASK < 0x800 ? 11 : \
495 + LDBL_EXP_MASK < 0x1000 ? 12 : \
496 + LDBL_EXP_MASK < 0x2000 ? 13 : \
497 + LDBL_EXP_MASK < 0x4000 ? 14 : \
498 + LDBL_EXP_MASK < 0x8000 ? 15 : \
499 + LDBL_EXP_MASK < 0x10000 ? 16 : \
500 + LDBL_EXP_MASK < 0x20000 ? 17 : \
501 + LDBL_EXP_MASK < 0x40000 ? 18 : \
502 + LDBL_EXP_MASK < 0x80000 ? 19 : \
503 + LDBL_EXP_MASK < 0x100000 ? 20 : \
504 + LDBL_EXP_MASK < 0x200000 ? 21 : \
505 + LDBL_EXP_MASK < 0x400000 ? 22 : \
506 + LDBL_EXP_MASK < 0x800000 ? 23 : \
507 + LDBL_EXP_MASK < 0x1000000 ? 24 : \
508 + LDBL_EXP_MASK < 0x2000000 ? 25 : \
509 + LDBL_EXP_MASK < 0x4000000 ? 26 : \
510 + LDBL_EXP_MASK < 0x8000000 ? 27 : \
511 + LDBL_EXP_MASK < 0x10000000 ? 28 : \
512 + LDBL_EXP_MASK < 0x20000000 ? 29 : \
513 + LDBL_EXP_MASK < 0x40000000 ? 30 : \
514 + LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
517 +/* Number of bits used for a floating-point number: the mantissa (not
518 + counting the "hidden bit", since it may or may not be explicit), the
519 + exponent, and the sign. */
520 +#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
521 +#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
522 +#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
524 +/* Number of bytes used for a floating-point number.
525 + This can be smaller than the 'sizeof'. For example, on i386 systems,
526 + 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
527 + LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
528 + sizeof (long double) = 12 or = 16. */
529 +#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
530 +#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
531 +#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
533 +/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
534 +typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1];
535 +typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1];
536 +typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1];
538 +#endif /* _FLOATPLUS_H */
539 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/float.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/float.in.h
540 --- gtk-vnc-0.3.7.dan3/gnulib/lib/float.in.h 1970-01-01 01:00:00.000000000 +0100
541 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/float.in.h 2008-10-09 15:24:52.000000000 +0100
543 +/* A correct <float.h>.
545 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
547 + This program is free software: you can redistribute it and/or modify
548 + it under the terms of the GNU Lesser General Public License as published by
549 + the Free Software Foundation; either version 2.1 of the License, or
550 + (at your option) any later version.
552 + This program is distributed in the hope that it will be useful,
553 + but WITHOUT ANY WARRANTY; without even the implied warranty of
554 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
555 + GNU Lesser General Public License for more details.
557 + You should have received a copy of the GNU Lesser General Public License
558 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
562 +@PRAGMA_SYSTEM_HEADER@
564 +/* The include_next requires a split double-inclusion guard. */
565 +#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
570 +/* 'long double' properties. */
571 +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
572 +/* Number of mantissa units, in base FLT_RADIX. */
573 +# undef LDBL_MANT_DIG
574 +# define LDBL_MANT_DIG 64
575 +/* Number of decimal digits that is sufficient for representing a number. */
577 +# define LDBL_DIG 18
578 +/* x-1 where x is the smallest representable number > 1. */
579 +# undef LDBL_EPSILON
580 +# define LDBL_EPSILON 1.0842021724855044340E-19L
581 +/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
582 +# undef LDBL_MIN_EXP
583 +# define LDBL_MIN_EXP (-16381)
584 +/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
585 +# undef LDBL_MAX_EXP
586 +# define LDBL_MAX_EXP 16384
587 +/* Minimum positive normalized number. */
589 +# define LDBL_MIN 3.3621031431120935063E-4932L
590 +/* Maximum representable finite number. */
592 +# define LDBL_MAX 1.1897314953572317650E+4932L
593 +/* Minimum e such that 10^e is in the range of normalized numbers. */
594 +# undef LDBL_MIN_10_EXP
595 +# define LDBL_MIN_10_EXP (-4931)
596 +/* Maximum e such that 10^e is in the range of representable finite numbers. */
597 +# undef LDBL_MAX_10_EXP
598 +# define LDBL_MAX_10_EXP 4932
601 +#endif /* _GL_FLOAT_H */
602 +#endif /* _GL_FLOAT_H */
603 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/gai_strerror.c gtk-vnc-0.3.7.gnulib/gnulib/lib/gai_strerror.c
604 --- gtk-vnc-0.3.7.dan3/gnulib/lib/gai_strerror.c 1970-01-01 01:00:00.000000000 +0100
605 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/gai_strerror.c 2008-10-09 15:24:52.000000000 +0100
607 +/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
608 + This file is part of the GNU C Library.
609 + Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
611 + This program is free software; you can redistribute it and/or modify
612 + it under the terms of the GNU Lesser General Public License as published by
613 + the Free Software Foundation; either version 2.1, or (at your option)
616 + This program is distributed in the hope that it will be useful,
617 + but WITHOUT ANY WARRANTY; without even the implied warranty of
618 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
619 + GNU Lesser General Public License for more details.
621 + You should have received a copy of the GNU Lesser General Public License
622 + along with this program; if not, write to the Free Software Foundation,
623 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
626 +# include <config.h>
627 +# include "getaddrinfo.h"
636 +# include <libintl.h>
638 +# include "gettext.h"
639 +# define _(String) gettext (String)
640 +# define N_(String) String
650 + { EAI_ADDRFAMILY, N_("Address family for hostname not supported") },
651 + { EAI_AGAIN, N_("Temporary failure in name resolution") },
652 + { EAI_BADFLAGS, N_("Bad value for ai_flags") },
653 + { EAI_FAIL, N_("Non-recoverable failure in name resolution") },
654 + { EAI_FAMILY, N_("ai_family not supported") },
655 + { EAI_MEMORY, N_("Memory allocation failure") },
656 + { EAI_NODATA, N_("No address associated with hostname") },
657 + { EAI_NONAME, N_("Name or service not known") },
658 + { EAI_SERVICE, N_("Servname not supported for ai_socktype") },
659 + { EAI_SOCKTYPE, N_("ai_socktype not supported") },
660 + { EAI_SYSTEM, N_("System error") },
661 + { EAI_OVERFLOW, N_("Argument buffer too small") },
663 + { EAI_INPROGRESS, N_("Processing request in progress") },
664 + { EAI_CANCELED, N_("Request canceled") },
665 + { EAI_NOTCANCELED, N_("Request not canceled") },
666 + { EAI_ALLDONE, N_("All requests done") },
667 + { EAI_INTR, N_("Interrupted by a signal") },
668 + { EAI_IDN_ENCODE, N_("Parameter string not correctly encoded") }
673 +gai_strerror (int code)
676 + for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i)
677 + if (values[i].code == code)
678 + return _(values[i].msg);
680 + return _("Unknown error");
683 +libc_hidden_def (gai_strerror)
685 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/getaddrinfo.c gtk-vnc-0.3.7.gnulib/gnulib/lib/getaddrinfo.c
686 --- gtk-vnc-0.3.7.dan3/gnulib/lib/getaddrinfo.c 1970-01-01 01:00:00.000000000 +0100
687 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/getaddrinfo.c 2008-10-09 15:24:52.000000000 +0100
689 +/* Get address information (partial implementation).
690 + Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software
692 + Contributed by Simon Josefsson <simon@josefsson.org>.
694 + This program is free software; you can redistribute it and/or modify
695 + it under the terms of the GNU Lesser General Public License as published by
696 + the Free Software Foundation; either version 2.1, or (at your option)
699 + This program is distributed in the hope that it will be useful,
700 + but WITHOUT ANY WARRANTY; without even the implied warranty of
701 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
702 + GNU Lesser General Public License for more details.
704 + You should have received a copy of the GNU Lesser General Public License
705 + along with this program; if not, write to the Free Software Foundation,
706 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
710 +#include "getaddrinfo.h"
712 +#if HAVE_NETINET_IN_H
713 +# include <netinet/in.h>
716 +/* Get inet_ntop. */
717 +#include <arpa/inet.h>
722 +/* Get memcpy, strdup. */
728 +#include <stdbool.h>
730 +#include "gettext.h"
731 +#define _(String) gettext (String)
732 +#define N_(String) String
734 +/* BeOS has AF_INET, but not PF_INET. */
736 +# define PF_INET AF_INET
738 +/* BeOS also lacks PF_UNSPEC. */
740 +# define PF_UNSPEC 0
743 +#if defined _WIN32 || defined __WIN32__
744 +# define WIN32_NATIVE
748 +typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
749 + const struct addrinfo*,
750 + struct addrinfo**);
751 +typedef void (WSAAPI *freeaddrinfo_func) (struct addrinfo*);
752 +typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr*,
753 + socklen_t, char*, DWORD,
754 + char*, DWORD, int);
756 +static getaddrinfo_func getaddrinfo_ptr = NULL;
757 +static freeaddrinfo_func freeaddrinfo_ptr = NULL;
758 +static getnameinfo_func getnameinfo_ptr = NULL;
763 + static int done = 0;
767 + return getaddrinfo_ptr ? 1 : 0;
771 + h = GetModuleHandle ("ws2_32.dll");
775 + getaddrinfo_ptr = (getaddrinfo_func) GetProcAddress (h, "getaddrinfo");
776 + freeaddrinfo_ptr = (freeaddrinfo_func) GetProcAddress (h, "freeaddrinfo");
777 + getnameinfo_ptr = (getnameinfo_func) GetProcAddress (h, "getnameinfo");
780 + /* If either is missing, something is odd. */
781 + if (!getaddrinfo_ptr || !freeaddrinfo_ptr || !getnameinfo_ptr)
783 + getaddrinfo_ptr = NULL;
784 + freeaddrinfo_ptr = NULL;
785 + getnameinfo_ptr = NULL;
794 +validate_family (int family)
796 + /* FIXME: Support more families. */
798 + if (family == PF_INET)
802 + if (family == PF_INET6)
805 + if (family == PF_UNSPEC)
810 +/* Translate name of a service location and/or a service name to set of
811 + socket addresses. */
813 +getaddrinfo (const char *restrict nodename,
814 + const char *restrict servname,
815 + const struct addrinfo *restrict hints,
816 + struct addrinfo **restrict res)
818 + struct addrinfo *tmp;
820 + struct hostent *he;
825 + struct addrinfo addrinfo;
826 + struct sockaddr_in6 sockaddr_in6;
831 + struct addrinfo addrinfo;
832 + struct sockaddr_in sockaddr_in;
837 + if (use_win32_p ())
838 + return getaddrinfo_ptr (nodename, servname, hints, res);
841 + if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE)))
842 + /* FIXME: Support more flags. */
843 + return EAI_BADFLAGS;
845 + if (hints && !validate_family (hints->ai_family))
849 + hints->ai_socktype != SOCK_STREAM && hints->ai_socktype != SOCK_DGRAM)
850 + /* FIXME: Support other socktype. */
851 + return EAI_SOCKTYPE; /* FIXME: Better return code? */
855 + if (!(hints->ai_flags & AI_PASSIVE))
859 + nodename = (hints->ai_family == AF_INET6) ? "::" : "0.0.0.0";
861 + nodename = "0.0.0.0";
867 + struct servent *se = NULL;
868 + const char *proto =
869 + (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
871 + if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV))
872 + /* FIXME: Use getservbyname_r if available. */
873 + se = getservbyname (servname, proto);
878 + if (!(*servname >= '0' && *servname <= '9'))
880 + port = strtoul (servname, &c, 10);
881 + if (*c || port > 0xffff)
883 + port = htons (port);
889 + /* FIXME: Use gethostbyname_r if available. */
890 + he = gethostbyname (nodename);
891 + if (!he || he->h_addr_list[0] == NULL)
894 + switch (he->h_addrtype)
898 + size = sizeof (struct v6_pair);
904 + size = sizeof (struct v4_pair);
912 + storage = calloc (1, size);
916 + switch (he->h_addrtype)
921 + struct v6_pair *p = storage;
922 + struct sockaddr_in6 *sinp = &p->sockaddr_in6;
923 + tmp = &p->addrinfo;
926 + sinp->sin6_port = port;
928 + if (he->h_length != sizeof (sinp->sin6_addr))
931 + return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */
934 + memcpy (&sinp->sin6_addr, he->h_addr_list[0], sizeof sinp->sin6_addr);
936 + tmp->ai_addr = (struct sockaddr *) sinp;
937 + tmp->ai_addrlen = sizeof *sinp;
945 + struct v4_pair *p = storage;
946 + struct sockaddr_in *sinp = &p->sockaddr_in;
947 + tmp = &p->addrinfo;
950 + sinp->sin_port = port;
952 + if (he->h_length != sizeof (sinp->sin_addr))
955 + return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */
958 + memcpy (&sinp->sin_addr, he->h_addr_list[0], sizeof sinp->sin_addr);
960 + tmp->ai_addr = (struct sockaddr *) sinp;
961 + tmp->ai_addrlen = sizeof *sinp;
971 + if (hints && hints->ai_flags & AI_CANONNAME)
979 + tmp->ai_canonname = strdup (cn);
980 + if (!tmp->ai_canonname)
987 + tmp->ai_protocol = (hints) ? hints->ai_protocol : 0;
988 + tmp->ai_socktype = (hints) ? hints->ai_socktype : 0;
989 + tmp->ai_addr->sa_family = he->h_addrtype;
990 + tmp->ai_family = he->h_addrtype;
992 + /* FIXME: If more than one address, create linked list of addrinfo's. */
999 +/* Free `addrinfo' structure AI including associated storage. */
1001 +freeaddrinfo (struct addrinfo *ai)
1003 +#ifdef WIN32_NATIVE
1004 + if (use_win32_p ())
1006 + freeaddrinfo_ptr (ai);
1013 + struct addrinfo *cur;
1018 + free (cur->ai_canonname);
1023 +int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
1024 + char *restrict node, socklen_t nodelen,
1025 + char *restrict service, socklen_t servicelen,
1028 +#ifdef WIN32_NATIVE
1029 + if (use_win32_p ())
1030 + return getnameinfo_ptr (sa, salen, node, nodelen,
1031 + service, servicelen, flags);
1034 + /* FIXME: Support other flags. */
1035 + if ((node && nodelen > 0 && !(flags & NI_NUMERICHOST)) ||
1036 + (service && servicelen > 0 && !(flags & NI_NUMERICHOST)) ||
1037 + (flags & ~(NI_NUMERICHOST|NI_NUMERICSERV)))
1038 + return EAI_BADFLAGS;
1040 + if (sa == NULL || salen < sizeof (sa->sa_family))
1041 + return EAI_FAMILY;
1043 + switch (sa->sa_family)
1047 + if (salen < sizeof (struct sockaddr_in))
1048 + return EAI_FAMILY;
1053 + if (salen < sizeof (struct sockaddr_in6))
1054 + return EAI_FAMILY;
1058 + return EAI_FAMILY;
1061 + if (node && nodelen > 0 && flags & NI_NUMERICHOST)
1063 + switch (sa->sa_family)
1067 + if (!inet_ntop (AF_INET,
1068 + &(((const struct sockaddr_in *) sa)->sin_addr),
1070 + return EAI_SYSTEM;
1076 + if (!inet_ntop (AF_INET6,
1077 + &(((const struct sockaddr_in6 *) sa)->sin6_addr),
1079 + return EAI_SYSTEM;
1084 + return EAI_FAMILY;
1088 + if (service && servicelen > 0 && flags & NI_NUMERICSERV)
1089 + switch (sa->sa_family)
1098 + unsigned short int port
1099 + = ntohs (((const struct sockaddr_in *) sa)->sin_port);
1100 + if (servicelen <= snprintf (service, servicelen, "%u", port))
1101 + return EAI_OVERFLOW;
1108 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/getaddrinfo.h gtk-vnc-0.3.7.gnulib/gnulib/lib/getaddrinfo.h
1109 --- gtk-vnc-0.3.7.dan3/gnulib/lib/getaddrinfo.h 1970-01-01 01:00:00.000000000 +0100
1110 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/getaddrinfo.h 2008-10-09 15:24:52.000000000 +0100
1112 +/* Get address information.
1113 + Copyright (C) 1996-2002, 2003, 2004, 2005, 2006, 2008
1114 + Free Software Foundation, Inc.
1115 + Contributed by Simon Josefsson <simon@josefsson.org>.
1117 + This program is free software; you can redistribute it and/or modify
1118 + it under the terms of the GNU Lesser General Public License as published by
1119 + the Free Software Foundation; either version 2.1, or (at your option)
1120 + any later version.
1122 + This program is distributed in the hope that it will be useful,
1123 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1124 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1125 + GNU Lesser General Public License for more details.
1127 + You should have received a copy of the GNU Lesser General Public License
1128 + along with this program; if not, write to the Free Software Foundation,
1129 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
1131 +#ifndef GETADDRINFO_H
1132 +#define GETADDRINFO_H
1134 +/* sys/socket.h in i386-unknown-freebsd4.10 and
1135 + powerpc-apple-darwin5.5 require sys/types.h, so include it first.
1136 + Then we'll also get 'socklen_t' and 'struct sockaddr' which are
1138 +#include <sys/types.h>
1139 +/* Get all getaddrinfo related declarations, if available. */
1140 +#include <sys/socket.h>
1141 +#ifdef HAVE_NETDB_H
1142 +# include <netdb.h>
1145 +#ifndef HAVE_STRUCT_ADDRINFO
1147 +/* Structure to contain information about address of a service provider. */
1150 + int ai_flags; /* Input flags. */
1151 + int ai_family; /* Protocol family for socket. */
1152 + int ai_socktype; /* Socket type. */
1153 + int ai_protocol; /* Protocol for socket. */
1154 + socklen_t ai_addrlen; /* Length of socket address. */
1155 + struct sockaddr *ai_addr; /* Socket address for socket. */
1156 + char *ai_canonname; /* Canonical name for service location. */
1157 + struct addrinfo *ai_next; /* Pointer to next in list. */
1161 +/* Possible values for `ai_flags' field in `addrinfo' structure. */
1163 +# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
1165 +#ifndef AI_CANONNAME
1166 +# define AI_CANONNAME 0x0002 /* Request for canonical name. */
1168 +#ifndef AI_NUMERICSERV
1169 +# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
1173 +/* The commented out definitions below are not yet implemented in the
1174 + GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact,
1175 + cause conflicts on systems with a getaddrinfo() function which does not
1178 + If they are restored, be sure to protect the definitions with #ifndef. */
1179 +#define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
1180 +#define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */
1181 +#define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */
1182 +#define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
1183 + returned address type.. */
1186 +/* Error values for `getaddrinfo' function. */
1187 +#ifndef EAI_BADFLAGS
1188 +# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
1189 +# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
1190 +# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
1191 +# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
1192 +# define EAI_NODATA -5 /* No address associated with NAME. */
1193 +# define EAI_FAMILY -6 /* `ai_family' not supported. */
1194 +# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
1195 +# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
1196 +# define EAI_MEMORY -10 /* Memory allocation failure. */
1199 +/* Since EAI_NODATA is deprecated by RFC3493, some systems (at least
1200 + FreeBSD, which does define EAI_BADFLAGS) have removed the definition
1201 + in favor of EAI_NONAME. */
1202 +#if !defined EAI_NODATA && defined EAI_NONAME
1203 +# define EAI_NODATA EAI_NONAME
1206 +#ifndef EAI_OVERFLOW
1207 +/* Not defined on mingw32. */
1208 +# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
1210 +#ifndef EAI_ADDRFAMILY
1211 +/* Not defined on mingw32. */
1212 +# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
1215 +/* Not defined on mingw32. */
1216 +# define EAI_SYSTEM -11 /* System error returned in `errno'. */
1220 +# ifndef EAI_INPROGRESS
1221 +# define EAI_INPROGRESS -100 /* Processing request in progress. */
1222 +# define EAI_CANCELED -101 /* Request canceled. */
1223 +# define EAI_NOTCANCELED -102 /* Request not canceled. */
1224 +# define EAI_ALLDONE -103 /* All requests done. */
1225 +# define EAI_INTR -104 /* Interrupted by a signal. */
1226 +# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
1230 +#if !HAVE_DECL_GETADDRINFO
1231 +/* Translate name of a service location and/or a service name to set of
1233 + For more details, see the POSIX:2001 specification
1234 + <http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
1235 +extern int getaddrinfo (const char *restrict nodename,
1236 + const char *restrict servname,
1237 + const struct addrinfo *restrict hints,
1238 + struct addrinfo **restrict res);
1241 +#if !HAVE_DECL_FREEADDRINFO
1242 +/* Free `addrinfo' structure AI including associated storage.
1243 + For more details, see the POSIX:2001 specification
1244 + <http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
1245 +extern void freeaddrinfo (struct addrinfo *ai);
1248 +#if !HAVE_DECL_GAI_STRERROR
1249 +/* Convert error return from getaddrinfo() to a string.
1250 + For more details, see the POSIX:2001 specification
1251 + <http://www.opengroup.org/susv3xsh/gai_strerror.html>. */
1252 +extern const char *gai_strerror (int ecode);
1255 +#if !HAVE_DECL_GETNAMEINFO
1256 +/* Convert socket address to printable node and service names.
1257 + For more details, see the POSIX:2001 specification
1258 + <http://www.opengroup.org/susv3xsh/getnameinfo.html>. */
1259 +extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
1260 + char *restrict node, socklen_t nodelen,
1261 + char *restrict service, socklen_t servicelen,
1266 +/* Possible flags for getnameinfo. */
1267 +#ifndef NI_NUMERICHOST
1268 +# define NI_NUMERICHOST 1
1270 +#ifndef NI_NUMERICSERV
1271 +# define NI_NUMERICSERV 2
1274 +#endif /* GETADDRINFO_H */
1275 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/gettext.h gtk-vnc-0.3.7.gnulib/gnulib/lib/gettext.h
1276 --- gtk-vnc-0.3.7.dan3/gnulib/lib/gettext.h 1970-01-01 01:00:00.000000000 +0100
1277 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/gettext.h 2008-10-09 15:24:52.000000000 +0100
1279 +/* Convenience header for conditional use of GNU <libintl.h>.
1280 + Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
1282 + This program is free software; you can redistribute it and/or modify
1283 + it under the terms of the GNU Lesser General Public License as published by
1284 + the Free Software Foundation; either version 2.1, or (at your option)
1285 + any later version.
1287 + This program is distributed in the hope that it will be useful,
1288 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1289 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1290 + GNU Lesser General Public License for more details.
1292 + You should have received a copy of the GNU Lesser General Public License along
1293 + with this program; if not, write to the Free Software Foundation,
1294 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
1296 +#ifndef _LIBGETTEXT_H
1297 +#define _LIBGETTEXT_H 1
1299 +/* NLS can be disabled through the configure --disable-nls option. */
1302 +/* Get declarations of GNU message catalog functions. */
1303 +# include <libintl.h>
1305 +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
1306 + the gettext() and ngettext() macros. This is an alternative to calling
1307 + textdomain(), and is useful for libraries. */
1308 +# ifdef DEFAULT_TEXT_DOMAIN
1310 +# define gettext(Msgid) \
1311 + dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
1313 +# define ngettext(Msgid1, Msgid2, N) \
1314 + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
1319 +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
1320 + chokes if dcgettext is defined as a macro. So include it now, to make
1321 + later inclusions of <locale.h> a NOP. We don't include <libintl.h>
1322 + as well because people using "gettext.h" will not include <libintl.h>,
1323 + and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
1326 +# include <locale.h>
1329 +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
1330 + <libintl.h>, which chokes if dcgettext is defined as a macro. So include
1331 + it now, to make later inclusions of <libintl.h> a NOP. */
1332 +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
1333 +# include <cstdlib>
1334 +# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
1335 +# include <libintl.h>
1340 + The casts to 'const char *' serve the purpose of producing warnings
1341 + for invalid uses of the value returned from these functions.
1342 + On pre-ANSI systems without 'const', the config.h file is supposed to
1343 + contain "#define const". */
1344 +# define gettext(Msgid) ((const char *) (Msgid))
1345 +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
1346 +# define dcgettext(Domainname, Msgid, Category) \
1347 + ((void) (Category), dgettext (Domainname, Msgid))
1348 +# define ngettext(Msgid1, Msgid2, N) \
1350 + ? ((void) (Msgid2), (const char *) (Msgid1)) \
1351 + : ((void) (Msgid1), (const char *) (Msgid2)))
1352 +# define dngettext(Domainname, Msgid1, Msgid2, N) \
1353 + ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
1354 +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
1355 + ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
1356 +# define textdomain(Domainname) ((const char *) (Domainname))
1357 +# define bindtextdomain(Domainname, Dirname) \
1358 + ((void) (Domainname), (const char *) (Dirname))
1359 +# define bind_textdomain_codeset(Domainname, Codeset) \
1360 + ((void) (Domainname), (const char *) (Codeset))
1364 +/* A pseudo function call that serves as a marker for the automated
1365 + extraction of messages, but does not call gettext(). The run-time
1366 + translation is done at a different place in the code.
1367 + The argument, String, should be a literal string. Concatenated strings
1368 + and other string expressions won't work.
1369 + The macro's expansion is not parenthesized, so that it is suitable as
1370 + initializer for static 'char[]' or 'const char[]' variables. */
1371 +#define gettext_noop(String) String
1373 +/* The separator between msgctxt and msgid in a .mo file. */
1374 +#define GETTEXT_CONTEXT_GLUE "\004"
1376 +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
1377 + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
1378 + short and rarely need to change.
1379 + The letter 'p' stands for 'particular' or 'special'. */
1380 +#ifdef DEFAULT_TEXT_DOMAIN
1381 +# define pgettext(Msgctxt, Msgid) \
1382 + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
1384 +# define pgettext(Msgctxt, Msgid) \
1385 + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
1387 +#define dpgettext(Domainname, Msgctxt, Msgid) \
1388 + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
1389 +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
1390 + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
1391 +#ifdef DEFAULT_TEXT_DOMAIN
1392 +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
1393 + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
1395 +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
1396 + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
1398 +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
1399 + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
1400 +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
1401 + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
1410 +static const char *
1411 +pgettext_aux (const char *domain,
1412 + const char *msg_ctxt_id, const char *msgid,
1415 + const char *translation = dcgettext (domain, msg_ctxt_id, category);
1416 + if (translation == msg_ctxt_id)
1419 + return translation;
1429 +static const char *
1430 +npgettext_aux (const char *domain,
1431 + const char *msg_ctxt_id, const char *msgid,
1432 + const char *msgid_plural, unsigned long int n,
1435 + const char *translation =
1436 + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
1437 + if (translation == msg_ctxt_id || translation == msgid_plural)
1438 + return (n == 1 ? msgid : msgid_plural);
1440 + return translation;
1443 +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
1444 + can be arbitrary expressions. But for string literals these macros are
1445 + less efficient than those above. */
1447 +#include <string.h>
1449 +#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
1450 + (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
1451 + /* || __STDC_VERSION__ >= 199901L */ )
1453 +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1454 +#include <stdlib.h>
1457 +#define pgettext_expr(Msgctxt, Msgid) \
1458 + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
1459 +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
1460 + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
1469 +static const char *
1470 +dcpgettext_expr (const char *domain,
1471 + const char *msgctxt, const char *msgid,
1474 + size_t msgctxt_len = strlen (msgctxt) + 1;
1475 + size_t msgid_len = strlen (msgid) + 1;
1476 + const char *translation;
1477 +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1478 + char msg_ctxt_id[msgctxt_len + msgid_len];
1481 + char *msg_ctxt_id =
1482 + (msgctxt_len + msgid_len <= sizeof (buf)
1484 + : (char *) malloc (msgctxt_len + msgid_len));
1485 + if (msg_ctxt_id != NULL)
1488 + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
1489 + msg_ctxt_id[msgctxt_len - 1] = '\004';
1490 + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
1491 + translation = dcgettext (domain, msg_ctxt_id, category);
1492 +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1493 + if (msg_ctxt_id != buf)
1494 + free (msg_ctxt_id);
1496 + if (translation != msg_ctxt_id)
1497 + return translation;
1502 +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
1503 + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
1504 +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
1505 + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
1514 +static const char *
1515 +dcnpgettext_expr (const char *domain,
1516 + const char *msgctxt, const char *msgid,
1517 + const char *msgid_plural, unsigned long int n,
1520 + size_t msgctxt_len = strlen (msgctxt) + 1;
1521 + size_t msgid_len = strlen (msgid) + 1;
1522 + const char *translation;
1523 +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1524 + char msg_ctxt_id[msgctxt_len + msgid_len];
1527 + char *msg_ctxt_id =
1528 + (msgctxt_len + msgid_len <= sizeof (buf)
1530 + : (char *) malloc (msgctxt_len + msgid_len));
1531 + if (msg_ctxt_id != NULL)
1534 + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
1535 + msg_ctxt_id[msgctxt_len - 1] = '\004';
1536 + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
1537 + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
1538 +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1539 + if (msg_ctxt_id != buf)
1540 + free (msg_ctxt_id);
1542 + if (!(translation == msg_ctxt_id || translation == msgid_plural))
1543 + return translation;
1545 + return (n == 1 ? msgid : msgid_plural);
1548 +#endif /* _LIBGETTEXT_H */
1549 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/inet_ntop.c gtk-vnc-0.3.7.gnulib/gnulib/lib/inet_ntop.c
1550 --- gtk-vnc-0.3.7.dan3/gnulib/lib/inet_ntop.c 1970-01-01 01:00:00.000000000 +0100
1551 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/inet_ntop.c 2008-10-09 15:24:52.000000000 +0100
1553 +/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
1555 + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
1557 + This program is free software; you can redistribute it and/or modify
1558 + it under the terms of the GNU Lesser General Public License as published by
1559 + the Free Software Foundation; either version 2.1, or (at your option)
1560 + any later version.
1562 + This program is distributed in the hope that it will be useful,
1563 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1564 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1565 + GNU Lesser General Public License for more details.
1567 + You should have received a copy of the GNU Lesser General Public License
1568 + along with this program; if not, write to the Free Software Foundation,
1569 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
1572 + * Copyright (c) 1996-1999 by Internet Software Consortium.
1574 + * Permission to use, copy, modify, and distribute this software for any
1575 + * purpose with or without fee is hereby granted, provided that the above
1576 + * copyright notice and this permission notice appear in all copies.
1578 + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
1579 + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
1580 + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
1581 + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
1582 + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
1583 + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
1584 + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
1588 +#include <config.h>
1590 +/* Specification. */
1591 +#include <arpa/inet.h>
1594 +#include <string.h>
1597 +#ifndef EAFNOSUPPORT
1598 +# define EAFNOSUPPORT EINVAL
1601 +#define NS_IN6ADDRSZ 16
1602 +#define NS_INT16SZ 2
1605 + * WARNING: Don't even consider trying to compile this on a system where
1606 + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
1608 +typedef int verify_int_size[2 * sizeof (int) - 7];
1610 +static const char *inet_ntop4 (const unsigned char *src, char *dst, socklen_t size);
1612 +static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t size);
1617 + * inet_ntop(af, src, dst, size)
1618 + * convert a network format address to presentation format.
1620 + * pointer to presentation format address (`dst'), or NULL (see errno).
1622 + * Paul Vixie, 1996.
1625 +inet_ntop (int af, const void *restrict src,
1626 + char *restrict dst, socklen_t cnt)
1632 + return (inet_ntop4 (src, dst, cnt));
1637 + return (inet_ntop6 (src, dst, cnt));
1641 + errno = EAFNOSUPPORT;
1648 + * inet_ntop4(src, dst, size)
1649 + * format an IPv4 address
1651 + * `dst' (as a const)
1653 + * (1) uses no statics
1654 + * (2) takes a u_char* not an in_addr as input
1656 + * Paul Vixie, 1996.
1658 +static const char *
1659 +inet_ntop4 (const unsigned char *src, char *dst, socklen_t size)
1661 + char tmp[sizeof "255.255.255.255"];
1664 + len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]);
1674 + return strcpy (dst, tmp);
1680 + * inet_ntop6(src, dst, size)
1681 + * convert IPv6 binary address into presentation (printable) format
1683 + * Paul Vixie, 1996.
1685 +static const char *
1686 +inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
1689 + * Note that int32_t and int16_t need only be "at least" large enough
1690 + * to contain a value of the specified size. On some systems, like
1691 + * Crays, there is no such thing as an integer variable with 16 bits.
1692 + * Keep this in mind if you think this function should have been coded
1693 + * to use pointer overlays. All the world's not a VAX.
1695 + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
1700 + unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
1705 + * Copy the input (bytewise) array into a wordwise array.
1706 + * Find the longest run of 0x00's in src[] for :: shorthanding.
1708 + memset (words, '\0', sizeof words);
1709 + for (i = 0; i < NS_IN6ADDRSZ; i += 2)
1710 + words[i / 2] = (src[i] << 8) | src[i + 1];
1713 + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
1715 + if (words[i] == 0)
1717 + if (cur.base == -1)
1718 + cur.base = i, cur.len = 1;
1724 + if (cur.base != -1)
1726 + if (best.base == -1 || cur.len > best.len)
1732 + if (cur.base != -1)
1734 + if (best.base == -1 || cur.len > best.len)
1737 + if (best.base != -1 && best.len < 2)
1741 + * Format the result.
1744 + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
1746 + /* Are we inside the best run of 0x00's? */
1747 + if (best.base != -1 && i >= best.base && i < (best.base + best.len))
1749 + if (i == best.base)
1753 + /* Are we following an initial run of 0x00s or any real hex? */
1756 + /* Is this address an encapsulated IPv4? */
1757 + if (i == 6 && best.base == 0 &&
1758 + (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
1760 + if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
1762 + tp += strlen (tp);
1766 + int len = sprintf (tp, "%x", words[i]);
1772 + /* Was it a trailing run of 0x00's? */
1773 + if (best.base != -1 && (best.base + best.len) ==
1774 + (NS_IN6ADDRSZ / NS_INT16SZ))
1779 + * Check for overflow, copy, and we're done.
1781 + if ((socklen_t) (tp - tmp) > size)
1787 + return strcpy (dst, tmp);
1791 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/Makefile.am gtk-vnc-0.3.7.gnulib/gnulib/lib/Makefile.am
1792 --- gtk-vnc-0.3.7.dan3/gnulib/lib/Makefile.am 1970-01-01 01:00:00.000000000 +0100
1793 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/Makefile.am 2008-10-09 15:24:53.000000000 +0100
1795 +## DO NOT EDIT! GENERATED AUTOMATICALLY!
1796 +## Process this file with automake to produce Makefile.in.
1797 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
1799 +# This file is free software, distributed under the terms of the GNU
1800 +# General Public License. As a special exception to the GNU General
1801 +# Public License, this file may be distributed as part of a program
1802 +# that contains a configuration script generated by Autoconf, under
1803 +# the same distribution terms as the rest of that program.
1805 +# Generated by gnulib-tool.
1806 +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=. --with-tests --lgpl=2 --libtool --macro-prefix=gl connect getaddrinfo malloc recv send socket vc-list-files
1808 +AUTOMAKE_OPTIONS = 1.5 gnits
1813 +noinst_LTLIBRARIES =
1817 +MOSTLYCLEANFILES = core *.stackdump
1821 +MAINTAINERCLEANFILES =
1825 +noinst_LTLIBRARIES += libgnu.la
1827 +libgnu_la_SOURCES =
1828 +libgnu_la_LIBADD = $(gl_LTLIBOBJS)
1829 +libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
1830 +EXTRA_libgnu_la_SOURCES =
1831 +libgnu_la_LDFLAGS = $(AM_LDFLAGS)
1833 +## begin gnulib module alloca-opt
1835 +BUILT_SOURCES += $(ALLOCA_H)
1837 +# We need the following in order to create <alloca.h> when the system
1838 +# doesn't have one that works with the given compiler.
1839 +alloca.h: alloca.in.h
1840 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1841 + cat $(srcdir)/alloca.in.h; \
1844 +MOSTLYCLEANFILES += alloca.h alloca.h-t
1846 +EXTRA_DIST += alloca.in.h
1848 +## end gnulib module alloca-opt
1850 +## begin gnulib module arpa_inet
1852 +BUILT_SOURCES += $(ARPA_INET_H)
1854 +# We need the following in order to create <arpa/inet.h> when the system
1855 +# doesn't have one.
1859 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1860 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1861 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1862 + -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
1863 + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
1864 + -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \
1865 + -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
1866 + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
1867 + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
1868 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
1869 + < $(srcdir)/arpa_inet.in.h; \
1872 +MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
1873 +MOSTLYCLEANDIRS += arpa
1875 +EXTRA_DIST += arpa_inet.in.h
1877 +## end gnulib module arpa_inet
1879 +## begin gnulib module connect
1882 +EXTRA_DIST += winsock.c
1884 +EXTRA_libgnu_la_SOURCES += winsock.c
1886 +## end gnulib module connect
1888 +## begin gnulib module errno
1890 +BUILT_SOURCES += $(ERRNO_H)
1892 +# We need the following in order to create <errno.h> when the system
1893 +# doesn't have one that is POSIX compliant.
1894 +errno.h: errno.in.h
1896 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
1897 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1898 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1899 + -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
1900 + -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
1901 + -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
1902 + -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
1903 + -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
1904 + -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
1905 + -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
1906 + < $(srcdir)/errno.in.h; \
1909 +MOSTLYCLEANFILES += errno.h errno.h-t
1911 +EXTRA_DIST += errno.in.h
1913 +## end gnulib module errno
1915 +## begin gnulib module float
1917 +BUILT_SOURCES += $(FLOAT_H)
1919 +# We need the following in order to create <float.h> when the system
1920 +# doesn't have one that works with the given compiler.
1921 +float.h: float.in.h
1923 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
1924 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1925 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1926 + -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
1927 + < $(srcdir)/float.in.h; \
1930 +MOSTLYCLEANFILES += float.h float.h-t
1932 +EXTRA_DIST += float.in.h
1934 +## end gnulib module float
1936 +## begin gnulib module getaddrinfo
1939 +EXTRA_DIST += gai_strerror.c getaddrinfo.c getaddrinfo.h
1941 +EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c
1943 +## end gnulib module getaddrinfo
1945 +## begin gnulib module gettext-h
1947 +libgnu_la_SOURCES += gettext.h
1949 +## end gnulib module gettext-h
1951 +## begin gnulib module inet_ntop
1954 +EXTRA_DIST += inet_ntop.c
1956 +EXTRA_libgnu_la_SOURCES += inet_ntop.c
1958 +## end gnulib module inet_ntop
1960 +## begin gnulib module link-warning
1962 +LINK_WARNING_H=$(top_srcdir)/./link-warning.h
1964 +EXTRA_DIST += $(top_srcdir)/./link-warning.h
1966 +## end gnulib module link-warning
1968 +## begin gnulib module malloc
1971 +EXTRA_DIST += malloc.c
1973 +EXTRA_libgnu_la_SOURCES += malloc.c
1975 +## end gnulib module malloc
1977 +## begin gnulib module malloc-posix
1980 +EXTRA_DIST += malloc.c
1982 +EXTRA_libgnu_la_SOURCES += malloc.c
1984 +## end gnulib module malloc-posix
1986 +## begin gnulib module netinet_in
1988 +BUILT_SOURCES += $(NETINET_IN_H)
1990 +# We need the following in order to create <netinet/in.h> when the system
1991 +# doesn't have one.
1992 +netinet/in.h: netinet_in.in.h
1995 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1996 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1997 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1998 + -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
1999 + -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
2000 + < $(srcdir)/netinet_in.in.h; \
2003 +MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
2004 +MOSTLYCLEANDIRS += netinet
2006 +EXTRA_DIST += netinet_in.in.h
2008 +## end gnulib module netinet_in
2010 +## begin gnulib module recv
2013 +EXTRA_DIST += winsock.c
2015 +EXTRA_libgnu_la_SOURCES += winsock.c
2017 +## end gnulib module recv
2019 +## begin gnulib module send
2022 +EXTRA_DIST += winsock.c
2024 +EXTRA_libgnu_la_SOURCES += winsock.c
2026 +## end gnulib module send
2028 +## begin gnulib module size_max
2030 +libgnu_la_SOURCES += size_max.h
2032 +## end gnulib module size_max
2034 +## begin gnulib module snprintf
2037 +EXTRA_DIST += snprintf.c
2039 +EXTRA_libgnu_la_SOURCES += snprintf.c
2041 +## end gnulib module snprintf
2043 +## begin gnulib module socket
2046 +EXTRA_DIST += winsock.c
2048 +EXTRA_libgnu_la_SOURCES += winsock.c
2050 +## end gnulib module socket
2052 +## begin gnulib module stdbool
2054 +BUILT_SOURCES += $(STDBOOL_H)
2056 +# We need the following in order to create <stdbool.h> when the system
2057 +# doesn't have one that works.
2058 +stdbool.h: stdbool.in.h
2060 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2061 + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
2064 +MOSTLYCLEANFILES += stdbool.h stdbool.h-t
2066 +EXTRA_DIST += stdbool.in.h
2068 +## end gnulib module stdbool
2070 +## begin gnulib module stdint
2072 +BUILT_SOURCES += $(STDINT_H)
2074 +# We need the following in order to create <stdint.h> when the system
2075 +# doesn't have one that works with the given compiler.
2076 +stdint.h: stdint.in.h
2078 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2079 + sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
2080 + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2081 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2082 + -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
2083 + -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
2084 + -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
2085 + -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
2086 + -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
2087 + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
2088 + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
2089 + -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
2090 + -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
2091 + -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
2092 + -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
2093 + -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
2094 + -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
2095 + -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
2096 + -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
2097 + -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
2098 + -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
2099 + -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
2100 + -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
2101 + -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
2102 + < $(srcdir)/stdint.in.h; \
2105 +MOSTLYCLEANFILES += stdint.h stdint.h-t
2107 +EXTRA_DIST += stdint.in.h
2109 +## end gnulib module stdint
2111 +## begin gnulib module stdio
2113 +BUILT_SOURCES += stdio.h
2115 +# We need the following in order to create <stdio.h> when the system
2116 +# doesn't have one that works with the given compiler.
2117 +stdio.h: stdio.in.h
2119 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
2120 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2121 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2122 + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
2123 + -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
2124 + -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
2125 + -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
2126 + -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
2127 + -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
2128 + -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
2129 + -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
2130 + -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
2131 + -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
2132 + -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
2133 + -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
2134 + -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
2135 + -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
2136 + -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
2137 + -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
2138 + -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
2139 + -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
2140 + -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
2141 + -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
2142 + -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
2143 + -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
2144 + -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
2145 + -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
2146 + -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
2147 + -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
2148 + -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
2149 + -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
2150 + -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
2151 + -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
2152 + -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
2153 + -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
2154 + -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
2155 + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
2156 + -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
2157 + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
2158 + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
2159 + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
2160 + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
2161 + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
2162 + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
2163 + -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
2164 + -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
2165 + -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
2166 + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
2167 + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
2168 + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
2169 + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
2170 + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
2171 + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
2172 + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
2173 + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
2174 + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
2175 + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
2176 + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
2177 + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
2178 + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
2179 + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
2180 + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
2181 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2182 + < $(srcdir)/stdio.in.h; \
2185 +MOSTLYCLEANFILES += stdio.h stdio.h-t
2187 +EXTRA_DIST += stdio-write.c stdio.in.h
2189 +EXTRA_libgnu_la_SOURCES += stdio-write.c
2191 +## end gnulib module stdio
2193 +## begin gnulib module stdlib
2195 +BUILT_SOURCES += stdlib.h
2197 +# We need the following in order to create <stdlib.h> when the system
2198 +# doesn't have one that works with the given compiler.
2199 +stdlib.h: stdlib.in.h
2201 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
2202 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2203 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2204 + -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
2205 + -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \
2206 + -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \
2207 + -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \
2208 + -e 's|@''GNULIB_GETSUBOPT''@|$(GNULIB_GETSUBOPT)|g' \
2209 + -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
2210 + -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
2211 + -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
2212 + -e 's|@''GNULIB_RPMATCH''@|$(GNULIB_RPMATCH)|g' \
2213 + -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
2214 + -e 's|@''GNULIB_STRTOD''@|$(GNULIB_STRTOD)|g' \
2215 + -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
2216 + -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
2217 + -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
2218 + -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
2219 + -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
2220 + -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
2221 + -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
2222 + -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
2223 + -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
2224 + -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
2225 + -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
2226 + -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
2227 + -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
2228 + -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
2229 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2230 + < $(srcdir)/stdlib.in.h; \
2233 +MOSTLYCLEANFILES += stdlib.h stdlib.h-t
2235 +EXTRA_DIST += stdlib.in.h
2237 +## end gnulib module stdlib
2239 +## begin gnulib module sys_socket
2241 +BUILT_SOURCES += $(SYS_SOCKET_H)
2243 +# We need the following in order to create <sys/socket.h> when the system
2244 +# doesn't have one that works with the given compiler.
2245 +sys/socket.h: sys_socket.in.h
2247 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2248 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2249 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2250 + -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
2251 + -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
2252 + -e 's|@''GNULIB_SOCKET''@|$(GNULIB_SOCKET)|g' \
2253 + -e 's|@''GNULIB_CONNECT''@|$(GNULIB_CONNECT)|g' \
2254 + -e 's|@''GNULIB_ACCEPT''@|$(GNULIB_ACCEPT)|g' \
2255 + -e 's|@''GNULIB_BIND''@|$(GNULIB_BIND)|g' \
2256 + -e 's|@''GNULIB_GETPEERNAME''@|$(GNULIB_GETPEERNAME)|g' \
2257 + -e 's|@''GNULIB_GETSOCKNAME''@|$(GNULIB_GETSOCKNAME)|g' \
2258 + -e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \
2259 + -e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \
2260 + -e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \
2261 + -e 's|@''GNULIB_SEND''@|$()GNULIB_SEND|g' \
2262 + -e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \
2263 + -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
2264 + -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
2265 + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
2266 + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
2267 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2268 + < $(srcdir)/sys_socket.in.h; \
2271 +MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
2272 +MOSTLYCLEANDIRS += sys
2274 +EXTRA_DIST += sys_socket.in.h winsock.c
2276 +EXTRA_libgnu_la_SOURCES += winsock.c
2278 +## end gnulib module sys_socket
2280 +## begin gnulib module unistd
2282 +BUILT_SOURCES += unistd.h
2284 +# We need the following in order to create an empty placeholder for
2285 +# <unistd.h> when the system doesn't have one.
2286 +unistd.h: unistd.in.h
2288 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2289 + sed -e 's|@''HAVE_UNISTD_H''@|$(HAVE_UNISTD_H)|g' \
2290 + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2291 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2292 + -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
2293 + -e 's|@''GNULIB_CHOWN''@|$(GNULIB_CHOWN)|g' \
2294 + -e 's|@''GNULIB_DUP2''@|$(GNULIB_DUP2)|g' \
2295 + -e 's|@''GNULIB_ENVIRON''@|$(GNULIB_ENVIRON)|g' \
2296 + -e 's|@''GNULIB_FCHDIR''@|$(GNULIB_FCHDIR)|g' \
2297 + -e 's|@''GNULIB_FSYNC''@|$(GNULIB_FSYNC)|g' \
2298 + -e 's|@''GNULIB_FTRUNCATE''@|$(GNULIB_FTRUNCATE)|g' \
2299 + -e 's|@''GNULIB_GETCWD''@|$(GNULIB_GETCWD)|g' \
2300 + -e 's|@''GNULIB_GETDTABLESIZE''@|$(GNULIB_GETDTABLESIZE)|g' \
2301 + -e 's|@''GNULIB_GETLOGIN_R''@|$(GNULIB_GETLOGIN_R)|g' \
2302 + -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \
2303 + -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \
2304 + -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
2305 + -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \
2306 + -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \
2307 + -e 's|@''GNULIB_UNISTD_H_SIGPIPE''@|$(GNULIB_UNISTD_H_SIGPIPE)|g' \
2308 + -e 's|@''GNULIB_WRITE''@|$(GNULIB_WRITE)|g' \
2309 + -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
2310 + -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
2311 + -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
2312 + -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
2313 + -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
2314 + -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \
2315 + -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \
2316 + -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
2317 + -e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
2318 + -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
2319 + -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
2320 + -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
2321 + -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
2322 + -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
2323 + -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
2324 + -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
2325 + -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
2326 + -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
2327 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2328 + < $(srcdir)/unistd.in.h; \
2331 +MOSTLYCLEANFILES += unistd.h unistd.h-t
2333 +EXTRA_DIST += unistd.in.h
2335 +## end gnulib module unistd
2337 +## begin gnulib module vasnprintf
2340 +EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
2342 +EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
2344 +## end gnulib module vasnprintf
2346 +## begin gnulib module vc-list-files
2349 +EXTRA_DIST += $(top_srcdir)/./vc-list-files
2351 +## end gnulib module vc-list-files
2353 +## begin gnulib module wchar
2355 +BUILT_SOURCES += $(WCHAR_H)
2357 +# We need the following in order to create <wchar.h> when the system
2358 +# version does not work standalone.
2359 +wchar.h: wchar.in.h
2361 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2362 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2363 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2364 + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
2365 + -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
2366 + -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
2367 + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
2368 + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
2369 + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
2370 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2371 + < $(srcdir)/wchar.in.h; \
2374 +MOSTLYCLEANFILES += wchar.h wchar.h-t
2376 +EXTRA_DIST += wchar.in.h
2378 +## end gnulib module wchar
2380 +## begin gnulib module xsize
2382 +libgnu_la_SOURCES += xsize.h
2384 +## end gnulib module xsize
2386 +## begin gnulib module dummy
2388 +libgnu_la_SOURCES += dummy.c
2390 +## end gnulib module dummy
2393 +mostlyclean-local: mostlyclean-generic
2394 + @for dir in '' $(MOSTLYCLEANDIRS); do \
2395 + if test -n "$$dir" && test -d $$dir; then \
2396 + echo "rmdir $$dir"; rmdir $$dir; \
2400 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/malloc.c gtk-vnc-0.3.7.gnulib/gnulib/lib/malloc.c
2401 --- gtk-vnc-0.3.7.dan3/gnulib/lib/malloc.c 1970-01-01 01:00:00.000000000 +0100
2402 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/malloc.c 2008-10-09 15:24:52.000000000 +0100
2404 +/* malloc() function that is glibc compatible.
2406 + Copyright (C) 1997, 1998, 2006, 2007 Free Software Foundation, Inc.
2408 + This program is free software; you can redistribute it and/or modify
2409 + it under the terms of the GNU Lesser General Public License as published by
2410 + the Free Software Foundation; either version 2.1, or (at your option)
2411 + any later version.
2413 + This program is distributed in the hope that it will be useful,
2414 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2415 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2416 + GNU Lesser General Public License for more details.
2418 + You should have received a copy of the GNU Lesser General Public License
2419 + along with this program; if not, write to the Free Software Foundation,
2420 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2422 +/* written by Jim Meyering and Bruno Haible */
2424 +#include <config.h>
2425 +/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */
2427 +# define NEED_MALLOC_GNU
2431 +/* Specification. */
2432 +#include <stdlib.h>
2436 +/* Call the system's malloc below. */
2439 +/* Allocate an N-byte block of memory from the heap.
2440 + If N is zero, allocate a 1-byte block. */
2443 +rpl_malloc (size_t n)
2447 +#ifdef NEED_MALLOC_GNU
2452 + result = malloc (n);
2454 +#if !HAVE_MALLOC_POSIX
2455 + if (result == NULL)
2461 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/netinet_in.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/netinet_in.in.h
2462 --- gtk-vnc-0.3.7.dan3/gnulib/lib/netinet_in.in.h 1970-01-01 01:00:00.000000000 +0100
2463 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/netinet_in.in.h 2008-10-09 15:24:52.000000000 +0100
2465 +/* Substitute for <netinet/in.h>.
2466 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
2468 + This program is free software; you can redistribute it and/or modify
2469 + it under the terms of the GNU Lesser General Public License as published by
2470 + the Free Software Foundation; either version 2.1, or (at your option)
2471 + any later version.
2473 + This program is distributed in the hope that it will be useful,
2474 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2475 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2476 + GNU Lesser General Public License for more details.
2478 + You should have received a copy of the GNU Lesser General Public License
2479 + along with this program; if not, write to the Free Software Foundation,
2480 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2482 +#ifndef _GL_NETINET_IN_H
2484 +#if @HAVE_NETINET_IN_H@
2486 +@PRAGMA_SYSTEM_HEADER@
2488 +/* On many platforms, <netinet/in.h> assumes prior inclusion of
2490 +# include <sys/types.h>
2492 +/* The include_next requires a split double-inclusion guard. */
2493 +# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@
2497 +#ifndef _GL_NETINET_IN_H
2498 +#define _GL_NETINET_IN_H
2500 +#if !@HAVE_NETINET_IN_H@
2502 +/* A platform that lacks <netinet/in.h>. */
2504 +# include <sys/socket.h>
2508 +#endif /* _GL_NETINET_IN_H */
2509 +#endif /* _GL_NETINET_IN_H */
2510 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/printf-args.c gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-args.c
2511 --- gtk-vnc-0.3.7.dan3/gnulib/lib/printf-args.c 1970-01-01 01:00:00.000000000 +0100
2512 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-args.c 2008-10-09 15:24:52.000000000 +0100
2514 +/* Decomposed printf argument list.
2515 + Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
2517 + This program is free software; you can redistribute it and/or modify
2518 + it under the terms of the GNU Lesser General Public License as published by
2519 + the Free Software Foundation; either version 2.1, or (at your option)
2520 + any later version.
2522 + This program is distributed in the hope that it will be useful,
2523 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2524 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2525 + GNU Lesser General Public License for more details.
2527 + You should have received a copy of the GNU Lesser General Public License along
2528 + with this program; if not, write to the Free Software Foundation,
2529 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2531 +/* This file can be parametrized with the following macros:
2532 + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
2533 + PRINTF_FETCHARGS Name of the function to be defined.
2534 + STATIC Set to 'static' to declare the function static. */
2536 +#ifndef PRINTF_FETCHARGS
2537 +# include <config.h>
2540 +/* Specification. */
2541 +#ifndef PRINTF_FETCHARGS
2542 +# include "printf-args.h"
2549 +PRINTF_FETCHARGS (va_list args, arguments *a)
2554 + for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
2558 + ap->a.a_schar = va_arg (args, /*signed char*/ int);
2561 + ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
2564 + ap->a.a_short = va_arg (args, /*short*/ int);
2567 + ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
2570 + ap->a.a_int = va_arg (args, int);
2573 + ap->a.a_uint = va_arg (args, unsigned int);
2575 + case TYPE_LONGINT:
2576 + ap->a.a_longint = va_arg (args, long int);
2578 + case TYPE_ULONGINT:
2579 + ap->a.a_ulongint = va_arg (args, unsigned long int);
2581 +#if HAVE_LONG_LONG_INT
2582 + case TYPE_LONGLONGINT:
2583 + ap->a.a_longlongint = va_arg (args, long long int);
2585 + case TYPE_ULONGLONGINT:
2586 + ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
2590 + ap->a.a_double = va_arg (args, double);
2592 + case TYPE_LONGDOUBLE:
2593 + ap->a.a_longdouble = va_arg (args, long double);
2596 + ap->a.a_char = va_arg (args, int);
2599 + case TYPE_WIDE_CHAR:
2600 + /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
2601 + default argument promotions", this is not the case in mingw32,
2602 + where wint_t is 'unsigned short'. */
2603 + ap->a.a_wide_char =
2604 + (sizeof (wint_t) < sizeof (int)
2605 + ? va_arg (args, int)
2606 + : va_arg (args, wint_t));
2610 + ap->a.a_string = va_arg (args, const char *);
2611 + /* A null pointer is an invalid argument for "%s", but in practice
2612 + it occurs quite frequently in printf statements that produce
2613 + debug output. Use a fallback in this case. */
2614 + if (ap->a.a_string == NULL)
2615 + ap->a.a_string = "(NULL)";
2618 + case TYPE_WIDE_STRING:
2619 + ap->a.a_wide_string = va_arg (args, const wchar_t *);
2620 + /* A null pointer is an invalid argument for "%ls", but in practice
2621 + it occurs quite frequently in printf statements that produce
2622 + debug output. Use a fallback in this case. */
2623 + if (ap->a.a_wide_string == NULL)
2625 + static const wchar_t wide_null_string[] =
2628 + (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
2632 + ap->a.a_wide_string = wide_null_string;
2636 + case TYPE_POINTER:
2637 + ap->a.a_pointer = va_arg (args, void *);
2639 + case TYPE_COUNT_SCHAR_POINTER:
2640 + ap->a.a_count_schar_pointer = va_arg (args, signed char *);
2642 + case TYPE_COUNT_SHORT_POINTER:
2643 + ap->a.a_count_short_pointer = va_arg (args, short *);
2645 + case TYPE_COUNT_INT_POINTER:
2646 + ap->a.a_count_int_pointer = va_arg (args, int *);
2648 + case TYPE_COUNT_LONGINT_POINTER:
2649 + ap->a.a_count_longint_pointer = va_arg (args, long int *);
2651 +#if HAVE_LONG_LONG_INT
2652 + case TYPE_COUNT_LONGLONGINT_POINTER:
2653 + ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
2656 +#if ENABLE_UNISTDIO
2657 + /* The unistdio extensions. */
2658 + case TYPE_U8_STRING:
2659 + ap->a.a_u8_string = va_arg (args, const uint8_t *);
2660 + /* A null pointer is an invalid argument for "%U", but in practice
2661 + it occurs quite frequently in printf statements that produce
2662 + debug output. Use a fallback in this case. */
2663 + if (ap->a.a_u8_string == NULL)
2665 + static const uint8_t u8_null_string[] =
2666 + { '(', 'N', 'U', 'L', 'L', ')', 0 };
2667 + ap->a.a_u8_string = u8_null_string;
2670 + case TYPE_U16_STRING:
2671 + ap->a.a_u16_string = va_arg (args, const uint16_t *);
2672 + /* A null pointer is an invalid argument for "%lU", but in practice
2673 + it occurs quite frequently in printf statements that produce
2674 + debug output. Use a fallback in this case. */
2675 + if (ap->a.a_u16_string == NULL)
2677 + static const uint16_t u16_null_string[] =
2678 + { '(', 'N', 'U', 'L', 'L', ')', 0 };
2679 + ap->a.a_u16_string = u16_null_string;
2682 + case TYPE_U32_STRING:
2683 + ap->a.a_u32_string = va_arg (args, const uint32_t *);
2684 + /* A null pointer is an invalid argument for "%llU", but in practice
2685 + it occurs quite frequently in printf statements that produce
2686 + debug output. Use a fallback in this case. */
2687 + if (ap->a.a_u32_string == NULL)
2689 + static const uint32_t u32_null_string[] =
2690 + { '(', 'N', 'U', 'L', 'L', ')', 0 };
2691 + ap->a.a_u32_string = u32_null_string;
2696 + /* Unknown type. */
2701 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/printf-args.h gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-args.h
2702 --- gtk-vnc-0.3.7.dan3/gnulib/lib/printf-args.h 1970-01-01 01:00:00.000000000 +0100
2703 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-args.h 2008-10-09 15:24:52.000000000 +0100
2705 +/* Decomposed printf argument list.
2706 + Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc.
2708 + This program is free software; you can redistribute it and/or modify
2709 + it under the terms of the GNU Lesser General Public License as published by
2710 + the Free Software Foundation; either version 2.1, or (at your option)
2711 + any later version.
2713 + This program is distributed in the hope that it will be useful,
2714 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2715 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2716 + GNU Lesser General Public License for more details.
2718 + You should have received a copy of the GNU Lesser General Public License along
2719 + with this program; if not, write to the Free Software Foundation,
2720 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2722 +#ifndef _PRINTF_ARGS_H
2723 +#define _PRINTF_ARGS_H
2725 +/* This file can be parametrized with the following macros:
2726 + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
2727 + PRINTF_FETCHARGS Name of the function to be declared.
2728 + STATIC Set to 'static' to declare the function static. */
2730 +/* Default parameters. */
2731 +#ifndef PRINTF_FETCHARGS
2732 +# define PRINTF_FETCHARGS printf_fetchargs
2736 +#include <stddef.h>
2740 +# include <stddef.h>
2745 +# include <wchar.h>
2749 +#include <stdarg.h>
2752 +/* Argument types */
2764 +#if HAVE_LONG_LONG_INT
2766 + TYPE_ULONGLONGINT,
2779 + TYPE_COUNT_SCHAR_POINTER,
2780 + TYPE_COUNT_SHORT_POINTER,
2781 + TYPE_COUNT_INT_POINTER,
2782 + TYPE_COUNT_LONGINT_POINTER
2783 +#if HAVE_LONG_LONG_INT
2784 +, TYPE_COUNT_LONGLONGINT_POINTER
2786 +#if ENABLE_UNISTDIO
2787 + /* The unistdio extensions. */
2794 +/* Polymorphic argument */
2800 + signed char a_schar;
2801 + unsigned char a_uchar;
2803 + unsigned short a_ushort;
2805 + unsigned int a_uint;
2806 + long int a_longint;
2807 + unsigned long int a_ulongint;
2808 +#if HAVE_LONG_LONG_INT
2809 + long long int a_longlongint;
2810 + unsigned long long int a_ulonglongint;
2814 + long double a_longdouble;
2817 + wint_t a_wide_char;
2819 + const char* a_string;
2821 + const wchar_t* a_wide_string;
2824 + signed char * a_count_schar_pointer;
2825 + short * a_count_short_pointer;
2826 + int * a_count_int_pointer;
2827 + long int * a_count_longint_pointer;
2828 +#if HAVE_LONG_LONG_INT
2829 + long long int * a_count_longlongint_pointer;
2831 +#if ENABLE_UNISTDIO
2832 + /* The unistdio extensions. */
2833 + const uint8_t * a_u8_string;
2834 + const uint16_t * a_u16_string;
2835 + const uint32_t * a_u32_string;
2850 +/* Fetch the arguments, putting them into a. */
2856 +int PRINTF_FETCHARGS (va_list args, arguments *a);
2858 +#endif /* _PRINTF_ARGS_H */
2859 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/printf-parse.c gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-parse.c
2860 --- gtk-vnc-0.3.7.dan3/gnulib/lib/printf-parse.c 1970-01-01 01:00:00.000000000 +0100
2861 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-parse.c 2008-10-09 15:24:52.000000000 +0100
2863 +/* Formatted output to strings.
2864 + Copyright (C) 1999-2000, 2002-2003, 2006-2008 Free Software Foundation, Inc.
2866 + This program is free software; you can redistribute it and/or modify
2867 + it under the terms of the GNU Lesser General Public License as published by
2868 + the Free Software Foundation; either version 2.1, or (at your option)
2869 + any later version.
2871 + This program is distributed in the hope that it will be useful,
2872 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2873 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2874 + GNU Lesser General Public License for more details.
2876 + You should have received a copy of the GNU Lesser General Public License along
2877 + with this program; if not, write to the Free Software Foundation,
2878 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2880 +/* This file can be parametrized with the following macros:
2881 + CHAR_T The element type of the format string.
2882 + CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
2883 + in the format string are ASCII.
2884 + DIRECTIVE Structure denoting a format directive.
2885 + Depends on CHAR_T.
2886 + DIRECTIVES Structure denoting the set of format directives of a
2887 + format string. Depends on CHAR_T.
2888 + PRINTF_PARSE Function that parses a format string.
2889 + Depends on CHAR_T.
2890 + STATIC Set to 'static' to declare the function static.
2891 + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */
2893 +#ifndef PRINTF_PARSE
2894 +# include <config.h>
2897 +/* Specification. */
2898 +#ifndef PRINTF_PARSE
2899 +# include "printf-parse.h"
2902 +/* Default parameters. */
2903 +#ifndef PRINTF_PARSE
2904 +# define PRINTF_PARSE printf_parse
2905 +# define CHAR_T char
2906 +# define DIRECTIVE char_directive
2907 +# define DIRECTIVES char_directives
2910 +/* Get size_t, NULL. */
2911 +#include <stddef.h>
2913 +/* Get intmax_t. */
2914 +#if defined IN_LIBINTL || defined IN_LIBASPRINTF
2915 +# if HAVE_STDINT_H_WITH_UINTMAX
2916 +# include <stdint.h>
2918 +# if HAVE_INTTYPES_H_WITH_UINTMAX
2919 +# include <inttypes.h>
2922 +# include <stdint.h>
2925 +/* malloc(), realloc(), free(). */
2926 +#include <stdlib.h>
2931 +/* Checked size_t computations. */
2934 +#if CHAR_T_ONLY_ASCII
2936 +# include "c-ctype.h"
2943 +PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
2945 + const CHAR_T *cp = format; /* pointer into format */
2946 + size_t arg_posn = 0; /* number of regular arguments consumed */
2947 + size_t d_allocated; /* allocated elements of d->dir */
2948 + size_t a_allocated; /* allocated elements of a->arg */
2949 + size_t max_width_length = 0;
2950 + size_t max_precision_length = 0;
2954 + d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
2955 + if (d->dir == NULL)
2956 + /* Out of memory. */
2957 + goto out_of_memory_1;
2963 +#define REGISTER_ARG(_index_,_type_) \
2965 + size_t n = (_index_); \
2966 + if (n >= a_allocated) \
2968 + size_t memory_size; \
2969 + argument *memory; \
2971 + a_allocated = xtimes (a_allocated, 2); \
2972 + if (a_allocated <= n) \
2973 + a_allocated = xsum (n, 1); \
2974 + memory_size = xtimes (a_allocated, sizeof (argument)); \
2975 + if (size_overflow_p (memory_size)) \
2976 + /* Overflow, would lead to out of memory. */ \
2977 + goto out_of_memory; \
2978 + memory = (argument *) (a->arg \
2979 + ? realloc (a->arg, memory_size) \
2980 + : malloc (memory_size)); \
2981 + if (memory == NULL) \
2982 + /* Out of memory. */ \
2983 + goto out_of_memory; \
2984 + a->arg = memory; \
2986 + while (a->count <= n) \
2987 + a->arg[a->count++].type = TYPE_NONE; \
2988 + if (a->arg[n].type == TYPE_NONE) \
2989 + a->arg[n].type = (_type_); \
2990 + else if (a->arg[n].type != (_type_)) \
2991 + /* Ambiguous type for positional argument. */ \
2995 + while (*cp != '\0')
3000 + size_t arg_index = ARG_NONE;
3001 + DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
3003 + /* Initialize the next directive. */
3004 + dp->dir_start = cp - 1;
3006 + dp->width_start = NULL;
3007 + dp->width_end = NULL;
3008 + dp->width_arg_index = ARG_NONE;
3009 + dp->precision_start = NULL;
3010 + dp->precision_end = NULL;
3011 + dp->precision_arg_index = ARG_NONE;
3012 + dp->arg_index = ARG_NONE;
3014 + /* Test for positional argument. */
3015 + if (*cp >= '0' && *cp <= '9')
3019 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3025 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3026 + n = xsum (xtimes (n, 10), *np - '0');
3028 + /* Positional argument 0. */
3030 + if (size_overflow_p (n))
3031 + /* n too large, would lead to out of memory later. */
3033 + arg_index = n - 1;
3038 + /* Read the flags. */
3043 + dp->flags |= FLAG_GROUP;
3046 + else if (*cp == '-')
3048 + dp->flags |= FLAG_LEFT;
3051 + else if (*cp == '+')
3053 + dp->flags |= FLAG_SHOWSIGN;
3056 + else if (*cp == ' ')
3058 + dp->flags |= FLAG_SPACE;
3061 + else if (*cp == '#')
3063 + dp->flags |= FLAG_ALT;
3066 + else if (*cp == '0')
3068 + dp->flags |= FLAG_ZERO;
3075 + /* Parse the field width. */
3078 + dp->width_start = cp;
3080 + dp->width_end = cp;
3081 + if (max_width_length < 1)
3082 + max_width_length = 1;
3084 + /* Test for positional argument. */
3085 + if (*cp >= '0' && *cp <= '9')
3089 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3095 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3096 + n = xsum (xtimes (n, 10), *np - '0');
3098 + /* Positional argument 0. */
3100 + if (size_overflow_p (n))
3101 + /* n too large, would lead to out of memory later. */
3103 + dp->width_arg_index = n - 1;
3107 + if (dp->width_arg_index == ARG_NONE)
3109 + dp->width_arg_index = arg_posn++;
3110 + if (dp->width_arg_index == ARG_NONE)
3111 + /* arg_posn wrapped around. */
3114 + REGISTER_ARG (dp->width_arg_index, TYPE_INT);
3116 + else if (*cp >= '0' && *cp <= '9')
3118 + size_t width_length;
3120 + dp->width_start = cp;
3121 + for (; *cp >= '0' && *cp <= '9'; cp++)
3123 + dp->width_end = cp;
3124 + width_length = dp->width_end - dp->width_start;
3125 + if (max_width_length < width_length)
3126 + max_width_length = width_length;
3129 + /* Parse the precision. */
3135 + dp->precision_start = cp - 1;
3137 + dp->precision_end = cp;
3138 + if (max_precision_length < 2)
3139 + max_precision_length = 2;
3141 + /* Test for positional argument. */
3142 + if (*cp >= '0' && *cp <= '9')
3146 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3152 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3153 + n = xsum (xtimes (n, 10), *np - '0');
3155 + /* Positional argument 0. */
3157 + if (size_overflow_p (n))
3158 + /* n too large, would lead to out of memory
3161 + dp->precision_arg_index = n - 1;
3165 + if (dp->precision_arg_index == ARG_NONE)
3167 + dp->precision_arg_index = arg_posn++;
3168 + if (dp->precision_arg_index == ARG_NONE)
3169 + /* arg_posn wrapped around. */
3172 + REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
3176 + size_t precision_length;
3178 + dp->precision_start = cp - 1;
3179 + for (; *cp >= '0' && *cp <= '9'; cp++)
3181 + dp->precision_end = cp;
3182 + precision_length = dp->precision_end - dp->precision_start;
3183 + if (max_precision_length < precision_length)
3184 + max_precision_length = precision_length;
3191 + /* Parse argument type/size specifiers. */
3199 + flags |= (1 << (flags & 1));
3202 + else if (*cp == 'L')
3207 + else if (*cp == 'l')
3212 + else if (*cp == 'j')
3214 + if (sizeof (intmax_t) > sizeof (long))
3216 + /* intmax_t = long long */
3219 + else if (sizeof (intmax_t) > sizeof (int))
3221 + /* intmax_t = long */
3226 + else if (*cp == 'z' || *cp == 'Z')
3228 + /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
3229 + because the warning facility in gcc-2.95.2 understands
3230 + only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
3231 + if (sizeof (size_t) > sizeof (long))
3233 + /* size_t = long long */
3236 + else if (sizeof (size_t) > sizeof (int))
3238 + /* size_t = long */
3243 + else if (*cp == 't')
3245 + if (sizeof (ptrdiff_t) > sizeof (long))
3247 + /* ptrdiff_t = long long */
3250 + else if (sizeof (ptrdiff_t) > sizeof (int))
3252 + /* ptrdiff_t = long */
3257 +#if defined __APPLE__ && defined __MACH__
3258 + /* On MacOS X 10.3, PRIdMAX is defined as "qd".
3259 + We cannot change it to "lld" because PRIdMAX must also
3260 + be understood by the system's printf routines. */
3261 + else if (*cp == 'q')
3263 + if (64 / 8 > sizeof (long))
3265 + /* int64_t = long long */
3270 + /* int64_t = long */
3276 +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
3277 + /* On native Win32, PRIdMAX is defined as "I64d".
3278 + We cannot change it to "lld" because PRIdMAX must also
3279 + be understood by the system's printf routines. */
3280 + else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
3282 + if (64 / 8 > sizeof (long))
3284 + /* __int64 = long long */
3289 + /* __int64 = long */
3299 + /* Read the conversion character. */
3303 + case 'd': case 'i':
3304 +#if HAVE_LONG_LONG_INT
3305 + /* If 'long long' exists and is larger than 'long': */
3306 + if (flags >= 16 || (flags & 4))
3307 + type = TYPE_LONGLONGINT;
3310 + /* If 'long long' exists and is the same as 'long', we parse
3311 + "lld" into TYPE_LONGINT. */
3313 + type = TYPE_LONGINT;
3314 + else if (flags & 2)
3315 + type = TYPE_SCHAR;
3316 + else if (flags & 1)
3317 + type = TYPE_SHORT;
3321 + case 'o': case 'u': case 'x': case 'X':
3322 +#if HAVE_LONG_LONG_INT
3323 + /* If 'long long' exists and is larger than 'long': */
3324 + if (flags >= 16 || (flags & 4))
3325 + type = TYPE_ULONGLONGINT;
3328 + /* If 'unsigned long long' exists and is the same as
3329 + 'unsigned long', we parse "llu" into TYPE_ULONGINT. */
3331 + type = TYPE_ULONGINT;
3332 + else if (flags & 2)
3333 + type = TYPE_UCHAR;
3334 + else if (flags & 1)
3335 + type = TYPE_USHORT;
3339 + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
3340 + case 'a': case 'A':
3341 + if (flags >= 16 || (flags & 4))
3342 + type = TYPE_LONGDOUBLE;
3344 + type = TYPE_DOUBLE;
3349 + type = TYPE_WIDE_CHAR;
3358 + type = TYPE_WIDE_CHAR;
3365 + type = TYPE_WIDE_STRING;
3370 + type = TYPE_STRING;
3374 + type = TYPE_WIDE_STRING;
3379 + type = TYPE_POINTER;
3382 +#if HAVE_LONG_LONG_INT
3383 + /* If 'long long' exists and is larger than 'long': */
3384 + if (flags >= 16 || (flags & 4))
3385 + type = TYPE_COUNT_LONGLONGINT_POINTER;
3388 + /* If 'long long' exists and is the same as 'long', we parse
3389 + "lln" into TYPE_COUNT_LONGINT_POINTER. */
3391 + type = TYPE_COUNT_LONGINT_POINTER;
3392 + else if (flags & 2)
3393 + type = TYPE_COUNT_SCHAR_POINTER;
3394 + else if (flags & 1)
3395 + type = TYPE_COUNT_SHORT_POINTER;
3397 + type = TYPE_COUNT_INT_POINTER;
3399 +#if ENABLE_UNISTDIO
3400 + /* The unistdio extensions. */
3403 + type = TYPE_U32_STRING;
3404 + else if (flags >= 8)
3405 + type = TYPE_U16_STRING;
3407 + type = TYPE_U8_STRING;
3414 + /* Unknown conversion character. */
3419 + if (type != TYPE_NONE)
3421 + dp->arg_index = arg_index;
3422 + if (dp->arg_index == ARG_NONE)
3424 + dp->arg_index = arg_posn++;
3425 + if (dp->arg_index == ARG_NONE)
3426 + /* arg_posn wrapped around. */
3429 + REGISTER_ARG (dp->arg_index, type);
3431 + dp->conversion = c;
3436 + if (d->count >= d_allocated)
3438 + size_t memory_size;
3439 + DIRECTIVE *memory;
3441 + d_allocated = xtimes (d_allocated, 2);
3442 + memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
3443 + if (size_overflow_p (memory_size))
3444 + /* Overflow, would lead to out of memory. */
3445 + goto out_of_memory;
3446 + memory = (DIRECTIVE *) realloc (d->dir, memory_size);
3447 + if (memory == NULL)
3448 + /* Out of memory. */
3449 + goto out_of_memory;
3453 +#if CHAR_T_ONLY_ASCII
3454 + else if (!c_isascii (c))
3456 + /* Non-ASCII character. Not supported. */
3461 + d->dir[d->count].dir_start = cp;
3463 + d->max_width_length = max_width_length;
3464 + d->max_precision_length = max_precision_length;
3485 +#undef PRINTF_PARSE
3488 +#undef CHAR_T_ONLY_ASCII
3490 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/printf-parse.h gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-parse.h
3491 --- gtk-vnc-0.3.7.dan3/gnulib/lib/printf-parse.h 1970-01-01 01:00:00.000000000 +0100
3492 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-parse.h 2008-10-09 15:24:52.000000000 +0100
3494 +/* Parse printf format string.
3495 + Copyright (C) 1999, 2002-2003, 2005, 2007 Free Software Foundation, Inc.
3497 + This program is free software; you can redistribute it and/or modify
3498 + it under the terms of the GNU Lesser General Public License as published by
3499 + the Free Software Foundation; either version 2.1, or (at your option)
3500 + any later version.
3502 + This program is distributed in the hope that it will be useful,
3503 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3504 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3505 + GNU Lesser General Public License for more details.
3507 + You should have received a copy of the GNU Lesser General Public License along
3508 + with this program; if not, write to the Free Software Foundation,
3509 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3511 +#ifndef _PRINTF_PARSE_H
3512 +#define _PRINTF_PARSE_H
3514 +/* This file can be parametrized with the following macros:
3515 + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
3516 + STATIC Set to 'static' to declare the function static. */
3518 +#include "printf-args.h"
3522 +#define FLAG_GROUP 1 /* ' flag */
3523 +#define FLAG_LEFT 2 /* - flag */
3524 +#define FLAG_SHOWSIGN 4 /* + flag */
3525 +#define FLAG_SPACE 8 /* space flag */
3526 +#define FLAG_ALT 16 /* # flag */
3527 +#define FLAG_ZERO 32
3529 +/* arg_index value indicating that no argument is consumed. */
3530 +#define ARG_NONE (~(size_t)0)
3532 +/* xxx_directive: A parsed directive.
3533 + xxx_directives: A parsed format string. */
3535 +/* A parsed directive. */
3538 + const char* dir_start;
3539 + const char* dir_end;
3541 + const char* width_start;
3542 + const char* width_end;
3543 + size_t width_arg_index;
3544 + const char* precision_start;
3545 + const char* precision_end;
3546 + size_t precision_arg_index;
3547 + char conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
3552 +/* A parsed format string. */
3556 + char_directive *dir;
3557 + size_t max_width_length;
3558 + size_t max_precision_length;
3562 +#if ENABLE_UNISTDIO
3564 +/* A parsed directive. */
3567 + const uint8_t* dir_start;
3568 + const uint8_t* dir_end;
3570 + const uint8_t* width_start;
3571 + const uint8_t* width_end;
3572 + size_t width_arg_index;
3573 + const uint8_t* precision_start;
3574 + const uint8_t* precision_end;
3575 + size_t precision_arg_index;
3576 + uint8_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
3581 +/* A parsed format string. */
3585 + u8_directive *dir;
3586 + size_t max_width_length;
3587 + size_t max_precision_length;
3591 +/* A parsed directive. */
3594 + const uint16_t* dir_start;
3595 + const uint16_t* dir_end;
3597 + const uint16_t* width_start;
3598 + const uint16_t* width_end;
3599 + size_t width_arg_index;
3600 + const uint16_t* precision_start;
3601 + const uint16_t* precision_end;
3602 + size_t precision_arg_index;
3603 + uint16_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
3608 +/* A parsed format string. */
3612 + u16_directive *dir;
3613 + size_t max_width_length;
3614 + size_t max_precision_length;
3618 +/* A parsed directive. */
3621 + const uint32_t* dir_start;
3622 + const uint32_t* dir_end;
3624 + const uint32_t* width_start;
3625 + const uint32_t* width_end;
3626 + size_t width_arg_index;
3627 + const uint32_t* precision_start;
3628 + const uint32_t* precision_end;
3629 + size_t precision_arg_index;
3630 + uint32_t conversion; /* d i o u x X f F e E g G a A c s p n U % but not C S */
3635 +/* A parsed format string. */
3639 + u32_directive *dir;
3640 + size_t max_width_length;
3641 + size_t max_precision_length;
3648 +/* Parses the format string. Fills in the number N of directives, and fills
3649 + in directives[0], ..., directives[N-1], and sets directives[N].dir_start
3650 + to the end of the format string. Also fills in the arg_type fields of the
3651 + arguments and the needed count of arguments. */
3652 +#if ENABLE_UNISTDIO
3654 + ulc_printf_parse (const char *format, char_directives *d, arguments *a);
3656 + u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
3658 + u16_printf_parse (const uint16_t *format, u16_directives *d,
3661 + u32_printf_parse (const uint32_t *format, u32_directives *d,
3669 +int printf_parse (const char *format, char_directives *d, arguments *a);
3672 +#endif /* _PRINTF_PARSE_H */
3673 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/size_max.h gtk-vnc-0.3.7.gnulib/gnulib/lib/size_max.h
3674 --- gtk-vnc-0.3.7.dan3/gnulib/lib/size_max.h 1970-01-01 01:00:00.000000000 +0100
3675 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/size_max.h 2008-10-09 15:24:52.000000000 +0100
3677 +/* size_max.h -- declare SIZE_MAX through system headers
3678 + Copyright (C) 2005-2006 Free Software Foundation, Inc.
3679 + Written by Simon Josefsson.
3681 + This program is free software; you can redistribute it and/or modify
3682 + it under the terms of the GNU Lesser General Public License as published by
3683 + the Free Software Foundation; either version 2.1, or (at your option)
3684 + any later version.
3686 + This program is distributed in the hope that it will be useful,
3687 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3688 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3689 + GNU Lesser General Public License for more details.
3691 + You should have received a copy of the GNU Lesser General Public License
3692 + along with this program; if not, write to the Free Software Foundation,
3693 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3695 +#ifndef GNULIB_SIZE_MAX_H
3696 +#define GNULIB_SIZE_MAX_H
3698 +/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
3699 +# include <limits.h>
3700 +/* Get SIZE_MAX declaration on systems like glibc 2. */
3702 +# include <stdint.h>
3704 +/* On systems where these include files don't define it, SIZE_MAX is defined
3707 +#endif /* GNULIB_SIZE_MAX_H */
3708 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/snprintf.c gtk-vnc-0.3.7.gnulib/gnulib/lib/snprintf.c
3709 --- gtk-vnc-0.3.7.dan3/gnulib/lib/snprintf.c 1970-01-01 01:00:00.000000000 +0100
3710 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/snprintf.c 2008-10-09 15:24:52.000000000 +0100
3712 +/* Formatted output to strings.
3713 + Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc.
3714 + Written by Simon Josefsson and Paul Eggert.
3716 + This program is free software; you can redistribute it and/or modify
3717 + it under the terms of the GNU Lesser General Public License as published by
3718 + the Free Software Foundation; either version 2.1, or (at your option)
3719 + any later version.
3721 + This program is distributed in the hope that it will be useful,
3722 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3723 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3724 + GNU Lesser General Public License for more details.
3726 + You should have received a copy of the GNU Lesser General Public License along
3727 + with this program; if not, write to the Free Software Foundation,
3728 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3730 +#include <config.h>
3732 +/* Specification. */
3736 +#include <limits.h>
3737 +#include <stdarg.h>
3738 +#include <stdlib.h>
3739 +#include <string.h>
3741 +#include "vasnprintf.h"
3743 +/* Print formatted output to string STR. Similar to sprintf, but
3744 + additional length SIZE limit how much is written into STR. Returns
3745 + string length of formatted string (which may be larger than SIZE).
3746 + STR may be NULL, in which case nothing will be written. On error,
3747 + return a negative value. */
3749 +snprintf (char *str, size_t size, const char *format, ...)
3753 + size_t lenbuf = size;
3756 + va_start (args, format);
3757 + output = vasnprintf (str, &lenbuf, format, args);
3764 + if (output != str)
3768 + size_t pruned_len = (len < size ? len : size - 1);
3769 + memcpy (str, output, pruned_len);
3770 + str[pruned_len] = '\0';
3776 + if (INT_MAX < len)
3778 + errno = EOVERFLOW;
3784 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/stdbool.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/stdbool.in.h
3785 --- gtk-vnc-0.3.7.dan3/gnulib/lib/stdbool.in.h 1970-01-01 01:00:00.000000000 +0100
3786 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdbool.in.h 2008-10-09 15:24:52.000000000 +0100
3788 +/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc.
3789 + Written by Bruno Haible <haible@clisp.cons.org>, 2001.
3791 + This program is free software; you can redistribute it and/or modify
3792 + it under the terms of the GNU Lesser General Public License as published by
3793 + the Free Software Foundation; either version 2.1, or (at your option)
3794 + any later version.
3796 + This program is distributed in the hope that it will be useful,
3797 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3798 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3799 + GNU Lesser General Public License for more details.
3801 + You should have received a copy of the GNU Lesser General Public License
3802 + along with this program; if not, write to the Free Software Foundation,
3803 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3805 +#ifndef _GL_STDBOOL_H
3806 +#define _GL_STDBOOL_H
3808 +/* ISO C 99 <stdbool.h> for platforms that lack it. */
3810 +/* Usage suggestions:
3812 + Programs that use <stdbool.h> should be aware of some limitations
3813 + and standards compliance issues.
3815 + Standards compliance:
3817 + - <stdbool.h> must be #included before 'bool', 'false', 'true'
3820 + - You cannot assume that sizeof (bool) == 1.
3822 + - Programs should not undefine the macros bool, true, and false,
3823 + as C99 lists that as an "obsolescent feature".
3825 + Limitations of this substitute, when used in a C89 environment:
3827 + - <stdbool.h> must be #included before the '_Bool' type can be used.
3829 + - You cannot assume that _Bool is a typedef; it might be a macro.
3831 + - Bit-fields of type 'bool' are not supported. Portable code
3832 + should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
3834 + - In C99, casts and automatic conversions to '_Bool' or 'bool' are
3835 + performed in such a way that every nonzero value gets converted
3836 + to 'true', and zero gets converted to 'false'. This doesn't work
3837 + with this substitute. With this substitute, only the values 0 and 1
3838 + give the expected result when converted to _Bool' or 'bool'.
3840 + Also, it is suggested that programs use 'bool' rather than '_Bool';
3841 + this isn't required, but 'bool' is more common. */
3844 +/* 7.16. Boolean type and values */
3846 +/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
3847 + definitions below, but temporarily we have to #undef them. */
3848 +#if defined __BEOS__ && !defined __HAIKU__
3849 +# include <OS.h> /* defines bool but not _Bool */
3854 +/* For the sake of symbolic names in gdb, we define true and false as
3855 + enum constants, not only as macros.
3856 + It is tempting to write
3857 + typedef enum { false = 0, true = 1 } _Bool;
3858 + so that gdb prints values of type 'bool' symbolically. But if we do
3859 + this, values of type '_Bool' may promote to 'int' or 'unsigned int'
3860 + (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
3861 + (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
3862 + enum; this ensures that '_Bool' promotes to 'int'. */
3863 +#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
3864 + /* A compiler known to have 'bool'. */
3865 + /* If the compiler already has both 'bool' and '_Bool', we can assume they
3866 + are the same types. */
3868 +typedef bool _Bool;
3871 +# if !defined __GNUC__
3872 + /* If @HAVE__BOOL@:
3873 + Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
3874 + the built-in _Bool type is used. See
3875 + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
3876 + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
3877 + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
3878 + Similar bugs are likely with other compilers as well; this file
3879 + wouldn't be used if <stdbool.h> was working.
3880 + So we override the _Bool type.
3882 + Need to define _Bool ourselves. As 'signed char' or as an enum type?
3883 + Use of a typedef, with SunPRO C, leads to a stupid
3884 + "warning: _Bool is a keyword in ISO C99".
3885 + Use of an enum type, with IRIX cc, leads to a stupid
3886 + "warning(1185): enumerated type mixed with another type".
3887 + Even the existence of an enum type, without a typedef,
3888 + "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
3889 + The only benefit of the enum, debuggability, is not important
3890 + with these compilers. So use 'signed char' and no enum. */
3891 +# define _Bool signed char
3893 + /* With this compiler, trust the _Bool type if the compiler has it. */
3895 +typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
3901 +/* The other macros must be usable in preprocessor directives. */
3904 +#define __bool_true_false_are_defined 1
3906 +#endif /* _GL_STDBOOL_H */
3907 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/stdint.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/stdint.in.h
3908 --- gtk-vnc-0.3.7.dan3/gnulib/lib/stdint.in.h 1970-01-01 01:00:00.000000000 +0100
3909 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdint.in.h 2008-10-09 15:24:52.000000000 +0100
3911 +/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc.
3912 + Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
3913 + This file is part of gnulib.
3915 + This program is free software; you can redistribute it and/or modify
3916 + it under the terms of the GNU Lesser General Public License as published by
3917 + the Free Software Foundation; either version 2.1, or (at your option)
3918 + any later version.
3920 + This program is distributed in the hope that it will be useful,
3921 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3922 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3923 + GNU Lesser General Public License for more details.
3925 + You should have received a copy of the GNU Lesser General Public License
3926 + along with this program; if not, write to the Free Software Foundation,
3927 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3930 + * ISO C 99 <stdint.h> for platforms that lack it.
3931 + * <http://www.opengroup.org/susv3xbd/stdint.h.html>
3934 +#ifndef _GL_STDINT_H
3936 +/* When including a system file that in turn includes <inttypes.h>,
3937 + use the system <inttypes.h>, not our substitute. This avoids
3938 + problems with (for example) VMS, whose <sys/bitypes.h> includes
3940 +#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
3942 +/* Get those types that are already defined in other system include
3943 + files, so that we can "#define int8_t signed char" below without
3944 + worrying about a later system include file containing a "typedef
3945 + signed char int8_t;" that will get messed up by our macro. Our
3946 + macros should all be consistent with the system versions, except
3947 + for the "fast" types and macros, which we recommend against using
3948 + in public interfaces due to compiler differences. */
3950 +#if @HAVE_STDINT_H@
3951 +# if defined __sgi && ! defined __c99
3952 + /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
3953 + with "This header file is to be used only for c99 mode compilations"
3955 +# define __STDINT_H__
3957 + /* Other systems may have an incomplete or buggy <stdint.h>.
3958 + Include it before <inttypes.h>, since any "#include <stdint.h>"
3959 + in <inttypes.h> would reinclude us, skipping our contents because
3960 + _GL_STDINT_H is defined.
3961 + The include_next requires a split double-inclusion guard. */
3962 +@PRAGMA_SYSTEM_HEADER@
3963 +# @INCLUDE_NEXT@ @NEXT_STDINT_H@
3966 +#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
3967 +#define _GL_STDINT_H
3969 +/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
3970 + IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
3971 + AIX 5.2 <sys/types.h> isn't needed and causes troubles.
3972 + MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
3973 + relies on the system <stdint.h> definitions, so include
3974 + <sys/types.h> after @NEXT_STDINT_H@. */
3975 +#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
3976 +# include <sys/types.h>
3979 +/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
3980 +#include <limits.h>
3982 +#if @HAVE_INTTYPES_H@
3983 + /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
3984 + int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
3985 + <inttypes.h> also defines intptr_t and uintptr_t. */
3986 +# include <inttypes.h>
3987 +#elif @HAVE_SYS_INTTYPES_H@
3988 + /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
3989 + the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
3990 +# include <sys/inttypes.h>
3993 +#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
3994 + /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
3995 + int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
3996 + included by <sys/types.h>. */
3997 +# include <sys/bitypes.h>
4000 +#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
4002 +/* Get WCHAR_MIN, WCHAR_MAX. */
4003 +# if ! (defined WCHAR_MIN && defined WCHAR_MAX)
4004 +# include <wchar.h>
4009 +#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
4011 +/* Minimum and maximum values for a integer type under the usual assumption.
4012 + Return an unspecified value if BITS == 0, adding a check to pacify
4013 + picky compilers. */
4015 +#define _STDINT_MIN(signed, bits, zero) \
4016 + ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
4018 +#define _STDINT_MAX(signed, bits, zero) \
4020 + ? ~ _STDINT_MIN (signed, bits, zero) \
4021 + : /* The expression for the unsigned case. The subtraction of (signed) \
4022 + is a nop in the unsigned case and avoids "signed integer overflow" \
4023 + warnings in the signed case. */ \
4024 + ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
4026 +/* 7.18.1.1. Exact-width integer types */
4028 +/* Here we assume a standard architecture where the hardware integer
4029 + types have 8, 16, 32, optionally 64 bits. */
4033 +#define int8_t signed char
4034 +#define uint8_t unsigned char
4038 +#define int16_t short int
4039 +#define uint16_t unsigned short int
4043 +#define int32_t int
4044 +#define uint32_t unsigned int
4046 +/* Do not undefine int64_t if gnulib is not being used with 64-bit
4047 + types, since otherwise it breaks platforms like Tandem/NSK. */
4048 +#if LONG_MAX >> 31 >> 31 == 1
4050 +# define int64_t long int
4051 +# define GL_INT64_T
4052 +#elif defined _MSC_VER
4054 +# define int64_t __int64
4055 +# define GL_INT64_T
4056 +#elif @HAVE_LONG_LONG_INT@
4058 +# define int64_t long long int
4059 +# define GL_INT64_T
4062 +#if ULONG_MAX >> 31 >> 31 >> 1 == 1
4064 +# define uint64_t unsigned long int
4065 +# define GL_UINT64_T
4066 +#elif defined _MSC_VER
4068 +# define uint64_t unsigned __int64
4069 +# define GL_UINT64_T
4070 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@
4072 +# define uint64_t unsigned long long int
4073 +# define GL_UINT64_T
4076 +/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
4082 +/* 7.18.1.2. Minimum-width integer types */
4084 +/* Here we assume a standard architecture where the hardware integer
4085 + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
4086 + are the same as the corresponding N_t types. */
4088 +#undef int_least8_t
4089 +#undef uint_least8_t
4090 +#undef int_least16_t
4091 +#undef uint_least16_t
4092 +#undef int_least32_t
4093 +#undef uint_least32_t
4094 +#undef int_least64_t
4095 +#undef uint_least64_t
4096 +#define int_least8_t int8_t
4097 +#define uint_least8_t uint8_t
4098 +#define int_least16_t int16_t
4099 +#define uint_least16_t uint16_t
4100 +#define int_least32_t int32_t
4101 +#define uint_least32_t uint32_t
4103 +# define int_least64_t int64_t
4106 +# define uint_least64_t uint64_t
4109 +/* 7.18.1.3. Fastest minimum-width integer types */
4111 +/* Note: Other <stdint.h> substitutes may define these types differently.
4112 + It is not recommended to use these types in public header files. */
4114 +/* Here we assume a standard architecture where the hardware integer
4115 + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
4116 + are taken from the same list of types. Assume that 'long int'
4117 + is fast enough for all narrower integers. */
4120 +#undef uint_fast8_t
4121 +#undef int_fast16_t
4122 +#undef uint_fast16_t
4123 +#undef int_fast32_t
4124 +#undef uint_fast32_t
4125 +#undef int_fast64_t
4126 +#undef uint_fast64_t
4127 +#define int_fast8_t long int
4128 +#define uint_fast8_t unsigned int_fast8_t
4129 +#define int_fast16_t long int
4130 +#define uint_fast16_t unsigned int_fast16_t
4131 +#define int_fast32_t long int
4132 +#define uint_fast32_t unsigned int_fast32_t
4134 +# define int_fast64_t int64_t
4137 +# define uint_fast64_t uint64_t
4140 +/* 7.18.1.4. Integer types capable of holding object pointers */
4144 +#define intptr_t long int
4145 +#define uintptr_t unsigned long int
4147 +/* 7.18.1.5. Greatest-width integer types */
4149 +/* Note: These types are compiler dependent. It may be unwise to use them in
4150 + public header files. */
4153 +#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
4154 +# define intmax_t long long int
4155 +#elif defined GL_INT64_T
4156 +# define intmax_t int64_t
4158 +# define intmax_t long int
4162 +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
4163 +# define uintmax_t unsigned long long int
4164 +#elif defined GL_UINT64_T
4165 +# define uintmax_t uint64_t
4167 +# define uintmax_t unsigned long int
4170 +/* Verify that intmax_t and uintmax_t have the same size. Too much code
4171 + breaks if this is not the case. If this check fails, the reason is likely
4172 + to be found in the autoconf macros. */
4173 +typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1];
4175 +/* 7.18.2. Limits of specified-width integer types */
4177 +#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
4179 +/* 7.18.2.1. Limits of exact-width integer types */
4181 +/* Here we assume a standard architecture where the hardware integer
4182 + types have 8, 16, 32, optionally 64 bits. */
4187 +#define INT8_MIN (~ INT8_MAX)
4188 +#define INT8_MAX 127
4189 +#define UINT8_MAX 255
4194 +#define INT16_MIN (~ INT16_MAX)
4195 +#define INT16_MAX 32767
4196 +#define UINT16_MAX 65535
4201 +#define INT32_MIN (~ INT32_MAX)
4202 +#define INT32_MAX 2147483647
4203 +#define UINT32_MAX 4294967295U
4208 +/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
4209 + evaluates the latter incorrectly in preprocessor expressions. */
4210 +# define INT64_MIN (- INTMAX_C (1) << 63)
4211 +# define INT64_MAX INTMAX_C (9223372036854775807)
4216 +# define UINT64_MAX UINTMAX_C (18446744073709551615)
4219 +/* 7.18.2.2. Limits of minimum-width integer types */
4221 +/* Here we assume a standard architecture where the hardware integer
4222 + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
4223 + are the same as the corresponding N_t types. */
4225 +#undef INT_LEAST8_MIN
4226 +#undef INT_LEAST8_MAX
4227 +#undef UINT_LEAST8_MAX
4228 +#define INT_LEAST8_MIN INT8_MIN
4229 +#define INT_LEAST8_MAX INT8_MAX
4230 +#define UINT_LEAST8_MAX UINT8_MAX
4232 +#undef INT_LEAST16_MIN
4233 +#undef INT_LEAST16_MAX
4234 +#undef UINT_LEAST16_MAX
4235 +#define INT_LEAST16_MIN INT16_MIN
4236 +#define INT_LEAST16_MAX INT16_MAX
4237 +#define UINT_LEAST16_MAX UINT16_MAX
4239 +#undef INT_LEAST32_MIN
4240 +#undef INT_LEAST32_MAX
4241 +#undef UINT_LEAST32_MAX
4242 +#define INT_LEAST32_MIN INT32_MIN
4243 +#define INT_LEAST32_MAX INT32_MAX
4244 +#define UINT_LEAST32_MAX UINT32_MAX
4246 +#undef INT_LEAST64_MIN
4247 +#undef INT_LEAST64_MAX
4249 +# define INT_LEAST64_MIN INT64_MIN
4250 +# define INT_LEAST64_MAX INT64_MAX
4253 +#undef UINT_LEAST64_MAX
4255 +# define UINT_LEAST64_MAX UINT64_MAX
4258 +/* 7.18.2.3. Limits of fastest minimum-width integer types */
4260 +/* Here we assume a standard architecture where the hardware integer
4261 + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
4262 + are taken from the same list of types. */
4264 +#undef INT_FAST8_MIN
4265 +#undef INT_FAST8_MAX
4266 +#undef UINT_FAST8_MAX
4267 +#define INT_FAST8_MIN LONG_MIN
4268 +#define INT_FAST8_MAX LONG_MAX
4269 +#define UINT_FAST8_MAX ULONG_MAX
4271 +#undef INT_FAST16_MIN
4272 +#undef INT_FAST16_MAX
4273 +#undef UINT_FAST16_MAX
4274 +#define INT_FAST16_MIN LONG_MIN
4275 +#define INT_FAST16_MAX LONG_MAX
4276 +#define UINT_FAST16_MAX ULONG_MAX
4278 +#undef INT_FAST32_MIN
4279 +#undef INT_FAST32_MAX
4280 +#undef UINT_FAST32_MAX
4281 +#define INT_FAST32_MIN LONG_MIN
4282 +#define INT_FAST32_MAX LONG_MAX
4283 +#define UINT_FAST32_MAX ULONG_MAX
4285 +#undef INT_FAST64_MIN
4286 +#undef INT_FAST64_MAX
4288 +# define INT_FAST64_MIN INT64_MIN
4289 +# define INT_FAST64_MAX INT64_MAX
4292 +#undef UINT_FAST64_MAX
4294 +# define UINT_FAST64_MAX UINT64_MAX
4297 +/* 7.18.2.4. Limits of integer types capable of holding object pointers */
4302 +#define INTPTR_MIN LONG_MIN
4303 +#define INTPTR_MAX LONG_MAX
4304 +#define UINTPTR_MAX ULONG_MAX
4306 +/* 7.18.2.5. Limits of greatest-width integer types */
4311 +# define INTMAX_MIN INT64_MIN
4312 +# define INTMAX_MAX INT64_MAX
4314 +# define INTMAX_MIN INT32_MIN
4315 +# define INTMAX_MAX INT32_MAX
4320 +# define UINTMAX_MAX UINT64_MAX
4322 +# define UINTMAX_MAX UINT32_MAX
4325 +/* 7.18.3. Limits of other integer types */
4327 +/* ptrdiff_t limits */
4330 +#define PTRDIFF_MIN \
4331 + _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
4332 +#define PTRDIFF_MAX \
4333 + _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
4335 +/* sig_atomic_t limits */
4336 +#undef SIG_ATOMIC_MIN
4337 +#undef SIG_ATOMIC_MAX
4338 +#define SIG_ATOMIC_MIN \
4339 + _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
4340 + 0@SIG_ATOMIC_T_SUFFIX@)
4341 +#define SIG_ATOMIC_MAX \
4342 + _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
4343 + 0@SIG_ATOMIC_T_SUFFIX@)
4348 +#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
4350 +/* wchar_t limits */
4353 +#define WCHAR_MIN \
4354 + _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
4355 +#define WCHAR_MAX \
4356 + _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
4358 +/* wint_t limits */
4362 + _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
4364 + _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
4366 +#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
4368 +/* 7.18.4. Macros for integer constants */
4370 +#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
4372 +/* 7.18.4.1. Macros for minimum-width integer constants */
4373 +/* According to ISO C 99 Technical Corrigendum 1 */
4375 +/* Here we assume a standard architecture where the hardware integer
4376 + types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
4380 +#define INT8_C(x) x
4381 +#define UINT8_C(x) x
4385 +#define INT16_C(x) x
4386 +#define UINT16_C(x) x
4390 +#define INT32_C(x) x
4391 +#define UINT32_C(x) x ## U
4395 +#if LONG_MAX >> 31 >> 31 == 1
4396 +# define INT64_C(x) x##L
4397 +#elif defined _MSC_VER
4398 +# define INT64_C(x) x##i64
4399 +#elif @HAVE_LONG_LONG_INT@
4400 +# define INT64_C(x) x##LL
4402 +#if ULONG_MAX >> 31 >> 31 >> 1 == 1
4403 +# define UINT64_C(x) x##UL
4404 +#elif defined _MSC_VER
4405 +# define UINT64_C(x) x##ui64
4406 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@
4407 +# define UINT64_C(x) x##ULL
4410 +/* 7.18.4.2. Macros for greatest-width integer constants */
4413 +#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
4414 +# define INTMAX_C(x) x##LL
4415 +#elif defined GL_INT64_T
4416 +# define INTMAX_C(x) INT64_C(x)
4418 +# define INTMAX_C(x) x##L
4422 +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
4423 +# define UINTMAX_C(x) x##ULL
4424 +#elif defined GL_UINT64_T
4425 +# define UINTMAX_C(x) UINT64_C(x)
4427 +# define UINTMAX_C(x) x##UL
4430 +#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
4432 +#endif /* _GL_STDINT_H */
4433 +#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
4434 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/stdio.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/stdio.in.h
4435 --- gtk-vnc-0.3.7.dan3/gnulib/lib/stdio.in.h 1970-01-01 01:00:00.000000000 +0100
4436 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdio.in.h 2008-10-09 15:24:52.000000000 +0100
4438 +/* A GNU-like <stdio.h>.
4440 + Copyright (C) 2004, 2007-2008 Free Software Foundation, Inc.
4442 + This program is free software; you can redistribute it and/or modify
4443 + it under the terms of the GNU Lesser General Public License as published by
4444 + the Free Software Foundation; either version 2.1, or (at your option)
4445 + any later version.
4447 + This program is distributed in the hope that it will be useful,
4448 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4449 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4450 + GNU Lesser General Public License for more details.
4452 + You should have received a copy of the GNU Lesser General Public License
4453 + along with this program; if not, write to the Free Software Foundation,
4454 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
4456 +@PRAGMA_SYSTEM_HEADER@
4458 +#if defined __need_FILE || defined __need___FILE
4459 +/* Special invocation convention inside glibc header files. */
4461 +#@INCLUDE_NEXT@ @NEXT_STDIO_H@
4464 +/* Normal invocation convention. */
4466 +#ifndef _GL_STDIO_H
4468 +/* The include_next requires a split double-inclusion guard. */
4469 +#@INCLUDE_NEXT@ @NEXT_STDIO_H@
4471 +#ifndef _GL_STDIO_H
4472 +#define _GL_STDIO_H
4474 +#include <stdarg.h>
4475 +#include <stddef.h>
4477 +#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
4478 + || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
4479 + || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
4480 + || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@))
4481 +/* Get off_t and ssize_t. */
4482 +# include <sys/types.h>
4485 +#ifndef __attribute__
4486 +/* This feature is available in gcc versions 2.5 and later. */
4487 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
4488 +# define __attribute__(Spec) /* empty */
4490 +/* The __-protected variants of `format' and `printf' attributes
4491 + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
4492 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
4493 +# define __format__ format
4494 +# define __printf__ printf
4499 +/* The definition of GL_LINK_WARNING is copied here. */
4507 +#if @GNULIB_FPRINTF_POSIX@
4508 +# if @REPLACE_FPRINTF@
4509 +# define fprintf rpl_fprintf
4510 +extern int fprintf (FILE *fp, const char *format, ...)
4511 + __attribute__ ((__format__ (__printf__, 2, 3)));
4513 +#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4514 +# define fprintf rpl_fprintf
4515 +extern int fprintf (FILE *fp, const char *format, ...)
4516 + __attribute__ ((__format__ (__printf__, 2, 3)));
4517 +#elif defined GNULIB_POSIXCHECK
4520 + (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
4521 + "use gnulib module fprintf-posix for portable " \
4522 + "POSIX compliance"), \
4526 +#if @GNULIB_VFPRINTF_POSIX@
4527 +# if @REPLACE_VFPRINTF@
4528 +# define vfprintf rpl_vfprintf
4529 +extern int vfprintf (FILE *fp, const char *format, va_list args)
4530 + __attribute__ ((__format__ (__printf__, 2, 0)));
4532 +#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4533 +# define vfprintf rpl_vfprintf
4534 +extern int vfprintf (FILE *fp, const char *format, va_list args)
4535 + __attribute__ ((__format__ (__printf__, 2, 0)));
4536 +#elif defined GNULIB_POSIXCHECK
4538 +# define vfprintf(s,f,a) \
4539 + (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
4540 + "use gnulib module vfprintf-posix for portable " \
4541 + "POSIX compliance"), \
4542 + vfprintf (s, f, a))
4545 +#if @GNULIB_PRINTF_POSIX@
4546 +# if @REPLACE_PRINTF@
4547 +/* Don't break __attribute__((format(printf,M,N))). */
4548 +# define printf __printf__
4549 +extern int printf (const char *format, ...)
4550 + __attribute__ ((__format__ (__printf__, 1, 2)));
4552 +#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4553 +/* Don't break __attribute__((format(printf,M,N))). */
4554 +# define printf __printf__
4555 +extern int printf (const char *format, ...)
4556 + __attribute__ ((__format__ (__printf__, 1, 2)));
4557 +#elif defined GNULIB_POSIXCHECK
4560 + (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
4561 + "use gnulib module printf-posix for portable " \
4562 + "POSIX compliance"), \
4564 +/* Don't break __attribute__((format(printf,M,N))). */
4565 +# define format(kind,m,n) format (__##kind##__, m, n)
4566 +# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
4567 +# define ____printf____ __printf__
4568 +# define ____scanf____ __scanf__
4569 +# define ____strftime____ __strftime__
4570 +# define ____strfmon____ __strfmon__
4573 +#if @GNULIB_VPRINTF_POSIX@
4574 +# if @REPLACE_VPRINTF@
4575 +# define vprintf rpl_vprintf
4576 +extern int vprintf (const char *format, va_list args)
4577 + __attribute__ ((__format__ (__printf__, 1, 0)));
4579 +#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4580 +# define vprintf rpl_vprintf
4581 +extern int vprintf (const char *format, va_list args)
4582 + __attribute__ ((__format__ (__printf__, 1, 0)));
4583 +#elif defined GNULIB_POSIXCHECK
4585 +# define vprintf(f,a) \
4586 + (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
4587 + "use gnulib module vprintf-posix for portable " \
4588 + "POSIX compliance"), \
4592 +#if @GNULIB_SNPRINTF@
4593 +# if @REPLACE_SNPRINTF@
4594 +# define snprintf rpl_snprintf
4596 +# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
4597 +extern int snprintf (char *str, size_t size, const char *format, ...)
4598 + __attribute__ ((__format__ (__printf__, 3, 4)));
4600 +#elif defined GNULIB_POSIXCHECK
4602 +# define snprintf \
4603 + (GL_LINK_WARNING ("snprintf is unportable - " \
4604 + "use gnulib module snprintf for portability"), \
4608 +#if @GNULIB_VSNPRINTF@
4609 +# if @REPLACE_VSNPRINTF@
4610 +# define vsnprintf rpl_vsnprintf
4612 +# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
4613 +extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
4614 + __attribute__ ((__format__ (__printf__, 3, 0)));
4616 +#elif defined GNULIB_POSIXCHECK
4618 +# define vsnprintf(b,s,f,a) \
4619 + (GL_LINK_WARNING ("vsnprintf is unportable - " \
4620 + "use gnulib module vsnprintf for portability"), \
4621 + vsnprintf (b, s, f, a))
4624 +#if @GNULIB_SPRINTF_POSIX@
4625 +# if @REPLACE_SPRINTF@
4626 +# define sprintf rpl_sprintf
4627 +extern int sprintf (char *str, const char *format, ...)
4628 + __attribute__ ((__format__ (__printf__, 2, 3)));
4630 +#elif defined GNULIB_POSIXCHECK
4633 + (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
4634 + "use gnulib module sprintf-posix for portable " \
4635 + "POSIX compliance"), \
4639 +#if @GNULIB_VSPRINTF_POSIX@
4640 +# if @REPLACE_VSPRINTF@
4641 +# define vsprintf rpl_vsprintf
4642 +extern int vsprintf (char *str, const char *format, va_list args)
4643 + __attribute__ ((__format__ (__printf__, 2, 0)));
4645 +#elif defined GNULIB_POSIXCHECK
4647 +# define vsprintf(b,f,a) \
4648 + (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
4649 + "use gnulib module vsprintf-posix for portable " \
4650 + "POSIX compliance"), \
4651 + vsprintf (b, f, a))
4654 +#if @GNULIB_VASPRINTF@
4655 +# if @REPLACE_VASPRINTF@
4656 +# define asprintf rpl_asprintf
4657 +# define vasprintf rpl_vasprintf
4659 +# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
4660 + /* Write formatted output to a string dynamically allocated with malloc().
4661 + If the memory allocation succeeds, store the address of the string in
4662 + *RESULT and return the number of resulting bytes, excluding the trailing
4663 + NUL. Upon memory allocation error, or some other error, return -1. */
4664 + extern int asprintf (char **result, const char *format, ...)
4665 + __attribute__ ((__format__ (__printf__, 2, 3)));
4666 + extern int vasprintf (char **result, const char *format, va_list args)
4667 + __attribute__ ((__format__ (__printf__, 2, 0)));
4671 +#if @GNULIB_OBSTACK_PRINTF@
4672 +# if @REPLACE_OBSTACK_PRINTF@
4673 +# define obstack_printf rpl_osbtack_printf
4674 +# define obstack_vprintf rpl_obstack_vprintf
4676 +# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
4678 + /* Grow an obstack with formatted output. Return the number of
4679 + bytes added to OBS. No trailing nul byte is added, and the
4680 + object should be closed with obstack_finish before use. Upon
4681 + memory allocation error, call obstack_alloc_failed_handler. Upon
4682 + other error, return -1. */
4683 + extern int obstack_printf (struct obstack *obs, const char *format, ...)
4684 + __attribute__ ((__format__ (__printf__, 2, 3)));
4685 + extern int obstack_vprintf (struct obstack *obs, const char *format,
4687 + __attribute__ ((__format__ (__printf__, 2, 0)));
4692 +# if @REPLACE_FOPEN@
4694 +# define fopen rpl_fopen
4695 +extern FILE * fopen (const char *filename, const char *mode);
4697 +#elif defined GNULIB_POSIXCHECK
4699 +# define fopen(f,m) \
4700 + (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
4701 + "use gnulib module fopen for portability"), \
4705 +#if @GNULIB_FREOPEN@
4706 +# if @REPLACE_FREOPEN@
4708 +# define freopen rpl_freopen
4709 +extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
4711 +#elif defined GNULIB_POSIXCHECK
4713 +# define freopen(f,m,s) \
4714 + (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \
4715 + "use gnulib module freopen for portability"), \
4716 + freopen (f, m, s))
4719 +#if @GNULIB_FSEEKO@
4720 +# if @REPLACE_FSEEKO@
4721 +/* Provide fseek, fseeko functions that are aware of a preceding
4722 + fflush(), and which detect pipes. */
4723 +# define fseeko rpl_fseeko
4724 +extern int fseeko (FILE *fp, off_t offset, int whence);
4725 +# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
4727 +#elif defined GNULIB_POSIXCHECK
4729 +# define fseeko(f,o,w) \
4730 + (GL_LINK_WARNING ("fseeko is unportable - " \
4731 + "use gnulib module fseeko for portability"), \
4735 +#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
4736 +extern int rpl_fseek (FILE *fp, long offset, int whence);
4738 +# if defined GNULIB_POSIXCHECK
4739 +# define fseek(f,o,w) \
4740 + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
4741 + "on 32-bit platforms - " \
4742 + "use fseeko function for handling of large files"), \
4743 + rpl_fseek (f, o, w))
4745 +# define fseek rpl_fseek
4747 +#elif defined GNULIB_POSIXCHECK
4749 +# define fseek(f,o,w) \
4750 + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
4751 + "on 32-bit platforms - " \
4752 + "use fseeko function for handling of large files"), \
4757 +#if @GNULIB_FTELLO@
4758 +# if @REPLACE_FTELLO@
4759 +# define ftello rpl_ftello
4760 +extern off_t ftello (FILE *fp);
4761 +# define ftell(fp) ftello (fp)
4763 +#elif defined GNULIB_POSIXCHECK
4765 +# define ftello(f) \
4766 + (GL_LINK_WARNING ("ftello is unportable - " \
4767 + "use gnulib module ftello for portability"), \
4771 +#if @GNULIB_FTELL@ && @REPLACE_FTELL@
4772 +extern long rpl_ftell (FILE *fp);
4774 +# if GNULIB_POSIXCHECK
4775 +# define ftell(f) \
4776 + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
4777 + "on 32-bit platforms - " \
4778 + "use ftello function for handling of large files"), \
4781 +# define ftell rpl_ftell
4783 +#elif defined GNULIB_POSIXCHECK
4785 +# define ftell(f) \
4786 + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
4787 + "on 32-bit platforms - " \
4788 + "use ftello function for handling of large files"), \
4793 +#if @GNULIB_FFLUSH@
4794 +# if @REPLACE_FFLUSH@
4795 +# define fflush rpl_fflush
4796 + /* Flush all pending data on STREAM according to POSIX rules. Both
4797 + output and seekable input streams are supported.
4798 + Note! LOSS OF DATA can occur if fflush is applied on an input stream
4799 + that is _not_seekable_ or on an update stream that is _not_seekable_
4800 + and in which the most recent operation was input. Seekability can
4801 + be tested with lseek(fileno(fp),0,SEEK_CUR). */
4802 + extern int fflush (FILE *gl_stream);
4804 +#elif defined GNULIB_POSIXCHECK
4806 +# define fflush(f) \
4807 + (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
4808 + "use gnulib module fflush for portable " \
4809 + "POSIX compliance"), \
4813 +#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4815 +# define fputc rpl_fputc
4816 +extern int fputc (int c, FILE *stream);
4819 +#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4821 +# define putc rpl_fputc
4822 +extern int putc (int c, FILE *stream);
4825 +#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4827 +# define putchar rpl_putchar
4828 +extern int putchar (int c);
4831 +#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4833 +# define fputs rpl_fputs
4834 +extern int fputs (const char *string, FILE *stream);
4837 +#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4839 +# define puts rpl_puts
4840 +extern int puts (const char *string);
4843 +#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4845 +# define fwrite rpl_fwrite
4846 +extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream);
4849 +#if @GNULIB_GETDELIM@
4850 +# if !@HAVE_DECL_GETDELIM@
4851 +/* Read input, up to (and including) the next occurrence of DELIMITER, from
4852 + STREAM, store it in *LINEPTR (and NUL-terminate it).
4853 + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
4854 + bytes of space. It is realloc'd as necessary.
4855 + Return the number of bytes read and stored at *LINEPTR (not including the
4856 + NUL terminator), or -1 on error or EOF. */
4857 +extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
4860 +#elif defined GNULIB_POSIXCHECK
4862 +# define getdelim(l, s, d, f) \
4863 + (GL_LINK_WARNING ("getdelim is unportable - " \
4864 + "use gnulib module getdelim for portability"), \
4865 + getdelim (l, s, d, f))
4868 +#if @GNULIB_GETLINE@
4869 +# if @REPLACE_GETLINE@
4871 +# define getline rpl_getline
4873 +# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
4874 +/* Read a line, up to (and including) the next newline, from STREAM, store it
4875 + in *LINEPTR (and NUL-terminate it).
4876 + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
4877 + bytes of space. It is realloc'd as necessary.
4878 + Return the number of bytes read and stored at *LINEPTR (not including the
4879 + NUL terminator), or -1 on error or EOF. */
4880 +extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream);
4882 +#elif defined GNULIB_POSIXCHECK
4884 +# define getline(l, s, f) \
4885 + (GL_LINK_WARNING ("getline is unportable - " \
4886 + "use gnulib module getline for portability"), \
4887 + getline (l, s, f))
4890 +#if @GNULIB_PERROR@
4891 +# if @REPLACE_PERROR@
4892 +# define perror rpl_perror
4893 +/* Print a message to standard error, describing the value of ERRNO,
4894 + (if STRING is not NULL and not empty) prefixed with STRING and ": ",
4895 + and terminated with a newline. */
4896 +extern void perror (const char *string);
4898 +#elif defined GNULIB_POSIXCHECK
4900 +# define perror(s) \
4901 + (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
4902 + "use gnulib module perror for portability"), \
4910 +#endif /* _GL_STDIO_H */
4911 +#endif /* _GL_STDIO_H */
4913 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/stdio-write.c gtk-vnc-0.3.7.gnulib/gnulib/lib/stdio-write.c
4914 --- gtk-vnc-0.3.7.dan3/gnulib/lib/stdio-write.c 1970-01-01 01:00:00.000000000 +0100
4915 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdio-write.c 2008-10-09 15:24:52.000000000 +0100
4917 +/* POSIX compatible FILE stream write function.
4918 + Copyright (C) 2008 Free Software Foundation, Inc.
4919 + Written by Bruno Haible <bruno@clisp.org>, 2008.
4921 + This program is free software: you can redistribute it and/or modify
4922 + it under the terms of the GNU Lesser General Public License as published by
4923 + the Free Software Foundation; either version 2.1 of the License, or
4924 + (at your option) any later version.
4926 + This program is distributed in the hope that it will be useful,
4927 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4928 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4929 + GNU Lesser General Public License for more details.
4931 + You should have received a copy of the GNU Lesser General Public License
4932 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
4934 +#include <config.h>
4936 +/* Specification. */
4939 +/* Replace these functions only if module 'sigpipe' is requested. */
4942 +/* On native Windows platforms, SIGPIPE does not exist. When write() is
4943 + called on a pipe with no readers, WriteFile() fails with error
4944 + GetLastError() = ERROR_NO_DATA, and write() in consequence fails with
4945 + error EINVAL. This write() function is at the basis of the function
4946 + which flushes the buffer of a FILE stream. */
4948 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
4950 +# include <errno.h>
4951 +# include <signal.h>
4954 +# define WIN32_LEAN_AND_MEAN /* avoid including junk */
4955 +# include <windows.h>
4957 +# define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \
4958 + if (ferror (stream)) \
4959 + return (EXPRESSION); \
4963 + SetLastError (0); \
4964 + ret = (EXPRESSION); \
4965 + if (FAILED && GetLastError () == ERROR_NO_DATA && ferror (stream)) \
4967 + int fd = fileno (stream); \
4969 + && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)\
4971 + /* Try to raise signal SIGPIPE. */ \
4972 + raise (SIGPIPE); \
4973 + /* If it is currently blocked or ignored, change errno from \
4974 + EINVAL to EPIPE. */ \
4981 +# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
4983 +printf (const char *format, ...)
4988 + va_start (args, format);
4989 + retval = vfprintf (stdout, format, args);
4996 +# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
4998 +fprintf (FILE *stream, const char *format, ...)
5003 + va_start (args, format);
5004 + retval = vfprintf (stream, format, args);
5011 +# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vprintf.c */
5013 +vprintf (const char *format, va_list args)
5015 + return vfprintf (stdout, format, args);
5019 +# if !REPLACE_VPRINTF_POSIX /* avoid collision with vfprintf.c */
5021 +vfprintf (FILE *stream, const char *format, va_list args)
5024 + CALL_WITH_SIGPIPE_EMULATION (int, vfprintf (stream, format, args), ret == EOF)
5031 + return fputc (c, stdout);
5035 +fputc (int c, FILE *stream)
5038 + CALL_WITH_SIGPIPE_EMULATION (int, fputc (c, stream), ret == EOF)
5042 +fputs (const char *string, FILE *stream)
5045 + CALL_WITH_SIGPIPE_EMULATION (int, fputs (string, stream), ret == EOF)
5049 +puts (const char *string)
5052 + FILE *stream = stdout;
5053 + CALL_WITH_SIGPIPE_EMULATION (int, puts (string), ret == EOF)
5057 +fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
5060 + CALL_WITH_SIGPIPE_EMULATION (size_t, fwrite (ptr, s, n, stream), ret < n)
5065 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/stdlib.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/stdlib.in.h
5066 --- gtk-vnc-0.3.7.dan3/gnulib/lib/stdlib.in.h 1970-01-01 01:00:00.000000000 +0100
5067 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdlib.in.h 2008-10-09 15:24:52.000000000 +0100
5069 +/* A GNU-like <stdlib.h>.
5071 + Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc.
5073 + This program is free software: you can redistribute it and/or modify
5074 + it under the terms of the GNU Lesser General Public License as published by
5075 + the Free Software Foundation; either version 2.1 of the License, or
5076 + (at your option) any later version.
5078 + This program is distributed in the hope that it will be useful,
5079 + but WITHOUT ANY WARRANTY; without even the implied warranty of
5080 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5081 + GNU Lesser General Public License for more details.
5083 + You should have received a copy of the GNU Lesser General Public License
5084 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
5086 +@PRAGMA_SYSTEM_HEADER@
5088 +#if defined __need_malloc_and_calloc
5089 +/* Special invocation convention inside glibc header files. */
5091 +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
5094 +/* Normal invocation convention. */
5096 +#ifndef _GL_STDLIB_H
5098 +/* The include_next requires a split double-inclusion guard. */
5099 +#@INCLUDE_NEXT@ @NEXT_STDLIB_H@
5101 +#ifndef _GL_STDLIB_H
5102 +#define _GL_STDLIB_H
5105 +/* The definition of GL_LINK_WARNING is copied here. */
5108 +/* Some systems do not define EXIT_*, despite otherwise supporting C89. */
5109 +#ifndef EXIT_SUCCESS
5110 +# define EXIT_SUCCESS 0
5112 +/* Tandem/NSK and other platforms that define EXIT_FAILURE as -1 interfere
5113 + with proper operation of xargs. */
5114 +#ifndef EXIT_FAILURE
5115 +# define EXIT_FAILURE 1
5116 +#elif EXIT_FAILURE != 1
5117 +# undef EXIT_FAILURE
5118 +# define EXIT_FAILURE 1
5127 +#if @GNULIB_MALLOC_POSIX@
5128 +# if !@HAVE_MALLOC_POSIX@
5130 +# define malloc rpl_malloc
5131 +extern void * malloc (size_t size);
5133 +#elif defined GNULIB_POSIXCHECK
5135 +# define malloc(s) \
5136 + (GL_LINK_WARNING ("malloc is not POSIX compliant everywhere - " \
5137 + "use gnulib module malloc-posix for portability"), \
5142 +#if @GNULIB_REALLOC_POSIX@
5143 +# if !@HAVE_REALLOC_POSIX@
5145 +# define realloc rpl_realloc
5146 +extern void * realloc (void *ptr, size_t size);
5148 +#elif defined GNULIB_POSIXCHECK
5150 +# define realloc(p,s) \
5151 + (GL_LINK_WARNING ("realloc is not POSIX compliant everywhere - " \
5152 + "use gnulib module realloc-posix for portability"), \
5157 +#if @GNULIB_CALLOC_POSIX@
5158 +# if !@HAVE_CALLOC_POSIX@
5160 +# define calloc rpl_calloc
5161 +extern void * calloc (size_t nmemb, size_t size);
5163 +#elif defined GNULIB_POSIXCHECK
5165 +# define calloc(n,s) \
5166 + (GL_LINK_WARNING ("calloc is not POSIX compliant everywhere - " \
5167 + "use gnulib module calloc-posix for portability"), \
5172 +#if @GNULIB_GETSUBOPT@
5173 +/* Assuming *OPTIONP is a comma separated list of elements of the form
5174 + "token" or "token=value", getsubopt parses the first of these elements.
5175 + If the first element refers to a "token" that is member of the given
5176 + NULL-terminated array of tokens:
5177 + - It replaces the comma with a NUL byte, updates *OPTIONP to point past
5178 + the first option and the comma, sets *VALUEP to the value of the
5179 + element (or NULL if it doesn't contain an "=" sign),
5180 + - It returns the index of the "token" in the given array of tokens.
5181 + Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
5182 + For more details see the POSIX:2001 specification.
5183 + http://www.opengroup.org/susv3xsh/getsubopt.html */
5184 +# if !@HAVE_GETSUBOPT@
5185 +extern int getsubopt (char **optionp, char *const *tokens, char **valuep);
5187 +#elif defined GNULIB_POSIXCHECK
5189 +# define getsubopt(o,t,v) \
5190 + (GL_LINK_WARNING ("getsubopt is unportable - " \
5191 + "use gnulib module getsubopt for portability"), \
5192 + getsubopt (o, t, v))
5196 +#if @GNULIB_MKDTEMP@
5197 +# if !@HAVE_MKDTEMP@
5198 +/* Create a unique temporary directory from TEMPLATE.
5199 + The last six characters of TEMPLATE must be "XXXXXX";
5200 + they are replaced with a string that makes the directory name unique.
5201 + Returns TEMPLATE, or a null pointer if it cannot get a unique name.
5202 + The directory is created mode 700. */
5203 +extern char * mkdtemp (char * /*template*/);
5205 +#elif defined GNULIB_POSIXCHECK
5207 +# define mkdtemp(t) \
5208 + (GL_LINK_WARNING ("mkdtemp is unportable - " \
5209 + "use gnulib module mkdtemp for portability"), \
5214 +#if @GNULIB_MKSTEMP@
5215 +# if @REPLACE_MKSTEMP@
5216 +/* Create a unique temporary file from TEMPLATE.
5217 + The last six characters of TEMPLATE must be "XXXXXX";
5218 + they are replaced with a string that makes the file name unique.
5219 + The file is then created, ensuring it didn't exist before.
5220 + The file is created read-write (mask at least 0600 & ~umask), but it may be
5221 + world-readable and world-writable (mask 0666 & ~umask), depending on the
5223 + Returns the open file descriptor if successful, otherwise -1 and errno
5225 +# define mkstemp rpl_mkstemp
5226 +extern int mkstemp (char * /*template*/);
5228 +/* On MacOS X 10.3, only <unistd.h> declares mkstemp. */
5229 +# include <unistd.h>
5231 +#elif defined GNULIB_POSIXCHECK
5233 +# define mkstemp(t) \
5234 + (GL_LINK_WARNING ("mkstemp is unportable - " \
5235 + "use gnulib module mkstemp for portability"), \
5240 +#if @GNULIB_PUTENV@
5241 +# if @REPLACE_PUTENV@
5243 +# define putenv rpl_putenv
5244 +extern int putenv (char *string);
5249 +#if @GNULIB_RPMATCH@
5250 +# if !@HAVE_RPMATCH@
5251 +/* Test a user response to a question.
5252 + Return 1 if it is affirmative, 0 if it is negative, or -1 if not clear. */
5253 +extern int rpmatch (const char *response);
5255 +#elif defined GNULIB_POSIXCHECK
5257 +# define rpmatch(r) \
5258 + (GL_LINK_WARNING ("rpmatch is unportable - " \
5259 + "use gnulib module rpmatch for portability"), \
5264 +#if @GNULIB_SETENV@
5265 +# if !@HAVE_SETENV@
5266 +/* Set NAME to VALUE in the environment.
5267 + If REPLACE is nonzero, overwrite an existing value. */
5268 +extern int setenv (const char *name, const char *value, int replace);
5273 +#if @GNULIB_UNSETENV@
5274 +# if @HAVE_UNSETENV@
5275 +# if @VOID_UNSETENV@
5276 +/* On some systems, unsetenv() returns void.
5277 + This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4. */
5278 +# define unsetenv(name) ((unsetenv)(name), 0)
5281 +/* Remove the variable NAME from the environment. */
5282 +extern int unsetenv (const char *name);
5287 +#if @GNULIB_STRTOD@
5288 +# if @REPLACE_STRTOD@
5289 +# define strtod rpl_strtod
5291 +# if !@HAVE_STRTOD@ || @REPLACE_STRTOD@
5292 + /* Parse a double from STRING, updating ENDP if appropriate. */
5293 +extern double strtod (const char *str, char **endp);
5295 +#elif defined GNULIB_POSIXCHECK
5297 +# define strtod(s, e) \
5298 + (GL_LINK_WARNING ("strtod is unportable - " \
5299 + "use gnulib module strtod for portability"), \
5308 +#endif /* _GL_STDLIB_H */
5309 +#endif /* _GL_STDLIB_H */
5311 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/sys_socket.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/sys_socket.in.h
5312 --- gtk-vnc-0.3.7.dan3/gnulib/lib/sys_socket.in.h 1970-01-01 01:00:00.000000000 +0100
5313 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/sys_socket.in.h 2008-10-09 15:24:52.000000000 +0100
5315 +/* Provide a sys/socket header file for systems lacking it (read: MinGW)
5316 + and for systems where it is incomplete.
5317 + Copyright (C) 2005-2008 Free Software Foundation, Inc.
5318 + Written by Simon Josefsson.
5320 + This program is free software; you can redistribute it and/or modify
5321 + it under the terms of the GNU Lesser General Public License as published by
5322 + the Free Software Foundation; either version 2.1, or (at your option)
5323 + any later version.
5325 + This program is distributed in the hope that it will be useful,
5326 + but WITHOUT ANY WARRANTY; without even the implied warranty of
5327 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5328 + GNU Lesser General Public License for more details.
5330 + You should have received a copy of the GNU Lesser General Public License
5331 + along with this program; if not, write to the Free Software Foundation,
5332 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
5334 +/* This file is supposed to be used on platforms that lack <sys/socket.h>,
5335 + on platforms where <sys/socket.h> cannot be included standalone, and on
5336 + platforms where <sys/socket.h> does not provide all necessary definitions.
5337 + It is intended to provide definitions and prototypes needed by an
5340 +#ifndef _GL_SYS_SOCKET_H
5342 +#if @HAVE_SYS_SOCKET_H@
5344 +@PRAGMA_SYSTEM_HEADER@
5346 +/* On many platforms, <sys/socket.h> assumes prior inclusion of
5348 +# include <sys/types.h>
5350 +/* The include_next requires a split double-inclusion guard. */
5351 +# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
5355 +#ifndef _GL_SYS_SOCKET_H
5356 +#define _GL_SYS_SOCKET_H
5358 +#if @HAVE_SYS_SOCKET_H@
5360 +/* A platform that has <sys/socket.h>. */
5362 +/* For shutdown(). */
5363 +# if !defined SHUT_RD
5366 +# if !defined SHUT_WR
5369 +# if !defined SHUT_RDWR
5370 +# define SHUT_RDWR 2
5376 +# error "Cygwin does have a sys/socket.h, doesn't it?!?"
5379 +/* A platform that lacks <sys/socket.h>.
5381 + Currently only MinGW is supported. See the gnulib manual regarding
5382 + Windows sockets. MinGW has the header files winsock2.h and
5383 + ws2tcpip.h that declare the sys/socket.h definitions we need. Note
5384 + that you can influence which definitions you get by setting the
5385 + WINVER symbol before including these two files. For example,
5386 + getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
5387 + symbol is set indiriectly through WINVER). You can set this by
5388 + adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
5389 + code may not run on older Windows releases then. My Windows 2000
5390 + box was not able to run the code, for example. The situation is
5391 + slightly confusing because:
5392 + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp
5393 + suggests that getaddrinfo should be available on all Windows
5397 +# if @HAVE_WINSOCK2_H@
5398 +# include <winsock2.h>
5400 +# if @HAVE_WS2TCPIP_H@
5401 +# include <ws2tcpip.h>
5404 +/* For shutdown(). */
5405 +# if !defined SHUT_RD && defined SD_RECEIVE
5406 +# define SHUT_RD SD_RECEIVE
5408 +# if !defined SHUT_WR && defined SD_SEND
5409 +# define SHUT_WR SD_SEND
5411 +# if !defined SHUT_RDWR && defined SD_BOTH
5412 +# define SHUT_RDWR SD_BOTH
5415 +/* The definition of GL_LINK_WARNING is copied here. */
5417 +# if @HAVE_WINSOCK2_H@
5418 +/* Include headers needed by the emulation code. */
5419 +# include <sys/types.h>
5422 +typedef int socklen_t;
5426 +# ifdef __cplusplus
5430 +# if @HAVE_WINSOCK2_H@
5432 +/* Re-define FD_ISSET to avoid a WSA call while we are not using
5433 + network sockets. */
5435 +rpl_fd_isset (int fd, fd_set * set)
5441 + for (i = 0; i < set->fd_count; i++)
5442 + if (set->fd_array[i] == fd)
5449 +# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
5453 +/* Wrap everything else to use libc file descriptors for sockets. */
5455 +# if @HAVE_WINSOCK2_H@
5457 +# define close rpl_close
5458 +extern int rpl_close(int);
5461 +# if @GNULIB_SOCKET@
5462 +# if @HAVE_WINSOCK2_H@
5464 +# define socket rpl_socket
5465 +extern int rpl_socket (int, int, int protocol);
5467 +# elif @HAVE_WINSOCK2_H@
5469 +# define socket socket_used_without_requesting_gnulib_module_socket
5470 +# elif defined GNULIB_POSIXCHECK
5472 +# define socket(d,t,p) \
5473 + (GL_LINK_WARNING ("socket is not always POSIX compliant - " \
5474 + "use gnulib module socket for portability"), \
5478 +# if @GNULIB_CONNECT@
5479 +# if @HAVE_WINSOCK2_H@
5481 +# define connect rpl_connect
5482 +extern int rpl_connect (int, struct sockaddr *, int);
5484 +# elif @HAVE_WINSOCK2_H@
5486 +# define connect socket_used_without_requesting_gnulib_module_connect
5487 +# elif defined GNULIB_POSIXCHECK
5489 +# define connect(s,a,l) \
5490 + (GL_LINK_WARNING ("connect is not always POSIX compliant - " \
5491 + "use gnulib module connect for portability"), \
5492 + connect (s, a, l))
5495 +# if @GNULIB_ACCEPT@
5496 +# if @HAVE_WINSOCK2_H@
5498 +# define accept rpl_accept
5499 +extern int rpl_accept (int, struct sockaddr *, int *);
5501 +# elif @HAVE_WINSOCK2_H@
5503 +# define accept accept_used_without_requesting_gnulib_module_accept
5504 +# elif defined GNULIB_POSIXCHECK
5506 +# define accept(s,a,l) \
5507 + (GL_LINK_WARNING ("accept is not always POSIX compliant - " \
5508 + "use gnulib module accept for portability"), \
5513 +# if @HAVE_WINSOCK2_H@
5515 +# define bind rpl_bind
5516 +extern int rpl_bind (int, struct sockaddr *, int);
5518 +# elif @HAVE_WINSOCK2_H@
5520 +# define bind bind_used_without_requesting_gnulib_module_bind
5521 +# elif defined GNULIB_POSIXCHECK
5523 +# define bind(s,a,l) \
5524 + (GL_LINK_WARNING ("bind is not always POSIX compliant - " \
5525 + "use gnulib module bind for portability"), \
5529 +# if @GNULIB_GETPEERNAME@
5530 +# if @HAVE_WINSOCK2_H@
5531 +# undef getpeername
5532 +# define getpeername rpl_getpeername
5533 +extern int rpl_getpeername (int, struct sockaddr *, int *);
5535 +# elif @HAVE_WINSOCK2_H@
5536 +# undef getpeername
5537 +# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
5538 +# elif defined GNULIB_POSIXCHECK
5539 +# undef getpeername
5540 +# define getpeername(s,a,l) \
5541 + (GL_LINK_WARNING ("getpeername is not always POSIX compliant - " \
5542 + "use gnulib module getpeername for portability"), \
5543 + getpeername (s, a, l))
5546 +# if @GNULIB_GETSOCKNAME@
5547 +# if @HAVE_WINSOCK2_H@
5548 +# undef getsockname
5549 +# define getsockname rpl_getsockname
5550 +extern int rpl_getsockname (int, struct sockaddr *, int *);
5552 +# elif @HAVE_WINSOCK2_H@
5553 +# undef getsockname
5554 +# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
5555 +# elif defined GNULIB_POSIXCHECK
5556 +# undef getsockname
5557 +# define getsockname(s,a,l) \
5558 + (GL_LINK_WARNING ("getsockname is not always POSIX compliant - " \
5559 + "use gnulib module getsockname for portability"), \
5560 + getsockname (s, a, l))
5563 +# if @GNULIB_GETSOCKOPT@
5564 +# if @HAVE_WINSOCK2_H@
5566 +# define getsockopt rpl_getsockopt
5567 +extern int rpl_getsockopt (int, int, int, void *, int *);
5569 +# elif @HAVE_WINSOCK2_H@
5571 +# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
5572 +# elif defined GNULIB_POSIXCHECK
5574 +# define getsockopt(s,lvl,o,v,l) \
5575 + (GL_LINK_WARNING ("getsockopt is not always POSIX compliant - " \
5576 + "use gnulib module getsockopt for portability"), \
5577 + getsockopt (s, lvl, o, v, l))
5580 +# if @GNULIB_LISTEN@
5581 +# if @HAVE_WINSOCK2_H@
5583 +# define listen rpl_listen
5584 +extern int rpl_listen (int, int);
5586 +# elif @HAVE_WINSOCK2_H@
5588 +# define listen listen_used_without_requesting_gnulib_module_listen
5589 +# elif defined GNULIB_POSIXCHECK
5591 +# define listen(s,b) \
5592 + (GL_LINK_WARNING ("listen is not always POSIX compliant - " \
5593 + "use gnulib module listen for portability"), \
5597 +# if @HAVE_WINSOCK2_H@
5599 +# define ioctl rpl_ioctl
5600 +extern int rpl_ioctl (int, unsigned long, char *);
5604 +# if @HAVE_WINSOCK2_H@
5606 +# define recv rpl_recv
5607 +extern int rpl_recv (int, void *, int, int);
5609 +# elif @HAVE_WINSOCK2_H@
5611 +# define recv recv_used_without_requesting_gnulib_module_recv
5612 +# elif defined GNULIB_POSIXCHECK
5614 +# define recv(s,b,n,f) \
5615 + (GL_LINK_WARNING ("recv is not always POSIX compliant - " \
5616 + "use gnulib module recv for portability"), \
5617 + recv (s, b, n, f))
5621 +# if @HAVE_WINSOCK2_H@
5623 +# define send rpl_send
5624 +extern int rpl_send (int, const void *, int, int);
5626 +# elif @HAVE_WINSOCK2_H@
5628 +# define send send_used_without_requesting_gnulib_module_send
5629 +# elif defined GNULIB_POSIXCHECK
5631 +# define send(s,b,n,f) \
5632 + (GL_LINK_WARNING ("send is not always POSIX compliant - " \
5633 + "use gnulib module send for portability"), \
5634 + send (s, b, n, f))
5637 +# if @GNULIB_RECVFROM@
5638 +# if @HAVE_WINSOCK2_H@
5640 +# define recvfrom rpl_recvfrom
5641 +extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *);
5643 +# elif @HAVE_WINSOCK2_H@
5645 +# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
5646 +# elif defined GNULIB_POSIXCHECK
5648 +# define recvfrom(s,b,n,f,a,l) \
5649 + (GL_LINK_WARNING ("recvfrom is not always POSIX compliant - " \
5650 + "use gnulib module recvfrom for portability"), \
5651 + recvfrom (s, b, n, f, a, l))
5654 +# if @GNULIB_SENDTO@
5655 +# if @HAVE_WINSOCK2_H@
5657 +# define sendto rpl_sendto
5658 +extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int);
5660 +# elif @HAVE_WINSOCK2_H@
5662 +# define sendto sendto_used_without_requesting_gnulib_module_sendto
5663 +# elif defined GNULIB_POSIXCHECK
5665 +# define sendto(s,b,n,f,a,l) \
5666 + (GL_LINK_WARNING ("sendto is not always POSIX compliant - " \
5667 + "use gnulib module sendto for portability"), \
5668 + sendto (s, b, n, f, a, l))
5671 +# if @GNULIB_SETSOCKOPT@
5672 +# if @HAVE_WINSOCK2_H@
5674 +# define setsockopt rpl_setsockopt
5675 +extern int rpl_setsockopt (int, int, int, const void *, int);
5677 +# elif @HAVE_WINSOCK2_H@
5679 +# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
5680 +# elif defined GNULIB_POSIXCHECK
5682 +# define setsockopt(s,lvl,o,v,l) \
5683 + (GL_LINK_WARNING ("setsockopt is not always POSIX compliant - " \
5684 + "use gnulib module setsockopt for portability"), \
5685 + setsockopt (s, lvl, o, v, l))
5688 +# if @HAVE_WINSOCK2_H@
5690 +# define select select_used_without_including_sys_select_h
5693 +# ifdef __cplusplus
5697 +#endif /* HAVE_SYS_SOCKET_H */
5699 +#endif /* _GL_SYS_SOCKET_H */
5700 +#endif /* _GL_SYS_SOCKET_H */
5701 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/unistd.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/unistd.in.h
5702 --- gtk-vnc-0.3.7.dan3/gnulib/lib/unistd.in.h 1970-01-01 01:00:00.000000000 +0100
5703 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/unistd.in.h 2008-10-09 15:24:52.000000000 +0100
5705 +/* Substitute for and wrapper around <unistd.h>.
5706 + Copyright (C) 2004-2008 Free Software Foundation, Inc.
5708 + This program is free software; you can redistribute it and/or modify
5709 + it under the terms of the GNU Lesser General Public License as published by
5710 + the Free Software Foundation; either version 2.1, or (at your option)
5711 + any later version.
5713 + This program is distributed in the hope that it will be useful,
5714 + but WITHOUT ANY WARRANTY; without even the implied warranty of
5715 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5716 + GNU Lesser General Public License for more details.
5718 + You should have received a copy of the GNU Lesser General Public License
5719 + along with this program; if not, write to the Free Software Foundation,
5720 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
5722 +#ifndef _GL_UNISTD_H
5724 +@PRAGMA_SYSTEM_HEADER@
5726 +/* The include_next requires a split double-inclusion guard. */
5727 +#if @HAVE_UNISTD_H@
5728 +# @INCLUDE_NEXT@ @NEXT_UNISTD_H@
5731 +#ifndef _GL_UNISTD_H
5732 +#define _GL_UNISTD_H
5734 +/* mingw doesn't define the SEEK_* macros in <unistd.h>. */
5735 +#if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET)
5736 +# include <stdio.h>
5739 +/* mingw fails to declare _exit in <unistd.h>. */
5740 +#include <stdlib.h>
5742 +#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
5744 +# include <sys/types.h>
5747 +/* The definition of GL_LINK_WARNING is copied here. */
5750 +/* Declare overridden functions. */
5758 +# if @REPLACE_CHOWN@
5759 +# ifndef REPLACE_CHOWN
5760 +# define REPLACE_CHOWN 1
5763 +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
5764 + to GID (if GID is not -1). Follow symbolic links.
5765 + Return 0 if successful, otherwise -1 and errno set.
5766 + See the POSIX:2001 specification
5767 + <http://www.opengroup.org/susv3xsh/chown.html>. */
5768 +# define chown rpl_chown
5769 +extern int chown (const char *file, uid_t uid, gid_t gid);
5772 +#elif defined GNULIB_POSIXCHECK
5774 +# define chown(f,u,g) \
5775 + (GL_LINK_WARNING ("chown fails to follow symlinks on some systems and " \
5776 + "doesn't treat a uid or gid of -1 on some systems - " \
5777 + "use gnulib module chown for portability"), \
5784 +/* Copy the file descriptor OLDFD into file descriptor NEWFD. Do nothing if
5785 + NEWFD = OLDFD, otherwise close NEWFD first if it is open.
5786 + Return 0 if successful, otherwise -1 and errno set.
5787 + See the POSIX:2001 specification
5788 + <http://www.opengroup.org/susv3xsh/dup2.html>. */
5789 +extern int dup2 (int oldfd, int newfd);
5791 +#elif defined GNULIB_POSIXCHECK
5793 +# define dup2(o,n) \
5794 + (GL_LINK_WARNING ("dup2 is unportable - " \
5795 + "use gnulib module dup2 for portability"), \
5800 +#if @GNULIB_ENVIRON@
5801 +# if !@HAVE_DECL_ENVIRON@
5802 +/* Set of environment variables and values. An array of strings of the form
5803 + "VARIABLE=VALUE", terminated with a NULL. */
5804 +# if defined __APPLE__ && defined __MACH__
5805 +# include <crt_externs.h>
5806 +# define environ (*_NSGetEnviron ())
5808 +extern char **environ;
5811 +#elif defined GNULIB_POSIXCHECK
5814 + (GL_LINK_WARNING ("environ is unportable - " \
5815 + "use gnulib module environ for portability"), \
5820 +#if @GNULIB_FCHDIR@
5821 +# if @REPLACE_FCHDIR@
5823 +/* Change the process' current working directory to the directory on which
5824 + the given file descriptor is open.
5825 + Return 0 if successful, otherwise -1 and errno set.
5826 + See the POSIX:2001 specification
5827 + <http://www.opengroup.org/susv3xsh/fchdir.html>. */
5828 +extern int fchdir (int /*fd*/);
5830 +# define close rpl_close
5831 +extern int close (int);
5832 +# define dup rpl_dup
5833 +extern int dup (int);
5834 +# define dup2 rpl_dup2
5835 +extern int dup2 (int, int);
5838 +#elif defined GNULIB_POSIXCHECK
5840 +# define fchdir(f) \
5841 + (GL_LINK_WARNING ("fchdir is unportable - " \
5842 + "use gnulib module fchdir for portability"), \
5848 +/* Synchronize changes to a file.
5849 + Return 0 if successful, otherwise -1 and errno set.
5850 + See POSIX:2001 specification
5851 + <http://www.opengroup.org/susv3xsh/fsync.html>. */
5853 +extern int fsync (int fd);
5855 +#elif defined GNULIB_POSIXCHECK
5857 +# define fsync(fd) \
5858 + (GL_LINK_WARNING ("fsync is unportable - " \
5859 + "use gnulib module fsync for portability"), \
5864 +#if @GNULIB_FTRUNCATE@
5865 +# if !@HAVE_FTRUNCATE@
5866 +/* Change the size of the file to which FD is opened to become equal to LENGTH.
5867 + Return 0 if successful, otherwise -1 and errno set.
5868 + See the POSIX:2001 specification
5869 + <http://www.opengroup.org/susv3xsh/ftruncate.html>. */
5870 +extern int ftruncate (int fd, off_t length);
5872 +#elif defined GNULIB_POSIXCHECK
5874 +# define ftruncate(f,l) \
5875 + (GL_LINK_WARNING ("ftruncate is unportable - " \
5876 + "use gnulib module ftruncate for portability"), \
5881 +#if @GNULIB_GETCWD@
5882 +/* Include the headers that might declare getcwd so that they will not
5883 + cause confusion if included after this file. */
5884 +# include <stdlib.h>
5885 +# if @REPLACE_GETCWD@
5886 +/* Get the name of the current working directory, and put it in SIZE bytes
5888 + Return BUF if successful, or NULL if the directory couldn't be determined
5889 + or SIZE was too small.
5890 + See the POSIX:2001 specification
5891 + <http://www.opengroup.org/susv3xsh/getcwd.html>.
5892 + Additionally, the gnulib module 'getcwd' guarantees the following GNU
5893 + extension: If BUF is NULL, an array is allocated with 'malloc'; the array
5894 + is SIZE bytes long, unless SIZE == 0, in which case it is as big as
5896 +# define getcwd rpl_getcwd
5897 +extern char * getcwd (char *buf, size_t size);
5899 +#elif defined GNULIB_POSIXCHECK
5901 +# define getcwd(b,s) \
5902 + (GL_LINK_WARNING ("getcwd is unportable - " \
5903 + "use gnulib module getcwd for portability"), \
5908 +#if @GNULIB_GETDTABLESIZE@
5909 +# if !@HAVE_GETDTABLESIZE@
5910 +/* Return the maximum number of file descriptors in the current process. */
5911 +extern int getdtablesize (void);
5913 +#elif defined GNULIB_POSIXCHECK
5914 +# undef getdtablesize
5915 +# define getdtablesize() \
5916 + (GL_LINK_WARNING ("getdtablesize is unportable - " \
5917 + "use gnulib module getdtablesize for portability"), \
5922 +#if @GNULIB_GETLOGIN_R@
5923 +/* Copies the user's login name to NAME.
5924 + The array pointed to by NAME has room for SIZE bytes.
5926 + Returns 0 if successful. Upon error, an error number is returned, or -1 in
5927 + the case that the login name cannot be found but no specific error is
5928 + provided (this case is hopefully rare but is left open by the POSIX spec).
5930 + See <http://www.opengroup.org/susv3xsh/getlogin.html>.
5932 +# if !@HAVE_DECL_GETLOGIN_R@
5933 +# include <stddef.h>
5934 +extern int getlogin_r (char *name, size_t size);
5936 +#elif defined GNULIB_POSIXCHECK
5938 +# define getlogin_r(n,s) \
5939 + (GL_LINK_WARNING ("getlogin_r is unportable - " \
5940 + "use gnulib module getlogin_r for portability"), \
5941 + getlogin_r (n, s))
5945 +#if @GNULIB_GETPAGESIZE@
5946 +# if @REPLACE_GETPAGESIZE@
5947 +# define getpagesize rpl_getpagesize
5948 +extern int getpagesize (void);
5949 +# elif !@HAVE_GETPAGESIZE@
5950 +/* This is for POSIX systems. */
5951 +# if !defined getpagesize && defined _SC_PAGESIZE
5952 +# if ! (defined __VMS && __VMS_VER < 70000000)
5953 +# define getpagesize() sysconf (_SC_PAGESIZE)
5956 +/* This is for older VMS. */
5957 +# if !defined getpagesize && defined __VMS
5959 +# define getpagesize() 8192
5961 +# define getpagesize() 512
5964 +/* This is for BeOS. */
5965 +# if !defined getpagesize && @HAVE_OS_H@
5967 +# if defined B_PAGE_SIZE
5968 +# define getpagesize() B_PAGE_SIZE
5971 +/* This is for AmigaOS4.0. */
5972 +# if !defined getpagesize && defined __amigaos4__
5973 +# define getpagesize() 2048
5975 +/* This is for older Unix systems. */
5976 +# if !defined getpagesize && @HAVE_SYS_PARAM_H@
5977 +# include <sys/param.h>
5978 +# ifdef EXEC_PAGESIZE
5979 +# define getpagesize() EXEC_PAGESIZE
5985 +# define getpagesize() (NBPG * CLSIZE)
5988 +# define getpagesize() NBPC
5994 +#elif defined GNULIB_POSIXCHECK
5995 +# undef getpagesize
5996 +# define getpagesize() \
5997 + (GL_LINK_WARNING ("getpagesize is unportable - " \
5998 + "use gnulib module getpagesize for portability"), \
6003 +#if @GNULIB_LCHOWN@
6004 +# if @REPLACE_LCHOWN@
6005 +/* Change the owner of FILE to UID (if UID is not -1) and the group of FILE
6006 + to GID (if GID is not -1). Do not follow symbolic links.
6007 + Return 0 if successful, otherwise -1 and errno set.
6008 + See the POSIX:2001 specification
6009 + <http://www.opengroup.org/susv3xsh/lchown.html>. */
6010 +# define lchown rpl_lchown
6011 +extern int lchown (char const *file, uid_t owner, gid_t group);
6013 +#elif defined GNULIB_POSIXCHECK
6015 +# define lchown(f,u,g) \
6016 + (GL_LINK_WARNING ("lchown is unportable to pre-POSIX.1-2001 " \
6017 + "systems - use gnulib module lchown for portability"), \
6023 +# if @REPLACE_LSEEK@
6024 +/* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
6025 + Return the new offset if successful, otherwise -1 and errno set.
6026 + See the POSIX:2001 specification
6027 + <http://www.opengroup.org/susv3xsh/lseek.html>. */
6028 +# define lseek rpl_lseek
6029 + extern off_t lseek (int fd, off_t offset, int whence);
6031 +#elif defined GNULIB_POSIXCHECK
6033 +# define lseek(f,o,w) \
6034 + (GL_LINK_WARNING ("lseek does not fail with ESPIPE on pipes on some " \
6035 + "systems - use gnulib module lseek for portability"), \
6040 +#if @GNULIB_READLINK@
6041 +/* Read the contents of the symbolic link FILE and place the first BUFSIZE
6042 + bytes of it into BUF. Return the number of bytes placed into BUF if
6043 + successful, otherwise -1 and errno set.
6044 + See the POSIX:2001 specification
6045 + <http://www.opengroup.org/susv3xsh/readlink.html>. */
6046 +# if !@HAVE_READLINK@
6047 +# include <stddef.h>
6048 +extern int readlink (const char *file, char *buf, size_t bufsize);
6050 +#elif defined GNULIB_POSIXCHECK
6052 +# define readlink(f,b,s) \
6053 + (GL_LINK_WARNING ("readlink is unportable - " \
6054 + "use gnulib module readlink for portability"), \
6055 + readlink (f, b, s))
6060 +/* Pause the execution of the current thread for N seconds.
6061 + Returns the number of seconds left to sleep.
6062 + See the POSIX:2001 specification
6063 + <http://www.opengroup.org/susv3xsh/sleep.html>. */
6065 +extern unsigned int sleep (unsigned int n);
6067 +#elif defined GNULIB_POSIXCHECK
6069 +# define sleep(n) \
6070 + (GL_LINK_WARNING ("sleep is unportable - " \
6071 + "use gnulib module sleep for portability"), \
6076 +#if @GNULIB_WRITE@ && @REPLACE_WRITE@ && @GNULIB_UNISTD_H_SIGPIPE@
6077 +/* Write up to COUNT bytes starting at BUF to file descriptor FD.
6078 + See the POSIX:2001 specification
6079 + <http://www.opengroup.org/susv3xsh/write.html>. */
6081 +# define write rpl_write
6082 +extern ssize_t write (int fd, const void *buf, size_t count);
6091 +#endif /* _GL_UNISTD_H */
6092 +#endif /* _GL_UNISTD_H */
6093 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/vasnprintf.c gtk-vnc-0.3.7.gnulib/gnulib/lib/vasnprintf.c
6094 --- gtk-vnc-0.3.7.dan3/gnulib/lib/vasnprintf.c 1970-01-01 01:00:00.000000000 +0100
6095 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/vasnprintf.c 2008-10-09 15:24:52.000000000 +0100
6097 +/* vsprintf with automatic memory allocation.
6098 + Copyright (C) 1999, 2002-2008 Free Software Foundation, Inc.
6100 + This program is free software; you can redistribute it and/or modify
6101 + it under the terms of the GNU Lesser General Public License as published by
6102 + the Free Software Foundation; either version 2.1, or (at your option)
6103 + any later version.
6105 + This program is distributed in the hope that it will be useful,
6106 + but WITHOUT ANY WARRANTY; without even the implied warranty of
6107 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6108 + GNU Lesser General Public License for more details.
6110 + You should have received a copy of the GNU Lesser General Public License along
6111 + with this program; if not, write to the Free Software Foundation,
6112 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
6114 +/* This file can be parametrized with the following macros:
6115 + VASNPRINTF The name of the function being defined.
6116 + FCHAR_T The element type of the format string.
6117 + DCHAR_T The element type of the destination (result) string.
6118 + FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
6119 + in the format string are ASCII. MUST be set if
6120 + FCHAR_T and DCHAR_T are not the same type.
6121 + DIRECTIVE Structure denoting a format directive.
6122 + Depends on FCHAR_T.
6123 + DIRECTIVES Structure denoting the set of format directives of a
6124 + format string. Depends on FCHAR_T.
6125 + PRINTF_PARSE Function that parses a format string.
6126 + Depends on FCHAR_T.
6127 + DCHAR_CPY memcpy like function for DCHAR_T[] arrays.
6128 + DCHAR_SET memset like function for DCHAR_T[] arrays.
6129 + DCHAR_MBSNLEN mbsnlen like function for DCHAR_T[] arrays.
6130 + SNPRINTF The system's snprintf (or similar) function.
6131 + This may be either snprintf or swprintf.
6132 + TCHAR_T The element type of the argument and result string
6133 + of the said SNPRINTF function. This may be either
6134 + char or wchar_t. The code exploits that
6135 + sizeof (TCHAR_T) | sizeof (DCHAR_T) and
6136 + alignof (TCHAR_T) <= alignof (DCHAR_T).
6137 + DCHAR_IS_TCHAR Set to 1 if DCHAR_T and TCHAR_T are the same type.
6138 + DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[].
6139 + DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t.
6140 + DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t.
6141 + DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t. */
6143 +/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
6144 + This must come before <config.h> because <config.h> may include
6145 + <features.h>, and once <features.h> has been included, it's too late. */
6146 +#ifndef _GNU_SOURCE
6147 +# define _GNU_SOURCE 1
6151 +# include <config.h>
6154 +# include <alloca.h>
6157 +/* Specification. */
6159 +# if WIDE_CHAR_VERSION
6160 +# include "vasnwprintf.h"
6162 +# include "vasnprintf.h"
6166 +#include <locale.h> /* localeconv() */
6167 +#include <stdio.h> /* snprintf(), sprintf() */
6168 +#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
6169 +#include <string.h> /* memcpy(), strlen() */
6170 +#include <errno.h> /* errno */
6171 +#include <limits.h> /* CHAR_BIT */
6172 +#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
6173 +#if HAVE_NL_LANGINFO
6174 +# include <langinfo.h>
6177 +# if WIDE_CHAR_VERSION
6178 +# include "wprintf-parse.h"
6180 +# include "printf-parse.h"
6184 +/* Checked size_t computations. */
6187 +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
6189 +# include "float+.h"
6192 +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
6194 +# include "isnand-nolibm.h"
6197 +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
6199 +# include "isnanl-nolibm.h"
6200 +# include "fpucw.h"
6203 +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
6205 +# include "isnand-nolibm.h"
6206 +# include "printf-frexp.h"
6209 +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
6211 +# include "isnanl-nolibm.h"
6212 +# include "printf-frexpl.h"
6213 +# include "fpucw.h"
6218 +# define local_wcslen wcslen
6220 + /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
6221 + a dependency towards this library, here is a local substitute.
6222 + Define this substitute only once, even if this file is included
6223 + twice in the same compilation unit. */
6224 +# ifndef local_wcslen_defined
6225 +# define local_wcslen_defined 1
6227 +local_wcslen (const wchar_t *s)
6229 + const wchar_t *ptr;
6231 + for (ptr = s; *ptr != (wchar_t) 0; ptr++)
6239 +/* Default parameters. */
6241 +# if WIDE_CHAR_VERSION
6242 +# define VASNPRINTF vasnwprintf
6243 +# define FCHAR_T wchar_t
6244 +# define DCHAR_T wchar_t
6245 +# define TCHAR_T wchar_t
6246 +# define DCHAR_IS_TCHAR 1
6247 +# define DIRECTIVE wchar_t_directive
6248 +# define DIRECTIVES wchar_t_directives
6249 +# define PRINTF_PARSE wprintf_parse
6250 +# define DCHAR_CPY wmemcpy
6252 +# define VASNPRINTF vasnprintf
6253 +# define FCHAR_T char
6254 +# define DCHAR_T char
6255 +# define TCHAR_T char
6256 +# define DCHAR_IS_TCHAR 1
6257 +# define DIRECTIVE char_directive
6258 +# define DIRECTIVES char_directives
6259 +# define PRINTF_PARSE printf_parse
6260 +# define DCHAR_CPY memcpy
6263 +#if WIDE_CHAR_VERSION
6264 + /* TCHAR_T is wchar_t. */
6265 +# define USE_SNPRINTF 1
6266 +# if HAVE_DECL__SNWPRINTF
6267 + /* On Windows, the function swprintf() has a different signature than
6268 + on Unix; we use the _snwprintf() function instead. */
6269 +# define SNPRINTF _snwprintf
6272 +# define SNPRINTF swprintf
6275 + /* TCHAR_T is char. */
6276 + /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
6277 + But don't use it on BeOS, since BeOS snprintf produces no output if the
6278 + size argument is >= 0x3000000.
6279 + Also don't use it on Linux libc5, since there snprintf with size = 1
6280 + writes any output without bounds, like sprintf. */
6281 +# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1)
6282 +# define USE_SNPRINTF 1
6284 +# define USE_SNPRINTF 0
6286 +# if HAVE_DECL__SNPRINTF
6288 +# define SNPRINTF _snprintf
6291 +# define SNPRINTF snprintf
6292 + /* Here we need to call the native snprintf, not rpl_snprintf. */
6296 +/* Here we need to call the native sprintf, not rpl_sprintf. */
6299 +/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
6300 + warnings in this file. Use -Dlint to suppress them. */
6302 +# define IF_LINT(Code) Code
6304 +# define IF_LINT(Code) /* empty */
6307 +/* Avoid some warnings from "gcc -Wshadow".
6308 + This file doesn't use the exp() and remainder() functions. */
6312 +#define remainder rem
6314 +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
6315 +/* Determine the decimal-point character according to the current locale. */
6316 +# ifndef decimal_point_char_defined
6317 +# define decimal_point_char_defined 1
6319 +decimal_point_char ()
6321 + const char *point;
6322 + /* Determine it in a multithread-safe way. We know nl_langinfo is
6323 + multithread-safe on glibc systems, but is not required to be multithread-
6324 + safe by POSIX. sprintf(), however, is multithread-safe. localeconv()
6325 + is rarely multithread-safe. */
6326 +# if HAVE_NL_LANGINFO && __GLIBC__
6327 + point = nl_langinfo (RADIXCHAR);
6330 + sprintf (pointbuf, "%#.0f", 1.0);
6331 + point = &pointbuf[1];
6333 + point = localeconv () -> decimal_point;
6335 + /* The decimal point is always a single byte: either '.' or ','. */
6336 + return (point[0] != '\0' ? point[0] : '.');
6341 +#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL
6343 +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
6345 +is_infinite_or_zero (double x)
6347 + return isnand (x) || x + x == x;
6352 +#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
6354 +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
6356 +is_infinite_or_zerol (long double x)
6358 + return isnanl (x) || x + x == x;
6363 +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
6365 +/* Converting 'long double' to decimal without rare rounding bugs requires
6366 + real bignums. We use the naming conventions of GNU gmp, but vastly simpler
6367 + (and slower) algorithms. */
6369 +typedef unsigned int mp_limb_t;
6370 +# define GMP_LIMB_BITS 32
6371 +typedef int mp_limb_verify[2 * (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS) - 1];
6373 +typedef unsigned long long mp_twolimb_t;
6374 +# define GMP_TWOLIMB_BITS 64
6375 +typedef int mp_twolimb_verify[2 * (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS) - 1];
6377 +/* Representation of a bignum >= 0. */
6381 + mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc(). */
6384 +/* Compute the product of two bignums >= 0.
6385 + Return the allocated memory in case of success, NULL in case of memory
6386 + allocation failure. */
6388 +multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
6390 + const mp_limb_t *p1;
6391 + const mp_limb_t *p2;
6395 + if (src1.nlimbs <= src2.nlimbs)
6397 + len1 = src1.nlimbs;
6399 + len2 = src2.nlimbs;
6404 + len1 = src2.nlimbs;
6406 + len2 = src1.nlimbs;
6409 + /* Now 0 <= len1 <= len2. */
6412 + /* src1 or src2 is zero. */
6414 + dest->limbs = (mp_limb_t *) malloc (1);
6418 + /* Here 1 <= len1 <= len2. */
6423 + dlen = len1 + len2;
6424 + dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
6427 + for (k = len2; k > 0; )
6429 + for (i = 0; i < len1; i++)
6431 + mp_limb_t digit1 = p1[i];
6432 + mp_twolimb_t carry = 0;
6433 + for (j = 0; j < len2; j++)
6435 + mp_limb_t digit2 = p2[j];
6436 + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
6437 + carry += dp[i + j];
6438 + dp[i + j] = (mp_limb_t) carry;
6439 + carry = carry >> GMP_LIMB_BITS;
6441 + dp[i + len2] = (mp_limb_t) carry;
6444 + while (dlen > 0 && dp[dlen - 1] == 0)
6446 + dest->nlimbs = dlen;
6449 + return dest->limbs;
6452 +/* Compute the quotient of a bignum a >= 0 and a bignum b > 0.
6453 + a is written as a = q * b + r with 0 <= r < b. q is the quotient, r
6455 + Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd,
6457 + Return the allocated memory in case of success, NULL in case of memory
6458 + allocation failure. */
6460 +divide (mpn_t a, mpn_t b, mpn_t *q)
6463 + First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]]
6464 + with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS).
6465 + If m<n, then q:=0 and r:=a.
6466 + If m>=n=1, perform a single-precision division:
6469 + {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j =
6470 + = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r<b[0]<beta}
6471 + j:=j-1, r:=r*beta+a[j], q[j]:=floor(r/b[0]), r:=r-b[0]*q[j].
6472 + Normalise [q[m-1],...,q[0]], yields q.
6473 + If m>=n>1, perform a multiple-precision division:
6474 + We have a/b < beta^(m-n+1).
6475 + s:=intDsize-1-(hightest bit in b[n-1]), 0<=s<intDsize.
6476 + Shift a and b left by s bits, copying them. r:=a.
6477 + r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2.
6478 + For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).}
6480 + q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]).
6481 + In case of overflow (q* >= beta) set q* := beta-1.
6482 + Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2]
6483 + and c3 := b[n-2] * q*.
6484 + {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow
6485 + occurred. Furthermore 0 <= c3 < beta^2.
6486 + If there was overflow and
6487 + r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2,
6488 + the next test can be skipped.}
6489 + While c3 > c2, {Here 0 <= c2 < c3 < beta^2}
6490 + Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2].
6492 + Put r := r - b * q* * beta^j. In detail:
6493 + [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]].
6494 + hence: u:=0, for i:=0 to n-1 do
6495 + u := u + q* * b[i],
6496 + r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry),
6497 + u:=u div beta (+ 1, if carry in subtraction)
6499 + {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1
6501 + the carry u does not overflow.}
6502 + If a negative carry occurs, put q* := q* - 1
6503 + and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]].
6505 + Normalise [q[m-n],..,q[0]]; this yields the quotient q.
6506 + Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the
6508 + The room for q[j] can be allocated at the memory location of r[n+j].
6509 + Finally, round-to-even:
6510 + Shift r left by 1 bit.
6511 + If r > b or if r = b and q[0] is odd, q := q+1.
6513 + const mp_limb_t *a_ptr = a.limbs;
6514 + size_t a_len = a.nlimbs;
6515 + const mp_limb_t *b_ptr = b.limbs;
6516 + size_t b_len = b.nlimbs;
6517 + mp_limb_t *roomptr;
6518 + mp_limb_t *tmp_roomptr = NULL;
6524 + /* Allocate room for a_len+2 digits.
6525 + (Need a_len+1 digits for the real division and 1 more digit for the
6526 + final rounding of q.) */
6527 + roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t));
6528 + if (roomptr == NULL)
6531 + /* Normalise a. */
6532 + while (a_len > 0 && a_ptr[a_len - 1] == 0)
6535 + /* Normalise b. */
6539 + /* Division by zero. */
6541 + if (b_ptr[b_len - 1] == 0)
6547 + /* Here m = a_len >= 0 and n = b_len > 0. */
6549 + if (a_len < b_len)
6551 + /* m<n: trivial case. q=0, r := copy of a. */
6554 + memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
6555 + q_ptr = roomptr + a_len;
6558 + else if (b_len == 1)
6560 + /* n=1: single precision division.
6561 + beta^(m-1) <= a < beta^m ==> beta^(m-2) <= a/b < beta^m */
6563 + q_ptr = roomptr + 1;
6565 + mp_limb_t den = b_ptr[0];
6566 + mp_limb_t remainder = 0;
6567 + const mp_limb_t *sourceptr = a_ptr + a_len;
6568 + mp_limb_t *destptr = q_ptr + a_len;
6570 + for (count = a_len; count > 0; count--)
6572 + mp_twolimb_t num =
6573 + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
6574 + *--destptr = num / den;
6575 + remainder = num % den;
6577 + /* Normalise and store r. */
6578 + if (remainder > 0)
6580 + r_ptr[0] = remainder;
6585 + /* Normalise q. */
6587 + if (q_ptr[q_len - 1] == 0)
6593 + /* n>1: multiple precision division.
6594 + beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==>
6595 + beta^(m-n-1) <= a/b < beta^(m-n+1). */
6596 + /* Determine s. */
6599 + mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
6601 + if (msd >= 0x10000)
6627 + /* 0 <= s < GMP_LIMB_BITS.
6628 + Copy b, shifting it left by s bits. */
6631 + tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
6632 + if (tmp_roomptr == NULL)
6638 + const mp_limb_t *sourceptr = b_ptr;
6639 + mp_limb_t *destptr = tmp_roomptr;
6640 + mp_twolimb_t accu = 0;
6642 + for (count = b_len; count > 0; count--)
6644 + accu += (mp_twolimb_t) *sourceptr++ << s;
6645 + *destptr++ = (mp_limb_t) accu;
6646 + accu = accu >> GMP_LIMB_BITS;
6648 + /* accu must be zero, since that was how s was determined. */
6652 + b_ptr = tmp_roomptr;
6654 + /* Copy a, shifting it left by s bits, yields r.
6656 + At the beginning: r = roomptr[0..a_len],
6657 + at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */
6661 + memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
6666 + const mp_limb_t *sourceptr = a_ptr;
6667 + mp_limb_t *destptr = r_ptr;
6668 + mp_twolimb_t accu = 0;
6670 + for (count = a_len; count > 0; count--)
6672 + accu += (mp_twolimb_t) *sourceptr++ << s;
6673 + *destptr++ = (mp_limb_t) accu;
6674 + accu = accu >> GMP_LIMB_BITS;
6676 + *destptr++ = (mp_limb_t) accu;
6678 + q_ptr = roomptr + b_len;
6679 + q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */
6681 + size_t j = a_len - b_len; /* m-n */
6682 + mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
6683 + mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
6684 + mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
6685 + ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
6686 + /* Division loop, traversed m-n+1 times.
6687 + j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */
6692 + if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
6694 + /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */
6695 + mp_twolimb_t num =
6696 + ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
6697 + | r_ptr[j + b_len - 1];
6698 + q_star = num / b_msd;
6703 + /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */
6704 + q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
6705 + /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
6706 + <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
6707 + <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
6709 + If yes, jump directly to the subtraction loop.
6710 + (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
6711 + <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
6712 + if (r_ptr[j + b_len] > b_msd
6713 + || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
6714 + /* r[j+n] >= b[n-1]+1 or
6715 + r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
6720 + c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta). */
6722 + mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
6723 + ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
6724 + mp_twolimb_t c3 = /* b[n-2] * q* */
6725 + (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
6726 + /* While c2 < c3, increase c2 and decrease c3.
6727 + Consider c3-c2. While it is > 0, decrease it by
6728 + b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2
6729 + this can happen only twice. */
6732 + q_star = q_star - 1; /* q* := q* - 1 */
6733 + if (c3 - c2 > b_msdd)
6734 + q_star = q_star - 1; /* q* := q* - 1 */
6740 + /* Subtract r := r - b * q* * beta^j. */
6743 + const mp_limb_t *sourceptr = b_ptr;
6744 + mp_limb_t *destptr = r_ptr + j;
6745 + mp_twolimb_t carry = 0;
6747 + for (count = b_len; count > 0; count--)
6749 + /* Here 0 <= carry <= q*. */
6752 + + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
6753 + + (mp_limb_t) ~(*destptr);
6754 + /* Here 0 <= carry <= beta*q* + beta-1. */
6755 + *destptr++ = ~(mp_limb_t) carry;
6756 + carry = carry >> GMP_LIMB_BITS; /* <= q* */
6758 + cr = (mp_limb_t) carry;
6760 + /* Subtract cr from r_ptr[j + b_len], then forget about
6761 + r_ptr[j + b_len]. */
6762 + if (cr > r_ptr[j + b_len])
6764 + /* Subtraction gave a carry. */
6765 + q_star = q_star - 1; /* q* := q* - 1 */
6768 + const mp_limb_t *sourceptr = b_ptr;
6769 + mp_limb_t *destptr = r_ptr + j;
6770 + mp_limb_t carry = 0;
6772 + for (count = b_len; count > 0; count--)
6774 + mp_limb_t source1 = *sourceptr++;
6775 + mp_limb_t source2 = *destptr;
6776 + *destptr++ = source1 + source2 + carry;
6779 + ? source1 >= (mp_limb_t) ~source2
6780 + : source1 > (mp_limb_t) ~source2);
6783 + /* Forget about the carry and about r[j+n]. */
6786 + /* q* is determined. Store it as q[j]. */
6787 + q_ptr[j] = q_star;
6794 + /* Normalise q. */
6795 + if (q_ptr[q_len - 1] == 0)
6797 +# if 0 /* Not needed here, since we need r only to compare it with b/2, and
6798 + b is shifted left by s bits. */
6799 + /* Shift r right by s bits. */
6802 + mp_limb_t ptr = r_ptr + r_len;
6803 + mp_twolimb_t accu = 0;
6805 + for (count = r_len; count > 0; count--)
6807 + accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
6808 + accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
6809 + *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
6813 + /* Normalise r. */
6814 + while (r_len > 0 && r_ptr[r_len - 1] == 0)
6817 + /* Compare r << 1 with b. */
6818 + if (r_len > b_len)
6825 + (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
6826 + | (i < r_len ? r_ptr[i] << 1 : 0);
6827 + mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
6837 + if (q_len > 0 && ((q_ptr[0] & 1) != 0))
6842 + for (i = 0; i < q_len; i++)
6843 + if (++(q_ptr[i]) != 0)
6845 + q_ptr[q_len++] = 1;
6848 + if (tmp_roomptr != NULL)
6849 + free (tmp_roomptr);
6851 + q->nlimbs = q_len;
6855 +/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal
6857 + Destroys the contents of a.
6858 + Return the allocated memory - containing the decimal digits in low-to-high
6859 + order, terminated with a NUL character - in case of success, NULL in case
6860 + of memory allocation failure. */
6862 +convert_to_decimal (mpn_t a, size_t extra_zeroes)
6864 + mp_limb_t *a_ptr = a.limbs;
6865 + size_t a_len = a.nlimbs;
6866 + /* 0.03345 is slightly larger than log(2)/(9*log(10)). */
6867 + size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1);
6868 + char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes));
6869 + if (c_ptr != NULL)
6871 + char *d_ptr = c_ptr;
6872 + for (; extra_zeroes > 0; extra_zeroes--)
6876 + /* Divide a by 10^9, in-place. */
6877 + mp_limb_t remainder = 0;
6878 + mp_limb_t *ptr = a_ptr + a_len;
6880 + for (count = a_len; count > 0; count--)
6882 + mp_twolimb_t num =
6883 + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
6884 + *ptr = num / 1000000000;
6885 + remainder = num % 1000000000;
6887 + /* Store the remainder as 9 decimal digits. */
6888 + for (count = 9; count > 0; count--)
6890 + *d_ptr++ = '0' + (remainder % 10);
6891 + remainder = remainder / 10;
6893 + /* Normalize a. */
6894 + if (a_ptr[a_len - 1] == 0)
6897 + /* Remove leading zeroes. */
6898 + while (d_ptr > c_ptr && d_ptr[-1] == '0')
6900 + /* But keep at least one zero. */
6901 + if (d_ptr == c_ptr)
6903 + /* Terminate the string. */
6909 +# if NEED_PRINTF_LONG_DOUBLE
6911 +/* Assuming x is finite and >= 0:
6912 + write x as x = 2^e * m, where m is a bignum.
6913 + Return the allocated memory in case of success, NULL in case of memory
6914 + allocation failure. */
6916 +decode_long_double (long double x, int *ep, mpn_t *mp)
6923 + /* Allocate memory for result. */
6924 + m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
6925 + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
6926 + if (m.limbs == NULL)
6928 + /* Split into exponential part and mantissa. */
6929 + y = frexpl (x, &exp);
6930 + if (!(y >= 0.0L && y < 1.0L))
6932 + /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * LDBL_MANT_BIT), and the
6933 + latter is an integer. */
6934 + /* Convert the mantissa (y * LDBL_MANT_BIT) to a sequence of limbs.
6935 + I'm not sure whether it's safe to cast a 'long double' value between
6936 + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
6937 + 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int',
6938 + doesn't matter). */
6939 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0
6940 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
6943 + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2));
6946 + if (!(y >= 0.0L && y < 1.0L))
6948 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6951 + if (!(y >= 0.0L && y < 1.0L))
6953 + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
6958 + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS);
6961 + if (!(y >= 0.0L && y < 1.0L))
6963 + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d;
6967 + for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
6970 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6973 + if (!(y >= 0.0L && y < 1.0L))
6975 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6978 + if (!(y >= 0.0L && y < 1.0L))
6980 + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
6982 +#if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
6988 + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
6991 + *ep = exp - LDBL_MANT_BIT;
6997 +# if NEED_PRINTF_DOUBLE
6999 +/* Assuming x is finite and >= 0:
7000 + write x as x = 2^e * m, where m is a bignum.
7001 + Return the allocated memory in case of success, NULL in case of memory
7002 + allocation failure. */
7004 +decode_double (double x, int *ep, mpn_t *mp)
7011 + /* Allocate memory for result. */
7012 + m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
7013 + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
7014 + if (m.limbs == NULL)
7016 + /* Split into exponential part and mantissa. */
7017 + y = frexp (x, &exp);
7018 + if (!(y >= 0.0 && y < 1.0))
7020 + /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * DBL_MANT_BIT), and the
7021 + latter is an integer. */
7022 + /* Convert the mantissa (y * DBL_MANT_BIT) to a sequence of limbs.
7023 + I'm not sure whether it's safe to cast a 'double' value between
7024 + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
7025 + 'double' values between 0 and 2^16 (to 'unsigned int' or 'int',
7026 + doesn't matter). */
7027 +# if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0
7028 +# if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
7031 + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2));
7034 + if (!(y >= 0.0 && y < 1.0))
7036 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
7039 + if (!(y >= 0.0 && y < 1.0))
7041 + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
7046 + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS);
7049 + if (!(y >= 0.0 && y < 1.0))
7051 + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d;
7055 + for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
7058 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
7061 + if (!(y >= 0.0 && y < 1.0))
7063 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
7066 + if (!(y >= 0.0 && y < 1.0))
7068 + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
7073 + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
7076 + *ep = exp - DBL_MANT_BIT;
7082 +/* Assuming x = 2^e * m is finite and >= 0, and n is an integer:
7083 + Returns the decimal representation of round (x * 10^n).
7084 + Return the allocated memory - containing the decimal digits in low-to-high
7085 + order, terminated with a NUL character - in case of success, NULL in case
7086 + of memory allocation failure. */
7088 +scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
7091 + size_t extra_zeroes;
7092 + unsigned int abs_n;
7093 + unsigned int abs_s;
7094 + mp_limb_t *pow5_ptr;
7096 + unsigned int s_limbs;
7097 + unsigned int s_bits;
7103 + if (memory == NULL)
7105 + /* x = 2^e * m, hence
7106 + y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m)
7107 + = round (2^s * 5^n * m). */
7110 + /* Factor out a common power of 10 if possible. */
7111 + if (s > 0 && n > 0)
7113 + extra_zeroes = (s < n ? s : n);
7114 + s -= extra_zeroes;
7115 + n -= extra_zeroes;
7117 + /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes.
7118 + Before converting to decimal, we need to compute
7119 + z = round (2^s * 5^n * m). */
7120 + /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same
7121 + sign. 2.322 is slightly larger than log(5)/log(2). */
7122 + abs_n = (n >= 0 ? n : -n);
7123 + abs_s = (s >= 0 ? s : -s);
7124 + pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1
7125 + + abs_s / GMP_LIMB_BITS + 1)
7126 + * sizeof (mp_limb_t));
7127 + if (pow5_ptr == NULL)
7132 + /* Initialize with 1. */
7135 + /* Multiply with 5^|n|. */
7138 + static mp_limb_t const small_pow5[13 + 1] =
7140 + 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
7141 + 48828125, 244140625, 1220703125
7144 + for (n13 = 0; n13 <= abs_n; n13 += 13)
7146 + mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
7148 + mp_twolimb_t carry = 0;
7149 + for (j = 0; j < pow5_len; j++)
7151 + mp_limb_t digit2 = pow5_ptr[j];
7152 + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
7153 + pow5_ptr[j] = (mp_limb_t) carry;
7154 + carry = carry >> GMP_LIMB_BITS;
7157 + pow5_ptr[pow5_len++] = (mp_limb_t) carry;
7160 + s_limbs = abs_s / GMP_LIMB_BITS;
7161 + s_bits = abs_s % GMP_LIMB_BITS;
7162 + if (n >= 0 ? s >= 0 : s <= 0)
7164 + /* Multiply with 2^|s|. */
7167 + mp_limb_t *ptr = pow5_ptr;
7168 + mp_twolimb_t accu = 0;
7170 + for (count = pow5_len; count > 0; count--)
7172 + accu += (mp_twolimb_t) *ptr << s_bits;
7173 + *ptr++ = (mp_limb_t) accu;
7174 + accu = accu >> GMP_LIMB_BITS;
7178 + *ptr = (mp_limb_t) accu;
7185 + for (count = pow5_len; count > 0;)
7188 + pow5_ptr[s_limbs + count] = pow5_ptr[count];
7190 + for (count = s_limbs; count > 0;)
7193 + pow5_ptr[count] = 0;
7195 + pow5_len += s_limbs;
7197 + pow5.limbs = pow5_ptr;
7198 + pow5.nlimbs = pow5_len;
7201 + /* Multiply m with pow5. No division needed. */
7202 + z_memory = multiply (m, pow5, &z);
7206 + /* Divide m by pow5 and round. */
7207 + z_memory = divide (m, pow5, &z);
7212 + pow5.limbs = pow5_ptr;
7213 + pow5.nlimbs = pow5_len;
7217 + Multiply m with pow5, then divide by 2^|s|. */
7219 + mpn_t denominator;
7221 + tmp_memory = multiply (m, pow5, &numerator);
7222 + if (tmp_memory == NULL)
7228 + /* Construct 2^|s|. */
7230 + mp_limb_t *ptr = pow5_ptr + pow5_len;
7232 + for (i = 0; i < s_limbs; i++)
7234 + ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
7235 + denominator.limbs = ptr;
7236 + denominator.nlimbs = s_limbs + 1;
7238 + z_memory = divide (numerator, denominator, &z);
7239 + free (tmp_memory);
7244 + Multiply m with 2^s, then divide by pow5. */
7246 + mp_limb_t *num_ptr;
7247 + num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
7248 + * sizeof (mp_limb_t));
7249 + if (num_ptr == NULL)
7256 + mp_limb_t *destptr = num_ptr;
7259 + for (i = 0; i < s_limbs; i++)
7264 + const mp_limb_t *sourceptr = m.limbs;
7265 + mp_twolimb_t accu = 0;
7267 + for (count = m.nlimbs; count > 0; count--)
7269 + accu += (mp_twolimb_t) *sourceptr++ << s_bits;
7270 + *destptr++ = (mp_limb_t) accu;
7271 + accu = accu >> GMP_LIMB_BITS;
7274 + *destptr++ = (mp_limb_t) accu;
7278 + const mp_limb_t *sourceptr = m.limbs;
7280 + for (count = m.nlimbs; count > 0; count--)
7281 + *destptr++ = *sourceptr++;
7283 + numerator.limbs = num_ptr;
7284 + numerator.nlimbs = destptr - num_ptr;
7286 + z_memory = divide (numerator, pow5, &z);
7293 + /* Here y = round (x * 10^n) = z * 10^extra_zeroes. */
7295 + if (z_memory == NULL)
7297 + digits = convert_to_decimal (z, extra_zeroes);
7302 +# if NEED_PRINTF_LONG_DOUBLE
7304 +/* Assuming x is finite and >= 0, and n is an integer:
7305 + Returns the decimal representation of round (x * 10^n).
7306 + Return the allocated memory - containing the decimal digits in low-to-high
7307 + order, terminated with a NUL character - in case of success, NULL in case
7308 + of memory allocation failure. */
7310 +scale10_round_decimal_long_double (long double x, int n)
7312 + int e IF_LINT(= 0);
7314 + void *memory = decode_long_double (x, &e, &m);
7315 + return scale10_round_decimal_decoded (e, m, memory, n);
7320 +# if NEED_PRINTF_DOUBLE
7322 +/* Assuming x is finite and >= 0, and n is an integer:
7323 + Returns the decimal representation of round (x * 10^n).
7324 + Return the allocated memory - containing the decimal digits in low-to-high
7325 + order, terminated with a NUL character - in case of success, NULL in case
7326 + of memory allocation failure. */
7328 +scale10_round_decimal_double (double x, int n)
7330 + int e IF_LINT(= 0);
7332 + void *memory = decode_double (x, &e, &m);
7333 + return scale10_round_decimal_decoded (e, m, memory, n);
7338 +# if NEED_PRINTF_LONG_DOUBLE
7340 +/* Assuming x is finite and > 0:
7341 + Return an approximation for n with 10^n <= x < 10^(n+1).
7342 + The approximation is usually the right n, but may be off by 1 sometimes. */
7344 +floorlog10l (long double x)
7351 + /* Split into exponential part and mantissa. */
7352 + y = frexpl (x, &exp);
7353 + if (!(y >= 0.0L && y < 1.0L))
7359 + while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
7361 + y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
7362 + exp -= GMP_LIMB_BITS;
7364 + if (y < (1.0L / (1 << 16)))
7366 + y *= 1.0L * (1 << 16);
7369 + if (y < (1.0L / (1 << 8)))
7371 + y *= 1.0L * (1 << 8);
7374 + if (y < (1.0L / (1 << 4)))
7376 + y *= 1.0L * (1 << 4);
7379 + if (y < (1.0L / (1 << 2)))
7381 + y *= 1.0L * (1 << 2);
7384 + if (y < (1.0L / (1 << 1)))
7386 + y *= 1.0L * (1 << 1);
7390 + if (!(y >= 0.5L && y < 1.0L))
7392 + /* Compute an approximation for l = log2(x) = exp + log2(y). */
7395 + if (z < 0.70710678118654752444)
7397 + z *= 1.4142135623730950488;
7400 + if (z < 0.8408964152537145431)
7402 + z *= 1.1892071150027210667;
7405 + if (z < 0.91700404320467123175)
7407 + z *= 1.0905077326652576592;
7410 + if (z < 0.9576032806985736469)
7412 + z *= 1.0442737824274138403;
7415 + /* Now 0.95 <= z <= 1.01. */
7417 + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
7418 + Four terms are enough to get an approximation with error < 10^-7. */
7419 + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
7420 + /* Finally multiply with log(2)/log(10), yields an approximation for
7422 + l *= 0.30102999566398119523;
7423 + /* Round down to the next integer. */
7424 + return (int) l + (l < 0 ? -1 : 0);
7429 +# if NEED_PRINTF_DOUBLE
7431 +/* Assuming x is finite and > 0:
7432 + Return an approximation for n with 10^n <= x < 10^(n+1).
7433 + The approximation is usually the right n, but may be off by 1 sometimes. */
7435 +floorlog10 (double x)
7442 + /* Split into exponential part and mantissa. */
7443 + y = frexp (x, &exp);
7444 + if (!(y >= 0.0 && y < 1.0))
7450 + while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
7452 + y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
7453 + exp -= GMP_LIMB_BITS;
7455 + if (y < (1.0 / (1 << 16)))
7457 + y *= 1.0 * (1 << 16);
7460 + if (y < (1.0 / (1 << 8)))
7462 + y *= 1.0 * (1 << 8);
7465 + if (y < (1.0 / (1 << 4)))
7467 + y *= 1.0 * (1 << 4);
7470 + if (y < (1.0 / (1 << 2)))
7472 + y *= 1.0 * (1 << 2);
7475 + if (y < (1.0 / (1 << 1)))
7477 + y *= 1.0 * (1 << 1);
7481 + if (!(y >= 0.5 && y < 1.0))
7483 + /* Compute an approximation for l = log2(x) = exp + log2(y). */
7486 + if (z < 0.70710678118654752444)
7488 + z *= 1.4142135623730950488;
7491 + if (z < 0.8408964152537145431)
7493 + z *= 1.1892071150027210667;
7496 + if (z < 0.91700404320467123175)
7498 + z *= 1.0905077326652576592;
7501 + if (z < 0.9576032806985736469)
7503 + z *= 1.0442737824274138403;
7506 + /* Now 0.95 <= z <= 1.01. */
7508 + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
7509 + Four terms are enough to get an approximation with error < 10^-7. */
7510 + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
7511 + /* Finally multiply with log(2)/log(10), yields an approximation for
7513 + l *= 0.30102999566398119523;
7514 + /* Round down to the next integer. */
7515 + return (int) l + (l < 0 ? -1 : 0);
7520 +/* Tests whether a string of digits consists of exactly PRECISION zeroes and
7521 + a single '1' digit. */
7523 +is_borderline (const char *digits, size_t precision)
7525 + for (; precision > 0; precision--, digits++)
7526 + if (*digits != '0')
7528 + if (*digits != '1')
7531 + return *digits == '\0';
7537 +VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
7538 + const FCHAR_T *format, va_list args)
7543 + if (PRINTF_PARSE (format, &d, &a) < 0)
7544 + /* errno is already set. */
7547 +#define CLEANUP() \
7552 + if (PRINTF_FETCHARGS (args, &a) < 0)
7560 + size_t buf_neededlength;
7562 + TCHAR_T *buf_malloced;
7563 + const FCHAR_T *cp;
7566 + /* Output string accumulator. */
7571 + /* Allocate a small buffer that will hold a directive passed to
7572 + sprintf or snprintf. */
7573 + buf_neededlength =
7574 + xsum4 (7, d.max_width_length, d.max_precision_length, 6);
7576 + if (buf_neededlength < 4000 / sizeof (TCHAR_T))
7578 + buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
7579 + buf_malloced = NULL;
7584 + size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
7585 + if (size_overflow_p (buf_memsize))
7586 + goto out_of_memory_1;
7587 + buf = (TCHAR_T *) malloc (buf_memsize);
7589 + goto out_of_memory_1;
7590 + buf_malloced = buf;
7593 + if (resultbuf != NULL)
7595 + result = resultbuf;
7596 + allocated = *lengthp;
7605 + result is either == resultbuf or == NULL or malloc-allocated.
7606 + If length > 0, then result != NULL. */
7608 + /* Ensures that allocated >= needed. Aborts through a jump to
7609 + out_of_memory if needed is SIZE_MAX or otherwise too big. */
7610 +#define ENSURE_ALLOCATION(needed) \
7611 + if ((needed) > allocated) \
7613 + size_t memory_size; \
7614 + DCHAR_T *memory; \
7616 + allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
7617 + if ((needed) > allocated) \
7618 + allocated = (needed); \
7619 + memory_size = xtimes (allocated, sizeof (DCHAR_T)); \
7620 + if (size_overflow_p (memory_size)) \
7621 + goto out_of_memory; \
7622 + if (result == resultbuf || result == NULL) \
7623 + memory = (DCHAR_T *) malloc (memory_size); \
7625 + memory = (DCHAR_T *) realloc (result, memory_size); \
7626 + if (memory == NULL) \
7627 + goto out_of_memory; \
7628 + if (result == resultbuf && length > 0) \
7629 + DCHAR_CPY (memory, result, length); \
7630 + result = memory; \
7633 + for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
7635 + if (cp != dp->dir_start)
7637 + size_t n = dp->dir_start - cp;
7638 + size_t augmented_length = xsum (length, n);
7640 + ENSURE_ALLOCATION (augmented_length);
7641 + /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we
7642 + need that the format string contains only ASCII characters
7643 + if FCHAR_T and DCHAR_T are not the same type. */
7644 + if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
7646 + DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
7647 + length = augmented_length;
7652 + result[length++] = (unsigned char) *cp++;
7659 + /* Execute a single directive. */
7660 + if (dp->conversion == '%')
7662 + size_t augmented_length;
7664 + if (!(dp->arg_index == ARG_NONE))
7666 + augmented_length = xsum (length, 1);
7667 + ENSURE_ALLOCATION (augmented_length);
7668 + result[length] = '%';
7669 + length = augmented_length;
7673 + if (!(dp->arg_index != ARG_NONE))
7676 + if (dp->conversion == 'n')
7678 + switch (a.arg[dp->arg_index].type)
7680 + case TYPE_COUNT_SCHAR_POINTER:
7681 + *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
7683 + case TYPE_COUNT_SHORT_POINTER:
7684 + *a.arg[dp->arg_index].a.a_count_short_pointer = length;
7686 + case TYPE_COUNT_INT_POINTER:
7687 + *a.arg[dp->arg_index].a.a_count_int_pointer = length;
7689 + case TYPE_COUNT_LONGINT_POINTER:
7690 + *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
7692 +#if HAVE_LONG_LONG_INT
7693 + case TYPE_COUNT_LONGLONGINT_POINTER:
7694 + *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
7701 +#if ENABLE_UNISTDIO
7702 + /* The unistdio extensions. */
7703 + else if (dp->conversion == 'U')
7705 + arg_type type = a.arg[dp->arg_index].type;
7706 + int flags = dp->flags;
7709 + int has_precision;
7714 + if (dp->width_start != dp->width_end)
7716 + if (dp->width_arg_index != ARG_NONE)
7720 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
7722 + arg = a.arg[dp->width_arg_index].a.a_int;
7725 + /* "A negative field width is taken as a '-' flag
7726 + followed by a positive field width." */
7727 + flags |= FLAG_LEFT;
7728 + width = (unsigned int) (-arg);
7735 + const FCHAR_T *digitp = dp->width_start;
7738 + width = xsum (xtimes (width, 10), *digitp++ - '0');
7739 + while (digitp != dp->width_end);
7744 + has_precision = 0;
7746 + if (dp->precision_start != dp->precision_end)
7748 + if (dp->precision_arg_index != ARG_NONE)
7752 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
7754 + arg = a.arg[dp->precision_arg_index].a.a_int;
7755 + /* "A negative precision is taken as if the precision
7760 + has_precision = 1;
7765 + const FCHAR_T *digitp = dp->precision_start + 1;
7768 + while (digitp != dp->precision_end)
7769 + precision = xsum (xtimes (precision, 10), *digitp++ - '0');
7770 + has_precision = 1;
7776 + case TYPE_U8_STRING:
7778 + const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
7779 + const uint8_t *arg_end;
7780 + size_t characters;
7782 + if (has_precision)
7784 + /* Use only PRECISION characters, from the left. */
7787 + for (; precision > 0; precision--)
7789 + int count = u8_strmblen (arg_end);
7794 + if (!(result == resultbuf || result == NULL))
7796 + if (buf_malloced != NULL)
7797 + free (buf_malloced);
7806 + else if (has_width)
7808 + /* Use the entire string, and count the number of
7814 + int count = u8_strmblen (arg_end);
7819 + if (!(result == resultbuf || result == NULL))
7821 + if (buf_malloced != NULL)
7822 + free (buf_malloced);
7833 + /* Use the entire string. */
7834 + arg_end = arg + u8_strlen (arg);
7835 + /* The number of characters doesn't matter. */
7839 + if (has_width && width > characters
7840 + && !(dp->flags & FLAG_LEFT))
7842 + size_t n = width - characters;
7843 + ENSURE_ALLOCATION (xsum (length, n));
7844 + DCHAR_SET (result + length, ' ', n);
7848 +# if DCHAR_IS_UINT8_T
7850 + size_t n = arg_end - arg;
7851 + ENSURE_ALLOCATION (xsum (length, n));
7852 + DCHAR_CPY (result + length, arg, n);
7857 + DCHAR_T *converted = result + length;
7858 + size_t converted_len = allocated - length;
7859 +# if DCHAR_IS_TCHAR
7860 + /* Convert from UTF-8 to locale encoding. */
7861 + if (u8_conv_to_encoding (locale_charset (),
7862 + iconveh_question_mark,
7863 + arg, arg_end - arg, NULL,
7864 + &converted, &converted_len)
7867 + /* Convert from UTF-8 to UTF-16/UTF-32. */
7869 + U8_TO_DCHAR (arg, arg_end - arg,
7870 + converted, &converted_len);
7871 + if (converted == NULL)
7874 + int saved_errno = errno;
7875 + if (!(result == resultbuf || result == NULL))
7877 + if (buf_malloced != NULL)
7878 + free (buf_malloced);
7880 + errno = saved_errno;
7883 + if (converted != result + length)
7885 + ENSURE_ALLOCATION (xsum (length, converted_len));
7886 + DCHAR_CPY (result + length, converted, converted_len);
7889 + length += converted_len;
7893 + if (has_width && width > characters
7894 + && (dp->flags & FLAG_LEFT))
7896 + size_t n = width - characters;
7897 + ENSURE_ALLOCATION (xsum (length, n));
7898 + DCHAR_SET (result + length, ' ', n);
7904 + case TYPE_U16_STRING:
7906 + const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
7907 + const uint16_t *arg_end;
7908 + size_t characters;
7910 + if (has_precision)
7912 + /* Use only PRECISION characters, from the left. */
7915 + for (; precision > 0; precision--)
7917 + int count = u16_strmblen (arg_end);
7922 + if (!(result == resultbuf || result == NULL))
7924 + if (buf_malloced != NULL)
7925 + free (buf_malloced);
7934 + else if (has_width)
7936 + /* Use the entire string, and count the number of
7942 + int count = u16_strmblen (arg_end);
7947 + if (!(result == resultbuf || result == NULL))
7949 + if (buf_malloced != NULL)
7950 + free (buf_malloced);
7961 + /* Use the entire string. */
7962 + arg_end = arg + u16_strlen (arg);
7963 + /* The number of characters doesn't matter. */
7967 + if (has_width && width > characters
7968 + && !(dp->flags & FLAG_LEFT))
7970 + size_t n = width - characters;
7971 + ENSURE_ALLOCATION (xsum (length, n));
7972 + DCHAR_SET (result + length, ' ', n);
7976 +# if DCHAR_IS_UINT16_T
7978 + size_t n = arg_end - arg;
7979 + ENSURE_ALLOCATION (xsum (length, n));
7980 + DCHAR_CPY (result + length, arg, n);
7985 + DCHAR_T *converted = result + length;
7986 + size_t converted_len = allocated - length;
7987 +# if DCHAR_IS_TCHAR
7988 + /* Convert from UTF-16 to locale encoding. */
7989 + if (u16_conv_to_encoding (locale_charset (),
7990 + iconveh_question_mark,
7991 + arg, arg_end - arg, NULL,
7992 + &converted, &converted_len)
7995 + /* Convert from UTF-16 to UTF-8/UTF-32. */
7997 + U16_TO_DCHAR (arg, arg_end - arg,
7998 + converted, &converted_len);
7999 + if (converted == NULL)
8002 + int saved_errno = errno;
8003 + if (!(result == resultbuf || result == NULL))
8005 + if (buf_malloced != NULL)
8006 + free (buf_malloced);
8008 + errno = saved_errno;
8011 + if (converted != result + length)
8013 + ENSURE_ALLOCATION (xsum (length, converted_len));
8014 + DCHAR_CPY (result + length, converted, converted_len);
8017 + length += converted_len;
8021 + if (has_width && width > characters
8022 + && (dp->flags & FLAG_LEFT))
8024 + size_t n = width - characters;
8025 + ENSURE_ALLOCATION (xsum (length, n));
8026 + DCHAR_SET (result + length, ' ', n);
8032 + case TYPE_U32_STRING:
8034 + const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
8035 + const uint32_t *arg_end;
8036 + size_t characters;
8038 + if (has_precision)
8040 + /* Use only PRECISION characters, from the left. */
8043 + for (; precision > 0; precision--)
8045 + int count = u32_strmblen (arg_end);
8050 + if (!(result == resultbuf || result == NULL))
8052 + if (buf_malloced != NULL)
8053 + free (buf_malloced);
8062 + else if (has_width)
8064 + /* Use the entire string, and count the number of
8070 + int count = u32_strmblen (arg_end);
8075 + if (!(result == resultbuf || result == NULL))
8077 + if (buf_malloced != NULL)
8078 + free (buf_malloced);
8089 + /* Use the entire string. */
8090 + arg_end = arg + u32_strlen (arg);
8091 + /* The number of characters doesn't matter. */
8095 + if (has_width && width > characters
8096 + && !(dp->flags & FLAG_LEFT))
8098 + size_t n = width - characters;
8099 + ENSURE_ALLOCATION (xsum (length, n));
8100 + DCHAR_SET (result + length, ' ', n);
8104 +# if DCHAR_IS_UINT32_T
8106 + size_t n = arg_end - arg;
8107 + ENSURE_ALLOCATION (xsum (length, n));
8108 + DCHAR_CPY (result + length, arg, n);
8113 + DCHAR_T *converted = result + length;
8114 + size_t converted_len = allocated - length;
8115 +# if DCHAR_IS_TCHAR
8116 + /* Convert from UTF-32 to locale encoding. */
8117 + if (u32_conv_to_encoding (locale_charset (),
8118 + iconveh_question_mark,
8119 + arg, arg_end - arg, NULL,
8120 + &converted, &converted_len)
8123 + /* Convert from UTF-32 to UTF-8/UTF-16. */
8125 + U32_TO_DCHAR (arg, arg_end - arg,
8126 + converted, &converted_len);
8127 + if (converted == NULL)
8130 + int saved_errno = errno;
8131 + if (!(result == resultbuf || result == NULL))
8133 + if (buf_malloced != NULL)
8134 + free (buf_malloced);
8136 + errno = saved_errno;
8139 + if (converted != result + length)
8141 + ENSURE_ALLOCATION (xsum (length, converted_len));
8142 + DCHAR_CPY (result + length, converted, converted_len);
8145 + length += converted_len;
8149 + if (has_width && width > characters
8150 + && (dp->flags & FLAG_LEFT))
8152 + size_t n = width - characters;
8153 + ENSURE_ALLOCATION (xsum (length, n));
8154 + DCHAR_SET (result + length, ' ', n);
8165 +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
8166 + else if ((dp->conversion == 'a' || dp->conversion == 'A')
8167 +# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
8169 +# if NEED_PRINTF_DOUBLE
8170 + || a.arg[dp->arg_index].type == TYPE_DOUBLE
8172 +# if NEED_PRINTF_LONG_DOUBLE
8173 + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
8179 + arg_type type = a.arg[dp->arg_index].type;
8180 + int flags = dp->flags;
8183 + int has_precision;
8185 + size_t tmp_length;
8186 + DCHAR_T tmpbuf[700];
8193 + if (dp->width_start != dp->width_end)
8195 + if (dp->width_arg_index != ARG_NONE)
8199 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
8201 + arg = a.arg[dp->width_arg_index].a.a_int;
8204 + /* "A negative field width is taken as a '-' flag
8205 + followed by a positive field width." */
8206 + flags |= FLAG_LEFT;
8207 + width = (unsigned int) (-arg);
8214 + const FCHAR_T *digitp = dp->width_start;
8217 + width = xsum (xtimes (width, 10), *digitp++ - '0');
8218 + while (digitp != dp->width_end);
8223 + has_precision = 0;
8225 + if (dp->precision_start != dp->precision_end)
8227 + if (dp->precision_arg_index != ARG_NONE)
8231 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
8233 + arg = a.arg[dp->precision_arg_index].a.a_int;
8234 + /* "A negative precision is taken as if the precision
8239 + has_precision = 1;
8244 + const FCHAR_T *digitp = dp->precision_start + 1;
8247 + while (digitp != dp->precision_end)
8248 + precision = xsum (xtimes (precision, 10), *digitp++ - '0');
8249 + has_precision = 1;
8253 + /* Allocate a temporary buffer of sufficient size. */
8254 + if (type == TYPE_LONGDOUBLE)
8256 + (unsigned int) ((LDBL_DIG + 1)
8257 + * 0.831 /* decimal -> hexadecimal */
8259 + + 1; /* turn floor into ceil */
8262 + (unsigned int) ((DBL_DIG + 1)
8263 + * 0.831 /* decimal -> hexadecimal */
8265 + + 1; /* turn floor into ceil */
8266 + if (tmp_length < precision)
8267 + tmp_length = precision;
8268 + /* Account for sign, decimal point etc. */
8269 + tmp_length = xsum (tmp_length, 12);
8271 + if (tmp_length < width)
8272 + tmp_length = width;
8274 + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
8276 + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
8280 + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
8282 + if (size_overflow_p (tmp_memsize))
8283 + /* Overflow, would lead to out of memory. */
8284 + goto out_of_memory;
8285 + tmp = (DCHAR_T *) malloc (tmp_memsize);
8287 + /* Out of memory. */
8288 + goto out_of_memory;
8293 + if (type == TYPE_LONGDOUBLE)
8295 +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE
8296 + long double arg = a.arg[dp->arg_index].a.a_longdouble;
8300 + if (dp->conversion == 'A')
8302 + *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
8306 + *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
8312 + DECL_LONG_DOUBLE_ROUNDING
8314 + BEGIN_LONG_DOUBLE_ROUNDING ();
8316 + if (signbit (arg)) /* arg < 0.0L or negative zero */
8324 + else if (flags & FLAG_SHOWSIGN)
8326 + else if (flags & FLAG_SPACE)
8329 + if (arg > 0.0L && arg + arg == arg)
8331 + if (dp->conversion == 'A')
8333 + *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
8337 + *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
8343 + long double mantissa;
8346 + mantissa = printf_frexpl (arg, &exponent);
8354 + && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
8356 + /* Round the mantissa. */
8357 + long double tail = mantissa;
8360 + for (q = precision; ; q--)
8362 + int digit = (int) tail;
8366 + if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
8375 + for (q = precision; q > 0; q--)
8381 + *p++ = dp->conversion - 'A' + 'X';
8386 + digit = (int) mantissa;
8387 + mantissa -= digit;
8388 + *p++ = '0' + digit;
8389 + if ((flags & FLAG_ALT)
8390 + || mantissa > 0.0L || precision > 0)
8392 + *p++ = decimal_point_char ();
8393 + /* This loop terminates because we assume
8394 + that FLT_RADIX is a power of 2. */
8395 + while (mantissa > 0.0L)
8397 + mantissa *= 16.0L;
8398 + digit = (int) mantissa;
8399 + mantissa -= digit;
8403 + : dp->conversion - 10);
8404 + if (precision > 0)
8407 + while (precision > 0)
8414 + *p++ = dp->conversion - 'A' + 'P';
8415 +# if WIDE_CHAR_VERSION
8417 + static const wchar_t decimal_format[] =
8418 + { '%', '+', 'd', '\0' };
8419 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
8421 + while (*p != '\0')
8424 + if (sizeof (DCHAR_T) == 1)
8426 + sprintf ((char *) p, "%+d", exponent);
8427 + while (*p != '\0')
8432 + char expbuf[6 + 1];
8434 + sprintf (expbuf, "%+d", exponent);
8435 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
8441 + END_LONG_DOUBLE_ROUNDING ();
8449 +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE
8450 + double arg = a.arg[dp->arg_index].a.a_double;
8454 + if (dp->conversion == 'A')
8456 + *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
8460 + *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
8467 + if (signbit (arg)) /* arg < 0.0 or negative zero */
8475 + else if (flags & FLAG_SHOWSIGN)
8477 + else if (flags & FLAG_SPACE)
8480 + if (arg > 0.0 && arg + arg == arg)
8482 + if (dp->conversion == 'A')
8484 + *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
8488 + *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
8497 + mantissa = printf_frexp (arg, &exponent);
8505 + && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
8507 + /* Round the mantissa. */
8508 + double tail = mantissa;
8511 + for (q = precision; ; q--)
8513 + int digit = (int) tail;
8517 + if (digit & 1 ? tail >= 0.5 : tail > 0.5)
8526 + for (q = precision; q > 0; q--)
8532 + *p++ = dp->conversion - 'A' + 'X';
8537 + digit = (int) mantissa;
8538 + mantissa -= digit;
8539 + *p++ = '0' + digit;
8540 + if ((flags & FLAG_ALT)
8541 + || mantissa > 0.0 || precision > 0)
8543 + *p++ = decimal_point_char ();
8544 + /* This loop terminates because we assume
8545 + that FLT_RADIX is a power of 2. */
8546 + while (mantissa > 0.0)
8549 + digit = (int) mantissa;
8550 + mantissa -= digit;
8554 + : dp->conversion - 10);
8555 + if (precision > 0)
8558 + while (precision > 0)
8565 + *p++ = dp->conversion - 'A' + 'P';
8566 +# if WIDE_CHAR_VERSION
8568 + static const wchar_t decimal_format[] =
8569 + { '%', '+', 'd', '\0' };
8570 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
8572 + while (*p != '\0')
8575 + if (sizeof (DCHAR_T) == 1)
8577 + sprintf ((char *) p, "%+d", exponent);
8578 + while (*p != '\0')
8583 + char expbuf[6 + 1];
8585 + sprintf (expbuf, "%+d", exponent);
8586 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
8596 + /* The generated string now extends from tmp to p, with the
8597 + zero padding insertion point being at pad_ptr. */
8598 + if (has_width && p - tmp < width)
8600 + size_t pad = width - (p - tmp);
8601 + DCHAR_T *end = p + pad;
8603 + if (flags & FLAG_LEFT)
8605 + /* Pad with spaces on the right. */
8606 + for (; pad > 0; pad--)
8609 + else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
8611 + /* Pad with zeroes. */
8614 + while (p > pad_ptr)
8616 + for (; pad > 0; pad--)
8621 + /* Pad with spaces on the left. */
8626 + for (; pad > 0; pad--)
8634 + size_t count = p - tmp;
8636 + if (count >= tmp_length)
8637 + /* tmp_length was incorrectly calculated - fix the
8641 + /* Make room for the result. */
8642 + if (count >= allocated - length)
8644 + size_t n = xsum (length, count);
8646 + ENSURE_ALLOCATION (n);
8649 + /* Append the result. */
8650 + memcpy (result + length, tmp, count * sizeof (DCHAR_T));
8651 + if (tmp != tmpbuf)
8657 +#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
8658 + else if ((dp->conversion == 'f' || dp->conversion == 'F'
8659 + || dp->conversion == 'e' || dp->conversion == 'E'
8660 + || dp->conversion == 'g' || dp->conversion == 'G'
8661 + || dp->conversion == 'a' || dp->conversion == 'A')
8663 +# if NEED_PRINTF_DOUBLE
8664 + || a.arg[dp->arg_index].type == TYPE_DOUBLE
8665 +# elif NEED_PRINTF_INFINITE_DOUBLE
8666 + || (a.arg[dp->arg_index].type == TYPE_DOUBLE
8667 + /* The systems (mingw) which produce wrong output
8668 + for Inf, -Inf, and NaN also do so for -0.0.
8669 + Therefore we treat this case here as well. */
8670 + && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
8672 +# if NEED_PRINTF_LONG_DOUBLE
8673 + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
8674 +# elif NEED_PRINTF_INFINITE_LONG_DOUBLE
8675 + || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
8676 + /* Some systems produce wrong output for Inf,
8677 + -Inf, and NaN. Some systems in this category
8678 + (IRIX 5.3) also do so for -0.0. Therefore we
8679 + treat this case here as well. */
8680 + && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble))
8684 +# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE)
8685 + arg_type type = a.arg[dp->arg_index].type;
8687 + int flags = dp->flags;
8690 + int has_precision;
8692 + size_t tmp_length;
8693 + DCHAR_T tmpbuf[700];
8700 + if (dp->width_start != dp->width_end)
8702 + if (dp->width_arg_index != ARG_NONE)
8706 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
8708 + arg = a.arg[dp->width_arg_index].a.a_int;
8711 + /* "A negative field width is taken as a '-' flag
8712 + followed by a positive field width." */
8713 + flags |= FLAG_LEFT;
8714 + width = (unsigned int) (-arg);
8721 + const FCHAR_T *digitp = dp->width_start;
8724 + width = xsum (xtimes (width, 10), *digitp++ - '0');
8725 + while (digitp != dp->width_end);
8730 + has_precision = 0;
8732 + if (dp->precision_start != dp->precision_end)
8734 + if (dp->precision_arg_index != ARG_NONE)
8738 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
8740 + arg = a.arg[dp->precision_arg_index].a.a_int;
8741 + /* "A negative precision is taken as if the precision
8746 + has_precision = 1;
8751 + const FCHAR_T *digitp = dp->precision_start + 1;
8754 + while (digitp != dp->precision_end)
8755 + precision = xsum (xtimes (precision, 10), *digitp++ - '0');
8756 + has_precision = 1;
8760 + /* POSIX specifies the default precision to be 6 for %f, %F,
8761 + %e, %E, but not for %g, %G. Implementations appear to use
8762 + the same default precision also for %g, %G. But for %a, %A,
8763 + the default precision is 0. */
8764 + if (!has_precision)
8765 + if (!(dp->conversion == 'a' || dp->conversion == 'A'))
8768 + /* Allocate a temporary buffer of sufficient size. */
8769 +# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE
8770 + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1);
8771 +# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE
8772 + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
8773 +# elif NEED_PRINTF_LONG_DOUBLE
8774 + tmp_length = LDBL_DIG + 1;
8775 +# elif NEED_PRINTF_DOUBLE
8776 + tmp_length = DBL_DIG + 1;
8780 + if (tmp_length < precision)
8781 + tmp_length = precision;
8782 +# if NEED_PRINTF_LONG_DOUBLE
8783 +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
8784 + if (type == TYPE_LONGDOUBLE)
8786 + if (dp->conversion == 'f' || dp->conversion == 'F')
8788 + long double arg = a.arg[dp->arg_index].a.a_longdouble;
8789 + if (!(isnanl (arg) || arg + arg == arg))
8791 + /* arg is finite and nonzero. */
8792 + int exponent = floorlog10l (arg < 0 ? -arg : arg);
8793 + if (exponent >= 0 && tmp_length < exponent + precision)
8794 + tmp_length = exponent + precision;
8798 +# if NEED_PRINTF_DOUBLE
8799 +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
8800 + if (type == TYPE_DOUBLE)
8802 + if (dp->conversion == 'f' || dp->conversion == 'F')
8804 + double arg = a.arg[dp->arg_index].a.a_double;
8805 + if (!(isnand (arg) || arg + arg == arg))
8807 + /* arg is finite and nonzero. */
8808 + int exponent = floorlog10 (arg < 0 ? -arg : arg);
8809 + if (exponent >= 0 && tmp_length < exponent + precision)
8810 + tmp_length = exponent + precision;
8814 + /* Account for sign, decimal point etc. */
8815 + tmp_length = xsum (tmp_length, 12);
8817 + if (tmp_length < width)
8818 + tmp_length = width;
8820 + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
8822 + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
8826 + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
8828 + if (size_overflow_p (tmp_memsize))
8829 + /* Overflow, would lead to out of memory. */
8830 + goto out_of_memory;
8831 + tmp = (DCHAR_T *) malloc (tmp_memsize);
8833 + /* Out of memory. */
8834 + goto out_of_memory;
8840 +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
8841 +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
8842 + if (type == TYPE_LONGDOUBLE)
8845 + long double arg = a.arg[dp->arg_index].a.a_longdouble;
8849 + if (dp->conversion >= 'A' && dp->conversion <= 'Z')
8851 + *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
8855 + *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
8861 + DECL_LONG_DOUBLE_ROUNDING
8863 + BEGIN_LONG_DOUBLE_ROUNDING ();
8865 + if (signbit (arg)) /* arg < 0.0L or negative zero */
8873 + else if (flags & FLAG_SHOWSIGN)
8875 + else if (flags & FLAG_SPACE)
8878 + if (arg > 0.0L && arg + arg == arg)
8880 + if (dp->conversion >= 'A' && dp->conversion <= 'Z')
8882 + *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
8886 + *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
8891 +# if NEED_PRINTF_LONG_DOUBLE
8894 + if (dp->conversion == 'f' || dp->conversion == 'F')
8900 + scale10_round_decimal_long_double (arg, precision);
8901 + if (digits == NULL)
8903 + END_LONG_DOUBLE_ROUNDING ();
8904 + goto out_of_memory;
8906 + ndigits = strlen (digits);
8908 + if (ndigits > precision)
8912 + *p++ = digits[ndigits];
8914 + while (ndigits > precision);
8917 + /* Here ndigits <= precision. */
8918 + if ((flags & FLAG_ALT) || precision > 0)
8920 + *p++ = decimal_point_char ();
8921 + for (; precision > ndigits; precision--)
8923 + while (ndigits > 0)
8926 + *p++ = digits[ndigits];
8932 + else if (dp->conversion == 'e' || dp->conversion == 'E')
8940 + if ((flags & FLAG_ALT) || precision > 0)
8942 + *p++ = decimal_point_char ();
8943 + for (; precision > 0; precision--)
8954 + exponent = floorlog10l (arg);
8959 + scale10_round_decimal_long_double (arg,
8960 + (int)precision - exponent);
8961 + if (digits == NULL)
8963 + END_LONG_DOUBLE_ROUNDING ();
8964 + goto out_of_memory;
8966 + ndigits = strlen (digits);
8968 + if (ndigits == precision + 1)
8970 + if (ndigits < precision
8971 + || ndigits > precision + 2)
8972 + /* The exponent was not guessed
8973 + precisely enough. */
8976 + /* None of two values of exponent is
8977 + the right one. Prevent an endless
8981 + if (ndigits == precision)
8987 + /* Here ndigits = precision+1. */
8988 + if (is_borderline (digits, precision))
8990 + /* Maybe the exponent guess was too high
8991 + and a smaller exponent can be reached
8992 + by turning a 10...0 into 9...9x. */
8994 + scale10_round_decimal_long_double (arg,
8995 + (int)precision - exponent + 1);
8996 + if (digits2 == NULL)
8999 + END_LONG_DOUBLE_ROUNDING ();
9000 + goto out_of_memory;
9002 + if (strlen (digits2) == precision + 1)
9011 + /* Here ndigits = precision+1. */
9013 + *p++ = digits[--ndigits];
9014 + if ((flags & FLAG_ALT) || precision > 0)
9016 + *p++ = decimal_point_char ();
9017 + while (ndigits > 0)
9020 + *p++ = digits[ndigits];
9027 + *p++ = dp->conversion; /* 'e' or 'E' */
9028 +# if WIDE_CHAR_VERSION
9030 + static const wchar_t decimal_format[] =
9031 + { '%', '+', '.', '2', 'd', '\0' };
9032 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
9034 + while (*p != '\0')
9037 + if (sizeof (DCHAR_T) == 1)
9039 + sprintf ((char *) p, "%+.2d", exponent);
9040 + while (*p != '\0')
9045 + char expbuf[6 + 1];
9047 + sprintf (expbuf, "%+.2d", exponent);
9048 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
9053 + else if (dp->conversion == 'g' || dp->conversion == 'G')
9055 + if (precision == 0)
9057 + /* precision >= 1. */
9060 + /* The exponent is 0, >= -4, < precision.
9061 + Use fixed-point notation. */
9063 + size_t ndigits = precision;
9064 + /* Number of trailing zeroes that have to be
9067 + (flags & FLAG_ALT ? 0 : precision - 1);
9071 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9073 + *p++ = decimal_point_char ();
9074 + while (ndigits > nzeroes)
9090 + exponent = floorlog10l (arg);
9095 + scale10_round_decimal_long_double (arg,
9096 + (int)(precision - 1) - exponent);
9097 + if (digits == NULL)
9099 + END_LONG_DOUBLE_ROUNDING ();
9100 + goto out_of_memory;
9102 + ndigits = strlen (digits);
9104 + if (ndigits == precision)
9106 + if (ndigits < precision - 1
9107 + || ndigits > precision + 1)
9108 + /* The exponent was not guessed
9109 + precisely enough. */
9112 + /* None of two values of exponent is
9113 + the right one. Prevent an endless
9117 + if (ndigits < precision)
9123 + /* Here ndigits = precision. */
9124 + if (is_borderline (digits, precision - 1))
9126 + /* Maybe the exponent guess was too high
9127 + and a smaller exponent can be reached
9128 + by turning a 10...0 into 9...9x. */
9130 + scale10_round_decimal_long_double (arg,
9131 + (int)(precision - 1) - exponent + 1);
9132 + if (digits2 == NULL)
9135 + END_LONG_DOUBLE_ROUNDING ();
9136 + goto out_of_memory;
9138 + if (strlen (digits2) == precision)
9147 + /* Here ndigits = precision. */
9149 + /* Determine the number of trailing zeroes
9150 + that have to be dropped. */
9152 + if ((flags & FLAG_ALT) == 0)
9153 + while (nzeroes < ndigits
9154 + && digits[nzeroes] == '0')
9157 + /* The exponent is now determined. */
9158 + if (exponent >= -4
9159 + && exponent < (long)precision)
9161 + /* Fixed-point notation:
9162 + max(exponent,0)+1 digits, then the
9163 + decimal point, then the remaining
9164 + digits without trailing zeroes. */
9165 + if (exponent >= 0)
9167 + size_t count = exponent + 1;
9168 + /* Note: count <= precision = ndigits. */
9169 + for (; count > 0; count--)
9170 + *p++ = digits[--ndigits];
9171 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9173 + *p++ = decimal_point_char ();
9174 + while (ndigits > nzeroes)
9177 + *p++ = digits[ndigits];
9183 + size_t count = -exponent - 1;
9185 + *p++ = decimal_point_char ();
9186 + for (; count > 0; count--)
9188 + while (ndigits > nzeroes)
9191 + *p++ = digits[ndigits];
9197 + /* Exponential notation. */
9198 + *p++ = digits[--ndigits];
9199 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9201 + *p++ = decimal_point_char ();
9202 + while (ndigits > nzeroes)
9205 + *p++ = digits[ndigits];
9208 + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
9209 +# if WIDE_CHAR_VERSION
9211 + static const wchar_t decimal_format[] =
9212 + { '%', '+', '.', '2', 'd', '\0' };
9213 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
9215 + while (*p != '\0')
9218 + if (sizeof (DCHAR_T) == 1)
9220 + sprintf ((char *) p, "%+.2d", exponent);
9221 + while (*p != '\0')
9226 + char expbuf[6 + 1];
9228 + sprintf (expbuf, "%+.2d", exponent);
9229 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
9241 + /* arg is finite. */
9242 + if (!(arg == 0.0L))
9247 + if (dp->conversion == 'f' || dp->conversion == 'F')
9250 + if ((flags & FLAG_ALT) || precision > 0)
9252 + *p++ = decimal_point_char ();
9253 + for (; precision > 0; precision--)
9257 + else if (dp->conversion == 'e' || dp->conversion == 'E')
9260 + if ((flags & FLAG_ALT) || precision > 0)
9262 + *p++ = decimal_point_char ();
9263 + for (; precision > 0; precision--)
9266 + *p++ = dp->conversion; /* 'e' or 'E' */
9271 + else if (dp->conversion == 'g' || dp->conversion == 'G')
9274 + if (flags & FLAG_ALT)
9277 + (precision > 0 ? precision - 1 : 0);
9278 + *p++ = decimal_point_char ();
9279 + for (; ndigits > 0; --ndigits)
9283 + else if (dp->conversion == 'a' || dp->conversion == 'A')
9286 + *p++ = dp->conversion - 'A' + 'X';
9289 + if ((flags & FLAG_ALT) || precision > 0)
9291 + *p++ = decimal_point_char ();
9292 + for (; precision > 0; precision--)
9295 + *p++ = dp->conversion - 'A' + 'P';
9304 + END_LONG_DOUBLE_ROUNDING ();
9307 +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
9311 +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
9313 + double arg = a.arg[dp->arg_index].a.a_double;
9317 + if (dp->conversion >= 'A' && dp->conversion <= 'Z')
9319 + *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
9323 + *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
9330 + if (signbit (arg)) /* arg < 0.0 or negative zero */
9338 + else if (flags & FLAG_SHOWSIGN)
9340 + else if (flags & FLAG_SPACE)
9343 + if (arg > 0.0 && arg + arg == arg)
9345 + if (dp->conversion >= 'A' && dp->conversion <= 'Z')
9347 + *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
9351 + *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
9356 +# if NEED_PRINTF_DOUBLE
9359 + if (dp->conversion == 'f' || dp->conversion == 'F')
9365 + scale10_round_decimal_double (arg, precision);
9366 + if (digits == NULL)
9367 + goto out_of_memory;
9368 + ndigits = strlen (digits);
9370 + if (ndigits > precision)
9374 + *p++ = digits[ndigits];
9376 + while (ndigits > precision);
9379 + /* Here ndigits <= precision. */
9380 + if ((flags & FLAG_ALT) || precision > 0)
9382 + *p++ = decimal_point_char ();
9383 + for (; precision > ndigits; precision--)
9385 + while (ndigits > 0)
9388 + *p++ = digits[ndigits];
9394 + else if (dp->conversion == 'e' || dp->conversion == 'E')
9402 + if ((flags & FLAG_ALT) || precision > 0)
9404 + *p++ = decimal_point_char ();
9405 + for (; precision > 0; precision--)
9416 + exponent = floorlog10 (arg);
9421 + scale10_round_decimal_double (arg,
9422 + (int)precision - exponent);
9423 + if (digits == NULL)
9424 + goto out_of_memory;
9425 + ndigits = strlen (digits);
9427 + if (ndigits == precision + 1)
9429 + if (ndigits < precision
9430 + || ndigits > precision + 2)
9431 + /* The exponent was not guessed
9432 + precisely enough. */
9435 + /* None of two values of exponent is
9436 + the right one. Prevent an endless
9440 + if (ndigits == precision)
9446 + /* Here ndigits = precision+1. */
9447 + if (is_borderline (digits, precision))
9449 + /* Maybe the exponent guess was too high
9450 + and a smaller exponent can be reached
9451 + by turning a 10...0 into 9...9x. */
9453 + scale10_round_decimal_double (arg,
9454 + (int)precision - exponent + 1);
9455 + if (digits2 == NULL)
9458 + goto out_of_memory;
9460 + if (strlen (digits2) == precision + 1)
9469 + /* Here ndigits = precision+1. */
9471 + *p++ = digits[--ndigits];
9472 + if ((flags & FLAG_ALT) || precision > 0)
9474 + *p++ = decimal_point_char ();
9475 + while (ndigits > 0)
9478 + *p++ = digits[ndigits];
9485 + *p++ = dp->conversion; /* 'e' or 'E' */
9486 +# if WIDE_CHAR_VERSION
9488 + static const wchar_t decimal_format[] =
9489 + /* Produce the same number of exponent digits
9490 + as the native printf implementation. */
9491 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9492 + { '%', '+', '.', '3', 'd', '\0' };
9494 + { '%', '+', '.', '2', 'd', '\0' };
9496 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
9498 + while (*p != '\0')
9502 + static const char decimal_format[] =
9503 + /* Produce the same number of exponent digits
9504 + as the native printf implementation. */
9505 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9510 + if (sizeof (DCHAR_T) == 1)
9512 + sprintf ((char *) p, decimal_format, exponent);
9513 + while (*p != '\0')
9518 + char expbuf[6 + 1];
9520 + sprintf (expbuf, decimal_format, exponent);
9521 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
9527 + else if (dp->conversion == 'g' || dp->conversion == 'G')
9529 + if (precision == 0)
9531 + /* precision >= 1. */
9534 + /* The exponent is 0, >= -4, < precision.
9535 + Use fixed-point notation. */
9537 + size_t ndigits = precision;
9538 + /* Number of trailing zeroes that have to be
9541 + (flags & FLAG_ALT ? 0 : precision - 1);
9545 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9547 + *p++ = decimal_point_char ();
9548 + while (ndigits > nzeroes)
9564 + exponent = floorlog10 (arg);
9569 + scale10_round_decimal_double (arg,
9570 + (int)(precision - 1) - exponent);
9571 + if (digits == NULL)
9572 + goto out_of_memory;
9573 + ndigits = strlen (digits);
9575 + if (ndigits == precision)
9577 + if (ndigits < precision - 1
9578 + || ndigits > precision + 1)
9579 + /* The exponent was not guessed
9580 + precisely enough. */
9583 + /* None of two values of exponent is
9584 + the right one. Prevent an endless
9588 + if (ndigits < precision)
9594 + /* Here ndigits = precision. */
9595 + if (is_borderline (digits, precision - 1))
9597 + /* Maybe the exponent guess was too high
9598 + and a smaller exponent can be reached
9599 + by turning a 10...0 into 9...9x. */
9601 + scale10_round_decimal_double (arg,
9602 + (int)(precision - 1) - exponent + 1);
9603 + if (digits2 == NULL)
9606 + goto out_of_memory;
9608 + if (strlen (digits2) == precision)
9617 + /* Here ndigits = precision. */
9619 + /* Determine the number of trailing zeroes
9620 + that have to be dropped. */
9622 + if ((flags & FLAG_ALT) == 0)
9623 + while (nzeroes < ndigits
9624 + && digits[nzeroes] == '0')
9627 + /* The exponent is now determined. */
9628 + if (exponent >= -4
9629 + && exponent < (long)precision)
9631 + /* Fixed-point notation:
9632 + max(exponent,0)+1 digits, then the
9633 + decimal point, then the remaining
9634 + digits without trailing zeroes. */
9635 + if (exponent >= 0)
9637 + size_t count = exponent + 1;
9638 + /* Note: count <= precision = ndigits. */
9639 + for (; count > 0; count--)
9640 + *p++ = digits[--ndigits];
9641 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9643 + *p++ = decimal_point_char ();
9644 + while (ndigits > nzeroes)
9647 + *p++ = digits[ndigits];
9653 + size_t count = -exponent - 1;
9655 + *p++ = decimal_point_char ();
9656 + for (; count > 0; count--)
9658 + while (ndigits > nzeroes)
9661 + *p++ = digits[ndigits];
9667 + /* Exponential notation. */
9668 + *p++ = digits[--ndigits];
9669 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9671 + *p++ = decimal_point_char ();
9672 + while (ndigits > nzeroes)
9675 + *p++ = digits[ndigits];
9678 + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
9679 +# if WIDE_CHAR_VERSION
9681 + static const wchar_t decimal_format[] =
9682 + /* Produce the same number of exponent digits
9683 + as the native printf implementation. */
9684 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9685 + { '%', '+', '.', '3', 'd', '\0' };
9687 + { '%', '+', '.', '2', 'd', '\0' };
9689 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
9691 + while (*p != '\0')
9695 + static const char decimal_format[] =
9696 + /* Produce the same number of exponent digits
9697 + as the native printf implementation. */
9698 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9703 + if (sizeof (DCHAR_T) == 1)
9705 + sprintf ((char *) p, decimal_format, exponent);
9706 + while (*p != '\0')
9711 + char expbuf[6 + 1];
9713 + sprintf (expbuf, decimal_format, exponent);
9714 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
9727 + /* arg is finite. */
9728 + if (!(arg == 0.0))
9733 + if (dp->conversion == 'f' || dp->conversion == 'F')
9736 + if ((flags & FLAG_ALT) || precision > 0)
9738 + *p++ = decimal_point_char ();
9739 + for (; precision > 0; precision--)
9743 + else if (dp->conversion == 'e' || dp->conversion == 'E')
9746 + if ((flags & FLAG_ALT) || precision > 0)
9748 + *p++ = decimal_point_char ();
9749 + for (; precision > 0; precision--)
9752 + *p++ = dp->conversion; /* 'e' or 'E' */
9754 + /* Produce the same number of exponent digits as
9755 + the native printf implementation. */
9756 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9762 + else if (dp->conversion == 'g' || dp->conversion == 'G')
9765 + if (flags & FLAG_ALT)
9768 + (precision > 0 ? precision - 1 : 0);
9769 + *p++ = decimal_point_char ();
9770 + for (; ndigits > 0; --ndigits)
9782 + /* The generated string now extends from tmp to p, with the
9783 + zero padding insertion point being at pad_ptr. */
9784 + if (has_width && p - tmp < width)
9786 + size_t pad = width - (p - tmp);
9787 + DCHAR_T *end = p + pad;
9789 + if (flags & FLAG_LEFT)
9791 + /* Pad with spaces on the right. */
9792 + for (; pad > 0; pad--)
9795 + else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
9797 + /* Pad with zeroes. */
9800 + while (p > pad_ptr)
9802 + for (; pad > 0; pad--)
9807 + /* Pad with spaces on the left. */
9812 + for (; pad > 0; pad--)
9820 + size_t count = p - tmp;
9822 + if (count >= tmp_length)
9823 + /* tmp_length was incorrectly calculated - fix the
9827 + /* Make room for the result. */
9828 + if (count >= allocated - length)
9830 + size_t n = xsum (length, count);
9832 + ENSURE_ALLOCATION (n);
9835 + /* Append the result. */
9836 + memcpy (result + length, tmp, count * sizeof (DCHAR_T));
9837 + if (tmp != tmpbuf)
9845 + arg_type type = a.arg[dp->arg_index].type;
9846 + int flags = dp->flags;
9847 +#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
9851 +#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
9852 + int has_precision;
9855 +#if NEED_PRINTF_UNBOUNDED_PRECISION
9856 + int prec_ourselves;
9858 +# define prec_ourselves 0
9860 +#if NEED_PRINTF_FLAG_LEFTADJUST
9861 +# define pad_ourselves 1
9862 +#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
9863 + int pad_ourselves;
9865 +# define pad_ourselves 0
9868 + unsigned int prefix_count;
9869 + int prefixes[2] IF_LINT (= { 0 });
9871 + size_t tmp_length;
9872 + TCHAR_T tmpbuf[700];
9876 +#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
9879 + if (dp->width_start != dp->width_end)
9881 + if (dp->width_arg_index != ARG_NONE)
9885 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
9887 + arg = a.arg[dp->width_arg_index].a.a_int;
9890 + /* "A negative field width is taken as a '-' flag
9891 + followed by a positive field width." */
9892 + flags |= FLAG_LEFT;
9893 + width = (unsigned int) (-arg);
9900 + const FCHAR_T *digitp = dp->width_start;
9903 + width = xsum (xtimes (width, 10), *digitp++ - '0');
9904 + while (digitp != dp->width_end);
9910 +#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
9911 + has_precision = 0;
9913 + if (dp->precision_start != dp->precision_end)
9915 + if (dp->precision_arg_index != ARG_NONE)
9919 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
9921 + arg = a.arg[dp->precision_arg_index].a.a_int;
9922 + /* "A negative precision is taken as if the precision
9927 + has_precision = 1;
9932 + const FCHAR_T *digitp = dp->precision_start + 1;
9935 + while (digitp != dp->precision_end)
9936 + precision = xsum (xtimes (precision, 10), *digitp++ - '0');
9937 + has_precision = 1;
9942 + /* Decide whether to handle the precision ourselves. */
9943 +#if NEED_PRINTF_UNBOUNDED_PRECISION
9944 + switch (dp->conversion)
9946 + case 'd': case 'i': case 'u':
9948 + case 'x': case 'X': case 'p':
9949 + prec_ourselves = has_precision && (precision > 0);
9952 + prec_ourselves = 0;
9957 + /* Decide whether to perform the padding ourselves. */
9958 +#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
9959 + switch (dp->conversion)
9961 +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
9962 + /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
9963 + to perform the padding after this conversion. Functions
9964 + with unistdio extensions perform the padding based on
9965 + character count rather than element count. */
9966 + case 'c': case 's':
9968 +# if NEED_PRINTF_FLAG_ZERO
9969 + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
9970 + case 'a': case 'A':
9972 + pad_ourselves = 1;
9975 + pad_ourselves = prec_ourselves;
9981 + /* Allocate a temporary buffer of sufficient size for calling
9984 + switch (dp->conversion)
9987 + case 'd': case 'i': case 'u':
9988 +# if HAVE_LONG_LONG_INT
9989 + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
9991 + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
9992 + * 0.30103 /* binary -> decimal */
9994 + + 1; /* turn floor into ceil */
9997 + if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
9999 + (unsigned int) (sizeof (unsigned long) * CHAR_BIT
10000 + * 0.30103 /* binary -> decimal */
10002 + + 1; /* turn floor into ceil */
10005 + (unsigned int) (sizeof (unsigned int) * CHAR_BIT
10006 + * 0.30103 /* binary -> decimal */
10008 + + 1; /* turn floor into ceil */
10009 + if (tmp_length < precision)
10010 + tmp_length = precision;
10011 + /* Multiply by 2, as an estimate for FLAG_GROUP. */
10012 + tmp_length = xsum (tmp_length, tmp_length);
10013 + /* Add 1, to account for a leading sign. */
10014 + tmp_length = xsum (tmp_length, 1);
10018 +# if HAVE_LONG_LONG_INT
10019 + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
10021 + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
10022 + * 0.333334 /* binary -> octal */
10024 + + 1; /* turn floor into ceil */
10027 + if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
10029 + (unsigned int) (sizeof (unsigned long) * CHAR_BIT
10030 + * 0.333334 /* binary -> octal */
10032 + + 1; /* turn floor into ceil */
10035 + (unsigned int) (sizeof (unsigned int) * CHAR_BIT
10036 + * 0.333334 /* binary -> octal */
10038 + + 1; /* turn floor into ceil */
10039 + if (tmp_length < precision)
10040 + tmp_length = precision;
10041 + /* Add 1, to account for a leading sign. */
10042 + tmp_length = xsum (tmp_length, 1);
10045 + case 'x': case 'X':
10046 +# if HAVE_LONG_LONG_INT
10047 + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
10049 + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
10050 + * 0.25 /* binary -> hexadecimal */
10052 + + 1; /* turn floor into ceil */
10055 + if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
10057 + (unsigned int) (sizeof (unsigned long) * CHAR_BIT
10058 + * 0.25 /* binary -> hexadecimal */
10060 + + 1; /* turn floor into ceil */
10063 + (unsigned int) (sizeof (unsigned int) * CHAR_BIT
10064 + * 0.25 /* binary -> hexadecimal */
10066 + + 1; /* turn floor into ceil */
10067 + if (tmp_length < precision)
10068 + tmp_length = precision;
10069 + /* Add 2, to account for a leading sign or alternate form. */
10070 + tmp_length = xsum (tmp_length, 2);
10073 + case 'f': case 'F':
10074 + if (type == TYPE_LONGDOUBLE)
10076 + (unsigned int) (LDBL_MAX_EXP
10077 + * 0.30103 /* binary -> decimal */
10078 + * 2 /* estimate for FLAG_GROUP */
10080 + + 1 /* turn floor into ceil */
10081 + + 10; /* sign, decimal point etc. */
10084 + (unsigned int) (DBL_MAX_EXP
10085 + * 0.30103 /* binary -> decimal */
10086 + * 2 /* estimate for FLAG_GROUP */
10088 + + 1 /* turn floor into ceil */
10089 + + 10; /* sign, decimal point etc. */
10090 + tmp_length = xsum (tmp_length, precision);
10093 + case 'e': case 'E': case 'g': case 'G':
10095 + 12; /* sign, decimal point, exponent etc. */
10096 + tmp_length = xsum (tmp_length, precision);
10099 + case 'a': case 'A':
10100 + if (type == TYPE_LONGDOUBLE)
10102 + (unsigned int) (LDBL_DIG
10103 + * 0.831 /* decimal -> hexadecimal */
10105 + + 1; /* turn floor into ceil */
10108 + (unsigned int) (DBL_DIG
10109 + * 0.831 /* decimal -> hexadecimal */
10111 + + 1; /* turn floor into ceil */
10112 + if (tmp_length < precision)
10113 + tmp_length = precision;
10114 + /* Account for sign, decimal point etc. */
10115 + tmp_length = xsum (tmp_length, 12);
10119 +# if HAVE_WINT_T && !WIDE_CHAR_VERSION
10120 + if (type == TYPE_WIDE_CHAR)
10121 + tmp_length = MB_CUR_MAX;
10129 + if (type == TYPE_WIDE_STRING)
10132 + local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
10134 +# if !WIDE_CHAR_VERSION
10135 + tmp_length = xtimes (tmp_length, MB_CUR_MAX);
10140 + tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
10145 + (unsigned int) (sizeof (void *) * CHAR_BIT
10146 + * 0.25 /* binary -> hexadecimal */
10148 + + 1 /* turn floor into ceil */
10149 + + 2; /* account for leading 0x */
10156 + if (!pad_ourselves)
10158 +# if ENABLE_UNISTDIO
10159 + /* Padding considers the number of characters, therefore
10160 + the number of elements after padding may be
10161 + > max (tmp_length, width)
10163 + <= tmp_length + width. */
10164 + tmp_length = xsum (tmp_length, width);
10166 + /* Padding considers the number of elements,
10168 + if (tmp_length < width)
10169 + tmp_length = width;
10173 + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
10176 + if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
10180 + size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
10182 + if (size_overflow_p (tmp_memsize))
10183 + /* Overflow, would lead to out of memory. */
10184 + goto out_of_memory;
10185 + tmp = (TCHAR_T *) malloc (tmp_memsize);
10187 + /* Out of memory. */
10188 + goto out_of_memory;
10192 + /* Construct the format string for calling snprintf or
10196 +#if NEED_PRINTF_FLAG_GROUPING
10197 + /* The underlying implementation doesn't support the ' flag.
10198 + Produce no grouping characters in this case; this is
10199 + acceptable because the grouping is locale dependent. */
10201 + if (flags & FLAG_GROUP)
10204 + if (flags & FLAG_LEFT)
10206 + if (flags & FLAG_SHOWSIGN)
10208 + if (flags & FLAG_SPACE)
10210 + if (flags & FLAG_ALT)
10212 + if (!pad_ourselves)
10214 + if (flags & FLAG_ZERO)
10216 + if (dp->width_start != dp->width_end)
10218 + size_t n = dp->width_end - dp->width_start;
10219 + /* The width specification is known to consist only
10220 + of standard ASCII characters. */
10221 + if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
10223 + memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
10228 + const FCHAR_T *mp = dp->width_start;
10230 + *fbp++ = (unsigned char) *mp++;
10235 + if (!prec_ourselves)
10237 + if (dp->precision_start != dp->precision_end)
10239 + size_t n = dp->precision_end - dp->precision_start;
10240 + /* The precision specification is known to consist only
10241 + of standard ASCII characters. */
10242 + if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
10244 + memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
10249 + const FCHAR_T *mp = dp->precision_start;
10251 + *fbp++ = (unsigned char) *mp++;
10259 +#if HAVE_LONG_LONG_INT
10260 + case TYPE_LONGLONGINT:
10261 + case TYPE_ULONGLONGINT:
10262 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
10272 + case TYPE_LONGINT:
10273 + case TYPE_ULONGINT:
10275 + case TYPE_WIDE_CHAR:
10278 + case TYPE_WIDE_STRING:
10282 + case TYPE_LONGDOUBLE:
10288 +#if NEED_PRINTF_DIRECTIVE_F
10289 + if (dp->conversion == 'F')
10293 + *fbp = dp->conversion;
10295 +# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
10300 + /* On glibc2 systems from glibc >= 2.3 - probably also older
10301 + ones - we know that snprintf's returns value conforms to
10302 + ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
10303 + Therefore we can avoid using %n in this situation.
10304 + On glibc2 systems from 2004-10-18 or newer, the use of %n
10305 + in format strings in writable memory may crash the program
10306 + (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
10307 + in this situation. */
10308 + /* On native Win32 systems (such as mingw), we can avoid using
10310 + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
10311 + snprintf does not write more than the specified number
10312 + of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
10313 + '4', '5', '6' into buf, not '4', '5', '\0'.)
10314 + - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
10315 + allows us to recognize the case of an insufficient
10316 + buffer size: it returns -1 in this case.
10317 + On native Win32 systems (such as mingw) where the OS is
10318 + Windows Vista, the use of %n in format strings by default
10319 + crashes the program. See
10320 + <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
10321 + <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx>
10322 + So we should avoid %n in this situation. */
10329 + /* Construct the arguments for calling snprintf or sprintf. */
10330 + prefix_count = 0;
10331 + if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
10333 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
10335 + prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
10337 + if (!prec_ourselves && dp->precision_arg_index != ARG_NONE)
10339 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
10341 + prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
10345 + /* The SNPRINTF result is appended after result[0..length].
10346 + The latter is an array of DCHAR_T; SNPRINTF appends an
10347 + array of TCHAR_T to it. This is possible because
10348 + sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
10349 + alignof (TCHAR_T) <= alignof (DCHAR_T). */
10350 +# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T))
10351 + /* Ensure that maxlen below will be >= 2. Needed on BeOS,
10352 + where an snprintf() with maxlen==1 acts like sprintf(). */
10353 + ENSURE_ALLOCATION (xsum (length,
10354 + (2 + TCHARS_PER_DCHAR - 1)
10355 + / TCHARS_PER_DCHAR));
10356 + /* Prepare checking whether snprintf returns the count
10358 + *(TCHAR_T *) (result + length) = '\0';
10366 + int retcount = 0;
10367 + size_t maxlen = allocated - length;
10368 + /* SNPRINTF can fail if its second argument is
10370 + if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
10371 + maxlen = INT_MAX / TCHARS_PER_DCHAR;
10372 + maxlen = maxlen * TCHARS_PER_DCHAR;
10373 +# define SNPRINTF_BUF(arg) \
10374 + switch (prefix_count) \
10377 + retcount = SNPRINTF ((TCHAR_T *) (result + length), \
10382 + retcount = SNPRINTF ((TCHAR_T *) (result + length), \
10384 + prefixes[0], arg, &count); \
10387 + retcount = SNPRINTF ((TCHAR_T *) (result + length), \
10389 + prefixes[0], prefixes[1], arg, \
10396 +# define SNPRINTF_BUF(arg) \
10397 + switch (prefix_count) \
10400 + count = sprintf (tmp, buf, arg); \
10403 + count = sprintf (tmp, buf, prefixes[0], arg); \
10406 + count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
10418 + int arg = a.arg[dp->arg_index].a.a_schar;
10419 + SNPRINTF_BUF (arg);
10424 + unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
10425 + SNPRINTF_BUF (arg);
10430 + int arg = a.arg[dp->arg_index].a.a_short;
10431 + SNPRINTF_BUF (arg);
10434 + case TYPE_USHORT:
10436 + unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
10437 + SNPRINTF_BUF (arg);
10442 + int arg = a.arg[dp->arg_index].a.a_int;
10443 + SNPRINTF_BUF (arg);
10448 + unsigned int arg = a.arg[dp->arg_index].a.a_uint;
10449 + SNPRINTF_BUF (arg);
10452 + case TYPE_LONGINT:
10454 + long int arg = a.arg[dp->arg_index].a.a_longint;
10455 + SNPRINTF_BUF (arg);
10458 + case TYPE_ULONGINT:
10460 + unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
10461 + SNPRINTF_BUF (arg);
10464 +#if HAVE_LONG_LONG_INT
10465 + case TYPE_LONGLONGINT:
10467 + long long int arg = a.arg[dp->arg_index].a.a_longlongint;
10468 + SNPRINTF_BUF (arg);
10471 + case TYPE_ULONGLONGINT:
10473 + unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
10474 + SNPRINTF_BUF (arg);
10478 + case TYPE_DOUBLE:
10480 + double arg = a.arg[dp->arg_index].a.a_double;
10481 + SNPRINTF_BUF (arg);
10484 + case TYPE_LONGDOUBLE:
10486 + long double arg = a.arg[dp->arg_index].a.a_longdouble;
10487 + SNPRINTF_BUF (arg);
10492 + int arg = a.arg[dp->arg_index].a.a_char;
10493 + SNPRINTF_BUF (arg);
10497 + case TYPE_WIDE_CHAR:
10499 + wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
10500 + SNPRINTF_BUF (arg);
10504 + case TYPE_STRING:
10506 + const char *arg = a.arg[dp->arg_index].a.a_string;
10507 + SNPRINTF_BUF (arg);
10511 + case TYPE_WIDE_STRING:
10513 + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
10514 + SNPRINTF_BUF (arg);
10518 + case TYPE_POINTER:
10520 + void *arg = a.arg[dp->arg_index].a.a_pointer;
10521 + SNPRINTF_BUF (arg);
10529 + /* Portability: Not all implementations of snprintf()
10530 + are ISO C 99 compliant. Determine the number of
10531 + bytes that snprintf() has produced or would have
10535 + /* Verify that snprintf() has NUL-terminated its
10537 + if (count < maxlen
10538 + && ((TCHAR_T *) (result + length)) [count] != '\0')
10540 + /* Portability hack. */
10541 + if (retcount > count)
10542 + count = retcount;
10546 + /* snprintf() doesn't understand the '%n'
10548 + if (fbp[1] != '\0')
10550 + /* Don't use the '%n' directive; instead, look
10551 + at the snprintf() return value. */
10557 + /* Look at the snprintf() return value. */
10558 + if (retcount < 0)
10560 + /* HP-UX 10.20 snprintf() is doubly deficient:
10561 + It doesn't understand the '%n' directive,
10562 + *and* it returns -1 (rather than the length
10563 + that would have been required) when the
10564 + buffer is too small. */
10565 + size_t bigger_need =
10566 + xsum (xtimes (allocated, 2), 12);
10567 + ENSURE_ALLOCATION (bigger_need);
10571 + count = retcount;
10576 + /* Attempt to handle failure. */
10579 + if (!(result == resultbuf || result == NULL))
10581 + if (buf_malloced != NULL)
10582 + free (buf_malloced);
10589 + /* Handle overflow of the allocated buffer.
10590 + If such an overflow occurs, a C99 compliant snprintf()
10591 + returns a count >= maxlen. However, a non-compliant
10592 + snprintf() function returns only count = maxlen - 1. To
10593 + cover both cases, test whether count >= maxlen - 1. */
10594 + if ((unsigned int) count + 1 >= maxlen)
10596 + /* If maxlen already has attained its allowed maximum,
10597 + allocating more memory will not increase maxlen.
10598 + Instead of looping, bail out. */
10599 + if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
10603 + /* Need at least (count + 1) * sizeof (TCHAR_T)
10604 + bytes. (The +1 is for the trailing NUL.)
10605 + But ask for (count + 2) * sizeof (TCHAR_T)
10606 + bytes, so that in the next round, we likely get
10607 + maxlen > (unsigned int) count + 1
10608 + and so we don't get here again.
10609 + And allocate proportionally, to avoid looping
10610 + eternally if snprintf() reports a too small
10613 + xmax (xsum (length,
10614 + ((unsigned int) count + 2
10615 + + TCHARS_PER_DCHAR - 1)
10616 + / TCHARS_PER_DCHAR),
10617 + xtimes (allocated, 2));
10619 + ENSURE_ALLOCATION (n);
10625 +#if NEED_PRINTF_UNBOUNDED_PRECISION
10626 + if (prec_ourselves)
10628 + /* Handle the precision. */
10629 + TCHAR_T *prec_ptr =
10631 + (TCHAR_T *) (result + length);
10635 + size_t prefix_count;
10638 + prefix_count = 0;
10639 + /* Put the additional zeroes after the sign. */
10641 + && (*prec_ptr == '-' || *prec_ptr == '+'
10642 + || *prec_ptr == ' '))
10643 + prefix_count = 1;
10644 + /* Put the additional zeroes after the 0x prefix if
10645 + (flags & FLAG_ALT) || (dp->conversion == 'p'). */
10646 + else if (count >= 2
10647 + && prec_ptr[0] == '0'
10648 + && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X'))
10649 + prefix_count = 2;
10651 + move = count - prefix_count;
10652 + if (precision > move)
10654 + /* Insert zeroes. */
10655 + size_t insert = precision - move;
10656 + TCHAR_T *prec_end;
10661 + (count + insert + TCHARS_PER_DCHAR - 1)
10662 + / TCHARS_PER_DCHAR);
10663 + length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
10664 + ENSURE_ALLOCATION (n);
10665 + length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
10666 + prec_ptr = (TCHAR_T *) (result + length);
10669 + prec_end = prec_ptr + count;
10670 + prec_ptr += prefix_count;
10672 + while (prec_end > prec_ptr)
10675 + prec_end[insert] = prec_end[0];
10678 + prec_end += insert;
10680 + *--prec_end = '0';
10681 + while (prec_end > prec_ptr);
10689 + if (count >= tmp_length)
10690 + /* tmp_length was incorrectly calculated - fix the
10695 +#if !DCHAR_IS_TCHAR
10696 + /* Convert from TCHAR_T[] to DCHAR_T[]. */
10697 + if (dp->conversion == 'c' || dp->conversion == 's')
10699 + /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
10700 + TYPE_WIDE_STRING.
10701 + The result string is not certainly ASCII. */
10702 + const TCHAR_T *tmpsrc;
10704 + size_t tmpdst_len;
10705 + /* This code assumes that TCHAR_T is 'char'. */
10706 + typedef int TCHAR_T_verify
10707 + [2 * (sizeof (TCHAR_T) == 1) - 1];
10709 + tmpsrc = (TCHAR_T *) (result + length);
10715 + if (DCHAR_CONV_FROM_ENCODING (locale_charset (),
10716 + iconveh_question_mark,
10719 + &tmpdst, &tmpdst_len)
10722 + int saved_errno = errno;
10723 + if (!(result == resultbuf || result == NULL))
10725 + if (buf_malloced != NULL)
10726 + free (buf_malloced);
10728 + errno = saved_errno;
10731 + ENSURE_ALLOCATION (xsum (length, tmpdst_len));
10732 + DCHAR_CPY (result + length, tmpdst, tmpdst_len);
10734 + count = tmpdst_len;
10738 + /* The result string is ASCII.
10739 + Simple 1:1 conversion. */
10741 + /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
10742 + no-op conversion, in-place on the array starting
10743 + at (result + length). */
10744 + if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
10747 + const TCHAR_T *tmpsrc;
10752 + if (result == resultbuf)
10754 + tmpsrc = (TCHAR_T *) (result + length);
10755 + /* ENSURE_ALLOCATION will not move tmpsrc
10756 + (because it's part of resultbuf). */
10757 + ENSURE_ALLOCATION (xsum (length, count));
10761 + /* ENSURE_ALLOCATION will move the array
10762 + (because it uses realloc(). */
10763 + ENSURE_ALLOCATION (xsum (length, count));
10764 + tmpsrc = (TCHAR_T *) (result + length);
10768 + ENSURE_ALLOCATION (xsum (length, count));
10770 + tmpdst = result + length;
10771 + /* Copy backwards, because of overlapping. */
10774 + for (n = count; n > 0; n--)
10775 + *--tmpdst = (unsigned char) *--tmpsrc;
10780 +#if DCHAR_IS_TCHAR && !USE_SNPRINTF
10781 + /* Make room for the result. */
10782 + if (count > allocated - length)
10784 + /* Need at least count elements. But allocate
10785 + proportionally. */
10787 + xmax (xsum (length, count), xtimes (allocated, 2));
10789 + ENSURE_ALLOCATION (n);
10793 + /* Here count <= allocated - length. */
10795 + /* Perform padding. */
10796 +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
10797 + if (pad_ourselves && has_width)
10800 +# if ENABLE_UNISTDIO
10801 + /* Outside POSIX, it's preferrable to compare the width
10802 + against the number of _characters_ of the converted
10804 + w = DCHAR_MBSNLEN (result + length, count);
10806 + /* The width is compared against the number of _bytes_
10807 + of the converted value, says POSIX. */
10812 + size_t pad = width - w;
10814 + /* Make room for the result. */
10815 + if (xsum (count, pad) > allocated - length)
10817 + /* Need at least count + pad elements. But
10818 + allocate proportionally. */
10820 + xmax (xsum3 (length, count, pad),
10821 + xtimes (allocated, 2));
10825 + ENSURE_ALLOCATION (n);
10828 + ENSURE_ALLOCATION (n);
10831 + /* Here count + pad <= allocated - length. */
10834 +# if !DCHAR_IS_TCHAR || USE_SNPRINTF
10835 + DCHAR_T * const rp = result + length;
10837 + DCHAR_T * const rp = tmp;
10839 + DCHAR_T *p = rp + count;
10840 + DCHAR_T *end = p + pad;
10841 + DCHAR_T *pad_ptr;
10842 +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
10843 + if (dp->conversion == 'c'
10844 + || dp->conversion == 's')
10845 + /* No zero-padding for string directives. */
10850 + pad_ptr = (*rp == '-' ? rp + 1 : rp);
10851 + /* No zero-padding of "inf" and "nan". */
10852 + if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
10853 + || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
10856 + /* The generated string now extends from rp to p,
10857 + with the zero padding insertion point being at
10860 + count = count + pad; /* = end - rp */
10862 + if (flags & FLAG_LEFT)
10864 + /* Pad with spaces on the right. */
10865 + for (; pad > 0; pad--)
10868 + else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
10870 + /* Pad with zeroes. */
10871 + DCHAR_T *q = end;
10873 + while (p > pad_ptr)
10875 + for (; pad > 0; pad--)
10880 + /* Pad with spaces on the left. */
10881 + DCHAR_T *q = end;
10885 + for (; pad > 0; pad--)
10893 + /* Here still count <= allocated - length. */
10895 +#if !DCHAR_IS_TCHAR || USE_SNPRINTF
10896 + /* The snprintf() result did fit. */
10898 + /* Append the sprintf() result. */
10899 + memcpy (result + length, tmp, count * sizeof (DCHAR_T));
10902 + if (tmp != tmpbuf)
10906 +#if NEED_PRINTF_DIRECTIVE_F
10907 + if (dp->conversion == 'F')
10909 + /* Convert the %f result to upper case for %F. */
10910 + DCHAR_T *rp = result + length;
10912 + for (rc = count; rc > 0; rc--, rp++)
10913 + if (*rp >= 'a' && *rp <= 'z')
10914 + *rp = *rp - 'a' + 'A';
10925 + /* Add the final NUL. */
10926 + ENSURE_ALLOCATION (xsum (length, 1));
10927 + result[length] = '\0';
10929 + if (result != resultbuf && length + 1 < allocated)
10931 + /* Shrink the allocated memory if possible. */
10934 + memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
10935 + if (memory != NULL)
10939 + if (buf_malloced != NULL)
10940 + free (buf_malloced);
10942 + *lengthp = length;
10943 + /* Note that we can produce a big string of a length > INT_MAX. POSIX
10944 + says that snprintf() fails with errno = EOVERFLOW in this case, but
10945 + that's only because snprintf() returns an 'int'. This function does
10946 + not have this limitation. */
10951 + if (!(result == resultbuf || result == NULL))
10953 + if (buf_malloced != NULL)
10954 + free (buf_malloced);
10956 + errno = EOVERFLOW;
10961 + if (!(result == resultbuf || result == NULL))
10963 + if (buf_malloced != NULL)
10964 + free (buf_malloced);
10972 +#undef TCHARS_PER_DCHAR
10974 +#undef USE_SNPRINTF
10976 +#undef PRINTF_PARSE
10979 +#undef DCHAR_IS_TCHAR
10984 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/vasnprintf.h gtk-vnc-0.3.7.gnulib/gnulib/lib/vasnprintf.h
10985 --- gtk-vnc-0.3.7.dan3/gnulib/lib/vasnprintf.h 1970-01-01 01:00:00.000000000 +0100
10986 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/vasnprintf.h 2008-10-09 15:24:52.000000000 +0100
10988 +/* vsprintf with automatic memory allocation.
10989 + Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc.
10991 + This program is free software; you can redistribute it and/or modify
10992 + it under the terms of the GNU Lesser General Public License as published by
10993 + the Free Software Foundation; either version 2.1, or (at your option)
10994 + any later version.
10996 + This program is distributed in the hope that it will be useful,
10997 + but WITHOUT ANY WARRANTY; without even the implied warranty of
10998 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10999 + GNU Lesser General Public License for more details.
11001 + You should have received a copy of the GNU Lesser General Public License along
11002 + with this program; if not, write to the Free Software Foundation,
11003 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
11005 +#ifndef _VASNPRINTF_H
11006 +#define _VASNPRINTF_H
11008 +/* Get va_list. */
11009 +#include <stdarg.h>
11012 +#include <stddef.h>
11014 +#ifndef __attribute__
11015 +/* This feature is available in gcc versions 2.5 and later. */
11016 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
11017 +# define __attribute__(Spec) /* empty */
11019 +/* The __-protected variants of `format' and `printf' attributes
11020 + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
11021 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
11022 +# define __format__ format
11023 +# define __printf__ printf
11027 +#ifdef __cplusplus
11031 +/* Write formatted output to a string dynamically allocated with malloc().
11032 + You can pass a preallocated buffer for the result in RESULTBUF and its
11033 + size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
11034 + If successful, return the address of the string (this may be = RESULTBUF
11035 + if no dynamic memory allocation was necessary) and set *LENGTHP to the
11036 + number of resulting bytes, excluding the trailing NUL. Upon error, set
11037 + errno and return NULL.
11039 + When dynamic memory allocation occurs, the preallocated buffer is left
11040 + alone (with possibly modified contents). This makes it possible to use
11041 + a statically allocated or stack-allocated buffer, like this:
11044 + size_t len = sizeof (buf);
11045 + char *output = vasnprintf (buf, &len, format, args);
11046 + if (output == NULL)
11047 + ... error handling ...;
11050 + ... use the output string ...;
11051 + if (output != buf)
11055 +#if REPLACE_VASNPRINTF
11056 +# define asnprintf rpl_asnprintf
11057 +# define vasnprintf rpl_vasnprintf
11059 +extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
11060 + __attribute__ ((__format__ (__printf__, 3, 4)));
11061 +extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
11062 + __attribute__ ((__format__ (__printf__, 3, 0)));
11064 +#ifdef __cplusplus
11068 +#endif /* _VASNPRINTF_H */
11069 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/wchar.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/wchar.in.h
11070 --- gtk-vnc-0.3.7.dan3/gnulib/lib/wchar.in.h 1970-01-01 01:00:00.000000000 +0100
11071 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/wchar.in.h 2008-10-09 15:24:52.000000000 +0100
11073 +/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
11075 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
11077 + This program is free software; you can redistribute it and/or modify
11078 + it under the terms of the GNU Lesser General Public License as published by
11079 + the Free Software Foundation; either version 2.1, or (at your option)
11080 + any later version.
11082 + This program is distributed in the hope that it will be useful,
11083 + but WITHOUT ANY WARRANTY; without even the implied warranty of
11084 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11085 + GNU Lesser General Public License for more details.
11087 + You should have received a copy of the GNU Lesser General Public License
11088 + along with this program; if not, write to the Free Software Foundation,
11089 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
11091 +/* Written by Eric Blake. */
11094 + * ISO C 99 <wchar.h> for platforms that have issues.
11095 + * <http://www.opengroup.org/susv3xbd/wchar.h.html>
11097 + * For now, this just ensures proper prerequisite inclusion order and
11098 + * the declaration of wcwidth().
11101 +@PRAGMA_SYSTEM_HEADER@
11103 +#ifdef __need_mbstate_t
11104 +/* Special invocation convention inside uClibc header files. */
11106 +#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
11109 +/* Normal invocation convention. */
11111 +#ifndef _GL_WCHAR_H
11113 +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
11115 + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
11116 + included before <wchar.h>. */
11117 +#include <stddef.h>
11118 +#include <stdio.h>
11121 +/* Include the original <wchar.h> if it exists.
11122 + Some builds of uClibc lack it. */
11123 +/* The include_next requires a split double-inclusion guard. */
11124 +#if @HAVE_WCHAR_H@
11125 +# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
11128 +#ifndef _GL_WCHAR_H
11129 +#define _GL_WCHAR_H
11131 +/* The definition of GL_LINK_WARNING is copied here. */
11133 +#ifdef __cplusplus
11138 +/* Define wint_t. (Also done in wctype.in.h.) */
11139 +#if !@HAVE_WINT_T@ && !defined wint_t
11140 +# define wint_t int
11144 +/* Return the number of screen columns needed for WC. */
11145 +#if @GNULIB_WCWIDTH@
11146 +# if @REPLACE_WCWIDTH@
11148 +# define wcwidth rpl_wcwidth
11149 +extern int wcwidth (wchar_t);
11151 +# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
11152 +/* wcwidth exists but is not declared. */
11153 +extern int wcwidth (int /* actually wchar_t */);
11156 +#elif defined GNULIB_POSIXCHECK
11158 +# define wcwidth(w) \
11159 + (GL_LINK_WARNING ("wcwidth is unportable - " \
11160 + "use gnulib module wcwidth for portability"), \
11165 +#ifdef __cplusplus
11169 +#endif /* _GL_WCHAR_H */
11170 +#endif /* _GL_WCHAR_H */
11172 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/winsock.c gtk-vnc-0.3.7.gnulib/gnulib/lib/winsock.c
11173 --- gtk-vnc-0.3.7.dan3/gnulib/lib/winsock.c 1970-01-01 01:00:00.000000000 +0100
11174 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/winsock.c 2008-10-09 15:24:52.000000000 +0100
11176 +/* winsock.c --- wrappers for Windows socket functions
11178 + Copyright (C) 2008 Free Software Foundation, Inc.
11180 + This program is free software: you can redistribute it and/or modify
11181 + it under the terms of the GNU Lesser General Public License as published by
11182 + the Free Software Foundation; either version 2.1 of the License, or
11183 + (at your option) any later version.
11185 + This program is distributed in the hope that it will be useful,
11186 + but WITHOUT ANY WARRANTY; without even the implied warranty of
11187 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11188 + GNU Lesser General Public License for more details.
11190 + You should have received a copy of the GNU Lesser General Public License
11191 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
11193 +/* Written by Paolo Bonzini */
11195 +#include <config.h>
11196 +#include <stdio.h>
11197 +#include <string.h>
11198 +#include <errno.h>
11199 +#include <fcntl.h>
11201 +#include <sys/socket.h>
11208 +#undef getpeername
11209 +#undef getsockname
11218 +# define FD_TO_SOCKET(fd) ((SOCKET) _get_osfhandle ((fd)))
11219 +# define SOCKET_TO_FD(fh) (_open_osfhandle ((long) (fh), O_RDWR | O_BINARY))
11222 +/* Wrappers for libc functions. */
11225 +rpl_close (int fd)
11227 + SOCKET sock = FD_TO_SOCKET (fd);
11228 + WSANETWORKEVENTS ev;
11230 + ev.lNetworkEvents = 0xDEADBEEF;
11231 + WSAEnumNetworkEvents (sock, NULL, &ev);
11232 + if (ev.lNetworkEvents != 0xDEADBEEF)
11234 + /* FIXME: other applications, like squid, use an undocumented
11235 + _free_osfhnd free function. Instead, here we just close twice
11236 + the file descriptor. I could not get the former to work
11237 + (pb, Sep 22 2008). */
11238 + int r = closesocket (sock);
11243 + return _close (fd);
11247 +/* Wrappers for WinSock functions. */
11249 +static inline void
11250 +set_winsock_errno (void)
11252 + int err = WSAGetLastError ();
11253 + WSASetLastError (0);
11255 + /* Map some WSAE* errors to the runtime library's error codes. */
11258 + case WSA_INVALID_HANDLE:
11261 + case WSA_NOT_ENOUGH_MEMORY:
11264 + case WSA_INVALID_PARAMETER:
11267 + case WSAEWOULDBLOCK:
11268 + errno = EWOULDBLOCK;
11270 + case WSAENAMETOOLONG:
11271 + errno = ENAMETOOLONG;
11273 + case WSAENOTEMPTY:
11274 + errno = ENOTEMPTY;
11277 + errno = (err > 10000 && err < 10025) ? err - 10000 : err;
11284 +rpl_socket (int domain, int type, int protocol)
11286 + /* We have to use WSASocket() to create non-overlapped IO sockets.
11287 + Overlapped IO sockets cannot be used with read/write. */
11288 + SOCKET fh = WSASocket (domain, type, protocol, NULL, 0, 0);
11290 + if (fh == INVALID_SOCKET)
11292 + set_winsock_errno ();
11296 + return SOCKET_TO_FD (fh);
11300 +#if GNULIB_CONNECT
11302 +rpl_connect (int fd, struct sockaddr *sockaddr, int len)
11304 + SOCKET sock = FD_TO_SOCKET (fd);
11305 + int r = connect (sock, sockaddr, len);
11308 + /* EINPROGRESS is not returned by WinSock 2.0; for backwards
11309 + compatibility, connect(2) uses EWOULDBLOCK. */
11310 + if (WSAGetLastError () == WSAEWOULDBLOCK)
11311 + WSASetLastError (WSAEINPROGRESS);
11313 + set_winsock_errno ();
11322 +rpl_accept (int fd, struct sockaddr *addr, int *addrlen)
11324 + SOCKET fh = accept (FD_TO_SOCKET (fd), addr, addrlen);
11325 + if (fh == INVALID_SOCKET)
11327 + set_winsock_errno ();
11331 + return SOCKET_TO_FD (fh);
11337 +rpl_bind (int fd, struct sockaddr *sockaddr, int len)
11339 + SOCKET sock = FD_TO_SOCKET (fd);
11340 + int r = bind (sock, sockaddr, len);
11342 + set_winsock_errno ();
11348 +#if GNULIB_GETPEERNAME
11350 +rpl_getpeername (int fd, struct sockaddr *addr, int *addrlen)
11352 + SOCKET sock = FD_TO_SOCKET (fd);
11353 + int r = getpeername (sock, addr, addrlen);
11355 + set_winsock_errno ();
11361 +#if GNULIB_GETSOCKNAME
11363 +rpl_getsockname (int fd, struct sockaddr *addr, int *addrlen)
11365 + SOCKET sock = FD_TO_SOCKET (fd);
11366 + int r = getsockname (sock, addr, addrlen);
11368 + set_winsock_errno ();
11374 +#if GNULIB_GETSOCKOPT
11376 +rpl_getsockopt (int fd, int level, int optname, void *optval, int *optlen)
11378 + SOCKET sock = FD_TO_SOCKET (fd);
11379 + int r = getsockopt (sock, level, optname, optval, optlen);
11381 + set_winsock_errno ();
11389 +rpl_listen (int fd, int backlog)
11391 + SOCKET sock = FD_TO_SOCKET (fd);
11392 + int r = listen (sock, backlog);
11394 + set_winsock_errno ();
11401 +rpl_ioctl (int fd, unsigned long req, char *buf)
11403 + SOCKET sock = FD_TO_SOCKET (fd);
11404 + int r = ioctlsocket (sock, req, (void *) buf);
11406 + set_winsock_errno ();
11413 +rpl_recv (int fd, void *buf, int len, int flags)
11415 + SOCKET sock = FD_TO_SOCKET (fd);
11416 + int r = recv (sock, buf, len, flags);
11418 + set_winsock_errno ();
11426 +rpl_send (int fd, const void *buf, int len, int flags)
11428 + SOCKET sock = FD_TO_SOCKET (fd);
11429 + int r = send (sock, buf, len, flags);
11431 + set_winsock_errno ();
11437 +#if GNULIB_RECVFROM
11439 +rpl_recvfrom (int fd, void *buf, int len, int flags, struct sockaddr *from,
11442 + int frombufsize = *fromlen;
11443 + SOCKET sock = FD_TO_SOCKET (fd);
11444 + int r = recvfrom (sock, buf, len, flags, from, fromlen);
11447 + set_winsock_errno ();
11449 + /* Winsock recvfrom() only returns a valid 'from' when the socket is
11450 + connectionless. POSIX gives a valid 'from' for all types of sockets. */
11451 + else if (*fromlen == frombufsize)
11452 + rpl_getpeername (fd, from, fromlen);
11460 +rpl_sendto (int fd, const void *buf, int len, int flags,
11461 + struct sockaddr *to, int tolen)
11463 + SOCKET sock = FD_TO_SOCKET (fd);
11464 + int r = sendto (sock, buf, len, flags, to, tolen);
11466 + set_winsock_errno ();
11472 +#if GNULIB_SETSOCKOPT
11474 +rpl_setsockopt (int fd, int level, int optname, const void *optval, int optlen)
11476 + SOCKET sock = FD_TO_SOCKET (fd);
11477 + int r = setsockopt (sock, level, optname, optval, optlen);
11479 + set_winsock_errno ();
11484 diff -urN gtk-vnc-0.3.7.dan3/gnulib/lib/xsize.h gtk-vnc-0.3.7.gnulib/gnulib/lib/xsize.h
11485 --- gtk-vnc-0.3.7.dan3/gnulib/lib/xsize.h 1970-01-01 01:00:00.000000000 +0100
11486 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/xsize.h 2008-10-09 15:24:52.000000000 +0100
11488 +/* xsize.h -- Checked size_t computations.
11490 + Copyright (C) 2003, 2008 Free Software Foundation, Inc.
11492 + This program is free software; you can redistribute it and/or modify
11493 + it under the terms of the GNU Lesser General Public License as published by
11494 + the Free Software Foundation; either version 2.1, or (at your option)
11495 + any later version.
11497 + This program is distributed in the hope that it will be useful,
11498 + but WITHOUT ANY WARRANTY; without even the implied warranty of
11499 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11500 + GNU Lesser General Public License for more details.
11502 + You should have received a copy of the GNU Lesser General Public License
11503 + along with this program; if not, write to the Free Software Foundation,
11504 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
11510 +#include <stddef.h>
11512 +/* Get SIZE_MAX. */
11513 +#include <limits.h>
11515 +# include <stdint.h>
11518 +/* The size of memory objects is often computed through expressions of
11519 + type size_t. Example:
11520 + void* p = malloc (header_size + n * element_size).
11521 + These computations can lead to overflow. When this happens, malloc()
11522 + returns a piece of memory that is way too small, and the program then
11523 + crashes while attempting to fill the memory.
11524 + To avoid this, the functions and macros in this file check for overflow.
11525 + The convention is that SIZE_MAX represents overflow.
11526 + malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
11527 + implementation that uses mmap --, it's recommended to use size_overflow_p()
11528 + or size_in_bounds_p() before invoking malloc().
11529 + The example thus becomes:
11530 + size_t size = xsum (header_size, xtimes (n, element_size));
11531 + void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
11534 +/* Convert an arbitrary value >= 0 to type size_t. */
11535 +#define xcast_size_t(N) \
11536 + ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
11538 +/* Sum of two sizes, with overflow check. */
11539 +static inline size_t
11541 +__attribute__ ((__pure__))
11543 +xsum (size_t size1, size_t size2)
11545 + size_t sum = size1 + size2;
11546 + return (sum >= size1 ? sum : SIZE_MAX);
11549 +/* Sum of three sizes, with overflow check. */
11550 +static inline size_t
11552 +__attribute__ ((__pure__))
11554 +xsum3 (size_t size1, size_t size2, size_t size3)
11556 + return xsum (xsum (size1, size2), size3);
11559 +/* Sum of four sizes, with overflow check. */
11560 +static inline size_t
11562 +__attribute__ ((__pure__))
11564 +xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
11566 + return xsum (xsum (xsum (size1, size2), size3), size4);
11569 +/* Maximum of two sizes, with overflow check. */
11570 +static inline size_t
11572 +__attribute__ ((__pure__))
11574 +xmax (size_t size1, size_t size2)
11576 + /* No explicit check is needed here, because for any n:
11577 + max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
11578 + return (size1 >= size2 ? size1 : size2);
11581 +/* Multiplication of a count with an element size, with overflow check.
11582 + The count must be >= 0 and the element size must be > 0.
11583 + This is a macro, not an inline function, so that it works correctly even
11584 + when N is of a wider type and N > SIZE_MAX. */
11585 +#define xtimes(N, ELSIZE) \
11586 + ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
11588 +/* Check for overflow. */
11589 +#define size_overflow_p(SIZE) \
11590 + ((SIZE) == SIZE_MAX)
11591 +/* Check against overflow. */
11592 +#define size_in_bounds_p(SIZE) \
11593 + ((SIZE) != SIZE_MAX)
11595 +#endif /* _XSIZE_H */
11596 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/alloca.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/alloca.m4
11597 --- gtk-vnc-0.3.7.dan3/gnulib/m4/alloca.m4 1970-01-01 01:00:00.000000000 +0100
11598 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/alloca.m4 2008-10-09 15:24:52.000000000 +0100
11600 +# alloca.m4 serial 8
11601 +dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc.
11602 +dnl This file is free software; the Free Software Foundation
11603 +dnl gives unlimited permission to copy and/or distribute it,
11604 +dnl with or without modifications, as long as this notice is preserved.
11606 +AC_DEFUN([gl_FUNC_ALLOCA],
11608 + dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
11609 + AC_REQUIRE([AC_PROG_CPP])
11610 + AC_REQUIRE([AC_PROG_EGREP])
11612 + AC_REQUIRE([AC_FUNC_ALLOCA])
11613 + if test $ac_cv_func_alloca_works = no; then
11617 + # Define an additional variable used in the Makefile substitution.
11618 + if test $ac_cv_working_alloca_h = yes; then
11619 + AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
11620 + AC_EGREP_CPP([Need own alloca], [
11621 +#if defined __GNUC__ || defined _AIX || defined _MSC_VER
11624 + ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
11626 + if test $gl_cv_rpl_alloca = yes; then
11627 + dnl OK, alloca can be implemented through a compiler built-in.
11628 + AC_DEFINE([HAVE_ALLOCA], 1,
11629 + [Define to 1 if you have 'alloca' after including <alloca.h>,
11630 + a header that may be supplied by this distribution.])
11631 + ALLOCA_H=alloca.h
11633 + dnl alloca exists as a library function, i.e. it is slow and probably
11634 + dnl a memory leak. Don't define HAVE_ALLOCA in this case.
11638 + ALLOCA_H=alloca.h
11640 + AC_SUBST([ALLOCA_H])
11643 +# Prerequisites of lib/alloca.c.
11644 +# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
11645 +AC_DEFUN([gl_PREREQ_ALLOCA], [:])
11646 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/arpa_inet_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/arpa_inet_h.m4
11647 --- gtk-vnc-0.3.7.dan3/gnulib/m4/arpa_inet_h.m4 1970-01-01 01:00:00.000000000 +0100
11648 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/arpa_inet_h.m4 2008-10-09 15:24:52.000000000 +0100
11650 +# arpa_inet_h.m4 serial 5
11651 +dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc.
11652 +dnl This file is free software; the Free Software Foundation
11653 +dnl gives unlimited permission to copy and/or distribute it,
11654 +dnl with or without modifications, as long as this notice is preserved.
11656 +dnl Written by Simon Josefsson and Bruno Haible
11658 +AC_DEFUN([gl_HEADER_ARPA_INET],
11660 + dnl Use AC_REQUIRE here, so that the default behavior below is expanded
11661 + dnl once only, before all statements that occur in other macros.
11662 + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
11664 + AC_CHECK_HEADERS_ONCE([arpa/inet.h])
11665 + if test $ac_cv_header_arpa_inet_h = yes; then
11666 + HAVE_ARPA_INET_H=1
11668 + ARPA_INET_H='arpa/inet.h'
11669 + HAVE_ARPA_INET_H=0
11671 + AC_SUBST([HAVE_ARPA_INET_H])
11672 + dnl Execute this unconditionally, because ARPA_INET_H may be set by other
11673 + dnl modules, after this code is executed.
11674 + gl_CHECK_NEXT_HEADERS([arpa/inet.h])
11677 +dnl Unconditionally enables the replacement of <arpa/inet.h>.
11678 +AC_DEFUN([gl_REPLACE_ARPA_INET_H],
11680 + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
11681 + ARPA_INET_H='arpa/inet.h'
11684 +AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
11686 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
11687 + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
11688 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
11691 +AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
11693 + GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
11694 + GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
11695 + dnl Assume proper GNU behavior unless another module says otherwise.
11696 + HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
11697 + HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
11698 + ARPA_INET_H=''; AC_SUBST([ARPA_INET_H])
11700 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/errno_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/errno_h.m4
11701 --- gtk-vnc-0.3.7.dan3/gnulib/m4/errno_h.m4 1970-01-01 01:00:00.000000000 +0100
11702 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/errno_h.m4 2008-10-09 15:24:52.000000000 +0100
11704 +# errno_h.m4 serial 1
11705 +dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc.
11706 +dnl This file is free software; the Free Software Foundation
11707 +dnl gives unlimited permission to copy and/or distribute it,
11708 +dnl with or without modifications, as long as this notice is preserved.
11710 +AC_DEFUN([gl_HEADER_ERRNO_H],
11712 + dnl Use AC_REQUIRE here, so that the default behavior below is expanded
11713 + dnl once only, before all statements that occur in other macros.
11714 + AC_REQUIRE([gl_HEADER_ERRNO_H_BODY])
11717 +AC_DEFUN([gl_HEADER_ERRNO_H_BODY],
11719 + AC_REQUIRE([AC_PROG_CC])
11720 + AC_CACHE_CHECK([for complete errno.h], gl_cv_header_errno_h_complete, [
11721 + AC_EGREP_CPP(booboo,[
11722 +#include <errno.h>
11723 +#if !defined ENOMSG
11726 +#if !defined EIDRM
11729 +#if !defined ENOLINK
11732 +#if !defined EPROTO
11735 +#if !defined EMULTIHOP
11738 +#if !defined EBADMSG
11741 +#if !defined EOVERFLOW
11744 +#if !defined ENOTSUP
11747 +#if !defined ECANCELED
11751 + [gl_cv_header_errno_h_complete=no],
11752 + [gl_cv_header_errno_h_complete=yes])
11754 + if test $gl_cv_header_errno_h_complete = yes; then
11757 + gl_CHECK_NEXT_HEADERS([errno.h])
11758 + ERRNO_H='errno.h'
11760 + AC_SUBST([ERRNO_H])
11761 + gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
11762 + gl_REPLACE_ERRNO_VALUE([ENOLINK])
11763 + gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
11766 +# Assuming $1 = EOVERFLOW.
11767 +# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
11768 +# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
11769 +# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
11770 +# Check for the value of EOVERFLOW.
11771 +# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
11772 +AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
11774 + if test -n "$ERRNO_H"; then
11775 + AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
11776 + AC_EGREP_CPP(yes,[
11777 +#include <errno.h>
11782 + [gl_cv_header_errno_h_]$1[=yes],
11783 + [gl_cv_header_errno_h_]$1[=no])
11784 + if test $gl_cv_header_errno_h_]$1[ = no; then
11785 + AC_EGREP_CPP(yes,[
11786 +#define _XOPEN_SOURCE_EXTENDED 1
11787 +#include <errno.h>
11791 + ], [gl_cv_header_errno_h_]$1[=hidden])
11792 + if test $gl_cv_header_errno_h_]$1[ = hidden; then
11793 + dnl The macro exists but is hidden.
11794 + dnl Define it to the same value.
11795 + AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
11796 +#define _XOPEN_SOURCE_EXTENDED 1
11797 +#include <errno.h>
11798 +/* The following two lines are a workaround against an autoconf-2.52 bug. */
11799 +#include <stdio.h>
11800 +#include <stdlib.h>
11805 + case $gl_cv_header_errno_h_]$1[ in
11807 + ]$1[_HIDDEN=0; ]$1[_VALUE=
11810 + ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
11813 + AC_SUBST($1[_HIDDEN])
11814 + AC_SUBST($1[_VALUE])
11817 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/extensions.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/extensions.m4
11818 --- gtk-vnc-0.3.7.dan3/gnulib/m4/extensions.m4 1970-01-01 01:00:00.000000000 +0100
11819 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/extensions.m4 2008-10-09 15:24:52.000000000 +0100
11821 +# serial 5 -*- Autoconf -*-
11822 +# Enable extensions on systems that normally disable them.
11824 +# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
11825 +# This file is free software; the Free Software Foundation
11826 +# gives unlimited permission to copy and/or distribute it,
11827 +# with or without modifications, as long as this notice is preserved.
11829 +# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
11830 +# Autoconf. Perhaps we can remove this once we can assume Autoconf
11831 +# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
11832 +# enough in this area it's likely we'll need to redefine
11833 +# AC_USE_SYSTEM_EXTENSIONS for quite some time.
11835 +# AC_USE_SYSTEM_EXTENSIONS
11836 +# ------------------------
11837 +# Enable extensions on systems that normally disable them,
11838 +# typically due to standards-conformance issues.
11839 +# Remember that #undef in AH_VERBATIM gets replaced with #define by
11840 +# AC_DEFINE. The goal here is to define all known feature-enabling
11841 +# macros, then, if reports of conflicts are made, disable macros that
11842 +# cause problems on some platforms (such as __EXTENSIONS__).
11843 +AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
11844 +[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
11845 +AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
11847 + AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
11848 + if test "$MINIX" = yes; then
11849 + AC_DEFINE([_POSIX_SOURCE], [1],
11850 + [Define to 1 if you need to in order for `stat' and other
11851 + things to work.])
11852 + AC_DEFINE([_POSIX_1_SOURCE], [2],
11853 + [Define to 2 if the system does not provide POSIX.1 features
11854 + except with this defined.])
11855 + AC_DEFINE([_MINIX], [1],
11856 + [Define to 1 if on MINIX.])
11859 + AH_VERBATIM([__EXTENSIONS__],
11860 +[/* Enable extensions on AIX 3, Interix. */
11861 +#ifndef _ALL_SOURCE
11862 +# undef _ALL_SOURCE
11864 +/* Enable GNU extensions on systems that have them. */
11865 +#ifndef _GNU_SOURCE
11866 +# undef _GNU_SOURCE
11868 +/* Enable threading extensions on Solaris. */
11869 +#ifndef _POSIX_PTHREAD_SEMANTICS
11870 +# undef _POSIX_PTHREAD_SEMANTICS
11872 +/* Enable extensions on HP NonStop. */
11873 +#ifndef _TANDEM_SOURCE
11874 +# undef _TANDEM_SOURCE
11876 +/* Enable general extensions on Solaris. */
11877 +#ifndef __EXTENSIONS__
11878 +# undef __EXTENSIONS__
11881 + AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
11882 + [ac_cv_safe_to_define___extensions__],
11883 + [AC_COMPILE_IFELSE(
11884 + [AC_LANG_PROGRAM([[
11885 +# define __EXTENSIONS__ 1
11886 + ]AC_INCLUDES_DEFAULT])],
11887 + [ac_cv_safe_to_define___extensions__=yes],
11888 + [ac_cv_safe_to_define___extensions__=no])])
11889 + test $ac_cv_safe_to_define___extensions__ = yes &&
11890 + AC_DEFINE([__EXTENSIONS__])
11891 + AC_DEFINE([_ALL_SOURCE])
11892 + AC_DEFINE([_GNU_SOURCE])
11893 + AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
11894 + AC_DEFINE([_TANDEM_SOURCE])
11895 +])# AC_USE_SYSTEM_EXTENSIONS
11897 +# gl_USE_SYSTEM_EXTENSIONS
11898 +# ------------------------
11899 +# Enable extensions on systems that normally disable them,
11900 +# typically due to standards-conformance issues.
11901 +AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
11902 + [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
11903 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/float_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/float_h.m4
11904 --- gtk-vnc-0.3.7.dan3/gnulib/m4/float_h.m4 1970-01-01 01:00:00.000000000 +0100
11905 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/float_h.m4 2008-10-09 15:24:52.000000000 +0100
11907 +# float_h.m4 serial 3
11908 +dnl Copyright (C) 2007 Free Software Foundation, Inc.
11909 +dnl This file is free software; the Free Software Foundation
11910 +dnl gives unlimited permission to copy and/or distribute it,
11911 +dnl with or without modifications, as long as this notice is preserved.
11913 +AC_DEFUN([gl_FLOAT_H],
11915 + AC_REQUIRE([AC_PROG_CC])
11916 + AC_REQUIRE([AC_CANONICAL_HOST])
11918 + case "$host_os" in
11919 + beos* | openbsd*)
11921 + gl_CHECK_NEXT_HEADERS([float.h])
11924 + AC_SUBST([FLOAT_H])
11926 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/getaddrinfo.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/getaddrinfo.m4
11927 --- gtk-vnc-0.3.7.dan3/gnulib/m4/getaddrinfo.m4 1970-01-01 01:00:00.000000000 +0100
11928 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/getaddrinfo.m4 2008-10-09 15:24:52.000000000 +0100
11930 +# getaddrinfo.m4 serial 15
11931 +dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
11932 +dnl This file is free software; the Free Software Foundation
11933 +dnl gives unlimited permission to copy and/or distribute it,
11934 +dnl with or without modifications, as long as this notice is preserved.
11936 +AC_DEFUN([gl_GETADDRINFO],
11938 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
11939 + AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
11941 + AC_CHECK_HEADERS_ONCE(netdb.h)
11943 + AC_SEARCH_LIBS(getaddrinfo, [nsl socket])
11944 + AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
11946 +#include <sys/types.h>
11947 +#ifdef HAVE_SYS_SOCKET_H
11948 +#include <sys/socket.h>
11950 +#ifdef HAVE_NETDB_H
11951 +#include <netdb.h>
11953 +#include <stddef.h>
11954 +], [getaddrinfo("", "", NULL, NULL);],
11955 + [gl_cv_func_getaddrinfo=yes],
11956 + [gl_cv_func_getaddrinfo=no])])
11957 + if test $gl_cv_func_getaddrinfo = no; then
11958 + AC_CACHE_CHECK(for getaddrinfo in ws2tcpip.h and -lws2_32,
11959 + gl_cv_w32_getaddrinfo, [
11960 + gl_cv_w32_getaddrinfo=no
11961 + am_save_LIBS="$LIBS"
11962 + LIBS="$LIBS -lws2_32"
11964 +#ifdef HAVE_WS2TCPIP_H
11965 +#include <ws2tcpip.h>
11967 +#include <stddef.h>
11968 +], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes)
11969 + LIBS="$am_save_LIBS"])
11970 + if test "$gl_cv_w32_getaddrinfo" = "yes"; then
11971 + LIBS="$LIBS -lws2_32"
11973 + AC_LIBOBJ(getaddrinfo)
11977 + # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
11978 + # inline function declared in ws2tcpip.h, so we need to get that
11979 + # header included somehow.
11980 + AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)],
11981 + gl_cv_func_gai_strerror, [
11983 +#include <sys/types.h>
11984 +#ifdef HAVE_SYS_SOCKET_H
11985 +#include <sys/socket.h>
11987 +#ifdef HAVE_NETDB_H
11988 +#include <netdb.h>
11990 +#ifdef HAVE_WS2TCPIP_H
11991 +#include <ws2tcpip.h>
11993 +#include <stddef.h>
11994 +], [gai_strerror (NULL);],
11995 + [gl_cv_func_gai_strerror=yes],
11996 + [gl_cv_func_gai_strerror=no])])
11997 + if test $gl_cv_func_gai_strerror = no; then
11998 + AC_LIBOBJ(gai_strerror)
12001 + gl_PREREQ_GETADDRINFO
12004 +# Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c.
12005 +AC_DEFUN([gl_PREREQ_GETADDRINFO], [
12006 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
12007 + AC_SEARCH_LIBS(gethostbyname, [inet nsl])
12008 + AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet])
12009 + AC_CHECK_FUNCS(gethostbyname,, [
12010 + AC_CACHE_CHECK(for gethostbyname in winsock2.h and -lws2_32,
12011 + gl_cv_w32_gethostbyname, [
12012 + gl_cv_w32_gethostbyname=no
12013 + am_save_LIBS="$LIBS"
12014 + LIBS="$LIBS -lws2_32"
12016 +#ifdef HAVE_WINSOCK2_H
12017 +#include <winsock2.h>
12019 +#include <stddef.h>
12020 +], [gethostbyname(NULL);], gl_cv_w32_gethostbyname=yes)
12021 + LIBS="$am_save_LIBS"])
12022 + if test "$gl_cv_w32_gethostbyname" = "yes"; then
12023 + LIBS="$LIBS -lws2_32"
12026 + AC_REQUIRE([AC_C_RESTRICT])
12027 + AC_REQUIRE([gl_SOCKET_FAMILIES])
12028 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
12029 + AC_REQUIRE([AC_C_INLINE])
12030 + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
12031 + AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h)
12032 + AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
12033 + /* sys/types.h is not needed according to POSIX, but the
12034 + sys/socket.h in i386-unknown-freebsd4.10 and
12035 + powerpc-apple-darwin5.5 required it. */
12036 +#include <sys/types.h>
12037 +#ifdef HAVE_SYS_SOCKET_H
12038 +#include <sys/socket.h>
12040 +#ifdef HAVE_NETDB_H
12041 +#include <netdb.h>
12043 +#ifdef HAVE_WS2TCPIP_H
12044 +#include <ws2tcpip.h>
12047 + AC_CHECK_TYPES([struct addrinfo],,,[
12048 +#include <sys/types.h>
12049 +#ifdef HAVE_SYS_SOCKET_H
12050 +#include <sys/socket.h>
12052 +#ifdef HAVE_NETDB_H
12053 +#include <netdb.h>
12055 +#ifdef HAVE_WS2TCPIP_H
12056 +#include <ws2tcpip.h>
12060 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/gnulib-cache.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-cache.m4
12061 --- gtk-vnc-0.3.7.dan3/gnulib/m4/gnulib-cache.m4 1970-01-01 01:00:00.000000000 +0100
12062 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-cache.m4 2008-10-09 15:24:53.000000000 +0100
12064 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
12066 +# This file is free software, distributed under the terms of the GNU
12067 +# General Public License. As a special exception to the GNU General
12068 +# Public License, this file may be distributed as part of a program
12069 +# that contains a configuration script generated by Autoconf, under
12070 +# the same distribution terms as the rest of that program.
12072 +# Generated by gnulib-tool.
12074 +# This file represents the specification of how gnulib-tool is used.
12075 +# It acts as a cache: It is written and read by gnulib-tool.
12076 +# In projects using CVS, this file is meant to be stored in CVS,
12077 +# like the configure.ac and various Makefile.am files.
12080 +# Specification in the form of a command-line invocation:
12081 +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=. --with-tests --lgpl=2 --libtool --macro-prefix=gl connect getaddrinfo malloc recv send socket vc-list-files
12083 +# Specification in the form of a few gnulib-tool.m4 macro invocations:
12095 +gl_SOURCE_BASE([gnulib/lib])
12096 +gl_M4_BASE([gnulib/m4])
12098 +gl_DOC_BASE([doc])
12099 +gl_TESTS_BASE([gnulib/tests])
12103 +gl_MAKEFILE_NAME([])
12105 +gl_MACRO_PREFIX([gl])
12107 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/gnulib-common.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-common.m4
12108 --- gtk-vnc-0.3.7.dan3/gnulib/m4/gnulib-common.m4 1970-01-01 01:00:00.000000000 +0100
12109 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-common.m4 2008-10-09 15:24:52.000000000 +0100
12111 +# gnulib-common.m4 serial 5
12112 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
12113 +dnl This file is free software; the Free Software Foundation
12114 +dnl gives unlimited permission to copy and/or distribute it,
12115 +dnl with or without modifications, as long as this notice is preserved.
12118 +# is expanded unconditionally through gnulib-tool magic.
12119 +AC_DEFUN([gl_COMMON], [
12120 + dnl Use AC_REQUIRE here, so that the code is expanded once only.
12121 + AC_REQUIRE([gl_COMMON_BODY])
12123 +AC_DEFUN([gl_COMMON_BODY], [
12124 + AH_VERBATIM([isoc99_inline],
12125 +[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
12126 + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
12127 + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
12128 + __APPLE__ && __MACH__ test for MacOS X.
12129 + __APPLE_CC__ tests for the Apple compiler and its version.
12130 + __STDC_VERSION__ tests for the C99 mode. */
12131 +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
12132 +# define __GNUC_STDC_INLINE__ 1
12136 +# gl_MODULE_INDICATOR([modulename])
12137 +# defines a C macro indicating the presence of the given module.
12138 +AC_DEFUN([gl_MODULE_INDICATOR],
12140 + AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
12141 + [Define to 1 when using the gnulib module ]$1[.])
12145 +# is a backport of autoconf-2.59c's m4_foreach_w.
12146 +# Remove this macro when we can assume autoconf >= 2.60.
12147 +m4_ifndef([m4_foreach_w],
12148 + [m4_define([m4_foreach_w],
12149 + [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
12152 +# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
12153 +# Remove this macro when we can assume autoconf >= 2.60.
12154 +m4_ifdef([AC_PROG_MKDIR_P], [], [
12155 + AC_DEFUN([AC_PROG_MKDIR_P],
12156 + [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
12157 + MKDIR_P='$(mkdir_p)'
12158 + AC_SUBST([MKDIR_P])])])
12161 +# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
12162 +# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
12164 +# This definition can be removed once autoconf >= 2.62 can be assumed.
12165 +AC_DEFUN([AC_C_RESTRICT],
12166 +[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict,
12167 + [ac_cv_c_restrict=no
12168 + # The order here caters to the fact that C++ does not require restrict.
12169 + for ac_kw in __restrict __restrict__ _Restrict restrict; do
12170 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
12171 + [[typedef int * int_ptr;
12172 + int foo (int_ptr $ac_kw ip) {
12176 + int * $ac_kw t = s;
12178 + return foo(t)]])],
12179 + [ac_cv_c_restrict=$ac_kw])
12180 + test "$ac_cv_c_restrict" != no && break
12183 + AH_VERBATIM([restrict],
12184 +[/* Define to the equivalent of the C99 'restrict' keyword, or to
12185 + nothing if this is not supported. Do not define if restrict is
12186 + supported directly. */
12188 +/* Work around a bug in Sun C++: it does not support _Restrict, even
12189 + though the corresponding Sun C compiler does, which causes
12190 + "#define restrict _Restrict" in the previous line. Perhaps some future
12191 + version of Sun C++ will work with _Restrict; if so, it'll probably
12192 + define __RESTRICT, just as Sun C does. */
12193 +#if defined __SUNPRO_CC && !defined __RESTRICT
12194 +# define _Restrict
12196 + case $ac_cv_c_restrict in
12198 + no) AC_DEFINE([restrict], []) ;;
12199 + *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
12202 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/gnulib-comp.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-comp.m4
12203 --- gtk-vnc-0.3.7.dan3/gnulib/m4/gnulib-comp.m4 1970-01-01 01:00:00.000000000 +0100
12204 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-comp.m4 2008-10-09 15:24:54.000000000 +0100
12206 +# DO NOT EDIT! GENERATED AUTOMATICALLY!
12207 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
12209 +# This file is free software, distributed under the terms of the GNU
12210 +# General Public License. As a special exception to the GNU General
12211 +# Public License, this file may be distributed as part of a program
12212 +# that contains a configuration script generated by Autoconf, under
12213 +# the same distribution terms as the rest of that program.
12215 +# Generated by gnulib-tool.
12217 +# This file represents the compiled summary of the specification in
12218 +# gnulib-cache.m4. It lists the computed macro invocations that need
12219 +# to be invoked from configure.ac.
12220 +# In projects using CVS, this file can be treated like other built files.
12223 +# This macro should be invoked from ./configure.ac, in the section
12224 +# "Checks for programs", right after AC_PROG_CC, and certainly before
12225 +# any checks for libraries, header files, types and library functions.
12226 +AC_DEFUN([gl_EARLY],
12228 + m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
12229 + m4_pattern_allow([^gl_ES$])dnl a valid locale name
12230 + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
12231 + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
12232 + AC_REQUIRE([AC_PROG_RANLIB])
12233 + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12236 +# This macro should be invoked from ./configure.ac, in the section
12237 +# "Check for header files, types and library functions".
12238 +AC_DEFUN([gl_INIT],
12240 + AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
12241 + gl_cond_libtool=true
12242 + m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
12243 + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
12244 + m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
12245 + m4_pushdef([gl_LIBSOURCES_LIST], [])
12246 + m4_pushdef([gl_LIBSOURCES_DIR], [])
12248 + gl_source_base='gnulib/lib'
12250 + gl_HEADER_ARPA_INET
12252 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
12253 + if test "$ac_cv_header_winsock2_h" = yes; then
12254 + AC_LIBOBJ([winsock])
12256 + gl_SYS_SOCKET_MODULE_INDICATOR([connect])
12257 + gl_HEADER_ERRNO_H
12260 + AC_SUBST([LIBINTL])
12261 + AC_SUBST([LTLIBINTL])
12263 + gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
12265 + AC_DEFINE([GNULIB_MALLOC_GNU], 1, [Define to indicate the 'malloc' module.])
12266 + gl_FUNC_MALLOC_POSIX
12267 + gl_STDLIB_MODULE_INDICATOR([malloc-posix])
12268 + gl_HEADER_NETINET_IN
12270 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
12271 + if test "$ac_cv_header_winsock2_h" = yes; then
12272 + AC_LIBOBJ([winsock])
12274 + gl_SYS_SOCKET_MODULE_INDICATOR([recv])
12275 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
12276 + if test "$ac_cv_header_winsock2_h" = yes; then
12277 + AC_LIBOBJ([winsock])
12279 + gl_SYS_SOCKET_MODULE_INDICATOR([send])
12282 + gl_STDIO_MODULE_INDICATOR([snprintf])
12283 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
12284 + if test "$ac_cv_header_winsock2_h" = yes; then
12285 + AC_LIBOBJ([winsock])
12287 + gl_SYS_SOCKET_MODULE_INDICATOR([socket])
12288 + gl_TYPE_SOCKLEN_T
12293 + gl_HEADER_SYS_SOCKET
12296 + gl_FUNC_VASNPRINTF
12299 + m4_ifval(gl_LIBSOURCES_LIST, [
12300 + m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
12301 + for gl_file in ]gl_LIBSOURCES_LIST[ ; do
12302 + if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
12303 + echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
12307 + m4_if(m4_sysval, [0], [],
12308 + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
12310 + m4_popdef([gl_LIBSOURCES_DIR])
12311 + m4_popdef([gl_LIBSOURCES_LIST])
12312 + m4_popdef([AC_LIBSOURCES])
12313 + m4_popdef([AC_REPLACE_FUNCS])
12314 + m4_popdef([AC_LIBOBJ])
12315 + AC_CONFIG_COMMANDS_PRE([
12318 + if test -n "$gl_LIBOBJS"; then
12319 + # Remove the extension.
12320 + sed_drop_objext='s/\.o$//;s/\.obj$//'
12321 + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
12322 + gl_libobjs="$gl_libobjs $i.$ac_objext"
12323 + gl_ltlibobjs="$gl_ltlibobjs $i.lo"
12326 + AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
12327 + AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
12330 + gltests_ltlibdeps=
12331 + m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
12332 + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
12333 + m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
12334 + m4_pushdef([gltests_LIBSOURCES_LIST], [])
12335 + m4_pushdef([gltests_LIBSOURCES_DIR], [])
12337 + gl_source_base='gnulib/tests'
12340 + AC_CHECK_FUNCS([shutdown])
12341 + abs_aux_dir=`cd "$ac_aux_dir"; pwd`
12342 + AC_SUBST([abs_aux_dir])
12343 + m4_ifval(gltests_LIBSOURCES_LIST, [
12344 + m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
12345 + for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
12346 + if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then
12347 + echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2
12351 + m4_if(m4_sysval, [0], [],
12352 + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
12354 + m4_popdef([gltests_LIBSOURCES_DIR])
12355 + m4_popdef([gltests_LIBSOURCES_LIST])
12356 + m4_popdef([AC_LIBSOURCES])
12357 + m4_popdef([AC_REPLACE_FUNCS])
12358 + m4_popdef([AC_LIBOBJ])
12359 + AC_CONFIG_COMMANDS_PRE([
12361 + gltests_ltlibobjs=
12362 + if test -n "$gltests_LIBOBJS"; then
12363 + # Remove the extension.
12364 + sed_drop_objext='s/\.o$//;s/\.obj$//'
12365 + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
12366 + gltests_libobjs="$gltests_libobjs $i.$ac_objext"
12367 + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
12370 + AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
12371 + AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
12373 + LIBTESTS_LIBDEPS="$gltests_libdeps"
12374 + AC_SUBST([LIBTESTS_LIBDEPS])
12377 +# Like AC_LIBOBJ, except that the module name goes
12378 +# into gl_LIBOBJS instead of into LIBOBJS.
12379 +AC_DEFUN([gl_LIBOBJ], [
12380 + AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
12381 + gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
12384 +# Like AC_REPLACE_FUNCS, except that the module name goes
12385 +# into gl_LIBOBJS instead of into LIBOBJS.
12386 +AC_DEFUN([gl_REPLACE_FUNCS], [
12387 + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
12388 + AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
12391 +# Like AC_LIBSOURCES, except the directory where the source file is
12392 +# expected is derived from the gnulib-tool parameterization,
12393 +# and alloca is special cased (for the alloca-opt module).
12394 +# We could also entirely rely on EXTRA_lib..._SOURCES.
12395 +AC_DEFUN([gl_LIBSOURCES], [
12396 + m4_foreach([_gl_NAME], [$1], [
12397 + m4_if(_gl_NAME, [alloca.c], [], [
12398 + m4_define([gl_LIBSOURCES_DIR], [gnulib/lib])
12399 + m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
12404 +# Like AC_LIBOBJ, except that the module name goes
12405 +# into gltests_LIBOBJS instead of into LIBOBJS.
12406 +AC_DEFUN([gltests_LIBOBJ], [
12407 + AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
12408 + gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
12411 +# Like AC_REPLACE_FUNCS, except that the module name goes
12412 +# into gltests_LIBOBJS instead of into LIBOBJS.
12413 +AC_DEFUN([gltests_REPLACE_FUNCS], [
12414 + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
12415 + AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
12418 +# Like AC_LIBSOURCES, except the directory where the source file is
12419 +# expected is derived from the gnulib-tool parameterization,
12420 +# and alloca is special cased (for the alloca-opt module).
12421 +# We could also entirely rely on EXTRA_lib..._SOURCES.
12422 +AC_DEFUN([gltests_LIBSOURCES], [
12423 + m4_foreach([_gl_NAME], [$1], [
12424 + m4_if(_gl_NAME, [alloca.c], [], [
12425 + m4_define([gltests_LIBSOURCES_DIR], [gnulib/tests])
12426 + m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
12431 +# This macro records the list of files which have been installed by
12432 +# gnulib-tool and may be removed by future gnulib-tool invocations.
12433 +AC_DEFUN([gl_FILE_LIST], [
12434 + build-aux/link-warning.h
12435 + build-aux/vc-list-files
12437 + lib/arpa_inet.in.h
12443 + lib/gai_strerror.c
12444 + lib/getaddrinfo.c
12445 + lib/getaddrinfo.h
12449 + lib/netinet_in.in.h
12450 + lib/printf-args.c
12451 + lib/printf-args.h
12452 + lib/printf-parse.c
12453 + lib/printf-parse.h
12458 + lib/stdio-write.c
12461 + lib/sys_socket.in.h
12469 + m4/arpa_inet_h.m4
12473 + m4/getaddrinfo.m4
12474 + m4/gnulib-common.m4
12475 + m4/include_next.m4
12481 + m4/netinet_in_h.m4
12493 + m4/sys_socket_h.m4
12500 + tests/test-alloca-opt.c
12501 + tests/test-arpa_inet.c
12502 + tests/test-errno.c
12503 + tests/test-getaddrinfo.c
12504 + tests/test-netinet_in.c
12505 + tests/test-snprintf.c
12506 + tests/test-stdbool.c
12507 + tests/test-stdint.c
12508 + tests/test-stdio.c
12509 + tests/test-stdlib.c
12510 + tests/test-sys_socket.c
12511 + tests/test-unistd.c
12512 + tests/test-vasnprintf.c
12513 + tests/test-vc-list-files-cvs.sh
12514 + tests/test-vc-list-files-git.sh
12515 + tests/test-wchar.c
12516 + tests=lib/dummy.c
12517 + tests=lib/intprops.h
12518 + tests=lib/verify.h
12520 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/gnulib-tool.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-tool.m4
12521 --- gtk-vnc-0.3.7.dan3/gnulib/m4/gnulib-tool.m4 1970-01-01 01:00:00.000000000 +0100
12522 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-tool.m4 2008-10-09 15:24:52.000000000 +0100
12524 +# gnulib-tool.m4 serial 2
12525 +dnl Copyright (C) 2004-2005 Free Software Foundation, Inc.
12526 +dnl This file is free software; the Free Software Foundation
12527 +dnl gives unlimited permission to copy and/or distribute it,
12528 +dnl with or without modifications, as long as this notice is preserved.
12530 +dnl The following macros need not be invoked explicitly.
12531 +dnl Invoking them does nothing except to declare default arguments
12532 +dnl for "gnulib-tool --import".
12534 +dnl Usage: gl_LOCAL_DIR([DIR])
12535 +AC_DEFUN([gl_LOCAL_DIR], [])
12537 +dnl Usage: gl_MODULES([module1 module2 ...])
12538 +AC_DEFUN([gl_MODULES], [])
12540 +dnl Usage: gl_AVOID([module1 module2 ...])
12541 +AC_DEFUN([gl_AVOID], [])
12543 +dnl Usage: gl_SOURCE_BASE([DIR])
12544 +AC_DEFUN([gl_SOURCE_BASE], [])
12546 +dnl Usage: gl_M4_BASE([DIR])
12547 +AC_DEFUN([gl_M4_BASE], [])
12549 +dnl Usage: gl_PO_BASE([DIR])
12550 +AC_DEFUN([gl_PO_BASE], [])
12552 +dnl Usage: gl_DOC_BASE([DIR])
12553 +AC_DEFUN([gl_DOC_BASE], [])
12555 +dnl Usage: gl_TESTS_BASE([DIR])
12556 +AC_DEFUN([gl_TESTS_BASE], [])
12558 +dnl Usage: gl_WITH_TESTS
12559 +AC_DEFUN([gl_WITH_TESTS], [])
12561 +dnl Usage: gl_LIB([LIBNAME])
12562 +AC_DEFUN([gl_LIB], [])
12564 +dnl Usage: gl_LGPL or gl_LGPL([VERSION])
12565 +AC_DEFUN([gl_LGPL], [])
12567 +dnl Usage: gl_MAKEFILE_NAME([FILENAME])
12568 +AC_DEFUN([gl_MAKEFILE_NAME], [])
12570 +dnl Usage: gl_LIBTOOL
12571 +AC_DEFUN([gl_LIBTOOL], [])
12573 +dnl Usage: gl_MACRO_PREFIX([PREFIX])
12574 +AC_DEFUN([gl_MACRO_PREFIX], [])
12576 +dnl Usage: gl_PO_DOMAIN([DOMAIN])
12577 +AC_DEFUN([gl_PO_DOMAIN], [])
12579 +dnl Usage: gl_VC_FILES([BOOLEAN])
12580 +AC_DEFUN([gl_VC_FILES], [])
12581 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/include_next.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/include_next.m4
12582 --- gtk-vnc-0.3.7.dan3/gnulib/m4/include_next.m4 1970-01-01 01:00:00.000000000 +0100
12583 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/include_next.m4 2008-10-09 15:24:52.000000000 +0100
12585 +# include_next.m4 serial 8
12586 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
12587 +dnl This file is free software; the Free Software Foundation
12588 +dnl gives unlimited permission to copy and/or distribute it,
12589 +dnl with or without modifications, as long as this notice is preserved.
12591 +dnl From Paul Eggert and Derek Price.
12593 +dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
12595 +dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
12596 +dnl 'include' otherwise.
12598 +dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next,
12599 +dnl so as to avoid GCC warnings when the gcc option -pedantic is used.
12600 +dnl '#pragma GCC system_header' has the same effect as if the file was found
12601 +dnl through the include search path specified with '-isystem' options (as
12602 +dnl opposed to the search path specified with '-I' options). Namely, gcc
12603 +dnl does not warn about some things, and on some systems (Solaris and Interix)
12604 +dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
12605 +dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
12606 +dnl of plain '__STDC__'.
12608 +AC_DEFUN([gl_INCLUDE_NEXT],
12610 + AC_LANG_PREPROC_REQUIRE()
12611 + AC_CACHE_CHECK([whether the preprocessor supports include_next],
12612 + [gl_cv_have_include_next],
12613 + [rm -rf conftestd1 conftestd2
12614 + mkdir conftestd1 conftestd2
12615 + dnl The include of <stdio.h> is because IBM C 9.0 on AIX 6.1 supports
12616 + dnl include_next when used as first preprocessor directive in a file,
12617 + dnl but not when preceded by another include directive.
12618 + cat <<EOF > conftestd1/conftest.h
12619 +#define DEFINED_IN_CONFTESTD1
12620 +#include <stdio.h>
12621 +#include_next <conftest.h>
12622 +#ifdef DEFINED_IN_CONFTESTD2
12625 +#error "include_next doesn't work"
12628 + cat <<EOF > conftestd2/conftest.h
12629 +#ifndef DEFINED_IN_CONFTESTD1
12630 +#error "include_next test doesn't work"
12632 +#define DEFINED_IN_CONFTESTD2
12634 + save_CPPFLAGS="$CPPFLAGS"
12635 + CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2"
12636 + AC_COMPILE_IFELSE([#include <conftest.h>],
12637 + [gl_cv_have_include_next=yes],
12638 + [gl_cv_have_include_next=no])
12639 + CPPFLAGS="$save_CPPFLAGS"
12640 + rm -rf conftestd1 conftestd2
12642 + PRAGMA_SYSTEM_HEADER=
12643 + if test $gl_cv_have_include_next = yes; then
12644 + INCLUDE_NEXT=include_next
12645 + if test -n "$GCC"; then
12646 + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
12649 + INCLUDE_NEXT=include
12651 + AC_SUBST([INCLUDE_NEXT])
12652 + AC_SUBST([PRAGMA_SYSTEM_HEADER])
12655 +# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
12656 +# ------------------------------------------
12657 +# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
12658 +# '<foo.h>'; otherwise define it to be
12659 +# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
12660 +# That way, a header file with the following line:
12661 +# #@INCLUDE_NEXT@ @NEXT_FOO_H@
12662 +# behaves (after sed substitution) as if it contained
12663 +# #include_next <foo.h>
12664 +# even if the compiler does not support include_next.
12665 +# The three "///" are to pacify Sun C 5.8, which otherwise would say
12666 +# "warning: #include of /usr/include/... may be non-portable".
12667 +# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
12668 +# Note: This macro assumes that the header file is not empty after
12669 +# preprocessing, i.e. it does not only define preprocessor macros but also
12670 +# provides some type/enum definitions or function/variable declarations.
12671 +AC_DEFUN([gl_CHECK_NEXT_HEADERS],
12673 + AC_REQUIRE([gl_INCLUDE_NEXT])
12674 + AC_CHECK_HEADERS_ONCE([$1])
12676 + m4_foreach_w([gl_HEADER_NAME], [$1],
12677 + [AS_VAR_PUSHDEF([gl_next_header],
12678 + [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
12679 + if test $gl_cv_have_include_next = yes; then
12680 + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
12683 + [absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
12684 + m4_quote(m4_defn([gl_next_header])),
12685 + [AS_VAR_PUSHDEF([gl_header_exists],
12686 + [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))
12687 + if test AS_VAR_GET(gl_header_exists) = yes; then
12688 + AC_LANG_CONFTEST(
12690 + [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
12692 + dnl eval is necessary to expand ac_cpp.
12693 + dnl Ultrix and Pyramid sh refuse to redirect output of eval,
12694 + dnl so use subshell.
12695 + AS_VAR_SET([gl_next_header],
12696 + ['"'`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
12697 + sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
12698 + s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
12704 + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
12706 + AS_VAR_POPDEF([gl_header_exists])])
12709 + AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))),
12710 + [AS_VAR_GET([gl_next_header])])
12711 + AS_VAR_POPDEF([gl_next_header])])
12713 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/inet_ntop.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/inet_ntop.m4
12714 --- gtk-vnc-0.3.7.dan3/gnulib/m4/inet_ntop.m4 1970-01-01 01:00:00.000000000 +0100
12715 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/inet_ntop.m4 2008-10-09 15:24:52.000000000 +0100
12717 +# inet_ntop.m4 serial 7
12718 +dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
12719 +dnl This file is free software; the Free Software Foundation
12720 +dnl gives unlimited permission to copy and/or distribute it,
12721 +dnl with or without modifications, as long as this notice is preserved.
12723 +AC_DEFUN([gl_INET_NTOP],
12725 + dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
12726 + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12728 + gl_REPLACE_ARPA_INET_H
12730 + AC_REPLACE_FUNCS(inet_ntop)
12731 + gl_PREREQ_INET_NTOP
12734 +# Prerequisites of lib/inet_ntop.c.
12735 +AC_DEFUN([gl_PREREQ_INET_NTOP], [
12736 + AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
12737 + if test $ac_cv_have_decl_inet_ntop = no; then
12738 + HAVE_DECL_INET_NTOP=0
12740 + AC_REQUIRE([gl_SOCKET_FAMILIES])
12741 + AC_REQUIRE([AC_C_RESTRICT])
12743 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/intmax_t.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/intmax_t.m4
12744 --- gtk-vnc-0.3.7.dan3/gnulib/m4/intmax_t.m4 1970-01-01 01:00:00.000000000 +0100
12745 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/intmax_t.m4 2008-10-09 15:24:52.000000000 +0100
12747 +# intmax_t.m4 serial 6
12748 +dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc.
12749 +dnl This file is free software; the Free Software Foundation
12750 +dnl gives unlimited permission to copy and/or distribute it,
12751 +dnl with or without modifications, as long as this notice is preserved.
12753 +dnl From Paul Eggert.
12757 +# Define intmax_t to 'long' or 'long long'
12758 +# if it is not already defined in <stdint.h> or <inttypes.h>.
12760 +AC_DEFUN([gl_AC_TYPE_INTMAX_T],
12762 + dnl For simplicity, we assume that a header file defines 'intmax_t' if and
12763 + dnl only if it defines 'uintmax_t'.
12764 + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
12765 + AC_REQUIRE([gl_AC_HEADER_STDINT_H])
12766 + if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
12767 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
12768 + test $ac_cv_type_long_long_int = yes \
12769 + && ac_type='long long' \
12770 + || ac_type='long'
12771 + AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
12772 + [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
12774 + AC_DEFINE(HAVE_INTMAX_T, 1,
12775 + [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
12779 +dnl An alternative would be to explicitly test for 'intmax_t'.
12781 +AC_DEFUN([gt_AC_TYPE_INTMAX_T],
12783 + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
12784 + AC_REQUIRE([gl_AC_HEADER_STDINT_H])
12785 + AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
12786 + [AC_TRY_COMPILE([
12787 +#include <stddef.h>
12788 +#include <stdlib.h>
12789 +#if HAVE_STDINT_H_WITH_UINTMAX
12790 +#include <stdint.h>
12792 +#if HAVE_INTTYPES_H_WITH_UINTMAX
12793 +#include <inttypes.h>
12795 +], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
12796 + if test $gt_cv_c_intmax_t = yes; then
12797 + AC_DEFINE(HAVE_INTMAX_T, 1,
12798 + [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
12800 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
12801 + test $ac_cv_type_long_long_int = yes \
12802 + && ac_type='long long' \
12803 + || ac_type='long'
12804 + AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
12805 + [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
12808 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/inttypes_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/inttypes_h.m4
12809 --- gtk-vnc-0.3.7.dan3/gnulib/m4/inttypes_h.m4 1970-01-01 01:00:00.000000000 +0100
12810 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/inttypes_h.m4 2008-10-09 15:24:52.000000000 +0100
12812 +# inttypes_h.m4 serial 7
12813 +dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
12814 +dnl This file is free software; the Free Software Foundation
12815 +dnl gives unlimited permission to copy and/or distribute it,
12816 +dnl with or without modifications, as long as this notice is preserved.
12818 +dnl From Paul Eggert.
12820 +# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
12821 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
12823 +AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
12825 + AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
12827 + [#include <sys/types.h>
12828 +#include <inttypes.h>],
12829 + [uintmax_t i = (uintmax_t) -1; return !i;],
12830 + gl_cv_header_inttypes_h=yes,
12831 + gl_cv_header_inttypes_h=no)])
12832 + if test $gl_cv_header_inttypes_h = yes; then
12833 + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
12834 + [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
12835 + and declares uintmax_t. ])
12838 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/longlong.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/longlong.m4
12839 --- gtk-vnc-0.3.7.dan3/gnulib/m4/longlong.m4 1970-01-01 01:00:00.000000000 +0100
12840 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/longlong.m4 2008-10-09 15:24:52.000000000 +0100
12842 +# longlong.m4 serial 13
12843 +dnl Copyright (C) 1999-2007 Free Software Foundation, Inc.
12844 +dnl This file is free software; the Free Software Foundation
12845 +dnl gives unlimited permission to copy and/or distribute it,
12846 +dnl with or without modifications, as long as this notice is preserved.
12848 +dnl From Paul Eggert.
12850 +# Define HAVE_LONG_LONG_INT if 'long long int' works.
12851 +# This fixes a bug in Autoconf 2.61, but can be removed once we
12852 +# assume 2.62 everywhere.
12854 +# Note: If the type 'long long int' exists but is only 32 bits large
12855 +# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
12856 +# defined. In this case you can treat 'long long int' like 'long int'.
12858 +AC_DEFUN([AC_TYPE_LONG_LONG_INT],
12860 + AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
12862 + [_AC_TYPE_LONG_LONG_SNIPPET],
12863 + [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
12864 + dnl If cross compiling, assume the bug isn't important, since
12865 + dnl nobody cross compiles for this platform as far as we know.
12867 + [AC_LANG_PROGRAM(
12868 + [[@%:@include <limits.h>
12869 + @%:@ifndef LLONG_MAX
12870 + @%:@ define HALF \
12871 + (1LL << (sizeof (long long int) * CHAR_BIT - 2))
12872 + @%:@ define LLONG_MAX (HALF - 1 + HALF)
12874 + [[long long int n = 1;
12876 + for (i = 0; ; i++)
12878 + long long int m = n << i;
12881 + if (LLONG_MAX / 2 < m)
12885 + [ac_cv_type_long_long_int=yes],
12886 + [ac_cv_type_long_long_int=no],
12887 + [ac_cv_type_long_long_int=yes])],
12888 + [ac_cv_type_long_long_int=no])])
12889 + if test $ac_cv_type_long_long_int = yes; then
12890 + AC_DEFINE([HAVE_LONG_LONG_INT], 1,
12891 + [Define to 1 if the system has the type `long long int'.])
12895 +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
12896 +# This fixes a bug in Autoconf 2.61, but can be removed once we
12897 +# assume 2.62 everywhere.
12899 +# Note: If the type 'unsigned long long int' exists but is only 32 bits
12900 +# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
12901 +# will not be defined. In this case you can treat 'unsigned long long int'
12902 +# like 'unsigned long int'.
12904 +AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
12906 + AC_CACHE_CHECK([for unsigned long long int],
12907 + [ac_cv_type_unsigned_long_long_int],
12909 + [_AC_TYPE_LONG_LONG_SNIPPET],
12910 + [ac_cv_type_unsigned_long_long_int=yes],
12911 + [ac_cv_type_unsigned_long_long_int=no])])
12912 + if test $ac_cv_type_unsigned_long_long_int = yes; then
12913 + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1,
12914 + [Define to 1 if the system has the type `unsigned long long int'.])
12918 +# Expands to a C program that can be used to test for simultaneous support
12919 +# of 'long long' and 'unsigned long long'. We don't want to say that
12920 +# 'long long' is available if 'unsigned long long' is not, or vice versa,
12921 +# because too many programs rely on the symmetry between signed and unsigned
12922 +# integer types (excluding 'bool').
12923 +AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
12926 + [[/* For now, do not test the preprocessor; as of 2007 there are too many
12927 + implementations with broken preprocessors. Perhaps this can
12928 + be revisited in 2012. In the meantime, code should not expect
12929 + #if to work with literals wider than 32 bits. */
12930 + /* Test literals. */
12931 + long long int ll = 9223372036854775807ll;
12932 + long long int nll = -9223372036854775807LL;
12933 + unsigned long long int ull = 18446744073709551615ULL;
12934 + /* Test constant expressions. */
12935 + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
12937 + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
12940 + [[/* Test availability of runtime routines for shift and division. */
12941 + long long int llmax = 9223372036854775807ll;
12942 + unsigned long long int ullmax = 18446744073709551615ull;
12943 + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
12944 + | (llmax / ll) | (llmax % ll)
12945 + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
12946 + | (ullmax / ull) | (ullmax % ull));]])
12948 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/malloc.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/malloc.m4
12949 --- gtk-vnc-0.3.7.dan3/gnulib/m4/malloc.m4 1970-01-01 01:00:00.000000000 +0100
12950 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/malloc.m4 2008-10-09 15:24:52.000000000 +0100
12952 +# malloc.m4 serial 8
12953 +dnl Copyright (C) 2007 Free Software Foundation, Inc.
12954 +dnl This file is free software; the Free Software Foundation
12955 +dnl gives unlimited permission to copy and/or distribute it,
12956 +dnl with or without modifications, as long as this notice is preserved.
12958 +# gl_FUNC_MALLOC_POSIX
12959 +# --------------------
12960 +# Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
12961 +# fails), and replace malloc if it is not.
12962 +AC_DEFUN([gl_FUNC_MALLOC_POSIX],
12964 + AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
12965 + if test $gl_cv_func_malloc_posix = yes; then
12966 + HAVE_MALLOC_POSIX=1
12967 + AC_DEFINE([HAVE_MALLOC_POSIX], 1,
12968 + [Define if the 'malloc' function is POSIX compliant.])
12970 + AC_LIBOBJ([malloc])
12971 + HAVE_MALLOC_POSIX=0
12973 + AC_SUBST([HAVE_MALLOC_POSIX])
12976 +# Test whether malloc, realloc, calloc are POSIX compliant,
12977 +# Set gl_cv_func_malloc_posix to yes or no accordingly.
12978 +AC_DEFUN([gl_CHECK_MALLOC_POSIX],
12980 + AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant],
12981 + [gl_cv_func_malloc_posix],
12983 + dnl It is too dangerous to try to allocate a large amount of memory:
12984 + dnl some systems go to their knees when you do that. So assume that
12985 + dnl all Unix implementations of the function are POSIX compliant.
12986 + AC_TRY_COMPILE([],
12987 + [#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
12990 + ], [gl_cv_func_malloc_posix=yes], [gl_cv_func_malloc_posix=no])
12993 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/netinet_in_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/netinet_in_h.m4
12994 --- gtk-vnc-0.3.7.dan3/gnulib/m4/netinet_in_h.m4 1970-01-01 01:00:00.000000000 +0100
12995 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/netinet_in_h.m4 2008-10-09 15:24:52.000000000 +0100
12997 +# netinet_in_h.m4 serial 4
12998 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
12999 +dnl This file is free software; the Free Software Foundation
13000 +dnl gives unlimited permission to copy and/or distribute it,
13001 +dnl with or without modifications, as long as this notice is preserved.
13003 +AC_DEFUN([gl_HEADER_NETINET_IN],
13005 + AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
13006 + [gl_cv_header_netinet_in_h_selfcontained],
13008 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
13009 + [gl_cv_header_netinet_in_h_selfcontained=yes],
13010 + [gl_cv_header_netinet_in_h_selfcontained=no])
13012 + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
13015 + NETINET_IN_H='netinet/in.h'
13016 + AC_CHECK_HEADERS([netinet/in.h])
13017 + gl_CHECK_NEXT_HEADERS([netinet/in.h])
13018 + if test $ac_cv_header_netinet_in_h = yes; then
13019 + HAVE_NETINET_IN_H=1
13021 + HAVE_NETINET_IN_H=0
13023 + AC_SUBST([HAVE_NETINET_IN_H])
13025 + AC_SUBST([NETINET_IN_H])
13027 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/onceonly.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/onceonly.m4
13028 --- gtk-vnc-0.3.7.dan3/gnulib/m4/onceonly.m4 1970-01-01 01:00:00.000000000 +0100
13029 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/onceonly.m4 2008-10-09 15:24:52.000000000 +0100
13031 +# onceonly.m4 serial 6
13032 +dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc.
13033 +dnl This file is free software, distributed under the terms of the GNU
13034 +dnl General Public License. As a special exception to the GNU General
13035 +dnl Public License, this file may be distributed as part of a program
13036 +dnl that contains a configuration script generated by Autoconf, under
13037 +dnl the same distribution terms as the rest of that program.
13039 +dnl This file defines some "once only" variants of standard autoconf macros.
13040 +dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
13041 +dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
13042 +dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
13043 +dnl AC_REQUIRE([AC_FUNC_STRCOLL]) like AC_FUNC_STRCOLL
13044 +dnl The advantage is that the check for each of the headers/functions/decls
13045 +dnl will be put only once into the 'configure' file. It keeps the size of
13046 +dnl the 'configure' file down, and avoids redundant output when 'configure'
13048 +dnl The drawback is that the checks cannot be conditionalized. If you write
13049 +dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
13050 +dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
13051 +dnl empty, and the check will be inserted before the body of the AC_DEFUNed
13054 +dnl The original code implemented AC_CHECK_HEADERS_ONCE and AC_CHECK_FUNCS_ONCE
13055 +dnl in terms of AC_DEFUN and AC_REQUIRE. This implementation uses diversions to
13056 +dnl named sections DEFAULTS and INIT_PREPARE in order to check all requested
13057 +dnl headers at once, thus reducing the size of 'configure'. It is known to work
13058 +dnl with autoconf 2.57..2.62 at least . The size reduction is ca. 9%.
13060 +dnl Autoconf version 2.59 plus gnulib is required; this file is not needed
13061 +dnl with Autoconf 2.60 or greater. But note that autoconf's implementation of
13062 +dnl AC_CHECK_DECLS_ONCE expects a comma-separated list of symbols as first
13066 +# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
13067 +# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
13068 +AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
13070 + m4_foreach_w([gl_HEADER_NAME], [$1], [
13071 + AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
13072 + [./-], [___])), [
13073 + m4_divert_text([INIT_PREPARE],
13074 + [gl_header_list="$gl_header_list gl_HEADER_NAME"])
13075 + gl_HEADERS_EXPANSION
13076 + AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
13077 + [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
13079 + AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
13083 +m4_define([gl_HEADERS_EXPANSION], [
13084 + m4_divert_text([DEFAULTS], [gl_header_list=])
13085 + AC_CHECK_HEADERS([$gl_header_list])
13086 + m4_define([gl_HEADERS_EXPANSION], [])
13089 +# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
13090 +# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
13091 +AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
13093 + m4_foreach_w([gl_FUNC_NAME], [$1], [
13094 + AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
13095 + m4_divert_text([INIT_PREPARE],
13096 + [gl_func_list="$gl_func_list gl_FUNC_NAME"])
13097 + gl_FUNCS_EXPANSION
13098 + AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
13099 + [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
13101 + AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
13104 +m4_define([gl_FUNCS_EXPANSION], [
13105 + m4_divert_text([DEFAULTS], [gl_func_list=])
13106 + AC_CHECK_FUNCS([$gl_func_list])
13107 + m4_define([gl_FUNCS_EXPANSION], [])
13110 +# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
13111 +# AC_CHECK_DECLS(DECL1, DECL2, ...).
13112 +AC_DEFUN([AC_CHECK_DECLS_ONCE], [
13114 + m4_foreach_w([gl_DECL_NAME], [$1], [
13115 + AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
13116 + AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
13118 + AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
13121 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/printf.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/printf.m4
13122 --- gtk-vnc-0.3.7.dan3/gnulib/m4/printf.m4 1970-01-01 01:00:00.000000000 +0100
13123 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/printf.m4 2008-10-09 15:24:52.000000000 +0100
13125 +# printf.m4 serial 23
13126 +dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc.
13127 +dnl This file is free software; the Free Software Foundation
13128 +dnl gives unlimited permission to copy and/or distribute it,
13129 +dnl with or without modifications, as long as this notice is preserved.
13131 +dnl Test whether the *printf family of functions supports the 'j', 'z', 't',
13132 +dnl 'L' size specifiers. (ISO C99, POSIX:2001)
13133 +dnl Result is gl_cv_func_printf_sizes_c99.
13135 +AC_DEFUN([gl_PRINTF_SIZES_C99],
13137 + AC_REQUIRE([AC_PROG_CC])
13138 + AC_REQUIRE([gl_AC_HEADER_STDINT_H])
13139 + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
13140 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13141 + AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
13142 + [gl_cv_func_printf_sizes_c99],
13145 +#include <stddef.h>
13146 +#include <stdio.h>
13147 +#include <string.h>
13148 +#include <sys/types.h>
13149 +#if HAVE_STDINT_H_WITH_UINTMAX
13150 +# include <stdint.h>
13152 +#if HAVE_INTTYPES_H_WITH_UINTMAX
13153 +# include <inttypes.h>
13155 +static char buf[100];
13158 +#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
13160 + if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
13161 + || strcmp (buf, "12345671 33") != 0)
13165 + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
13166 + || strcmp (buf, "12345672 33") != 0)
13169 + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
13170 + || strcmp (buf, "12345673 33") != 0)
13173 + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
13174 + || strcmp (buf, "1.5 33") != 0)
13177 +}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
13180 + case "$host_os" in
13181 + # Guess yes on glibc systems.
13182 + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
13183 + # Guess yes on FreeBSD >= 5.
13184 + freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";;
13185 + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
13186 + # Guess yes on MacOS X >= 10.3.
13187 + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
13188 + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
13189 + # Guess yes on OpenBSD >= 3.9.
13190 + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
13191 + gl_cv_func_printf_sizes_c99="guessing no";;
13192 + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
13193 + # Guess yes on Solaris >= 2.10.
13194 + solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
13195 + solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
13196 + # Guess yes on NetBSD >= 3.
13197 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
13198 + gl_cv_func_printf_sizes_c99="guessing no";;
13199 + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
13200 + # If we don't know, assume the worst.
13201 + *) gl_cv_func_printf_sizes_c99="guessing no";;
13203 +changequote([,])dnl
13208 +dnl Test whether the *printf family of functions supports 'long double'
13209 +dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
13210 +dnl Result is gl_cv_func_printf_long_double.
13212 +AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
13214 + AC_REQUIRE([AC_PROG_CC])
13215 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13216 + AC_CACHE_CHECK([whether printf supports 'long double' arguments],
13217 + [gl_cv_func_printf_long_double],
13220 +#include <stdio.h>
13221 +#include <string.h>
13222 +static char buf[10000];
13226 + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
13227 + || strcmp (buf, "1.750000 33") != 0)
13230 + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
13231 + || strcmp (buf, "1.750000e+00 33") != 0)
13234 + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
13235 + || strcmp (buf, "1.75 33") != 0)
13238 +}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
13241 + case "$host_os" in
13242 + beos*) gl_cv_func_printf_long_double="guessing no";;
13243 + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
13244 + *) gl_cv_func_printf_long_double="guessing yes";;
13246 +changequote([,])dnl
13251 +dnl Test whether the *printf family of functions supports infinite and NaN
13252 +dnl 'double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
13253 +dnl Result is gl_cv_func_printf_infinite.
13255 +AC_DEFUN([gl_PRINTF_INFINITE],
13257 + AC_REQUIRE([AC_PROG_CC])
13258 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13259 + AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
13260 + [gl_cv_func_printf_infinite],
13263 +#include <stdio.h>
13264 +#include <string.h>
13266 +strisnan (const char *string, size_t start_index, size_t end_index)
13268 + if (start_index < end_index)
13270 + if (string[start_index] == '-')
13272 + if (start_index + 3 <= end_index
13273 + && memcmp (string + start_index, "nan", 3) == 0)
13275 + start_index += 3;
13276 + if (start_index == end_index
13277 + || (string[start_index] == '(' && string[end_index - 1] == ')'))
13283 +static char buf[10000];
13284 +static double zero = 0.0;
13287 + if (sprintf (buf, "%f", 1.0 / 0.0) < 0
13288 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13290 + if (sprintf (buf, "%f", -1.0 / 0.0) < 0
13291 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13293 + if (sprintf (buf, "%f", zero / zero) < 0
13294 + || !strisnan (buf, 0, strlen (buf)))
13296 + if (sprintf (buf, "%e", 1.0 / 0.0) < 0
13297 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13299 + if (sprintf (buf, "%e", -1.0 / 0.0) < 0
13300 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13302 + if (sprintf (buf, "%e", zero / zero) < 0
13303 + || !strisnan (buf, 0, strlen (buf)))
13305 + if (sprintf (buf, "%g", 1.0 / 0.0) < 0
13306 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13308 + if (sprintf (buf, "%g", -1.0 / 0.0) < 0
13309 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13311 + if (sprintf (buf, "%g", zero / zero) < 0
13312 + || !strisnan (buf, 0, strlen (buf)))
13315 +}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
13318 + case "$host_os" in
13319 + # Guess yes on glibc systems.
13320 + *-gnu*) gl_cv_func_printf_infinite="guessing yes";;
13321 + # Guess yes on FreeBSD >= 6.
13322 + freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";;
13323 + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
13324 + # Guess yes on MacOS X >= 10.3.
13325 + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
13326 + darwin*) gl_cv_func_printf_infinite="guessing yes";;
13327 + # Guess yes on HP-UX >= 11.
13328 + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
13329 + hpux*) gl_cv_func_printf_infinite="guessing yes";;
13330 + # Guess yes on NetBSD >= 3.
13331 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
13332 + gl_cv_func_printf_infinite="guessing no";;
13333 + netbsd*) gl_cv_func_printf_infinite="guessing yes";;
13334 + # Guess yes on BeOS.
13335 + beos*) gl_cv_func_printf_infinite="guessing yes";;
13336 + # If we don't know, assume the worst.
13337 + *) gl_cv_func_printf_infinite="guessing no";;
13339 +changequote([,])dnl
13344 +dnl Test whether the *printf family of functions supports infinite and NaN
13345 +dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
13346 +dnl Result is gl_cv_func_printf_infinite_long_double.
13348 +AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
13350 + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
13351 + AC_REQUIRE([AC_PROG_CC])
13352 + AC_REQUIRE([AC_C_BIGENDIAN])
13353 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13354 + dnl The user can set or unset the variable gl_printf_safe to indicate
13355 + dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
13356 + if test -n "$gl_printf_safe"; then
13357 + AC_DEFINE([CHECK_PRINTF_SAFE], 1,
13358 + [Define if you wish *printf() functions that have a safe handling of
13359 + non-IEEE-754 'long double' values.])
13361 + case "$gl_cv_func_printf_long_double" in
13363 + AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
13364 + [gl_cv_func_printf_infinite_long_double],
13368 +#include <float.h>
13369 +#include <stdio.h>
13370 +#include <string.h>
13372 +strisnan (const char *string, size_t start_index, size_t end_index)
13374 + if (start_index < end_index)
13376 + if (string[start_index] == '-')
13378 + if (start_index + 3 <= end_index
13379 + && memcmp (string + start_index, "nan", 3) == 0)
13381 + start_index += 3;
13382 + if (start_index == end_index
13383 + || (string[start_index] == '(' && string[end_index - 1] == ')'))
13389 +static char buf[10000];
13390 +static long double zeroL = 0.0L;
13394 + if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
13395 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13397 + if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
13398 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13400 + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
13401 + || !strisnan (buf, 0, strlen (buf)))
13403 + if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
13404 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13406 + if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
13407 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13409 + if (sprintf (buf, "%Le", zeroL / zeroL) < 0
13410 + || !strisnan (buf, 0, strlen (buf)))
13412 + if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
13413 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13415 + if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
13416 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13418 + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
13419 + || !strisnan (buf, 0, strlen (buf)))
13421 +#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_))
13422 +/* Representation of an 80-bit 'long double' as an initializer for a sequence
13423 + of 'unsigned int' words. */
13424 +# ifdef WORDS_BIGENDIAN
13425 +# define LDBL80_WORDS(exponent,manthi,mantlo) \
13426 + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
13427 + ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
13428 + (unsigned int) (mantlo) << 16 \
13431 +# define LDBL80_WORDS(exponent,manthi,mantlo) \
13432 + { mantlo, manthi, exponent }
13434 + { /* Quiet NaN. */
13435 + static union { unsigned int word[4]; long double value; } x =
13436 + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
13437 + if (sprintf (buf, "%Lf", x.value) < 0
13438 + || !strisnan (buf, 0, strlen (buf)))
13440 + if (sprintf (buf, "%Le", x.value) < 0
13441 + || !strisnan (buf, 0, strlen (buf)))
13443 + if (sprintf (buf, "%Lg", x.value) < 0
13444 + || !strisnan (buf, 0, strlen (buf)))
13448 + /* Signalling NaN. */
13449 + static union { unsigned int word[4]; long double value; } x =
13450 + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
13451 + if (sprintf (buf, "%Lf", x.value) < 0
13452 + || !strisnan (buf, 0, strlen (buf)))
13454 + if (sprintf (buf, "%Le", x.value) < 0
13455 + || !strisnan (buf, 0, strlen (buf)))
13457 + if (sprintf (buf, "%Lg", x.value) < 0
13458 + || !strisnan (buf, 0, strlen (buf)))
13461 + { /* Pseudo-NaN. */
13462 + static union { unsigned int word[4]; long double value; } x =
13463 + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
13464 + if (sprintf (buf, "%Lf", x.value) < 0
13465 + || !strisnan (buf, 0, strlen (buf)))
13467 + if (sprintf (buf, "%Le", x.value) < 0
13468 + || !strisnan (buf, 0, strlen (buf)))
13470 + if (sprintf (buf, "%Lg", x.value) < 0
13471 + || !strisnan (buf, 0, strlen (buf)))
13474 + { /* Pseudo-Infinity. */
13475 + static union { unsigned int word[4]; long double value; } x =
13476 + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
13477 + if (sprintf (buf, "%Lf", x.value) < 0
13478 + || !strisnan (buf, 0, strlen (buf)))
13480 + if (sprintf (buf, "%Le", x.value) < 0
13481 + || !strisnan (buf, 0, strlen (buf)))
13483 + if (sprintf (buf, "%Lg", x.value) < 0
13484 + || !strisnan (buf, 0, strlen (buf)))
13487 + { /* Pseudo-Zero. */
13488 + static union { unsigned int word[4]; long double value; } x =
13489 + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
13490 + if (sprintf (buf, "%Lf", x.value) < 0
13491 + || !strisnan (buf, 0, strlen (buf)))
13493 + if (sprintf (buf, "%Le", x.value) < 0
13494 + || !strisnan (buf, 0, strlen (buf)))
13496 + if (sprintf (buf, "%Lg", x.value) < 0
13497 + || !strisnan (buf, 0, strlen (buf)))
13500 + { /* Unnormalized number. */
13501 + static union { unsigned int word[4]; long double value; } x =
13502 + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
13503 + if (sprintf (buf, "%Lf", x.value) < 0
13504 + || !strisnan (buf, 0, strlen (buf)))
13506 + if (sprintf (buf, "%Le", x.value) < 0
13507 + || !strisnan (buf, 0, strlen (buf)))
13509 + if (sprintf (buf, "%Lg", x.value) < 0
13510 + || !strisnan (buf, 0, strlen (buf)))
13513 + { /* Pseudo-Denormal. */
13514 + static union { unsigned int word[4]; long double value; } x =
13515 + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
13516 + if (sprintf (buf, "%Lf", x.value) < 0
13517 + || !strisnan (buf, 0, strlen (buf)))
13519 + if (sprintf (buf, "%Le", x.value) < 0
13520 + || !strisnan (buf, 0, strlen (buf)))
13522 + if (sprintf (buf, "%Lg", x.value) < 0
13523 + || !strisnan (buf, 0, strlen (buf)))
13529 + [gl_cv_func_printf_infinite_long_double=yes],
13530 + [gl_cv_func_printf_infinite_long_double=no],
13533 + case "$host_cpu" in
13534 + # Guess no on ia64, x86_64, i386.
13535 + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
13537 + case "$host_os" in
13538 + # Guess yes on glibc systems.
13539 + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13540 + # Guess yes on FreeBSD >= 6.
13541 + freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";;
13542 + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13543 + # Guess yes on MacOS X >= 10.3.
13544 + darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";;
13545 + darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13546 + # Guess yes on HP-UX >= 11.
13547 + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
13548 + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13549 + # Guess yes on NetBSD >= 3.
13550 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
13551 + gl_cv_func_printf_infinite_long_double="guessing no";;
13552 + netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13553 + # If we don't know, assume the worst.
13554 + *) gl_cv_func_printf_infinite_long_double="guessing no";;
13558 +changequote([,])dnl
13563 + gl_cv_func_printf_infinite_long_double="irrelevant"
13568 +dnl Test whether the *printf family of functions supports the 'a' and 'A'
13569 +dnl conversion specifier for hexadecimal output of floating-point numbers.
13570 +dnl (ISO C99, POSIX:2001)
13571 +dnl Result is gl_cv_func_printf_directive_a.
13573 +AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
13575 + AC_REQUIRE([AC_PROG_CC])
13576 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13577 + AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
13578 + [gl_cv_func_printf_directive_a],
13581 +#include <stdio.h>
13582 +#include <string.h>
13583 +static char buf[100];
13586 + if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
13587 + || (strcmp (buf, "0x1.922p+1 33") != 0
13588 + && strcmp (buf, "0x3.244p+0 33") != 0
13589 + && strcmp (buf, "0x6.488p-1 33") != 0
13590 + && strcmp (buf, "0xc.91p-2 33") != 0))
13592 + if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
13593 + || (strcmp (buf, "-0X1.922P+1 33") != 0
13594 + && strcmp (buf, "-0X3.244P+0 33") != 0
13595 + && strcmp (buf, "-0X6.488P-1 33") != 0
13596 + && strcmp (buf, "-0XC.91P-2 33") != 0))
13598 + /* This catches a FreeBSD 6.1 bug: it doesn't round. */
13599 + if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
13600 + || (strcmp (buf, "0x1.83p+0 33") != 0
13601 + && strcmp (buf, "0x3.05p-1 33") != 0
13602 + && strcmp (buf, "0x6.0ap-2 33") != 0
13603 + && strcmp (buf, "0xc.14p-3 33") != 0))
13605 + /* This catches a FreeBSD 6.1 bug. See
13606 + <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
13607 + if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
13608 + || buf[0] == '0')
13610 + /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */
13611 + if (sprintf (buf, "%.1a", 1.999) < 0
13612 + || (strcmp (buf, "0x1.0p+1") != 0
13613 + && strcmp (buf, "0x2.0p+0") != 0
13614 + && strcmp (buf, "0x4.0p-1") != 0
13615 + && strcmp (buf, "0x8.0p-2") != 0))
13617 + /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
13618 + glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
13619 + if (sprintf (buf, "%.1La", 1.999L) < 0
13620 + || (strcmp (buf, "0x1.0p+1") != 0
13621 + && strcmp (buf, "0x2.0p+0") != 0
13622 + && strcmp (buf, "0x4.0p-1") != 0
13623 + && strcmp (buf, "0x8.0p-2") != 0))
13626 +}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
13628 + case "$host_os" in
13629 + # Guess yes on glibc >= 2.5 systems.
13631 + AC_EGREP_CPP([BZ2908], [
13632 + #include <features.h>
13633 + #ifdef __GNU_LIBRARY__
13634 + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
13639 + [gl_cv_func_printf_directive_a="guessing yes"],
13640 + [gl_cv_func_printf_directive_a="guessing no"])
13642 + # If we don't know, assume the worst.
13643 + *) gl_cv_func_printf_directive_a="guessing no";;
13649 +dnl Test whether the *printf family of functions supports the %F format
13650 +dnl directive. (ISO C99, POSIX:2001)
13651 +dnl Result is gl_cv_func_printf_directive_f.
13653 +AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
13655 + AC_REQUIRE([AC_PROG_CC])
13656 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13657 + AC_CACHE_CHECK([whether printf supports the 'F' directive],
13658 + [gl_cv_func_printf_directive_f],
13661 +#include <stdio.h>
13662 +#include <string.h>
13663 +static char buf[100];
13666 + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
13667 + || strcmp (buf, "1234567.000000 33") != 0)
13669 + if (sprintf (buf, "%F", 1.0 / 0.0) < 0
13670 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
13672 + /* This catches a Cygwin 2007 bug. */
13673 + if (sprintf (buf, "%.F", 1234.0) < 0
13674 + || strcmp (buf, "1234") != 0)
13677 +}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
13680 + case "$host_os" in
13681 + # Guess yes on glibc systems.
13682 + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
13683 + # Guess yes on FreeBSD >= 6.
13684 + freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";;
13685 + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
13686 + # Guess yes on MacOS X >= 10.3.
13687 + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
13688 + darwin*) gl_cv_func_printf_directive_f="guessing yes";;
13689 + # Guess yes on Solaris >= 2.10.
13690 + solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
13691 + solaris*) gl_cv_func_printf_directive_f="guessing yes";;
13692 + # If we don't know, assume the worst.
13693 + *) gl_cv_func_printf_directive_f="guessing no";;
13695 +changequote([,])dnl
13700 +dnl Test whether the *printf family of functions supports the %n format
13701 +dnl directive. (ISO C99, POSIX:2001)
13702 +dnl Result is gl_cv_func_printf_directive_n.
13704 +AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
13706 + AC_REQUIRE([AC_PROG_CC])
13707 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13708 + AC_CACHE_CHECK([whether printf supports the 'n' directive],
13709 + [gl_cv_func_printf_directive_n],
13712 +#include <stdio.h>
13713 +#include <string.h>
13714 +static char fmtstring[10];
13715 +static char buf[100];
13719 + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
13720 + support %n in format strings in read-only memory but not in writable
13722 + strcpy (fmtstring, "%d %n");
13723 + if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
13724 + || strcmp (buf, "123 ") != 0
13728 +}], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
13731 + case "$host_os" in
13732 + *) gl_cv_func_printf_directive_n="guessing yes";;
13734 +changequote([,])dnl
13739 +dnl Test whether the *printf family of functions supports POSIX/XSI format
13740 +dnl strings with positions. (POSIX:2001)
13741 +dnl Result is gl_cv_func_printf_positions.
13743 +AC_DEFUN([gl_PRINTF_POSITIONS],
13745 + AC_REQUIRE([AC_PROG_CC])
13746 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13747 + AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
13748 + [gl_cv_func_printf_positions],
13751 +#include <stdio.h>
13752 +#include <string.h>
13753 +/* The string "%2$d %1$d", with dollar characters protected from the shell's
13754 + dollar expansion (possibly an autoconf bug). */
13755 +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
13756 +static char buf[100];
13759 + sprintf (buf, format, 33, 55);
13760 + return (strcmp (buf, "55 33") != 0);
13761 +}], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
13764 + case "$host_os" in
13765 + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
13766 + gl_cv_func_printf_positions="guessing no";;
13767 + beos*) gl_cv_func_printf_positions="guessing no";;
13768 + mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
13769 + *) gl_cv_func_printf_positions="guessing yes";;
13771 +changequote([,])dnl
13776 +dnl Test whether the *printf family of functions supports POSIX/XSI format
13777 +dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001)
13778 +dnl Result is gl_cv_func_printf_flag_grouping.
13780 +AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
13782 + AC_REQUIRE([AC_PROG_CC])
13783 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13784 + AC_CACHE_CHECK([whether printf supports the grouping flag],
13785 + [gl_cv_func_printf_flag_grouping],
13788 +#include <stdio.h>
13789 +#include <string.h>
13790 +static char buf[100];
13793 + if (sprintf (buf, "%'d %d", 1234567, 99) < 0
13794 + || buf[strlen (buf) - 1] != '9')
13797 +}], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no],
13800 + case "$host_os" in
13801 + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
13802 + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
13803 + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
13804 + *) gl_cv_func_printf_flag_grouping="guessing yes";;
13806 +changequote([,])dnl
13811 +dnl Test whether the *printf family of functions supports the - flag correctly.
13812 +dnl (ISO C99.) See
13813 +dnl <http://lists.gnu.org/archive/html/bug-coreutils/2008-02/msg00035.html>
13814 +dnl Result is gl_cv_func_printf_flag_leftadjust.
13816 +AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
13818 + AC_REQUIRE([AC_PROG_CC])
13819 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13820 + AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
13821 + [gl_cv_func_printf_flag_leftadjust],
13824 +#include <stdio.h>
13825 +#include <string.h>
13826 +static char buf[100];
13829 + /* Check that a '-' flag is not annihilated by a negative width. */
13830 + if (sprintf (buf, "a%-*sc", -3, "b") < 0
13831 + || strcmp (buf, "ab c") != 0)
13835 + [gl_cv_func_printf_flag_leftadjust=yes],
13836 + [gl_cv_func_printf_flag_leftadjust=no],
13839 + case "$host_os" in
13840 + # Guess yes on HP-UX 11.
13841 + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
13842 + # Guess no on HP-UX 10 and older.
13843 + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
13844 + # Guess yes otherwise.
13845 + *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
13847 +changequote([,])dnl
13852 +dnl Test whether the *printf family of functions supports padding of non-finite
13853 +dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
13854 +dnl <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html>
13855 +dnl Result is gl_cv_func_printf_flag_zero.
13857 +AC_DEFUN([gl_PRINTF_FLAG_ZERO],
13859 + AC_REQUIRE([AC_PROG_CC])
13860 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13861 + AC_CACHE_CHECK([whether printf supports the zero flag correctly],
13862 + [gl_cv_func_printf_flag_zero],
13865 +#include <stdio.h>
13866 +#include <string.h>
13867 +static char buf[100];
13870 + if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
13871 + || (strcmp (buf, " inf") != 0
13872 + && strcmp (buf, " infinity") != 0))
13875 +}], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
13878 + case "$host_os" in
13879 + # Guess yes on glibc systems.
13880 + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
13881 + # Guess yes on BeOS.
13882 + beos*) gl_cv_func_printf_flag_zero="guessing yes";;
13883 + # If we don't know, assume the worst.
13884 + *) gl_cv_func_printf_flag_zero="guessing no";;
13886 +changequote([,])dnl
13891 +dnl Test whether the *printf family of functions supports large precisions.
13892 +dnl On mingw, precisions larger than 512 are treated like 512, in integer,
13893 +dnl floating-point or pointer output. On BeOS, precisions larger than 1044
13894 +dnl crash the program.
13895 +dnl Result is gl_cv_func_printf_precision.
13897 +AC_DEFUN([gl_PRINTF_PRECISION],
13899 + AC_REQUIRE([AC_PROG_CC])
13900 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13901 + AC_CACHE_CHECK([whether printf supports large precisions],
13902 + [gl_cv_func_printf_precision],
13905 +#include <stdio.h>
13906 +#include <string.h>
13907 +static char buf[5000];
13911 + /* On BeOS, this would crash and show a dialog box. Avoid the crash. */
13914 + if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
13917 +}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
13920 + case "$host_os" in
13921 + # Guess no only on native Win32 and BeOS systems.
13922 + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
13923 + beos*) gl_cv_func_printf_precision="guessing no" ;;
13924 + *) gl_cv_func_printf_precision="guessing yes" ;;
13926 +changequote([,])dnl
13931 +dnl Test whether the *printf family of functions recovers gracefully in case
13932 +dnl of an out-of-memory condition, or whether it crashes the entire program.
13933 +dnl Result is gl_cv_func_printf_enomem.
13935 +AC_DEFUN([gl_PRINTF_ENOMEM],
13937 + AC_REQUIRE([AC_PROG_CC])
13938 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13939 + AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
13940 + [gl_cv_func_printf_enomem],
13942 + if test "$cross_compiling" = no; then
13943 + AC_LANG_CONFTEST([AC_LANG_SOURCE([
13946 +#include <stdio.h>
13947 +#include <sys/types.h>
13948 +#include <sys/time.h>
13949 +#include <sys/resource.h>
13950 +#include <errno.h>
13953 + struct rlimit limit;
13956 + /* Some printf implementations allocate temporary space with malloc. */
13957 + /* On BSD systems, malloc() is limited by RLIMIT_DATA. */
13958 +#ifdef RLIMIT_DATA
13959 + if (getrlimit (RLIMIT_DATA, &limit) < 0)
13961 + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
13962 + limit.rlim_max = 5000000;
13963 + limit.rlim_cur = limit.rlim_max;
13964 + if (setrlimit (RLIMIT_DATA, &limit) < 0)
13967 + /* On Linux systems, malloc() is limited by RLIMIT_AS. */
13969 + if (getrlimit (RLIMIT_AS, &limit) < 0)
13971 + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
13972 + limit.rlim_max = 5000000;
13973 + limit.rlim_cur = limit.rlim_max;
13974 + if (setrlimit (RLIMIT_AS, &limit) < 0)
13977 + /* Some printf implementations allocate temporary space on the stack. */
13978 +#ifdef RLIMIT_STACK
13979 + if (getrlimit (RLIMIT_STACK, &limit) < 0)
13981 + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
13982 + limit.rlim_max = 5000000;
13983 + limit.rlim_cur = limit.rlim_max;
13984 + if (setrlimit (RLIMIT_STACK, &limit) < 0)
13987 + ret = printf ("%.5000000f", 1.0);
13988 + return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
13990 +changequote([,])dnl
13992 + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
13995 + if test $result != 0 && test $result != 77; then result=1; fi
13997 + ) >/dev/null 2>/dev/null
13999 + 0) gl_cv_func_printf_enomem="yes" ;;
14000 + 77) gl_cv_func_printf_enomem="guessing no" ;;
14001 + *) gl_cv_func_printf_enomem="no" ;;
14004 + gl_cv_func_printf_enomem="guessing no"
14009 + case "$host_os" in
14010 + # Guess yes on glibc systems.
14011 + *-gnu*) gl_cv_func_printf_enomem="guessing yes";;
14012 + # Guess yes on Solaris.
14013 + solaris*) gl_cv_func_printf_enomem="guessing yes";;
14014 + # Guess yes on AIX.
14015 + aix*) gl_cv_func_printf_enomem="guessing yes";;
14016 + # Guess yes on HP-UX/hppa.
14017 + hpux*) case "$host_cpu" in
14018 + hppa*) gl_cv_func_printf_enomem="guessing yes";;
14019 + *) gl_cv_func_printf_enomem="guessing no";;
14022 + # Guess yes on IRIX.
14023 + irix*) gl_cv_func_printf_enomem="guessing yes";;
14024 + # Guess yes on OSF/1.
14025 + osf*) gl_cv_func_printf_enomem="guessing yes";;
14026 + # Guess yes on BeOS.
14027 + beos*) gl_cv_func_printf_enomem="guessing yes";;
14028 + # If we don't know, assume the worst.
14029 + *) gl_cv_func_printf_enomem="guessing no";;
14031 +changequote([,])dnl
14036 +dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
14037 +dnl Result is ac_cv_func_snprintf.
14039 +AC_DEFUN([gl_SNPRINTF_PRESENCE],
14041 + AC_CHECK_FUNCS_ONCE([snprintf])
14044 +dnl Test whether the string produced by the snprintf function is always NUL
14045 +dnl terminated. (ISO C99, POSIX:2001)
14046 +dnl Result is gl_cv_func_snprintf_truncation_c99.
14048 +AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
14050 + AC_REQUIRE([AC_PROG_CC])
14051 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
14052 + AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
14053 + [gl_cv_func_snprintf_truncation_c99],
14056 +#include <stdio.h>
14057 +#include <string.h>
14058 +static char buf[100];
14061 + strcpy (buf, "ABCDEF");
14062 + snprintf (buf, 3, "%d %d", 4567, 89);
14063 + if (memcmp (buf, "45\0DEF", 6) != 0)
14066 +}], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no],
14069 + case "$host_os" in
14070 + # Guess yes on glibc systems.
14071 + *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14072 + # Guess yes on FreeBSD >= 5.
14073 + freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
14074 + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14075 + # Guess yes on MacOS X >= 10.3.
14076 + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
14077 + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14078 + # Guess yes on OpenBSD >= 3.9.
14079 + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
14080 + gl_cv_func_snprintf_truncation_c99="guessing no";;
14081 + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14082 + # Guess yes on Solaris >= 2.6.
14083 + solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
14084 + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14085 + # Guess yes on AIX >= 4.
14086 + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
14087 + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14088 + # Guess yes on HP-UX >= 11.
14089 + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
14090 + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14091 + # Guess yes on IRIX >= 6.5.
14092 + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14093 + # Guess yes on OSF/1 >= 5.
14094 + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
14095 + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14096 + # Guess yes on NetBSD >= 3.
14097 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
14098 + gl_cv_func_snprintf_truncation_c99="guessing no";;
14099 + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14100 + # Guess yes on BeOS.
14101 + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14102 + # If we don't know, assume the worst.
14103 + *) gl_cv_func_snprintf_truncation_c99="guessing no";;
14105 +changequote([,])dnl
14110 +dnl Test whether the return value of the snprintf function is the number
14111 +dnl of bytes (excluding the terminating NUL) that would have been produced
14112 +dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
14113 +dnl For example, this test program fails on IRIX 6.5:
14114 +dnl ---------------------------------------------------------------------
14115 +dnl #include <stdio.h>
14118 +dnl static char buf[8];
14119 +dnl int retval = snprintf (buf, 3, "%d", 12345);
14120 +dnl return retval >= 0 && retval < 3;
14122 +dnl ---------------------------------------------------------------------
14123 +dnl Result is gl_cv_func_snprintf_retval_c99.
14125 +AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
14127 + AC_REQUIRE([AC_PROG_CC])
14128 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
14129 + AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
14130 + [gl_cv_func_snprintf_retval_c99],
14133 +#include <stdio.h>
14134 +#include <string.h>
14135 +static char buf[100];
14138 + strcpy (buf, "ABCDEF");
14139 + if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
14142 +}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
14145 + case "$host_os" in
14146 + # Guess yes on glibc systems.
14147 + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14148 + # Guess yes on FreeBSD >= 5.
14149 + freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
14150 + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14151 + # Guess yes on MacOS X >= 10.3.
14152 + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
14153 + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14154 + # Guess yes on OpenBSD >= 3.9.
14155 + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
14156 + gl_cv_func_snprintf_retval_c99="guessing no";;
14157 + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14158 + # Guess yes on Solaris >= 2.6.
14159 + solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
14160 + solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14161 + # Guess yes on AIX >= 4.
14162 + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
14163 + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14164 + # Guess yes on NetBSD >= 3.
14165 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
14166 + gl_cv_func_snprintf_retval_c99="guessing no";;
14167 + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14168 + # Guess yes on BeOS.
14169 + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14170 + # If we don't know, assume the worst.
14171 + *) gl_cv_func_snprintf_retval_c99="guessing no";;
14173 +changequote([,])dnl
14178 +dnl Test whether the snprintf function supports the %n format directive
14179 +dnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
14180 +dnl Result is gl_cv_func_snprintf_directive_n.
14182 +AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
14184 + AC_REQUIRE([AC_PROG_CC])
14185 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
14186 + AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
14187 + [gl_cv_func_snprintf_directive_n],
14190 +#include <stdio.h>
14191 +#include <string.h>
14192 +static char fmtstring[10];
14193 +static char buf[100];
14197 + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
14198 + support %n in format strings in read-only memory but not in writable
14200 + strcpy (fmtstring, "%d %n");
14201 + snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
14205 +}], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no],
14208 + case "$host_os" in
14209 + # Guess yes on glibc systems.
14210 + *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
14211 + # Guess yes on FreeBSD >= 5.
14212 + freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
14213 + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
14214 + # Guess yes on MacOS X >= 10.3.
14215 + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
14216 + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
14217 + # Guess yes on Solaris >= 2.6.
14218 + solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
14219 + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
14220 + # Guess yes on AIX >= 4.
14221 + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
14222 + aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
14223 + # Guess yes on IRIX >= 6.5.
14224 + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
14225 + # Guess yes on OSF/1 >= 5.
14226 + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
14227 + osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
14228 + # Guess yes on NetBSD >= 3.
14229 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
14230 + gl_cv_func_snprintf_directive_n="guessing no";;
14231 + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
14232 + # Guess yes on BeOS.
14233 + beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
14234 + # If we don't know, assume the worst.
14235 + *) gl_cv_func_snprintf_directive_n="guessing no";;
14237 +changequote([,])dnl
14242 +dnl Test whether the snprintf function, when passed a size = 1, writes any
14243 +dnl output without bounds in this case, behaving like sprintf. This is the
14244 +dnl case on Linux libc5.
14245 +dnl Result is gl_cv_func_snprintf_size1.
14247 +AC_DEFUN([gl_SNPRINTF_SIZE1],
14249 + AC_REQUIRE([AC_PROG_CC])
14250 + AC_CACHE_CHECK([whether snprintf respects a size of 1],
14251 + [gl_cv_func_snprintf_size1],
14254 +#include <stdio.h>
14257 + static char buf[8] = "DEADBEEF";
14258 + snprintf (buf, 1, "%d", 12345);
14259 + return buf[1] != 'E';
14261 + [gl_cv_func_snprintf_size1=yes],
14262 + [gl_cv_func_snprintf_size1=no],
14263 + [gl_cv_func_snprintf_size1="guessing yes"])
14267 +dnl Test whether the vsnprintf function, when passed a zero size, produces no
14268 +dnl output. (ISO C99, POSIX:2001)
14269 +dnl For example, snprintf nevertheless writes a NUL byte in this case
14271 +dnl ---------------------------------------------------------------------
14272 +dnl #include <stdio.h>
14275 +dnl static char buf[8] = "DEADBEEF";
14276 +dnl snprintf (buf, 0, "%d", 12345);
14277 +dnl return buf[0] != 'D';
14279 +dnl ---------------------------------------------------------------------
14280 +dnl And vsnprintf writes any output without bounds in this case, behaving like
14281 +dnl vsprintf, on HP-UX 11 and OSF/1 5.1:
14282 +dnl ---------------------------------------------------------------------
14283 +dnl #include <stdarg.h>
14284 +dnl #include <stdio.h>
14285 +dnl static int my_snprintf (char *buf, int size, const char *format, ...)
14289 +dnl va_start (args, format);
14290 +dnl ret = vsnprintf (buf, size, format, args);
14291 +dnl va_end (args);
14296 +dnl static char buf[8] = "DEADBEEF";
14297 +dnl my_snprintf (buf, 0, "%d", 12345);
14298 +dnl return buf[0] != 'D';
14300 +dnl ---------------------------------------------------------------------
14301 +dnl Result is gl_cv_func_vsnprintf_zerosize_c99.
14303 +AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
14305 + AC_REQUIRE([AC_PROG_CC])
14306 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
14307 + AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
14308 + [gl_cv_func_vsnprintf_zerosize_c99],
14311 +#include <stdarg.h>
14312 +#include <stdio.h>
14313 +static int my_snprintf (char *buf, int size, const char *format, ...)
14317 + va_start (args, format);
14318 + ret = vsnprintf (buf, size, format, args);
14324 + static char buf[8] = "DEADBEEF";
14325 + my_snprintf (buf, 0, "%d", 12345);
14326 + return buf[0] != 'D';
14328 + [gl_cv_func_vsnprintf_zerosize_c99=yes],
14329 + [gl_cv_func_vsnprintf_zerosize_c99=no],
14332 + case "$host_os" in
14333 + # Guess yes on glibc systems.
14334 + *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14335 + # Guess yes on FreeBSD >= 5.
14336 + freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14337 + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14338 + # Guess yes on MacOS X >= 10.3.
14339 + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14340 + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14341 + # Guess yes on Cygwin.
14342 + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14343 + # Guess yes on Solaris >= 2.6.
14344 + solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14345 + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14346 + # Guess yes on AIX >= 4.
14347 + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14348 + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14349 + # Guess yes on IRIX >= 6.5.
14350 + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14351 + # Guess yes on NetBSD >= 3.
14352 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
14353 + gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14354 + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14355 + # Guess yes on BeOS.
14356 + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14357 + # Guess yes on mingw.
14358 + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14359 + # If we don't know, assume the worst.
14360 + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14362 +changequote([,])dnl
14367 +dnl The results of these tests on various platforms are:
14369 +dnl 1 = gl_PRINTF_SIZES_C99
14370 +dnl 2 = gl_PRINTF_LONG_DOUBLE
14371 +dnl 3 = gl_PRINTF_INFINITE
14372 +dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
14373 +dnl 5 = gl_PRINTF_DIRECTIVE_A
14374 +dnl 6 = gl_PRINTF_DIRECTIVE_F
14375 +dnl 7 = gl_PRINTF_DIRECTIVE_N
14376 +dnl 8 = gl_PRINTF_POSITIONS
14377 +dnl 9 = gl_PRINTF_FLAG_GROUPING
14378 +dnl 10 = gl_PRINTF_FLAG_LEFTADJUST
14379 +dnl 11 = gl_PRINTF_FLAG_ZERO
14380 +dnl 12 = gl_PRINTF_PRECISION
14381 +dnl 13 = gl_PRINTF_ENOMEM
14382 +dnl 14 = gl_SNPRINTF_PRESENCE
14383 +dnl 15 = gl_SNPRINTF_TRUNCATION_C99
14384 +dnl 16 = gl_SNPRINTF_RETVAL_C99
14385 +dnl 17 = gl_SNPRINTF_DIRECTIVE_N
14386 +dnl 18 = gl_SNPRINTF_SIZE1
14387 +dnl 19 = gl_VSNPRINTF_ZEROSIZE_C99
14389 +dnl 1 = checking whether printf supports size specifiers as in C99...
14390 +dnl 2 = checking whether printf supports 'long double' arguments...
14391 +dnl 3 = checking whether printf supports infinite 'double' arguments...
14392 +dnl 4 = checking whether printf supports infinite 'long double' arguments...
14393 +dnl 5 = checking whether printf supports the 'a' and 'A' directives...
14394 +dnl 6 = checking whether printf supports the 'F' directive...
14395 +dnl 7 = checking whether printf supports the 'n' directive...
14396 +dnl 8 = checking whether printf supports POSIX/XSI format strings with positions...
14397 +dnl 9 = checking whether printf supports the grouping flag...
14398 +dnl 10 = checking whether printf supports the left-adjust flag correctly...
14399 +dnl 11 = checking whether printf supports the zero flag correctly...
14400 +dnl 12 = checking whether printf supports large precisions...
14401 +dnl 13 = checking whether printf survives out-of-memory conditions...
14402 +dnl 14 = checking for snprintf...
14403 +dnl 15 = checking whether snprintf truncates the result as in C99...
14404 +dnl 16 = checking whether snprintf returns a byte count as in C99...
14405 +dnl 17 = checking whether snprintf fully supports the 'n' directive...
14406 +dnl 18 = checking whether snprintf respects a size of 1...
14407 +dnl 19 = checking whether vsnprintf respects a zero size as in C99...
14409 +dnl . = yes, # = no.
14411 +dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
14412 +dnl glibc 2.5 . . . . . . . . . . . . . . . . . . .
14413 +dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . .
14414 +dnl FreeBSD 5.4, 6.1 . . . . # . . . . . # . # . . . . . .
14415 +dnl MacOS X 10.3.9 . . . . # . . . . . # . # . . . . . .
14416 +dnl OpenBSD 3.9, 4.0 . . # # # # . . # . # . # . . . . . .
14417 +dnl Cygwin 2007 (= Cygwin 1.5.24) . . . . # # . . . ? # ? ? . . . . . .
14418 +dnl Cygwin 2006 (= Cygwin 1.5.19) # . . . # # . . # ? # ? ? . . . . . .
14419 +dnl Solaris 10 . . # # # . . . . . # . . . . . . . .
14420 +dnl Solaris 2.6 ... 9 # . # # # # . . . . # . . . . . . . .
14421 +dnl Solaris 2.5.1 # . # # # # . . . . # . . # # # # # #
14422 +dnl AIX 5.2 . . # # # . . . . . # . . . . . . . .
14423 +dnl AIX 4.3.2, 5.1 # . # # # # . . . . # . . . . . . . .
14424 +dnl HP-UX 11.31 . . . . # . . . . . # . . . . # # . .
14425 +dnl HP-UX 11.{00,11,23} # . . . # # . . . . # . . . . # # . #
14426 +dnl HP-UX 10.20 # . . . # # . . . # # . . . . # # ? #
14427 +dnl IRIX 6.5 # . # # # # . . . . # . . . . # . . .
14428 +dnl OSF/1 5.1 # . # # # # . . . . # . . . . # . . #
14429 +dnl OSF/1 4.0d # . # # # # . . . . # . . # # # # # #
14430 +dnl NetBSD 4.0 . ? ? ? ? ? . . ? ? ? ? ? . . . ? ? ?
14431 +dnl NetBSD 3.0 . . . . # # . # # ? # . # . . . . . .
14432 +dnl BeOS # # . # # # . # . ? . # ? . . . . . .
14433 +dnl mingw # # # # # # . # # . # # ? . # # # . .
14434 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/size_max.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/size_max.m4
14435 --- gtk-vnc-0.3.7.dan3/gnulib/m4/size_max.m4 1970-01-01 01:00:00.000000000 +0100
14436 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/size_max.m4 2008-10-09 15:24:52.000000000 +0100
14438 +# size_max.m4 serial 6
14439 +dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
14440 +dnl This file is free software; the Free Software Foundation
14441 +dnl gives unlimited permission to copy and/or distribute it,
14442 +dnl with or without modifications, as long as this notice is preserved.
14444 +dnl From Bruno Haible.
14446 +AC_DEFUN([gl_SIZE_MAX],
14448 + AC_CHECK_HEADERS(stdint.h)
14449 + dnl First test whether the system already has SIZE_MAX.
14450 + AC_MSG_CHECKING([for SIZE_MAX])
14451 + AC_CACHE_VAL([gl_cv_size_max], [
14453 + AC_EGREP_CPP([Found it], [
14454 +#include <limits.h>
14456 +#include <stdint.h>
14461 +], gl_cv_size_max=yes)
14462 + if test -z "$gl_cv_size_max"; then
14463 + dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
14464 + dnl than the type 'unsigned long'. Try hard to find a definition that can
14465 + dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
14466 + AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
14467 + [#include <stddef.h>
14468 +#include <limits.h>], size_t_bits_minus_1=)
14469 + AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
14470 + [#include <stddef.h>], fits_in_uint=)
14471 + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
14472 + if test $fits_in_uint = 1; then
14473 + dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
14474 + dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
14475 + AC_TRY_COMPILE([#include <stddef.h>
14476 + extern size_t foo;
14477 + extern unsigned long foo;
14478 + ], [], fits_in_uint=0)
14480 + dnl We cannot use 'expr' to simplify this expression, because 'expr'
14481 + dnl works only with 'long' integers in the host environment, while we
14482 + dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
14483 + if test $fits_in_uint = 1; then
14484 + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
14486 + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
14489 + dnl Shouldn't happen, but who knows...
14490 + gl_cv_size_max='((size_t)~(size_t)0)'
14494 + AC_MSG_RESULT([$gl_cv_size_max])
14495 + if test "$gl_cv_size_max" != yes; then
14496 + AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
14497 + [Define as the maximum value of type 'size_t', if the system doesn't define it.])
14501 +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
14502 +dnl Remove this when we can assume autoconf >= 2.61.
14503 +m4_ifdef([AC_COMPUTE_INT], [], [
14504 + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
14506 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/snprintf.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/snprintf.m4
14507 --- gtk-vnc-0.3.7.dan3/gnulib/m4/snprintf.m4 1970-01-01 01:00:00.000000000 +0100
14508 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/snprintf.m4 2008-10-09 15:24:53.000000000 +0100
14510 +# snprintf.m4 serial 5
14511 +dnl Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc.
14512 +dnl This file is free software; the Free Software Foundation
14513 +dnl gives unlimited permission to copy and/or distribute it,
14514 +dnl with or without modifications, as long as this notice is preserved.
14516 +AC_DEFUN([gl_FUNC_SNPRINTF],
14518 + AC_REQUIRE([gl_STDIO_H_DEFAULTS])
14519 + gl_cv_func_snprintf_usable=no
14520 + AC_CHECK_FUNCS([snprintf])
14521 + if test $ac_cv_func_snprintf = yes; then
14522 + gl_SNPRINTF_SIZE1
14523 + case "$gl_cv_func_snprintf_size1" in
14525 + gl_cv_func_snprintf_usable=yes
14529 + if test $gl_cv_func_snprintf_usable = no; then
14530 + gl_REPLACE_SNPRINTF
14532 + AC_CHECK_DECLS_ONCE([snprintf])
14533 + if test $ac_cv_have_decl_snprintf = no; then
14534 + HAVE_DECL_SNPRINTF=0
14538 +AC_DEFUN([gl_REPLACE_SNPRINTF],
14540 + AC_REQUIRE([gl_STDIO_H_DEFAULTS])
14541 + AC_LIBOBJ([snprintf])
14542 + if test $ac_cv_func_snprintf = yes; then
14543 + REPLACE_SNPRINTF=1
14545 + gl_PREREQ_SNPRINTF
14548 +# Prerequisites of lib/snprintf.c.
14549 +AC_DEFUN([gl_PREREQ_SNPRINTF], [:])
14550 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/socklen.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/socklen.m4
14551 --- gtk-vnc-0.3.7.dan3/gnulib/m4/socklen.m4 1970-01-01 01:00:00.000000000 +0100
14552 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/socklen.m4 2008-10-09 15:24:53.000000000 +0100
14554 +# socklen.m4 serial 6
14555 +dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
14556 +dnl This file is free software; the Free Software Foundation
14557 +dnl gives unlimited permission to copy and/or distribute it,
14558 +dnl with or without modifications, as long as this notice is preserved.
14560 +dnl From Albert Chin, Windows fixes from Simon Josefsson.
14562 +dnl Check for socklen_t: historically on BSD it is an int, and in
14563 +dnl POSIX 1g it is a type of its own, but some platforms use different
14564 +dnl types for the argument to getsockopt, getpeername, etc. So we
14565 +dnl have to test to find something that will work.
14567 +dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
14568 +dnl it there first. That file is included by gnulib's sys_socket.in.h, which
14569 +dnl all users of this module should include. Cygwin must not include
14571 +AC_DEFUN([gl_TYPE_SOCKLEN_T],
14572 + [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl
14573 + AC_CHECK_TYPE([socklen_t], ,
14574 + [AC_MSG_CHECKING([for socklen_t equivalent])
14575 + AC_CACHE_VAL([gl_cv_socklen_t_equiv],
14576 + [# Systems have either "struct sockaddr *" or
14577 + # "void *" as the second argument to getpeername
14578 + gl_cv_socklen_t_equiv=
14579 + for arg2 in "struct sockaddr" void; do
14580 + for t in int size_t "unsigned int" "long int" "unsigned long int"; do
14582 + [#include <sys/types.h>
14583 + #include <sys/socket.h>
14585 + int getpeername (int, $arg2 *, $t *);],
14587 + getpeername (0, 0, &len);],
14588 + [gl_cv_socklen_t_equiv="$t"])
14589 + test "$gl_cv_socklen_t_equiv" != "" && break
14591 + test "$gl_cv_socklen_t_equiv" != "" && break
14594 + if test "$gl_cv_socklen_t_equiv" = ""; then
14595 + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
14597 + AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
14598 + AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
14599 + [type to use in place of socklen_t if not defined])],
14600 + [#include <sys/types.h>
14601 + #if HAVE_SYS_SOCKET_H
14602 + # include <sys/socket.h>
14603 + #elif HAVE_WS2TCPIP_H
14604 + # include <ws2tcpip.h>
14606 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/sockpfaf.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/sockpfaf.m4
14607 --- gtk-vnc-0.3.7.dan3/gnulib/m4/sockpfaf.m4 1970-01-01 01:00:00.000000000 +0100
14608 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/sockpfaf.m4 2008-10-09 15:24:53.000000000 +0100
14610 +# sockpfaf.m4 serial 5
14611 +dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
14612 +dnl This file is free software; the Free Software Foundation
14613 +dnl gives unlimited permission to copy and/or distribute it,
14614 +dnl with or without modifications, as long as this notice is preserved.
14616 +dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...)
14617 +dnl and some common address families (AF_INET, AF_INET6, ...).
14618 +dnl This test assumes that a system supports an address family if and only if
14619 +dnl it supports the corresponding protocol family.
14621 +dnl From Bruno Haible.
14623 +AC_DEFUN([gl_SOCKET_FAMILIES],
14625 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
14626 + AC_CHECK_HEADERS_ONCE([netinet/in.h])
14628 + AC_MSG_CHECKING(for IPv4 sockets)
14629 + AC_CACHE_VAL(gl_cv_socket_ipv4,
14630 + [AC_TRY_COMPILE([#include <sys/types.h>
14631 +#ifdef HAVE_SYS_SOCKET_H
14632 +#include <sys/socket.h>
14634 +#ifdef HAVE_NETINET_IN_H
14635 +#include <netinet/in.h>
14637 +#ifdef HAVE_WINSOCK2_H
14638 +#include <winsock2.h>
14640 +[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
14641 + if (&x && &y && &z) return 0;],
14642 + gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
14643 + AC_MSG_RESULT($gl_cv_socket_ipv4)
14644 + if test $gl_cv_socket_ipv4 = yes; then
14645 + AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if <sys/socket.h> defines AF_INET.])
14648 + AC_MSG_CHECKING(for IPv6 sockets)
14649 + AC_CACHE_VAL(gl_cv_socket_ipv6,
14650 + [AC_TRY_COMPILE([#include <sys/types.h>
14651 +#ifdef HAVE_SYS_SOCKET_H
14652 +#include <sys/socket.h>
14654 +#ifdef HAVE_NETINET_IN_H
14655 +#include <netinet/in.h>
14657 +#ifdef HAVE_WINSOCK2_H
14658 +#include <winsock2.h>
14660 +[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
14661 + if (&x && &y && &z) return 0;],
14662 + gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
14663 + AC_MSG_RESULT($gl_cv_socket_ipv6)
14664 + if test $gl_cv_socket_ipv6 = yes; then
14665 + AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if <sys/socket.h> defines AF_INET6.])
14668 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/stdbool.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdbool.m4
14669 --- gtk-vnc-0.3.7.dan3/gnulib/m4/stdbool.m4 1970-01-01 01:00:00.000000000 +0100
14670 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdbool.m4 2008-10-09 15:24:53.000000000 +0100
14672 +# Check for stdbool.h that conforms to C99.
14674 +dnl Copyright (C) 2002-2006 Free Software Foundation, Inc.
14675 +dnl This file is free software; the Free Software Foundation
14676 +dnl gives unlimited permission to copy and/or distribute it,
14677 +dnl with or without modifications, as long as this notice is preserved.
14679 +# Prepare for substituting <stdbool.h> if it is not supported.
14681 +AC_DEFUN([AM_STDBOOL_H],
14683 + AC_REQUIRE([AC_HEADER_STDBOOL])
14685 + # Define two additional variables used in the Makefile substitution.
14687 + if test "$ac_cv_header_stdbool_h" = yes; then
14690 + STDBOOL_H='stdbool.h'
14692 + AC_SUBST([STDBOOL_H])
14694 + if test "$ac_cv_type__Bool" = yes; then
14699 + AC_SUBST([HAVE__BOOL])
14702 +# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
14703 +AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
14705 +# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf
14706 +# have this macro built-in.
14708 +AC_DEFUN([AC_HEADER_STDBOOL],
14709 + [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
14710 + [ac_cv_header_stdbool_h],
14713 + #include <stdbool.h>
14715 + "error: bool is not defined"
14718 + "error: false is not defined"
14721 + "error: false is not 0"
14724 + "error: true is not defined"
14727 + "error: true is not 1"
14729 + #ifndef __bool_true_false_are_defined
14730 + "error: __bool_true_false_are_defined is not defined"
14733 + struct s { _Bool s: 1; _Bool t; } s;
14735 + char a[true == 1 ? 1 : -1];
14736 + char b[false == 0 ? 1 : -1];
14737 + char c[__bool_true_false_are_defined == 1 ? 1 : -1];
14738 + char d[(bool) 0.5 == true ? 1 : -1];
14740 + char f[(_Bool) 0.0 == false ? 1 : -1];
14742 + char h[sizeof (_Bool)];
14743 + char i[sizeof s.t];
14744 + enum { j = false, k = true, l = false * true, m = true * 256 };
14746 + char o[sizeof n == m * sizeof n[0] ? 1 : -1];
14747 + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
14748 + #if defined __xlc__ || defined __GNUC__
14749 + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
14750 + reported by James Lemley on 2005-10-05; see
14751 + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
14752 + This test is not quite right, since xlc is allowed to
14753 + reject this program, as the initializer for xlcbug is
14754 + not one of the forms that C requires support for.
14755 + However, doing the test right would require a run-time
14756 + test, and that would make cross-compilation harder.
14757 + Let us hope that IBM fixes the xlc bug, and also adds
14758 + support for this kind of constant expression. In the
14759 + meantime, this test will reject xlc, which is OK, since
14760 + our stdbool.h substitute should suffice. We also test
14761 + this with GCC, where it should work, to detect more
14762 + quickly whether someone messes up the test in the
14764 + char digs[] = "0123456789";
14765 + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
14767 + /* Catch a bug in an HP-UX C compiler. See
14768 + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
14769 + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
14777 + /* Refer to every declared value, to avoid compiler optimizations. */
14778 + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
14779 + + !m + !n + !o + !p + !q + !pq);
14781 + [ac_cv_header_stdbool_h=yes],
14782 + [ac_cv_header_stdbool_h=no])])
14783 + AC_CHECK_TYPES([_Bool])
14784 + if test $ac_cv_header_stdbool_h = yes; then
14785 + AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
14787 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/stdint_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdint_h.m4
14788 --- gtk-vnc-0.3.7.dan3/gnulib/m4/stdint_h.m4 1970-01-01 01:00:00.000000000 +0100
14789 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdint_h.m4 2008-10-09 15:24:53.000000000 +0100
14791 +# stdint_h.m4 serial 6
14792 +dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
14793 +dnl This file is free software; the Free Software Foundation
14794 +dnl gives unlimited permission to copy and/or distribute it,
14795 +dnl with or without modifications, as long as this notice is preserved.
14797 +dnl From Paul Eggert.
14799 +# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
14800 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
14802 +AC_DEFUN([gl_AC_HEADER_STDINT_H],
14804 + AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
14806 + [#include <sys/types.h>
14807 +#include <stdint.h>],
14808 + [uintmax_t i = (uintmax_t) -1; return !i;],
14809 + gl_cv_header_stdint_h=yes,
14810 + gl_cv_header_stdint_h=no)])
14811 + if test $gl_cv_header_stdint_h = yes; then
14812 + AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
14813 + [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
14814 + and declares uintmax_t. ])
14817 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/stdint.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdint.m4
14818 --- gtk-vnc-0.3.7.dan3/gnulib/m4/stdint.m4 1970-01-01 01:00:00.000000000 +0100
14819 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdint.m4 2008-10-09 15:24:53.000000000 +0100
14821 +# stdint.m4 serial 31
14822 +dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
14823 +dnl This file is free software; the Free Software Foundation
14824 +dnl gives unlimited permission to copy and/or distribute it,
14825 +dnl with or without modifications, as long as this notice is preserved.
14827 +dnl From Paul Eggert and Bruno Haible.
14828 +dnl Test whether <stdint.h> is supported or must be substituted.
14830 +AC_DEFUN([gl_STDINT_H],
14832 + AC_PREREQ(2.59)dnl
14834 + dnl Check for long long int and unsigned long long int.
14835 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
14836 + if test $ac_cv_type_long_long_int = yes; then
14837 + HAVE_LONG_LONG_INT=1
14839 + HAVE_LONG_LONG_INT=0
14841 + AC_SUBST([HAVE_LONG_LONG_INT])
14842 + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
14843 + if test $ac_cv_type_unsigned_long_long_int = yes; then
14844 + HAVE_UNSIGNED_LONG_LONG_INT=1
14846 + HAVE_UNSIGNED_LONG_LONG_INT=0
14848 + AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
14850 + dnl Check for <inttypes.h>.
14851 + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
14852 + if test $ac_cv_header_inttypes_h = yes; then
14853 + HAVE_INTTYPES_H=1
14855 + HAVE_INTTYPES_H=0
14857 + AC_SUBST([HAVE_INTTYPES_H])
14859 + dnl Check for <sys/types.h>.
14860 + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h.
14861 + if test $ac_cv_header_sys_types_h = yes; then
14862 + HAVE_SYS_TYPES_H=1
14864 + HAVE_SYS_TYPES_H=0
14866 + AC_SUBST([HAVE_SYS_TYPES_H])
14868 + gl_CHECK_NEXT_HEADERS([stdint.h])
14869 + if test $ac_cv_header_stdint_h = yes; then
14874 + AC_SUBST([HAVE_STDINT_H])
14876 + dnl Now see whether we need a substitute <stdint.h>.
14877 + if test $ac_cv_header_stdint_h = yes; then
14878 + AC_CACHE_CHECK([whether stdint.h conforms to C99],
14879 + [gl_cv_header_working_stdint_h],
14880 + [gl_cv_header_working_stdint_h=no
14881 + AC_COMPILE_IFELSE([
14882 + AC_LANG_PROGRAM([[
14883 +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
14884 +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
14885 +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
14886 +#include <stdint.h>
14887 +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
14888 +#if !(defined WCHAR_MIN && defined WCHAR_MAX)
14889 +#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
14892 +gl_STDINT_INCLUDES
14895 +int8_t a1 = INT8_MAX;
14896 +int8_t a1min = INT8_MIN;
14899 +int16_t a2 = INT16_MAX;
14900 +int16_t a2min = INT16_MIN;
14903 +int32_t a3 = INT32_MAX;
14904 +int32_t a3min = INT32_MIN;
14907 +int64_t a4 = INT64_MAX;
14908 +int64_t a4min = INT64_MIN;
14911 +uint8_t b1 = UINT8_MAX;
14913 +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
14916 +uint16_t b2 = UINT16_MAX;
14919 +uint32_t b3 = UINT32_MAX;
14922 +uint64_t b4 = UINT64_MAX;
14924 +int_least8_t c1 = INT8_C (0x7f);
14925 +int_least8_t c1max = INT_LEAST8_MAX;
14926 +int_least8_t c1min = INT_LEAST8_MIN;
14927 +int_least16_t c2 = INT16_C (0x7fff);
14928 +int_least16_t c2max = INT_LEAST16_MAX;
14929 +int_least16_t c2min = INT_LEAST16_MIN;
14930 +int_least32_t c3 = INT32_C (0x7fffffff);
14931 +int_least32_t c3max = INT_LEAST32_MAX;
14932 +int_least32_t c3min = INT_LEAST32_MIN;
14933 +int_least64_t c4 = INT64_C (0x7fffffffffffffff);
14934 +int_least64_t c4max = INT_LEAST64_MAX;
14935 +int_least64_t c4min = INT_LEAST64_MIN;
14936 +uint_least8_t d1 = UINT8_C (0xff);
14937 +uint_least8_t d1max = UINT_LEAST8_MAX;
14938 +uint_least16_t d2 = UINT16_C (0xffff);
14939 +uint_least16_t d2max = UINT_LEAST16_MAX;
14940 +uint_least32_t d3 = UINT32_C (0xffffffff);
14941 +uint_least32_t d3max = UINT_LEAST32_MAX;
14942 +uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
14943 +uint_least64_t d4max = UINT_LEAST64_MAX;
14944 +int_fast8_t e1 = INT_FAST8_MAX;
14945 +int_fast8_t e1min = INT_FAST8_MIN;
14946 +int_fast16_t e2 = INT_FAST16_MAX;
14947 +int_fast16_t e2min = INT_FAST16_MIN;
14948 +int_fast32_t e3 = INT_FAST32_MAX;
14949 +int_fast32_t e3min = INT_FAST32_MIN;
14950 +int_fast64_t e4 = INT_FAST64_MAX;
14951 +int_fast64_t e4min = INT_FAST64_MIN;
14952 +uint_fast8_t f1 = UINT_FAST8_MAX;
14953 +uint_fast16_t f2 = UINT_FAST16_MAX;
14954 +uint_fast32_t f3 = UINT_FAST32_MAX;
14955 +uint_fast64_t f4 = UINT_FAST64_MAX;
14957 +intptr_t g = INTPTR_MAX;
14958 +intptr_t gmin = INTPTR_MIN;
14960 +#ifdef UINTPTR_MAX
14961 +uintptr_t h = UINTPTR_MAX;
14963 +intmax_t i = INTMAX_MAX;
14964 +uintmax_t j = UINTMAX_MAX;
14966 +#include <limits.h> /* for CHAR_BIT */
14967 +#define TYPE_MINIMUM(t) \
14968 + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
14969 +#define TYPE_MAXIMUM(t) \
14970 + ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
14972 + int check_PTRDIFF:
14973 + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
14974 + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
14976 + /* Detect bug in FreeBSD 6.0 / ia64. */
14977 + int check_SIG_ATOMIC:
14978 + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
14979 + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
14981 + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
14983 + WCHAR_MIN == TYPE_MINIMUM (wchar_t)
14984 + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
14986 + /* Detect bug in mingw. */
14988 + WINT_MIN == TYPE_MINIMUM (wint_t)
14989 + && WINT_MAX == TYPE_MAXIMUM (wint_t)
14992 + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
14993 + int check_UINT8_C:
14994 + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
14995 + int check_UINT16_C:
14996 + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
14998 + /* Detect bugs in OpenBSD 3.9 stdint.h. */
15000 + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
15003 + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
15006 + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
15009 + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
15011 + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
15012 + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
15013 + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
15014 + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
15015 + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
15016 + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
15017 + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
15018 + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
15019 + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
15020 + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
15021 + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
15024 + [gl_cv_header_working_stdint_h=yes])])
15026 + if test "$gl_cv_header_working_stdint_h" = yes; then
15029 + dnl Check for <sys/inttypes.h>, and for
15030 + dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
15031 + AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
15032 + if test $ac_cv_header_sys_inttypes_h = yes; then
15033 + HAVE_SYS_INTTYPES_H=1
15035 + HAVE_SYS_INTTYPES_H=0
15037 + AC_SUBST([HAVE_SYS_INTTYPES_H])
15038 + if test $ac_cv_header_sys_bitypes_h = yes; then
15039 + HAVE_SYS_BITYPES_H=1
15041 + HAVE_SYS_BITYPES_H=0
15043 + AC_SUBST([HAVE_SYS_BITYPES_H])
15045 + dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
15046 + dnl character support).
15047 + AC_CHECK_HEADERS_ONCE([wchar.h])
15049 + gl_STDINT_TYPE_PROPERTIES
15050 + STDINT_H=stdint.h
15052 + AC_SUBST(STDINT_H)
15055 +dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
15056 +dnl Determine the size of each of the given types in bits.
15057 +AC_DEFUN([gl_STDINT_BITSIZEOF],
15059 + dnl Use a shell loop, to avoid bloating configure, and
15060 + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
15062 + dnl - extra AC_SUBST calls, so that the right substitutions are made.
15063 + m4_foreach_w([gltype], [$1],
15064 + [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
15065 + [Define to the number of bits in type ']gltype['.])])
15066 + for gltype in $1 ; do
15067 + AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
15068 + [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT],
15070 +#include <limits.h>], [result=unknown])
15071 + eval gl_cv_bitsizeof_${gltype}=\$result
15073 + eval result=\$gl_cv_bitsizeof_${gltype}
15074 + if test $result = unknown; then
15075 + dnl Use a nonempty default, because some compilers, such as IRIX 5 cc,
15076 + dnl do a syntax check even on unused #if conditions and give an error
15077 + dnl on valid C code like this:
15084 + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
15085 + AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
15086 + eval BITSIZEOF_${GLTYPE}=\$result
15088 + m4_foreach_w([gltype], [$1],
15089 + [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
15092 +dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
15093 +dnl Determine the signedness of each of the given types.
15094 +dnl Define HAVE_SIGNED_TYPE if type is signed.
15095 +AC_DEFUN([gl_CHECK_TYPES_SIGNED],
15097 + dnl Use a shell loop, to avoid bloating configure, and
15098 + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
15100 + dnl - extra AC_SUBST calls, so that the right substitutions are made.
15101 + m4_foreach_w([gltype], [$1],
15102 + [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
15103 + [Define to 1 if ']gltype[' is a signed integer type.])])
15104 + for gltype in $1 ; do
15105 + AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
15106 + [AC_COMPILE_IFELSE(
15107 + [AC_LANG_PROGRAM([$2[
15108 + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])],
15109 + result=yes, result=no)
15110 + eval gl_cv_type_${gltype}_signed=\$result
15112 + eval result=\$gl_cv_type_${gltype}_signed
15113 + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
15114 + if test "$result" = yes; then
15115 + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1)
15116 + eval HAVE_SIGNED_${GLTYPE}=1
15118 + eval HAVE_SIGNED_${GLTYPE}=0
15121 + m4_foreach_w([gltype], [$1],
15122 + [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
15125 +dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
15126 +dnl Determine the suffix to use for integer constants of the given types.
15127 +dnl Define t_SUFFIX for each such type.
15128 +AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
15130 + dnl Use a shell loop, to avoid bloating configure, and
15131 + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
15133 + dnl - extra AC_SUBST calls, so that the right substitutions are made.
15134 + m4_foreach_w([gltype], [$1],
15135 + [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
15136 + [Define to l, ll, u, ul, ull, etc., as suitable for
15137 + constants of type ']gltype['.])])
15138 + for gltype in $1 ; do
15139 + AC_CACHE_CHECK([for $gltype integer literal suffix],
15140 + [gl_cv_type_${gltype}_suffix],
15141 + [eval gl_cv_type_${gltype}_suffix=no
15142 + eval result=\$gl_cv_type_${gltype}_signed
15143 + if test "$result" = yes; then
15148 + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
15150 + '') gltype1='int';;
15151 + l) gltype1='long int';;
15152 + ll) gltype1='long long int';;
15153 + i64) gltype1='__int64';;
15154 + u) gltype1='unsigned int';;
15155 + ul) gltype1='unsigned long int';;
15156 + ull) gltype1='unsigned long long int';;
15157 + ui64)gltype1='unsigned __int64';;
15159 + AC_COMPILE_IFELSE(
15160 + [AC_LANG_PROGRAM([$2[
15161 + extern $gltype foo;
15162 + extern $gltype1 foo;]])],
15163 + [eval gl_cv_type_${gltype}_suffix=\$glsuf])
15164 + eval result=\$gl_cv_type_${gltype}_suffix
15165 + test "$result" != no && break
15167 + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
15168 + eval result=\$gl_cv_type_${gltype}_suffix
15169 + test "$result" = no && result=
15170 + eval ${GLTYPE}_SUFFIX=\$result
15171 + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result)
15173 + m4_foreach_w([gltype], [$1],
15174 + [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
15177 +dnl gl_STDINT_INCLUDES
15178 +AC_DEFUN([gl_STDINT_INCLUDES],
15180 + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
15181 + included before <wchar.h>. */
15182 + #include <stddef.h>
15183 + #include <signal.h>
15185 + # include <stdio.h>
15186 + # include <time.h>
15187 + # include <wchar.h>
15191 +dnl gl_STDINT_TYPE_PROPERTIES
15192 +dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
15193 +dnl of interest to stdint.in.h.
15194 +AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
15196 + gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
15197 + [gl_STDINT_INCLUDES])
15198 + gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
15199 + [gl_STDINT_INCLUDES])
15200 + gl_cv_type_ptrdiff_t_signed=yes
15201 + gl_cv_type_size_t_signed=no
15202 + gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
15203 + [gl_STDINT_INCLUDES])
15206 +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
15207 +dnl Remove this when we can assume autoconf >= 2.61.
15208 +m4_ifdef([AC_COMPUTE_INT], [], [
15209 + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
15213 +# Local Variables:
15214 +# indent-tabs-mode: nil
15216 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/stdio_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdio_h.m4
15217 --- gtk-vnc-0.3.7.dan3/gnulib/m4/stdio_h.m4 1970-01-01 01:00:00.000000000 +0100
15218 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdio_h.m4 2008-10-09 15:24:53.000000000 +0100
15220 +# stdio_h.m4 serial 13
15221 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
15222 +dnl This file is free software; the Free Software Foundation
15223 +dnl gives unlimited permission to copy and/or distribute it,
15224 +dnl with or without modifications, as long as this notice is preserved.
15226 +AC_DEFUN([gl_STDIO_H],
15228 + AC_REQUIRE([gl_STDIO_H_DEFAULTS])
15229 + gl_CHECK_NEXT_HEADERS([stdio.h])
15230 + dnl No need to create extra modules for these functions. Everyone who uses
15231 + dnl <stdio.h> likely needs them.
15234 + GNULIB_VFPRINTF=1
15242 + dnl This ifdef is just an optimization, to avoid performing a configure
15243 + dnl check whose result is not used. It does not make the test of
15244 + dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
15245 + m4_ifdef([gl_SIGNAL_SIGPIPE], [
15246 + gl_SIGNAL_SIGPIPE
15247 + if test $gl_cv_header_signal_h_SIGPIPE != yes; then
15248 + REPLACE_STDIO_WRITE_FUNCS=1
15249 + AC_LIBOBJ([stdio-write])
15254 +AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
15256 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
15257 + AC_REQUIRE([gl_STDIO_H_DEFAULTS])
15258 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
15261 +AC_DEFUN([gl_STDIO_H_DEFAULTS],
15263 + GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
15264 + GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
15265 + GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
15266 + GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
15267 + GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
15268 + GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
15269 + GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
15270 + GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
15271 + GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
15272 + GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
15273 + GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
15274 + GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
15275 + GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
15276 + GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
15277 + GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
15278 + GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
15279 + GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
15280 + GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
15281 + GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
15282 + GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
15283 + GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
15284 + GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
15285 + GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
15286 + GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
15287 + GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
15288 + GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
15289 + GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
15290 + GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
15291 + GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
15292 + GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
15293 + GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
15294 + GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
15295 + dnl Assume proper GNU behavior unless another module says otherwise.
15296 + REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
15297 + REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
15298 + REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
15299 + REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
15300 + REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
15301 + REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
15302 + HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
15303 + REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
15304 + HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
15305 + REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
15306 + REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
15307 + HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
15308 + REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
15309 + HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
15310 + REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
15311 + REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
15312 + REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
15313 + HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
15314 + REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
15315 + REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
15316 + HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
15317 + REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
15318 + REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
15319 + REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
15320 + HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
15321 + HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
15322 + REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
15323 + REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
15326 +dnl Code shared by fseeko and ftello. Determine if large files are supported,
15327 +dnl but stdin does not start as a large file by default.
15328 +AC_DEFUN([gl_STDIN_LARGE_OFFSET],
15330 + AC_CACHE_CHECK([whether stdin defaults to large file offsets],
15331 + [gl_cv_var_stdin_large_offset],
15332 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
15333 +[[#if defined __SL64 && defined __SCLE /* cygwin */
15334 + /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
15335 + fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
15336 + it is easier to do a version check than building a runtime test. */
15337 +# include <cygwin/version.h>
15338 +# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
15342 + [gl_cv_var_stdin_large_offset=yes],
15343 + [gl_cv_var_stdin_large_offset=no])])
15345 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/stdlib_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdlib_h.m4
15346 --- gtk-vnc-0.3.7.dan3/gnulib/m4/stdlib_h.m4 1970-01-01 01:00:00.000000000 +0100
15347 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdlib_h.m4 2008-10-09 15:24:53.000000000 +0100
15349 +# stdlib_h.m4 serial 7
15350 +dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
15351 +dnl This file is free software; the Free Software Foundation
15352 +dnl gives unlimited permission to copy and/or distribute it,
15353 +dnl with or without modifications, as long as this notice is preserved.
15355 +AC_DEFUN([gl_STDLIB_H],
15357 + AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
15358 + gl_CHECK_NEXT_HEADERS([stdlib.h])
15361 +AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
15363 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
15364 + AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
15365 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
15368 +AC_DEFUN([gl_STDLIB_H_DEFAULTS],
15370 + GNULIB_MALLOC_POSIX=0; AC_SUBST([GNULIB_MALLOC_POSIX])
15371 + GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
15372 + GNULIB_CALLOC_POSIX=0; AC_SUBST([GNULIB_CALLOC_POSIX])
15373 + GNULIB_GETSUBOPT=0; AC_SUBST([GNULIB_GETSUBOPT])
15374 + GNULIB_MKDTEMP=0; AC_SUBST([GNULIB_MKDTEMP])
15375 + GNULIB_MKSTEMP=0; AC_SUBST([GNULIB_MKSTEMP])
15376 + GNULIB_PUTENV=0; AC_SUBST([GNULIB_PUTENV])
15377 + GNULIB_RPMATCH=0; AC_SUBST([GNULIB_RPMATCH])
15378 + GNULIB_SETENV=0; AC_SUBST([GNULIB_SETENV])
15379 + GNULIB_STRTOD=0; AC_SUBST([GNULIB_STRTOD])
15380 + GNULIB_UNSETENV=0; AC_SUBST([GNULIB_UNSETENV])
15381 + dnl Assume proper GNU behavior unless another module says otherwise.
15382 + HAVE_CALLOC_POSIX=1; AC_SUBST([HAVE_CALLOC_POSIX])
15383 + HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
15384 + HAVE_MALLOC_POSIX=1; AC_SUBST([HAVE_MALLOC_POSIX])
15385 + HAVE_MKDTEMP=1; AC_SUBST([HAVE_MKDTEMP])
15386 + HAVE_REALLOC_POSIX=1; AC_SUBST([HAVE_REALLOC_POSIX])
15387 + HAVE_RPMATCH=1; AC_SUBST([HAVE_RPMATCH])
15388 + HAVE_SETENV=1; AC_SUBST([HAVE_SETENV])
15389 + HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
15390 + HAVE_UNSETENV=1; AC_SUBST([HAVE_UNSETENV])
15391 + REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
15392 + REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
15393 + REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
15394 + VOID_UNSETENV=0; AC_SUBST([VOID_UNSETENV])
15396 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/sys_socket_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/sys_socket_h.m4
15397 --- gtk-vnc-0.3.7.dan3/gnulib/m4/sys_socket_h.m4 1970-01-01 01:00:00.000000000 +0100
15398 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/sys_socket_h.m4 2008-10-09 15:24:53.000000000 +0100
15400 +# sys_socket_h.m4 serial 8
15401 +dnl Copyright (C) 2005-2008 Free Software Foundation, Inc.
15402 +dnl This file is free software; the Free Software Foundation
15403 +dnl gives unlimited permission to copy and/or distribute it,
15404 +dnl with or without modifications, as long as this notice is preserved.
15406 +dnl From Simon Josefsson.
15408 +AC_DEFUN([gl_HEADER_SYS_SOCKET],
15410 + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
15411 + AC_REQUIRE([AC_C_INLINE])
15413 + AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
15414 + [gl_cv_header_sys_socket_h_selfcontained],
15416 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
15417 + [gl_cv_header_sys_socket_h_selfcontained=yes],
15418 + [gl_cv_header_sys_socket_h_selfcontained=no])
15420 + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
15422 + dnl If the shutdown function exists, <sys/socket.h> should define
15423 + dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
15424 + AC_CHECK_FUNCS([shutdown])
15425 + if test $ac_cv_func_shutdown = yes; then
15426 + AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
15427 + [gl_cv_header_sys_socket_h_shut],
15429 + AC_COMPILE_IFELSE(
15430 + [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
15431 + [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
15432 + [gl_cv_header_sys_socket_h_shut=yes],
15433 + [gl_cv_header_sys_socket_h_shut=no])
15435 + if test $gl_cv_header_sys_socket_h_shut = no; then
15436 + SYS_SOCKET_H='sys/socket.h'
15440 + SYS_SOCKET_H='sys/socket.h'
15442 + if test -n "$SYS_SOCKET_H"; then
15443 + dnl Check prerequisites of the <sys/socket.h> replacement.
15444 + gl_CHECK_NEXT_HEADERS([sys/socket.h])
15445 + if test $ac_cv_header_sys_socket_h = yes; then
15446 + HAVE_SYS_SOCKET_H=1
15447 + HAVE_WS2TCPIP_H=0
15449 + HAVE_SYS_SOCKET_H=0
15450 + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
15451 + dnl the check for those headers unconditional; yet cygwin reports
15452 + dnl that the headers are present but cannot be compiled (since on
15453 + dnl cygwin, all socket information should come from sys/socket.h).
15454 + AC_CHECK_HEADERS([ws2tcpip.h])
15455 + if test $ac_cv_header_ws2tcpip_h = yes; then
15456 + HAVE_WS2TCPIP_H=1
15458 + HAVE_WS2TCPIP_H=0
15461 + gl_PREREQ_SYS_H_WINSOCK2
15462 + AC_SUBST([HAVE_SYS_SOCKET_H])
15463 + AC_SUBST([HAVE_WS2TCPIP_H])
15465 + AC_SUBST([SYS_SOCKET_H])
15468 +# Common prerequisites of of the <sys/socket.h> replacement and of the
15469 +# <sys/select.h> replacement.
15470 +# Sets and substitutes HAVE_WINSOCK2_H.
15471 +AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
15473 + AC_CHECK_HEADERS_ONCE([sys/socket.h])
15474 + if test $ac_cv_header_sys_socket_h != yes; then
15475 + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
15476 + dnl the check for those headers unconditional; yet cygwin reports
15477 + dnl that the headers are present but cannot be compiled (since on
15478 + dnl cygwin, all socket information should come from sys/socket.h).
15479 + AC_CHECK_HEADERS([winsock2.h])
15481 + if test "$ac_cv_header_winsock2_h" = yes; then
15482 + HAVE_WINSOCK2_H=1
15484 + HAVE_WINSOCK2_H=0
15486 + AC_SUBST([HAVE_WINSOCK2_H])
15489 +AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
15491 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
15492 + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
15493 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
15494 + gl_MODULE_INDICATOR([$1])
15497 +AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
15499 + GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET])
15500 + GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT])
15501 + GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT])
15502 + GNULIB_BIND=0; AC_SUBST([GNULIB_BIND])
15503 + GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
15504 + GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
15505 + GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT])
15506 + GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN])
15507 + GNULIB_RECV=0; AC_SUBST([GNULIB_RECV])
15508 + GNULIB_SEND=0; AC_SUBST([GNULIB_SEND])
15509 + GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM])
15510 + GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO])
15511 + GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT])
15513 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/unistd_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/unistd_h.m4
15514 --- gtk-vnc-0.3.7.dan3/gnulib/m4/unistd_h.m4 1970-01-01 01:00:00.000000000 +0100
15515 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/unistd_h.m4 2008-10-09 15:24:53.000000000 +0100
15517 +# unistd_h.m4 serial 13
15518 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
15519 +dnl This file is free software; the Free Software Foundation
15520 +dnl gives unlimited permission to copy and/or distribute it,
15521 +dnl with or without modifications, as long as this notice is preserved.
15523 +dnl Written by Simon Josefsson, Bruno Haible.
15525 +AC_DEFUN([gl_UNISTD_H],
15527 + dnl Use AC_REQUIRE here, so that the default behavior below is expanded
15528 + dnl once only, before all statements that occur in other macros.
15529 + AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
15531 + gl_CHECK_NEXT_HEADERS([unistd.h])
15533 + AC_CHECK_HEADERS_ONCE([unistd.h])
15534 + if test $ac_cv_header_unistd_h = yes; then
15539 + AC_SUBST([HAVE_UNISTD_H])
15542 +AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
15544 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
15545 + AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
15546 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
15549 +AC_DEFUN([gl_UNISTD_H_DEFAULTS],
15551 + GNULIB_CHOWN=0; AC_SUBST([GNULIB_CHOWN])
15552 + GNULIB_DUP2=0; AC_SUBST([GNULIB_DUP2])
15553 + GNULIB_ENVIRON=0; AC_SUBST([GNULIB_ENVIRON])
15554 + GNULIB_FCHDIR=0; AC_SUBST([GNULIB_FCHDIR])
15555 + GNULIB_FSYNC=0; AC_SUBST([GNULIB_FSYNC])
15556 + GNULIB_FTRUNCATE=0; AC_SUBST([GNULIB_FTRUNCATE])
15557 + GNULIB_GETCWD=0; AC_SUBST([GNULIB_GETCWD])
15558 + GNULIB_GETDTABLESIZE=0; AC_SUBST([GNULIB_GETDTABLESIZE])
15559 + GNULIB_GETLOGIN_R=0; AC_SUBST([GNULIB_GETLOGIN_R])
15560 + GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE])
15561 + GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN])
15562 + GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
15563 + GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK])
15564 + GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP])
15565 + GNULIB_UNISTD_H_SIGPIPE=0; AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
15566 + GNULIB_WRITE=0; AC_SUBST([GNULIB_WRITE])
15567 + dnl Assume proper GNU behavior unless another module says otherwise.
15568 + HAVE_DUP2=1; AC_SUBST([HAVE_DUP2])
15569 + HAVE_FSYNC=1; AC_SUBST([HAVE_FSYNC])
15570 + HAVE_FTRUNCATE=1; AC_SUBST([HAVE_FTRUNCATE])
15571 + HAVE_GETDTABLESIZE=1; AC_SUBST([HAVE_GETDTABLESIZE])
15572 + HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE])
15573 + HAVE_READLINK=1; AC_SUBST([HAVE_READLINK])
15574 + HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP])
15575 + HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON])
15576 + HAVE_DECL_GETLOGIN_R=1; AC_SUBST([HAVE_DECL_GETLOGIN_R])
15577 + HAVE_OS_H=0; AC_SUBST([HAVE_OS_H])
15578 + HAVE_SYS_PARAM_H=0; AC_SUBST([HAVE_SYS_PARAM_H])
15579 + REPLACE_CHOWN=0; AC_SUBST([REPLACE_CHOWN])
15580 + REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR])
15581 + REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
15582 + REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
15583 + REPLACE_LCHOWN=0; AC_SUBST([REPLACE_LCHOWN])
15584 + REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
15585 + REPLACE_WRITE=0; AC_SUBST([REPLACE_WRITE])
15587 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/vasnprintf.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/vasnprintf.m4
15588 --- gtk-vnc-0.3.7.dan3/gnulib/m4/vasnprintf.m4 1970-01-01 01:00:00.000000000 +0100
15589 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/vasnprintf.m4 2008-10-09 15:24:53.000000000 +0100
15591 +# vasnprintf.m4 serial 25
15592 +dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc.
15593 +dnl This file is free software; the Free Software Foundation
15594 +dnl gives unlimited permission to copy and/or distribute it,
15595 +dnl with or without modifications, as long as this notice is preserved.
15597 +AC_DEFUN([gl_FUNC_VASNPRINTF],
15599 + AC_CHECK_FUNCS_ONCE([vasnprintf])
15600 + if test $ac_cv_func_vasnprintf = no; then
15601 + gl_REPLACE_VASNPRINTF
15605 +AC_DEFUN([gl_REPLACE_VASNPRINTF],
15607 + AC_CHECK_FUNCS_ONCE([vasnprintf])
15608 + AC_LIBOBJ([vasnprintf])
15609 + AC_LIBOBJ([printf-args])
15610 + AC_LIBOBJ([printf-parse])
15611 + AC_LIBOBJ([asnprintf])
15612 + if test $ac_cv_func_vasnprintf = yes; then
15613 + AC_DEFINE([REPLACE_VASNPRINTF], 1,
15614 + [Define if vasnprintf exists but is overridden by gnulib.])
15616 + gl_PREREQ_PRINTF_ARGS
15617 + gl_PREREQ_PRINTF_PARSE
15618 + gl_PREREQ_VASNPRINTF
15619 + gl_PREREQ_ASNPRINTF
15622 +# Prequisites of lib/printf-args.h, lib/printf-args.c.
15623 +AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
15625 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
15626 + AC_REQUIRE([gt_TYPE_WCHAR_T])
15627 + AC_REQUIRE([gt_TYPE_WINT_T])
15630 +# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
15631 +AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
15633 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
15634 + AC_REQUIRE([gt_TYPE_WCHAR_T])
15635 + AC_REQUIRE([gt_TYPE_WINT_T])
15636 + AC_REQUIRE([AC_TYPE_SIZE_T])
15637 + AC_CHECK_TYPE([ptrdiff_t], ,
15638 + [AC_DEFINE([ptrdiff_t], [long],
15639 + [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
15641 + AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
15644 +# Prerequisites of lib/vasnprintf.c.
15645 +AC_DEFUN([gl_PREREQ_VASNPRINTF],
15647 + AC_REQUIRE([AC_FUNC_ALLOCA])
15648 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
15649 + AC_REQUIRE([gt_TYPE_WCHAR_T])
15650 + AC_REQUIRE([gt_TYPE_WINT_T])
15651 + AC_CHECK_FUNCS(snprintf wcslen)
15652 + dnl Use the _snprintf function only if it is declared (because on NetBSD it
15653 + dnl is defined as a weak alias of snprintf; we prefer to use the latter).
15654 + AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
15657 +# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
15659 +AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
15661 + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
15662 + case "$gl_cv_func_printf_long_double" in
15666 + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
15667 + [Define if the vasnprintf implementation needs special code for
15668 + 'long double' arguments.])
15673 +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double'
15675 +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
15677 + AC_REQUIRE([gl_PRINTF_INFINITE])
15678 + case "$gl_cv_func_printf_infinite" in
15682 + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1,
15683 + [Define if the vasnprintf implementation needs special code for
15684 + infinite 'double' arguments.])
15689 +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double'
15691 +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
15693 + AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
15694 + dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if
15695 + dnl NEED_PRINTF_LONG_DOUBLE is already set.
15696 + AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE])
15697 + case "$gl_cv_func_printf_long_double" in
15699 + case "$gl_cv_func_printf_infinite_long_double" in
15703 + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1,
15704 + [Define if the vasnprintf implementation needs special code for
15705 + infinite 'long double' arguments.])
15712 +# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive.
15713 +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
15715 + AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
15716 + case "$gl_cv_func_printf_directive_a" in
15720 + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1,
15721 + [Define if the vasnprintf implementation needs special code for
15722 + the 'a' and 'A' directives.])
15723 + AC_CHECK_FUNCS([nl_langinfo])
15728 +# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive.
15729 +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
15731 + AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
15732 + case "$gl_cv_func_printf_directive_f" in
15736 + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1,
15737 + [Define if the vasnprintf implementation needs special code for
15738 + the 'F' directive.])
15743 +# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
15744 +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
15746 + AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
15747 + case "$gl_cv_func_printf_flag_grouping" in
15751 + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1,
15752 + [Define if the vasnprintf implementation needs special code for the
15758 +# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag.
15759 +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
15761 + AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
15762 + case "$gl_cv_func_printf_flag_leftadjust" in
15766 + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1,
15767 + [Define if the vasnprintf implementation needs special code for the
15773 +# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag.
15774 +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
15776 + AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
15777 + case "$gl_cv_func_printf_flag_zero" in
15781 + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1,
15782 + [Define if the vasnprintf implementation needs special code for the
15788 +# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
15789 +AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
15791 + AC_REQUIRE([gl_PRINTF_PRECISION])
15792 + case "$gl_cv_func_printf_precision" in
15796 + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1,
15797 + [Define if the vasnprintf implementation needs special code for
15798 + supporting large precisions without arbitrary bounds.])
15799 + AC_DEFINE([NEED_PRINTF_DOUBLE], 1,
15800 + [Define if the vasnprintf implementation needs special code for
15801 + 'double' arguments.])
15802 + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
15803 + [Define if the vasnprintf implementation needs special code for
15804 + 'long double' arguments.])
15809 +# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory
15811 +AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
15813 + AC_REQUIRE([gl_PRINTF_ENOMEM])
15814 + case "$gl_cv_func_printf_enomem" in
15818 + AC_DEFINE([NEED_PRINTF_ENOMEM], 1,
15819 + [Define if the vasnprintf implementation needs special code for
15820 + surviving out-of-memory conditions.])
15821 + AC_DEFINE([NEED_PRINTF_DOUBLE], 1,
15822 + [Define if the vasnprintf implementation needs special code for
15823 + 'double' arguments.])
15824 + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
15825 + [Define if the vasnprintf implementation needs special code for
15826 + 'long double' arguments.])
15831 +# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
15832 +AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
15834 + AC_REQUIRE([gl_PREREQ_VASNPRINTF])
15835 + gl_PREREQ_VASNPRINTF_LONG_DOUBLE
15836 + gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
15837 + gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
15838 + gl_PREREQ_VASNPRINTF_DIRECTIVE_A
15839 + gl_PREREQ_VASNPRINTF_DIRECTIVE_F
15840 + gl_PREREQ_VASNPRINTF_FLAG_GROUPING
15841 + gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
15842 + gl_PREREQ_VASNPRINTF_FLAG_ZERO
15843 + gl_PREREQ_VASNPRINTF_PRECISION
15844 + gl_PREREQ_VASNPRINTF_ENOMEM
15847 +# Prerequisites of lib/asnprintf.c.
15848 +AC_DEFUN([gl_PREREQ_ASNPRINTF],
15851 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/wchar.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/wchar.m4
15852 --- gtk-vnc-0.3.7.dan3/gnulib/m4/wchar.m4 1970-01-01 01:00:00.000000000 +0100
15853 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/wchar.m4 2008-10-09 15:24:53.000000000 +0100
15855 +dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
15857 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
15858 +dnl This file is free software; the Free Software Foundation
15859 +dnl gives unlimited permission to copy and/or distribute it,
15860 +dnl with or without modifications, as long as this notice is preserved.
15862 +dnl Written by Eric Blake.
15864 +# wchar.m4 serial 6
15866 +AC_DEFUN([gl_WCHAR_H],
15868 + AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
15869 + AC_CACHE_CHECK([whether <wchar.h> is standalone],
15870 + [gl_cv_header_wchar_h_standalone],
15871 + [AC_COMPILE_IFELSE([[#include <wchar.h>
15873 + [gl_cv_header_wchar_h_standalone=yes],
15874 + [gl_cv_header_wchar_h_standalone=no])])
15876 + AC_REQUIRE([gt_TYPE_WINT_T])
15877 + if test $gt_cv_c_wint_t = yes; then
15882 + AC_SUBST([HAVE_WINT_T])
15884 + if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then
15888 + dnl Prepare for creating substitute <wchar.h>.
15889 + dnl Do it always: WCHAR_H may be empty here but can be set later.
15890 + dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
15891 + dnl character support).
15892 + AC_CHECK_HEADERS_ONCE([wchar.h])
15893 + if test $ac_cv_header_wchar_h = yes; then
15898 + AC_SUBST([HAVE_WCHAR_H])
15899 + gl_CHECK_NEXT_HEADERS([wchar.h])
15902 +dnl Unconditionally enables the replacement of <wchar.h>.
15903 +AC_DEFUN([gl_REPLACE_WCHAR_H],
15905 + AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
15909 +AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
15911 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
15912 + AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
15913 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
15916 +AC_DEFUN([gl_WCHAR_H_DEFAULTS],
15918 + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
15919 + dnl Assume proper GNU behavior unless another module says otherwise.
15920 + HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
15921 + REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
15922 + WCHAR_H=''; AC_SUBST([WCHAR_H])
15924 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/wchar_t.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/wchar_t.m4
15925 --- gtk-vnc-0.3.7.dan3/gnulib/m4/wchar_t.m4 1970-01-01 01:00:00.000000000 +0100
15926 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/wchar_t.m4 2008-10-09 15:24:53.000000000 +0100
15928 +# wchar_t.m4 serial 1 (gettext-0.12)
15929 +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
15930 +dnl This file is free software; the Free Software Foundation
15931 +dnl gives unlimited permission to copy and/or distribute it,
15932 +dnl with or without modifications, as long as this notice is preserved.
15934 +dnl From Bruno Haible.
15935 +dnl Test whether <stddef.h> has the 'wchar_t' type.
15936 +dnl Prerequisite: AC_PROG_CC
15938 +AC_DEFUN([gt_TYPE_WCHAR_T],
15940 + AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
15941 + [AC_TRY_COMPILE([#include <stddef.h>
15942 + wchar_t foo = (wchar_t)'\0';], ,
15943 + gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
15944 + if test $gt_cv_c_wchar_t = yes; then
15945 + AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
15948 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/wint_t.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/wint_t.m4
15949 --- gtk-vnc-0.3.7.dan3/gnulib/m4/wint_t.m4 1970-01-01 01:00:00.000000000 +0100
15950 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/wint_t.m4 2008-10-09 15:24:53.000000000 +0100
15952 +# wint_t.m4 serial 2 (gettext-0.17)
15953 +dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
15954 +dnl This file is free software; the Free Software Foundation
15955 +dnl gives unlimited permission to copy and/or distribute it,
15956 +dnl with or without modifications, as long as this notice is preserved.
15958 +dnl From Bruno Haible.
15959 +dnl Test whether <wchar.h> has the 'wint_t' type.
15960 +dnl Prerequisite: AC_PROG_CC
15962 +AC_DEFUN([gt_TYPE_WINT_T],
15964 + AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
15965 + [AC_TRY_COMPILE([
15966 +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
15968 + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
15969 + before <wchar.h>. */
15970 +#include <stddef.h>
15971 +#include <stdio.h>
15973 +#include <wchar.h>
15974 + wint_t foo = (wchar_t)'\0';], ,
15975 + gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
15976 + if test $gt_cv_c_wint_t = yes; then
15977 + AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
15980 diff -urN gtk-vnc-0.3.7.dan3/gnulib/m4/xsize.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/xsize.m4
15981 --- gtk-vnc-0.3.7.dan3/gnulib/m4/xsize.m4 1970-01-01 01:00:00.000000000 +0100
15982 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/xsize.m4 2008-10-09 15:24:53.000000000 +0100
15984 +# xsize.m4 serial 3
15985 +dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
15986 +dnl This file is free software; the Free Software Foundation
15987 +dnl gives unlimited permission to copy and/or distribute it,
15988 +dnl with or without modifications, as long as this notice is preserved.
15990 +AC_DEFUN([gl_XSIZE],
15992 + dnl Prerequisites of lib/xsize.h.
15993 + AC_REQUIRE([gl_SIZE_MAX])
15994 + AC_REQUIRE([AC_C_INLINE])
15995 + AC_CHECK_HEADERS(stdint.h)
15997 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/dummy.c gtk-vnc-0.3.7.gnulib/gnulib/tests/dummy.c
15998 --- gtk-vnc-0.3.7.dan3/gnulib/tests/dummy.c 1970-01-01 01:00:00.000000000 +0100
15999 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/dummy.c 2008-10-09 15:24:53.000000000 +0100
16001 +/* A dummy file, to prevent empty libraries from breaking builds.
16002 + Copyright (C) 2004, 2007 Free Software Foundation, Inc.
16004 + This program is free software: you can redistribute it and/or modify
16005 + it under the terms of the GNU General Public License as published by
16006 + the Free Software Foundation; either version 3 of the License, or
16007 + (at your option) any later version.
16009 + This program is distributed in the hope that it will be useful,
16010 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16011 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16012 + GNU General Public License for more details.
16014 + You should have received a copy of the GNU General Public License
16015 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16017 +/* Some systems, reportedly OpenBSD and Mac OS X, refuse to create
16018 + libraries without any object files. You might get an error like:
16020 + > ar cru .libs/libgl.a
16021 + > ar: no archive members specified
16023 + Compiling this file, and adding its object file to the library, will
16024 + prevent the library from being empty. */
16026 +/* Some systems, such as Solaris with cc 5.0, refuse to work with libraries
16027 + that don't export any symbol. You might get an error like:
16029 + > cc ... libgnu.a
16030 + > ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a
16032 + Compiling this file, and adding its object file to the library, will
16033 + prevent the library from exporting no symbols. */
16036 +/* This declaration ensures that the library will export at least 1 symbol. */
16037 +int gl_dummy_symbol;
16039 +/* This declaration is solely to ensure that after preprocessing
16040 + this file is never empty. */
16041 +typedef int dummy;
16043 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/intprops.h gtk-vnc-0.3.7.gnulib/gnulib/tests/intprops.h
16044 --- gtk-vnc-0.3.7.dan3/gnulib/tests/intprops.h 1970-01-01 01:00:00.000000000 +0100
16045 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/intprops.h 2008-10-09 15:24:53.000000000 +0100
16047 +/* intprops.h -- properties of integer types
16049 + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
16051 + This program is free software: you can redistribute it and/or modify
16052 + it under the terms of the GNU General Public License as published by
16053 + the Free Software Foundation; either version 3 of the License, or
16054 + (at your option) any later version.
16056 + This program is distributed in the hope that it will be useful,
16057 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16058 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16059 + GNU General Public License for more details.
16061 + You should have received a copy of the GNU General Public License
16062 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16064 +/* Written by Paul Eggert. */
16066 +#include <limits.h>
16068 +/* The extra casts in the following macros work around compiler bugs,
16069 + e.g., in Cray C 5.0.3.0. */
16071 +/* True if the arithmetic type T is an integer type. bool counts as
16073 +#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
16075 +/* True if negative values of the signed integer type T use two's
16076 + complement, ones' complement, or signed magnitude representation,
16077 + respectively. Much GNU code assumes two's complement, but some
16078 + people like to be portable to all possible C hosts. */
16079 +#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
16080 +#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
16081 +#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
16083 +/* True if the arithmetic type T is signed. */
16084 +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
16086 +/* The maximum and minimum values for the integer type T. These
16087 + macros have undefined behavior if T is signed and has padding bits.
16088 + If this is a problem for you, please let us know how to fix it for
16090 +#define TYPE_MINIMUM(t) \
16091 + ((t) (! TYPE_SIGNED (t) \
16093 + : TYPE_SIGNED_MAGNITUDE (t) \
16095 + : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
16096 +#define TYPE_MAXIMUM(t) \
16097 + ((t) (! TYPE_SIGNED (t) \
16099 + : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
16101 +/* Return zero if T can be determined to be an unsigned type.
16102 + Otherwise, return 1.
16103 + When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a
16104 + tighter bound. Otherwise, it overestimates the true bound by one byte
16105 + when applied to unsigned types of size 2, 4, 16, ... bytes.
16106 + The symbol signed_type_or_expr__ is private to this header file. */
16108 +# define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t))
16110 +# define signed_type_or_expr__(t) 1
16113 +/* Bound on length of the string representing an integer type or expression T.
16114 + Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485;
16115 + add 1 for integer division truncation; add 1 more for a minus sign
16117 +#define INT_STRLEN_BOUND(t) \
16118 + ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \
16119 + + signed_type_or_expr__ (t) + 1)
16121 +/* Bound on buffer size needed to represent an integer type or expression T,
16122 + including the terminating null. */
16123 +#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
16124 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/Makefile.am gtk-vnc-0.3.7.gnulib/gnulib/tests/Makefile.am
16125 --- gtk-vnc-0.3.7.dan3/gnulib/tests/Makefile.am 1970-01-01 01:00:00.000000000 +0100
16126 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/Makefile.am 2008-10-09 15:24:54.000000000 +0100
16128 +## DO NOT EDIT! GENERATED AUTOMATICALLY!
16129 +## Process this file with automake to produce Makefile.in.
16130 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
16132 +# This file is free software, distributed under the terms of the GNU
16133 +# General Public License. As a special exception to the GNU General
16134 +# Public License, this file may be distributed as part of a program
16135 +# that contains a configuration script generated by Autoconf, under
16136 +# the same distribution terms as the rest of that program.
16138 +# Generated by gnulib-tool.
16140 +AUTOMAKE_OPTIONS = 1.5 foreign
16144 +TESTS_ENVIRONMENT =
16148 +noinst_LIBRARIES =
16149 +check_LIBRARIES = libtests.a
16153 +MOSTLYCLEANFILES = core *.stackdump
16157 +MAINTAINERCLEANFILES =
16160 + -I. -I$(srcdir) \
16161 + -I../.. -I$(srcdir)/../.. \
16162 + -I../../gnulib/lib -I$(srcdir)/../../gnulib/lib
16164 +LDADD = libtests.a ../../gnulib/lib/libgnu.la libtests.a $(LIBTESTS_LIBDEPS)
16166 +libtests_a_SOURCES =
16167 +libtests_a_LIBADD = $(gltests_LIBOBJS)
16168 +libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
16169 +EXTRA_libtests_a_SOURCES =
16170 +AM_LIBTOOLFLAGS = --preserve-dup-deps
16172 +## begin gnulib module alloca-opt-tests
16174 +TESTS += test-alloca-opt
16175 +check_PROGRAMS += test-alloca-opt
16177 +EXTRA_DIST += test-alloca-opt.c
16179 +## end gnulib module alloca-opt-tests
16181 +## begin gnulib module arpa_inet-tests
16183 +TESTS += test-arpa_inet
16184 +check_PROGRAMS += test-arpa_inet
16186 +EXTRA_DIST += test-arpa_inet.c
16188 +## end gnulib module arpa_inet-tests
16190 +## begin gnulib module errno-tests
16192 +TESTS += test-errno
16193 +check_PROGRAMS += test-errno
16195 +EXTRA_DIST += test-errno.c
16197 +## end gnulib module errno-tests
16199 +## begin gnulib module getaddrinfo-tests
16201 +TESTS += test-getaddrinfo
16202 +check_PROGRAMS += test-getaddrinfo
16203 +test_getaddrinfo_LDADD = $(LDADD) @LIBINTL@
16205 +EXTRA_DIST += test-getaddrinfo.c
16207 +## end gnulib module getaddrinfo-tests
16209 +## begin gnulib module intprops
16212 +EXTRA_DIST += intprops.h
16214 +## end gnulib module intprops
16216 +## begin gnulib module netinet_in-tests
16218 +TESTS += test-netinet_in
16219 +check_PROGRAMS += test-netinet_in
16221 +EXTRA_DIST += test-netinet_in.c
16223 +## end gnulib module netinet_in-tests
16225 +## begin gnulib module snprintf-tests
16227 +TESTS += test-snprintf
16228 +check_PROGRAMS += test-snprintf
16230 +EXTRA_DIST += test-snprintf.c
16232 +## end gnulib module snprintf-tests
16234 +## begin gnulib module stdbool-tests
16236 +TESTS += test-stdbool
16237 +check_PROGRAMS += test-stdbool
16239 +EXTRA_DIST += test-stdbool.c
16241 +## end gnulib module stdbool-tests
16243 +## begin gnulib module stdint-tests
16245 +TESTS += test-stdint
16246 +check_PROGRAMS += test-stdint
16248 +EXTRA_DIST += test-stdint.c
16250 +## end gnulib module stdint-tests
16252 +## begin gnulib module stdio-tests
16254 +TESTS += test-stdio
16255 +check_PROGRAMS += test-stdio
16257 +EXTRA_DIST += test-stdio.c
16259 +## end gnulib module stdio-tests
16261 +## begin gnulib module stdlib-tests
16263 +TESTS += test-stdlib
16264 +check_PROGRAMS += test-stdlib
16266 +EXTRA_DIST += test-stdlib.c
16268 +## end gnulib module stdlib-tests
16270 +## begin gnulib module sys_socket-tests
16272 +TESTS += test-sys_socket
16273 +check_PROGRAMS += test-sys_socket
16275 +EXTRA_DIST += test-sys_socket.c
16277 +## end gnulib module sys_socket-tests
16279 +## begin gnulib module unistd-tests
16281 +TESTS += test-unistd
16282 +check_PROGRAMS += test-unistd
16284 +EXTRA_DIST += test-unistd.c
16286 +## end gnulib module unistd-tests
16288 +## begin gnulib module vasnprintf-tests
16290 +TESTS += test-vasnprintf
16291 +check_PROGRAMS += test-vasnprintf
16293 +EXTRA_DIST += test-vasnprintf.c
16295 +## end gnulib module vasnprintf-tests
16297 +## begin gnulib module vc-list-files-tests
16299 +TESTS += test-vc-list-files-git.sh
16300 +TESTS += test-vc-list-files-cvs.sh
16301 +TESTS_ENVIRONMENT += PATH='$(abs_aux_dir)':"$$PATH"
16302 +EXTRA_DIST += test-vc-list-files-git.sh test-vc-list-files-cvs.sh
16304 +## end gnulib module vc-list-files-tests
16306 +## begin gnulib module verify
16308 +libtests_a_SOURCES += verify.h
16310 +## end gnulib module verify
16312 +## begin gnulib module wchar-tests
16314 +TESTS += test-wchar
16315 +check_PROGRAMS += test-wchar
16317 +EXTRA_DIST += test-wchar.c
16319 +## end gnulib module wchar-tests
16321 +## begin gnulib module dummy
16323 +libtests_a_SOURCES += dummy.c
16325 +## end gnulib module dummy
16327 +# Clean up after Solaris cc.
16329 + rm -rf SunWS_cache
16331 +mostlyclean-local: mostlyclean-generic
16332 + @for dir in '' $(MOSTLYCLEANDIRS); do \
16333 + if test -n "$$dir" && test -d $$dir; then \
16334 + echo "rmdir $$dir"; rmdir $$dir; \
16338 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-alloca-opt.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-alloca-opt.c
16339 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-alloca-opt.c 1970-01-01 01:00:00.000000000 +0100
16340 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-alloca-opt.c 2008-10-09 15:24:53.000000000 +0100
16342 +/* Test of optional automatic memory allocation.
16343 + Copyright (C) 2005, 2007 Free Software Foundation, Inc.
16345 + This program is free software: you can redistribute it and/or modify
16346 + it under the terms of the GNU General Public License as published by
16347 + the Free Software Foundation; either version 3 of the License, or
16348 + (at your option) any later version.
16350 + This program is distributed in the hope that it will be useful,
16351 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16352 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16353 + GNU General Public License for more details.
16355 + You should have received a copy of the GNU General Public License
16356 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16358 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16360 +#include <config.h>
16362 +#include <alloca.h>
16367 +do_allocation (int n)
16369 + void *ptr = alloca (n);
16373 +void (*func) (int) = do_allocation;
16383 + /* Repeat a lot of times, to make sure there's no memory leak. */
16384 + for (i = 0; i < 100000; i++)
16386 + /* Try various values.
16387 + n = 0 gave a crash on Alpha with gcc-2.5.8.
16388 + Some versions of MacOS X have a stack size limit of 512 KB. */
16404 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-arpa_inet.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-arpa_inet.c
16405 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-arpa_inet.c 1970-01-01 01:00:00.000000000 +0100
16406 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-arpa_inet.c 2008-10-09 15:24:53.000000000 +0100
16408 +/* Test of <arpa/inet.h> substitute.
16409 + Copyright (C) 2007 Free Software Foundation, Inc.
16411 + This program is free software: you can redistribute it and/or modify
16412 + it under the terms of the GNU General Public License as published by
16413 + the Free Software Foundation; either version 3 of the License, or
16414 + (at your option) any later version.
16416 + This program is distributed in the hope that it will be useful,
16417 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16418 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16419 + GNU General Public License for more details.
16421 + You should have received a copy of the GNU General Public License
16422 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16424 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16426 +#include <config.h>
16428 +#include <arpa/inet.h>
16435 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-errno.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-errno.c
16436 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-errno.c 1970-01-01 01:00:00.000000000 +0100
16437 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-errno.c 2008-10-09 15:24:53.000000000 +0100
16439 +/* Test of <errno.h> substitute.
16440 + Copyright (C) 2008 Free Software Foundation, Inc.
16442 + This program is free software: you can redistribute it and/or modify
16443 + it under the terms of the GNU General Public License as published by
16444 + the Free Software Foundation; either version 3 of the License, or
16445 + (at your option) any later version.
16447 + This program is distributed in the hope that it will be useful,
16448 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16449 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16450 + GNU General Public License for more details.
16452 + You should have received a copy of the GNU General Public License
16453 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16455 +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
16457 +#include <config.h>
16459 +#include <errno.h>
16461 +/* Verify that the POSIX mandated errno values exist and can be used as
16462 + initializers outside of a function.
16463 + The variable names happen to match the Linux/x86 error numbers. */
16475 +int e11a = EWOULDBLOCK;
16483 +int e20 = ENOTDIR;
16489 +int e26 = ETXTBSY;
16498 +int e35 = EDEADLK;
16499 +int e36 = ENAMETOOLONG;
16502 +int e39 = ENOTEMPTY;
16506 +int e67 = ENOLINK;
16508 +int e72 = EMULTIHOP;
16509 +int e74 = EBADMSG;
16510 +int e75 = EOVERFLOW;
16512 +int e88 = ENOTSOCK;
16513 +int e89 = EDESTADDRREQ;
16514 +int e90 = EMSGSIZE;
16515 +int e91 = EPROTOTYPE;
16516 +int e92 = ENOPROTOOPT;
16517 +int e93 = EPROTONOSUPPORT;
16518 +int e95 = EOPNOTSUPP;
16519 +int e95a = ENOTSUP;
16520 +int e97 = EAFNOSUPPORT;
16521 +int e98 = EADDRINUSE;
16522 +int e99 = EADDRNOTAVAIL;
16523 +int e100 = ENETDOWN;
16524 +int e101 = ENETUNREACH;
16525 +int e102 = ENETRESET;
16526 +int e103 = ECONNABORTED;
16527 +int e104 = ECONNRESET;
16528 +int e105 = ENOBUFS;
16529 +int e106 = EISCONN;
16530 +int e107 = ENOTCONN;
16531 +int e110 = ETIMEDOUT;
16532 +int e111 = ECONNREFUSED;
16533 +int e113 = EHOSTUNREACH;
16534 +int e114 = EALREADY;
16535 +int e115 = EINPROGRESS;
16536 +int e116 = ESTALE;
16537 +int e122 = EDQUOT;
16538 +int e125 = ECANCELED;
16540 +/* Don't verify that these errno values are all different, except for possibly
16541 + EWOULDBLOCK == EAGAIN. Even Linux/x86 does not pass this check: it has
16542 + ENOTSUP == EOPNOTSUPP. */
16547 + /* Verify that errno can be assigned. */
16548 + errno = EOVERFLOW;
16550 + /* snprintf() callers want to distinguish EINVAL and EOVERFLOW. */
16551 + if (errno == EINVAL)
16556 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-getaddrinfo.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-getaddrinfo.c
16557 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-getaddrinfo.c 1970-01-01 01:00:00.000000000 +0100
16558 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-getaddrinfo.c 2008-10-09 15:24:53.000000000 +0100
16560 +/* Test the getaddrinfo module.
16562 + Copyright (C) 2006-2008 Free Software Foundation, Inc.
16564 + This program is free software: you can redistribute it and/or modify
16565 + it under the terms of the GNU General Public License as published by
16566 + the Free Software Foundation; either version 3 of the License, or
16567 + (at your option) any later version.
16569 + This program is distributed in the hope that it will be useful,
16570 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16571 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16572 + GNU General Public License for more details.
16574 + You should have received a copy of the GNU General Public License
16575 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16577 +/* Written by Simon Josefsson. */
16579 +#include <config.h>
16580 +#include "getaddrinfo.h"
16581 +#include <arpa/inet.h>
16582 +#include <netinet/in.h>
16583 +#include <stdio.h>
16584 +#include <string.h>
16586 +/* Whether to print debugging messages. */
16587 +#define ENABLE_DEBUGGING 0
16589 +#if ENABLE_DEBUGGING
16590 +# define dbgprintf printf
16592 +# define dbgprintf if (0) printf
16595 +/* BeOS does not have AF_UNSPEC. */
16597 +# define AF_UNSPEC 0
16600 +#ifndef EAI_SERVICE
16601 +# define EAI_SERVICE 0
16604 +int simple (char *host, char *service)
16606 + char buf[BUFSIZ];
16607 + struct addrinfo hints;
16608 + struct addrinfo *ai0, *ai;
16611 + dbgprintf ("Finding %s service %s...\n", host, service);
16613 + /* This initializes "hints" but does not use it. Is there a reason
16614 + for this? If so, please fix this comment. */
16615 + memset (&hints, 0, sizeof (hints));
16616 + hints.ai_flags = AI_CANONNAME;
16617 + hints.ai_family = AF_UNSPEC;
16618 + hints.ai_socktype = SOCK_STREAM;
16620 + res = getaddrinfo (host, service, 0, &ai0);
16622 + dbgprintf ("res %d: %s\n", res, gai_strerror (res));
16626 + /* IRIX reports EAI_NONAME for "https". Don't fail the test
16627 + merely because of this. */
16628 + if (res == EAI_NONAME)
16630 + /* Solaris reports EAI_SERVICE for "http" and "https". Don't
16631 + fail the test merely because of this. */
16632 + if (res == EAI_SERVICE)
16634 + /* AIX reports EAI_NODATA for "https". Don't fail the test
16635 + merely because of this. */
16636 + if (res == EAI_NODATA)
16642 + for (ai = ai0; ai; ai = ai->ai_next)
16644 + dbgprintf ("\tflags %x\n", ai->ai_flags);
16645 + dbgprintf ("\tfamily %x\n", ai->ai_family);
16646 + dbgprintf ("\tsocktype %x\n", ai->ai_socktype);
16647 + dbgprintf ("\tprotocol %x\n", ai->ai_protocol);
16648 + dbgprintf ("\taddrlen %ld: ", (unsigned long) ai->ai_addrlen);
16649 + dbgprintf ("\tFound %s\n",
16650 + inet_ntop (ai->ai_family,
16651 + &((struct sockaddr_in *)
16652 + ai->ai_addr)->sin_addr,
16653 + buf, sizeof (buf) - 1));
16654 + if (ai->ai_canonname)
16655 + dbgprintf ("\tFound %s...\n", ai->ai_canonname);
16658 + char ipbuf[BUFSIZ];
16659 + char portbuf[BUFSIZ];
16661 + res = getnameinfo (ai->ai_addr, ai->ai_addrlen,
16662 + ipbuf, sizeof (ipbuf) - 1,
16663 + portbuf, sizeof (portbuf) - 1,
16664 + NI_NUMERICHOST|NI_NUMERICSERV);
16665 + dbgprintf ("\t\tgetnameinfo %d: %s\n", res, gai_strerror (res));
16668 + dbgprintf ("\t\tip %s\n", ipbuf);
16669 + dbgprintf ("\t\tport %s\n", portbuf);
16675 + freeaddrinfo (ai0);
16680 +#define HOST1 "www.gnu.org"
16681 +#define SERV1 "http"
16682 +#define HOST2 "www.ibm.com"
16683 +#define SERV2 "https"
16684 +#define HOST3 "microsoft.com"
16685 +#define SERV3 "http"
16686 +#define HOST4 "google.org"
16687 +#define SERV4 "ldap"
16697 + requested = MAKEWORD (1, 1);
16698 + err = WSAStartup (requested, &data);
16702 + if (data.wVersion < requested)
16710 + return simple (HOST1, SERV1)
16711 + + simple (HOST2, SERV2)
16712 + + simple (HOST3, SERV3)
16713 + + simple (HOST4, SERV4);
16715 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-netinet_in.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-netinet_in.c
16716 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-netinet_in.c 1970-01-01 01:00:00.000000000 +0100
16717 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-netinet_in.c 2008-10-09 15:24:53.000000000 +0100
16719 +/* Test of <netinet/in.h> substitute.
16720 + Copyright (C) 2007 Free Software Foundation, Inc.
16722 + This program is free software: you can redistribute it and/or modify
16723 + it under the terms of the GNU General Public License as published by
16724 + the Free Software Foundation; either version 3 of the License, or
16725 + (at your option) any later version.
16727 + This program is distributed in the hope that it will be useful,
16728 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16729 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16730 + GNU General Public License for more details.
16732 + You should have received a copy of the GNU General Public License
16733 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16735 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16737 +#include <config.h>
16739 +#include <netinet/in.h>
16746 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-snprintf.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-snprintf.c
16747 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-snprintf.c 1970-01-01 01:00:00.000000000 +0100
16748 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-snprintf.c 2008-10-09 15:24:53.000000000 +0100
16750 +/* Test of snprintf() function.
16751 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
16753 + This program is free software: you can redistribute it and/or modify
16754 + it under the terms of the GNU General Public License as published by
16755 + the Free Software Foundation; either version 3 of the License, or
16756 + (at your option) any later version.
16758 + This program is distributed in the hope that it will be useful,
16759 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16760 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16761 + GNU General Public License for more details.
16763 + You should have received a copy of the GNU General Public License
16764 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16766 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16768 +#include <config.h>
16770 +#include <stdio.h>
16772 +#include <stdlib.h>
16773 +#include <string.h>
16775 +#define ASSERT(expr) \
16780 + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
16781 + fflush (stderr); \
16788 +main (int argc, char *argv[])
16794 + for (size = 0; size <= 8; size++)
16796 + memcpy (buf, "DEADBEEF", 8);
16797 + retval = snprintf (buf, size, "%d", 12345);
16800 +#if CHECK_SNPRINTF_POSIX
16801 + ASSERT (retval < 0 || retval >= size);
16805 + ASSERT (memcmp (buf, "12345", size - 1) == 0);
16806 + ASSERT (buf[size - 1] == '\0' || buf[size - 1] == '0' + size);
16808 +#if !CHECK_SNPRINTF_POSIX
16811 + ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
16815 + ASSERT (retval == 5);
16816 + ASSERT (memcmp (buf, "12345\0EF", 8) == 0);
16822 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-stdbool.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdbool.c
16823 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-stdbool.c 1970-01-01 01:00:00.000000000 +0100
16824 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdbool.c 2008-10-09 15:24:53.000000000 +0100
16826 +/* Test of <stdbool.h> substitute.
16827 + Copyright (C) 2002-2007 Free Software Foundation, Inc.
16829 + This program is free software: you can redistribute it and/or modify
16830 + it under the terms of the GNU General Public License as published by
16831 + the Free Software Foundation; either version 3 of the License, or
16832 + (at your option) any later version.
16834 + This program is distributed in the hope that it will be useful,
16835 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16836 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16837 + GNU General Public License for more details.
16839 + You should have received a copy of the GNU General Public License
16840 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16842 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16844 +#include <config.h>
16846 +#include <stdbool.h>
16849 + "error: bool is not defined"
16852 + "error: false is not defined"
16855 + "error: false is not 0"
16858 + "error: true is not defined"
16861 + "error: true is not 1"
16863 +#ifndef __bool_true_false_are_defined
16864 + "error: __bool_true_false_are_defined is not defined"
16867 +#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>. */
16868 +struct s { _Bool s: 1; _Bool t; } s;
16871 +char a[true == 1 ? 1 : -1];
16872 +char b[false == 0 ? 1 : -1];
16873 +char c[__bool_true_false_are_defined == 1 ? 1 : -1];
16874 +#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>. */
16875 +char d[(bool) 0.5 == true ? 1 : -1];
16878 +char f[(_Bool) 0.0 == false ? 1 : -1];
16880 +char h[sizeof (_Bool)];
16881 +#if 0 /* See above. */
16882 +char i[sizeof s.t];
16884 +enum { j = false, k = true, l = false * true, m = true * 256 };
16886 +char o[sizeof n == m * sizeof n[0] ? 1 : -1];
16887 +char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
16888 +#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>. */
16889 +#if defined __xlc__ || defined __GNUC__
16890 + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
16891 + reported by James Lemley on 2005-10-05; see
16892 + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
16893 + This test is not quite right, since xlc is allowed to
16894 + reject this program, as the initializer for xlcbug is
16895 + not one of the forms that C requires support for.
16896 + However, doing the test right would require a run-time
16897 + test, and that would make cross-compilation harder.
16898 + Let us hope that IBM fixes the xlc bug, and also adds
16899 + support for this kind of constant expression. In the
16900 + meantime, this test will reject xlc, which is OK, since
16901 + our stdbool.h substitute should suffice. We also test
16902 + this with GCC, where it should work, to detect more
16903 + quickly whether someone messes up the test in the
16905 + char digs[] = "0123456789";
16906 + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
16909 +/* Catch a bug in an HP-UX C compiler. See
16910 + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
16911 + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
16921 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-stdint.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdint.c
16922 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-stdint.c 1970-01-01 01:00:00.000000000 +0100
16923 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdint.c 2008-10-09 15:24:53.000000000 +0100
16925 +/* Test of <stdint.h> substitute.
16926 + Copyright (C) 2006-2008 Free Software Foundation, Inc.
16928 + This program is free software: you can redistribute it and/or modify
16929 + it under the terms of the GNU General Public License as published by
16930 + the Free Software Foundation; either version 3 of the License, or
16931 + (at your option) any later version.
16933 + This program is distributed in the hope that it will be useful,
16934 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16935 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16936 + GNU General Public License for more details.
16938 + You should have received a copy of the GNU General Public License
16939 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16941 +/* Written by Bruno Haible <bruno@clisp.org>, 2006. */
16943 +#include <config.h>
16945 +/* Whether to enable pedantic checks. */
16946 +#define DO_PEDANTIC 0
16948 +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
16949 +#include <stdint.h>
16951 +#include "verify.h"
16952 +#include "intprops.h"
16954 +#if __GNUC__ >= 2 && DO_PEDANTIC
16955 +# define verify_same_types(expr1,expr2) \
16956 + extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \
16957 + extern void _verify_func(__LINE__) (__typeof__ (expr2) *);
16958 +# define _verify_func(line) _verify_func2(line)
16959 +# define _verify_func2(line) verify_func_ ## line
16961 +# define verify_same_types(expr1,expr2) extern void verify_func (int)
16964 +/* 7.18.1.1. Exact-width integer types */
16965 +/* 7.18.2.1. Limits of exact-width integer types */
16967 +int8_t a1[3] = { INT8_C (17), INT8_MIN, INT8_MAX };
16968 +verify (TYPE_MINIMUM (int8_t) == INT8_MIN);
16969 +verify (TYPE_MAXIMUM (int8_t) == INT8_MAX);
16970 +verify_same_types (INT8_MIN, (int8_t) 0 + 0);
16971 +verify_same_types (INT8_MAX, (int8_t) 0 + 0);
16973 +int16_t a2[3] = { INT16_C (17), INT16_MIN, INT16_MAX };
16974 +verify (TYPE_MINIMUM (int16_t) == INT16_MIN);
16975 +verify (TYPE_MAXIMUM (int16_t) == INT16_MAX);
16976 +verify_same_types (INT16_MIN, (int16_t) 0 + 0);
16977 +verify_same_types (INT16_MAX, (int16_t) 0 + 0);
16979 +int32_t a3[3] = { INT32_C (17), INT32_MIN, INT32_MAX };
16980 +verify (TYPE_MINIMUM (int32_t) == INT32_MIN);
16981 +verify (TYPE_MAXIMUM (int32_t) == INT32_MAX);
16982 +verify_same_types (INT32_MIN, (int32_t) 0 + 0);
16983 +verify_same_types (INT32_MAX, (int32_t) 0 + 0);
16986 +int64_t a4[3] = { INT64_C (17), INT64_MIN, INT64_MAX };
16987 +verify (TYPE_MINIMUM (int64_t) == INT64_MIN);
16988 +verify (TYPE_MAXIMUM (int64_t) == INT64_MAX);
16989 +verify_same_types (INT64_MIN, (int64_t) 0 + 0);
16990 +verify_same_types (INT64_MAX, (int64_t) 0 + 0);
16993 +uint8_t b1[2] = { UINT8_C (17), UINT8_MAX };
16994 +verify (TYPE_MAXIMUM (uint8_t) == UINT8_MAX);
16995 +verify_same_types (UINT8_MAX, (uint8_t) 0 + 0);
16997 +uint16_t b2[2] = { UINT16_C (17), UINT16_MAX };
16998 +verify (TYPE_MAXIMUM (uint16_t) == UINT16_MAX);
16999 +verify_same_types (UINT16_MAX, (uint16_t) 0 + 0);
17001 +uint32_t b3[2] = { UINT32_C (17), UINT32_MAX };
17002 +verify (TYPE_MAXIMUM (uint32_t) == UINT32_MAX);
17003 +verify_same_types (UINT32_MAX, (uint32_t) 0 + 0);
17006 +uint64_t b4[2] = { UINT64_C (17), UINT64_MAX };
17007 +verify (TYPE_MAXIMUM (uint64_t) == UINT64_MAX);
17008 +verify_same_types (UINT64_MAX, (uint64_t) 0 + 0);
17011 +#if INT8_MIN && INT8_MAX && INT16_MIN && INT16_MAX && INT32_MIN && INT32_MAX
17017 +#if UINT8_MAX && UINT16_MAX && UINT32_MAX
17023 +/* 7.18.1.2. Minimum-width integer types */
17024 +/* 7.18.2.2. Limits of minimum-width integer types */
17026 +int_least8_t c1[3] = { 17, INT_LEAST8_MIN, INT_LEAST8_MAX };
17027 +verify (TYPE_MINIMUM (int_least8_t) == INT_LEAST8_MIN);
17028 +verify (TYPE_MAXIMUM (int_least8_t) == INT_LEAST8_MAX);
17029 +verify_same_types (INT_LEAST8_MIN, (int_least8_t) 0 + 0);
17030 +verify_same_types (INT_LEAST8_MAX, (int_least8_t) 0 + 0);
17032 +int_least16_t c2[3] = { 17, INT_LEAST16_MIN, INT_LEAST16_MAX };
17033 +verify (TYPE_MINIMUM (int_least16_t) == INT_LEAST16_MIN);
17034 +verify (TYPE_MAXIMUM (int_least16_t) == INT_LEAST16_MAX);
17035 +verify_same_types (INT_LEAST16_MIN, (int_least16_t) 0 + 0);
17036 +verify_same_types (INT_LEAST16_MAX, (int_least16_t) 0 + 0);
17038 +int_least32_t c3[3] = { 17, INT_LEAST32_MIN, INT_LEAST32_MAX };
17039 +verify (TYPE_MINIMUM (int_least32_t) == INT_LEAST32_MIN);
17040 +verify (TYPE_MAXIMUM (int_least32_t) == INT_LEAST32_MAX);
17041 +verify_same_types (INT_LEAST32_MIN, (int_least32_t) 0 + 0);
17042 +verify_same_types (INT_LEAST32_MAX, (int_least32_t) 0 + 0);
17044 +#ifdef INT_LEAST64_MAX
17045 +int_least64_t c4[3] = { 17, INT_LEAST64_MIN, INT_LEAST64_MAX };
17046 +verify (TYPE_MINIMUM (int_least64_t) == INT_LEAST64_MIN);
17047 +verify (TYPE_MAXIMUM (int_least64_t) == INT_LEAST64_MAX);
17048 +verify_same_types (INT_LEAST64_MIN, (int_least64_t) 0 + 0);
17049 +verify_same_types (INT_LEAST64_MAX, (int_least64_t) 0 + 0);
17052 +uint_least8_t d1[2] = { 17, UINT_LEAST8_MAX };
17053 +verify (TYPE_MAXIMUM (uint_least8_t) == UINT_LEAST8_MAX);
17054 +verify_same_types (UINT_LEAST8_MAX, (uint_least8_t) 0 + 0);
17056 +uint_least16_t d2[2] = { 17, UINT_LEAST16_MAX };
17057 +verify (TYPE_MAXIMUM (uint_least16_t) == UINT_LEAST16_MAX);
17058 +verify_same_types (UINT_LEAST16_MAX, (uint_least16_t) 0 + 0);
17060 +uint_least32_t d3[2] = { 17, UINT_LEAST32_MAX };
17061 +verify (TYPE_MAXIMUM (uint_least32_t) == UINT_LEAST32_MAX);
17062 +verify_same_types (UINT_LEAST32_MAX, (uint_least32_t) 0 + 0);
17064 +#ifdef UINT_LEAST64_MAX
17065 +uint_least64_t d4[2] = { 17, UINT_LEAST64_MAX };
17066 +verify (TYPE_MAXIMUM (uint_least64_t) == UINT_LEAST64_MAX);
17067 +verify_same_types (UINT_LEAST64_MAX, (uint_least64_t) 0 + 0);
17070 +#if INT_LEAST8_MIN && INT_LEAST8_MAX && INT_LEAST16_MIN && INT_LEAST16_MAX && INT_LEAST32_MIN && INT_LEAST32_MAX
17076 +#if UINT_LEAST8_MAX && UINT_LEAST16_MAX && UINT_LEAST32_MAX
17082 +/* 7.18.1.3. Fastest minimum-width integer types */
17083 +/* 7.18.2.3. Limits of fastest minimum-width integer types */
17085 +int_fast8_t e1[3] = { 17, INT_FAST8_MIN, INT_FAST8_MAX };
17086 +verify (TYPE_MINIMUM (int_fast8_t) == INT_FAST8_MIN);
17087 +verify (TYPE_MAXIMUM (int_fast8_t) == INT_FAST8_MAX);
17088 +verify_same_types (INT_FAST8_MIN, (int_fast8_t) 0 + 0);
17089 +verify_same_types (INT_FAST8_MAX, (int_fast8_t) 0 + 0);
17091 +int_fast16_t e2[3] = { 17, INT_FAST16_MIN, INT_FAST16_MAX };
17092 +verify (TYPE_MINIMUM (int_fast16_t) == INT_FAST16_MIN);
17093 +verify (TYPE_MAXIMUM (int_fast16_t) == INT_FAST16_MAX);
17094 +verify_same_types (INT_FAST16_MIN, (int_fast16_t) 0 + 0);
17095 +verify_same_types (INT_FAST16_MAX, (int_fast16_t) 0 + 0);
17097 +int_fast32_t e3[3] = { 17, INT_FAST32_MIN, INT_FAST32_MAX };
17098 +verify (TYPE_MINIMUM (int_fast32_t) == INT_FAST32_MIN);
17099 +verify (TYPE_MAXIMUM (int_fast32_t) == INT_FAST32_MAX);
17100 +verify_same_types (INT_FAST32_MIN, (int_fast32_t) 0 + 0);
17101 +verify_same_types (INT_FAST32_MAX, (int_fast32_t) 0 + 0);
17103 +#ifdef INT_FAST64_MAX
17104 +int_fast64_t e4[3] = { 17, INT_FAST64_MIN, INT_FAST64_MAX };
17105 +verify (TYPE_MINIMUM (int_fast64_t) == INT_FAST64_MIN);
17106 +verify (TYPE_MAXIMUM (int_fast64_t) == INT_FAST64_MAX);
17107 +verify_same_types (INT_FAST64_MIN, (int_fast64_t) 0 + 0);
17108 +verify_same_types (INT_FAST64_MAX, (int_fast64_t) 0 + 0);
17111 +uint_fast8_t f1[2] = { 17, UINT_FAST8_MAX };
17112 +verify (TYPE_MAXIMUM (uint_fast8_t) == UINT_FAST8_MAX);
17113 +verify_same_types (UINT_FAST8_MAX, (uint_fast8_t) 0 + 0);
17115 +uint_fast16_t f2[2] = { 17, UINT_FAST16_MAX };
17116 +verify (TYPE_MAXIMUM (uint_fast16_t) == UINT_FAST16_MAX);
17117 +verify_same_types (UINT_FAST16_MAX, (uint_fast16_t) 0 + 0);
17119 +uint_fast32_t f3[2] = { 17, UINT_FAST32_MAX };
17120 +verify (TYPE_MAXIMUM (uint_fast32_t) == UINT_FAST32_MAX);
17121 +verify_same_types (UINT_FAST32_MAX, (uint_fast32_t) 0 + 0);
17123 +#ifdef UINT_FAST64_MAX
17124 +uint_fast64_t f4[2] = { 17, UINT_FAST64_MAX };
17125 +verify (TYPE_MAXIMUM (uint_fast64_t) == UINT_FAST64_MAX);
17126 +verify_same_types (UINT_FAST64_MAX, (uint_fast64_t) 0 + 0);
17129 +#if INT_FAST8_MIN && INT_FAST8_MAX && INT_FAST16_MIN && INT_FAST16_MAX && INT_FAST32_MIN && INT_FAST32_MAX
17135 +#if UINT_FAST8_MAX && UINT_FAST16_MAX && UINT_FAST32_MAX
17141 +/* 7.18.1.4. Integer types capable of holding object pointers */
17142 +/* 7.18.2.4. Limits of integer types capable of holding object pointers */
17144 +intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX };
17145 +verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN);
17146 +verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX);
17147 +verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0);
17148 +verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0);
17150 +uintptr_t h[2] = { 17, UINTPTR_MAX };
17151 +verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX);
17152 +verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0);
17154 +#if INTPTR_MIN && INTPTR_MAX && UINTPTR_MAX
17160 +/* 7.18.1.5. Greatest-width integer types */
17161 +/* 7.18.2.5. Limits of greatest-width integer types */
17163 +intmax_t i[3] = { INTMAX_C (17), INTMAX_MIN, INTMAX_MAX };
17164 +verify (TYPE_MINIMUM (intmax_t) == INTMAX_MIN);
17165 +verify (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX);
17166 +verify_same_types (INTMAX_MIN, (intmax_t) 0 + 0);
17167 +verify_same_types (INTMAX_MAX, (intmax_t) 0 + 0);
17169 +uintmax_t j[2] = { UINTMAX_C (17), UINTMAX_MAX };
17170 +verify (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX);
17171 +verify_same_types (UINTMAX_MAX, (uintmax_t) 0 + 0);
17173 +/* As of 2007, Sun C and HP-UX 10.20 cc don't support 'long long' constants in
17174 + the preprocessor. */
17175 +#if !(defined __SUNPRO_C || (defined __hpux && !defined __GNUC__))
17176 +#if INTMAX_MIN && INTMAX_MAX && UINTMAX_MAX
17183 +/* 7.18.3. Limits of other integer types */
17185 +#include <stddef.h>
17187 +verify (TYPE_MINIMUM (ptrdiff_t) == PTRDIFF_MIN);
17188 +verify (TYPE_MAXIMUM (ptrdiff_t) == PTRDIFF_MAX);
17189 +verify_same_types (PTRDIFF_MIN, (ptrdiff_t) 0 + 0);
17190 +verify_same_types (PTRDIFF_MAX, (ptrdiff_t) 0 + 0);
17192 +#if PTRDIFF_MIN && PTRDIFF_MAX
17198 +#include <signal.h>
17200 +verify (TYPE_MINIMUM (sig_atomic_t) == SIG_ATOMIC_MIN);
17201 +verify (TYPE_MAXIMUM (sig_atomic_t) == SIG_ATOMIC_MAX);
17202 +verify_same_types (SIG_ATOMIC_MIN, (sig_atomic_t) 0 + 0);
17203 +verify_same_types (SIG_ATOMIC_MAX, (sig_atomic_t) 0 + 0);
17205 +#if SIG_ATOMIC_MIN != 17 && SIG_ATOMIC_MAX
17211 +verify (TYPE_MAXIMUM (size_t) == SIZE_MAX);
17212 +verify_same_types (SIZE_MAX, (size_t) 0 + 0);
17221 +verify (TYPE_MINIMUM (wchar_t) == WCHAR_MIN);
17222 +verify (TYPE_MAXIMUM (wchar_t) == WCHAR_MAX);
17223 +verify_same_types (WCHAR_MIN, (wchar_t) 0 + 0);
17224 +verify_same_types (WCHAR_MAX, (wchar_t) 0 + 0);
17226 +# if WCHAR_MIN != 17 && WCHAR_MAX
17234 +# include <wchar.h>
17236 +verify (TYPE_MINIMUM (wint_t) == WINT_MIN);
17237 +verify (TYPE_MAXIMUM (wint_t) == WINT_MAX);
17238 +verify_same_types (WINT_MIN, (wint_t) 0 + 0);
17239 +verify_same_types (WINT_MAX, (wint_t) 0 + 0);
17241 +# if WINT_MIN != 17 && WINT_MAX
17248 +/* 7.18.4. Macros for integer constants */
17250 +verify (INT8_C (17) == 17);
17251 +verify_same_types (INT8_C (17), (int_least8_t)0 + 0);
17252 +verify (UINT8_C (17) == 17);
17253 +verify_same_types (UINT8_C (17), (uint_least8_t)0 + 0);
17255 +verify (INT16_C (17) == 17);
17256 +verify_same_types (INT16_C (17), (int_least16_t)0 + 0);
17257 +verify (UINT16_C (17) == 17);
17258 +verify_same_types (UINT16_C (17), (uint_least16_t)0 + 0);
17260 +verify (INT32_C (17) == 17);
17261 +verify_same_types (INT32_C (17), (int_least32_t)0 + 0);
17262 +verify (UINT32_C (17) == 17);
17263 +verify_same_types (UINT32_C (17), (uint_least32_t)0 + 0);
17266 +verify (INT64_C (17) == 17);
17267 +verify_same_types (INT64_C (17), (int_least64_t)0 + 0);
17270 +verify (UINT64_C (17) == 17);
17271 +verify_same_types (UINT64_C (17), (uint_least64_t)0 + 0);
17274 +verify (INTMAX_C (17) == 17);
17275 +verify_same_types (INTMAX_C (17), (intmax_t)0 + 0);
17276 +verify (UINTMAX_C (17) == 17);
17277 +verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
17285 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-stdio.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdio.c
17286 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-stdio.c 1970-01-01 01:00:00.000000000 +0100
17287 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdio.c 2008-10-09 15:24:53.000000000 +0100
17289 +/* Test of <stdio.h> substitute.
17290 + Copyright (C) 2007 Free Software Foundation, Inc.
17292 + This program is free software: you can redistribute it and/or modify
17293 + it under the terms of the GNU General Public License as published by
17294 + the Free Software Foundation; either version 3 of the License, or
17295 + (at your option) any later version.
17297 + This program is distributed in the hope that it will be useful,
17298 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17299 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17300 + GNU General Public License for more details.
17302 + You should have received a copy of the GNU General Public License
17303 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17305 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17307 +#include <config.h>
17309 +#include <stdio.h>
17311 +/* Check that the various SEEK_* macros are defined. */
17312 +int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
17319 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-stdlib.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdlib.c
17320 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-stdlib.c 1970-01-01 01:00:00.000000000 +0100
17321 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdlib.c 2008-10-09 15:24:53.000000000 +0100
17323 +/* Test of <stdlib.h> substitute.
17324 + Copyright (C) 2007 Free Software Foundation, Inc.
17326 + This program is free software: you can redistribute it and/or modify
17327 + it under the terms of the GNU General Public License as published by
17328 + the Free Software Foundation; either version 3 of the License, or
17329 + (at your option) any later version.
17331 + This program is distributed in the hope that it will be useful,
17332 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17333 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17334 + GNU General Public License for more details.
17336 + You should have received a copy of the GNU General Public License
17337 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17339 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17341 +#include <config.h>
17343 +#include <stdlib.h>
17350 + /* Check that some macros are defined and different integer constants. */
17351 + switch (exitcode)
17353 + case EXIT_SUCCESS:
17354 + case EXIT_FAILURE:
17360 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-sys_socket.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-sys_socket.c
17361 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-sys_socket.c 1970-01-01 01:00:00.000000000 +0100
17362 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-sys_socket.c 2008-10-09 15:24:53.000000000 +0100
17364 +/* Test of <sys/socket.h> substitute.
17365 + Copyright (C) 2007 Free Software Foundation, Inc.
17367 + This program is free software: you can redistribute it and/or modify
17368 + it under the terms of the GNU General Public License as published by
17369 + the Free Software Foundation; either version 3 of the License, or
17370 + (at your option) any later version.
17372 + This program is distributed in the hope that it will be useful,
17373 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17374 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17375 + GNU General Public License for more details.
17377 + You should have received a copy of the GNU General Public License
17378 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17380 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17382 +#include <config.h>
17384 +#include <sys/socket.h>
17386 +#include <errno.h>
17389 +/* Check some integer constant expressions. */
17390 +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
17396 + /* Check some errno values. */
17402 + case ECONNABORTED:
17411 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-unistd.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-unistd.c
17412 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-unistd.c 1970-01-01 01:00:00.000000000 +0100
17413 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-unistd.c 2008-10-09 15:24:53.000000000 +0100
17415 +/* Test of <unistd.h> substitute.
17416 + Copyright (C) 2007 Free Software Foundation, Inc.
17418 + This program is free software: you can redistribute it and/or modify
17419 + it under the terms of the GNU General Public License as published by
17420 + the Free Software Foundation; either version 3 of the License, or
17421 + (at your option) any later version.
17423 + This program is distributed in the hope that it will be useful,
17424 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17425 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17426 + GNU General Public License for more details.
17428 + You should have received a copy of the GNU General Public License
17429 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17431 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17433 +#include <config.h>
17435 +#include <unistd.h>
17437 +/* Check that the various SEEK_* macros are defined. */
17438 +int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
17440 +/* Check that the types are all defined. */
17443 +#ifdef TODO /* Not implemented in gnulib yet */
17459 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-vasnprintf.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vasnprintf.c
17460 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-vasnprintf.c 1970-01-01 01:00:00.000000000 +0100
17461 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vasnprintf.c 2008-10-09 15:24:53.000000000 +0100
17463 +/* Test of vasnprintf() and asnprintf() functions.
17464 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
17466 + This program is free software: you can redistribute it and/or modify
17467 + it under the terms of the GNU General Public License as published by
17468 + the Free Software Foundation; either version 3 of the License, or
17469 + (at your option) any later version.
17471 + This program is distributed in the hope that it will be useful,
17472 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17473 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17474 + GNU General Public License for more details.
17476 + You should have received a copy of the GNU General Public License
17477 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17479 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17481 +#include <config.h>
17483 +#include "vasnprintf.h"
17485 +#include <stdarg.h>
17486 +#include <stdio.h>
17487 +#include <stdlib.h>
17488 +#include <string.h>
17490 +#define ASSERT(expr) \
17495 + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
17496 + fflush (stderr); \
17503 +my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
17508 + va_start (args, format);
17509 + ret = vasnprintf (resultbuf, lengthp, format, args);
17515 +test_vasnprintf ()
17520 + for (size = 0; size <= 8; size++)
17522 + size_t length = size;
17523 + char *result = my_asnprintf (NULL, &length, "%d", 12345);
17524 + ASSERT (result != NULL);
17525 + ASSERT (strcmp (result, "12345") == 0);
17526 + ASSERT (length == 5);
17530 + for (size = 0; size <= 8; size++)
17535 + memcpy (buf, "DEADBEEF", 8);
17537 + result = my_asnprintf (buf, &length, "%d", 12345);
17538 + ASSERT (result != NULL);
17539 + ASSERT (strcmp (result, "12345") == 0);
17540 + ASSERT (length == 5);
17542 + ASSERT (result != buf);
17543 + ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
17544 + if (result != buf)
17555 + for (size = 0; size <= 8; size++)
17557 + size_t length = size;
17558 + char *result = asnprintf (NULL, &length, "%d", 12345);
17559 + ASSERT (result != NULL);
17560 + ASSERT (strcmp (result, "12345") == 0);
17561 + ASSERT (length == 5);
17565 + for (size = 0; size <= 8; size++)
17570 + memcpy (buf, "DEADBEEF", 8);
17572 + result = asnprintf (buf, &length, "%d", 12345);
17573 + ASSERT (result != NULL);
17574 + ASSERT (strcmp (result, "12345") == 0);
17575 + ASSERT (length == 5);
17577 + ASSERT (result != buf);
17578 + ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
17579 + if (result != buf)
17585 +main (int argc, char *argv[])
17587 + test_vasnprintf ();
17588 + test_asnprintf ();
17591 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-vc-list-files-cvs.sh gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vc-list-files-cvs.sh
17592 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-vc-list-files-cvs.sh 1970-01-01 01:00:00.000000000 +0100
17593 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vc-list-files-cvs.sh 2008-10-09 15:24:53.000000000 +0100
17596 +# Unit tests for vc-list-files
17597 +# Copyright (C) 2008 Free Software Foundation, Inc.
17598 +# This file is part of the GNUlib Library.
17600 +# This program is free software: you can redistribute it and/or modify
17601 +# it under the terms of the GNU General Public License as published by
17602 +# the Free Software Foundation; either version 3 of the License, or
17603 +# (at your option) any later version.
17605 +# This program is distributed in the hope that it will be useful,
17606 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
17607 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17608 +# GNU General Public License for more details.
17610 +# You should have received a copy of the GNU General Public License
17611 +# along with this program. If not, see <http://www.gnu.org/licenses/>. */
17614 +trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
17615 +trap '(exit $?); exit $?' 1 2 13 15
17617 +if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
17618 + compare() { diff -u "$@"; }
17619 +elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
17620 + compare() { cmp -s "$@"; }
17622 + compare() { cmp "$@"; }
17625 +repo=`pwd`/$tmpdir/repo
17628 +for i in with-cvsu without; do
17629 + # On the first iteration, test using cvsu, if it's in your path.
17630 + # On the second iteration, ensure that cvsu fails, so we'll
17631 + # exercise the awk-using code.
17632 + if test $i = without; then
17633 + printf '%s\n' '#!/bin/sh' 'exit 1' > cvsu
17639 + mkdir $tmpdir && cd $tmpdir &&
17640 + # without cvs, skip the test
17641 + # The double use of 'exit' is needed for the reference to $? inside the trap.
17642 + { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 \
17643 + || { echo "Skipping test: cvs not found in PATH"; (exit 77); exit 77; }; } &&
17644 + mkdir w && cd w &&
17647 + cvs -Q -d "$repo" import -m imp m M M0 &&
17648 + cvs -Q -d "$repo" co m && cd m &&
17649 + printf '%s\n' b c d/a > expected &&
17650 + vc-list-files | sort > actual &&
17651 + compare expected actual &&
17653 + test $ok = 0 && fail=1
17656 +(exit $fail); exit $fail
17657 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-vc-list-files-git.sh gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vc-list-files-git.sh
17658 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-vc-list-files-git.sh 1970-01-01 01:00:00.000000000 +0100
17659 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vc-list-files-git.sh 2008-10-09 15:24:53.000000000 +0100
17662 +# Unit tests for vc-list-files
17663 +# Copyright (C) 2008 Free Software Foundation, Inc.
17664 +# This file is part of the GNUlib Library.
17666 +# This program is free software: you can redistribute it and/or modify
17667 +# it under the terms of the GNU General Public License as published by
17668 +# the Free Software Foundation; either version 3 of the License, or
17669 +# (at your option) any later version.
17671 +# This program is distributed in the hope that it will be useful,
17672 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
17673 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17674 +# GNU General Public License for more details.
17676 +# You should have received a copy of the GNU General Public License
17677 +# along with this program. If not, see <http://www.gnu.org/licenses/>. */
17679 +if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
17680 + compare() { diff -u "$@"; }
17681 +elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
17682 + compare() { cmp -s "$@"; }
17684 + compare() { cmp "$@"; }
17688 +trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
17689 +trap '(exit $?); exit $?' 1 2 13 15
17692 +mkdir $tmpdir && cd $tmpdir &&
17693 + # without git, skip the test
17694 + # The double use of 'exit' is needed for the reference to $? inside the trap.
17695 + { ( git init -q ) > /dev/null 2>&1 \
17696 + || { echo "Skipping test: git not found in PATH"; (exit 77); exit 77; }; } &&
17699 + git add . > /dev/null &&
17700 + git commit -q -a -m log &&
17701 + printf '%s\n' b c d/a > expected &&
17702 + vc-list-files > actual &&
17703 + compare expected actual &&
17706 +(exit $fail); exit $fail
17707 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/test-wchar.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-wchar.c
17708 --- gtk-vnc-0.3.7.dan3/gnulib/tests/test-wchar.c 1970-01-01 01:00:00.000000000 +0100
17709 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-wchar.c 2008-10-09 15:24:53.000000000 +0100
17711 +/* Test of <wchar.h> substitute.
17712 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
17714 + This program is free software: you can redistribute it and/or modify
17715 + it under the terms of the GNU General Public License as published by
17716 + the Free Software Foundation; either version 3 of the License, or
17717 + (at your option) any later version.
17719 + This program is distributed in the hope that it will be useful,
17720 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17721 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17722 + GNU General Public License for more details.
17724 + You should have received a copy of the GNU General Public License
17725 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17727 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17729 +#include <config.h>
17731 +#include <wchar.h>
17733 +/* Check that the types wchar_t and wint_t are defined. */
17742 diff -urN gtk-vnc-0.3.7.dan3/gnulib/tests/verify.h gtk-vnc-0.3.7.gnulib/gnulib/tests/verify.h
17743 --- gtk-vnc-0.3.7.dan3/gnulib/tests/verify.h 1970-01-01 01:00:00.000000000 +0100
17744 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/verify.h 2008-10-09 15:24:53.000000000 +0100
17746 +/* Compile-time assert-like macros.
17748 + Copyright (C) 2005, 2006 Free Software Foundation, Inc.
17750 + This program is free software: you can redistribute it and/or modify
17751 + it under the terms of the GNU General Public License as published by
17752 + the Free Software Foundation; either version 3 of the License, or
17753 + (at your option) any later version.
17755 + This program is distributed in the hope that it will be useful,
17756 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17757 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17758 + GNU General Public License for more details.
17760 + You should have received a copy of the GNU General Public License
17761 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17763 +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
17766 +# define VERIFY_H 1
17768 +/* Each of these macros verifies that its argument R is nonzero. To
17769 + be portable, R should be an integer constant expression. Unlike
17770 + assert (R), there is no run-time overhead.
17772 + There are two macros, since no single macro can be used in all
17773 + contexts in C. verify_true (R) is for scalar contexts, including
17774 + integer constant expression contexts. verify (R) is for declaration
17775 + contexts, e.g., the top level.
17777 + Symbols ending in "__" are private to this header.
17779 + The code below uses several ideas.
17781 + * The first step is ((R) ? 1 : -1). Given an expression R, of
17782 + integral or boolean or floating-point type, this yields an
17783 + expression of integral type, whose value is later verified to be
17784 + constant and nonnegative.
17786 + * Next this expression W is wrapped in a type
17787 + struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }.
17788 + If W is negative, this yields a compile-time error. No compiler can
17789 + deal with a bit-field of negative size.
17791 + One might think that an array size check would have the same
17792 + effect, that is, that the type struct { unsigned int dummy[W]; }
17793 + would work as well. However, inside a function, some compilers
17794 + (such as C++ compilers and GNU C) allow local parameters and
17795 + variables inside array size expressions. With these compilers,
17796 + an array size check would not properly diagnose this misuse of
17797 + the verify macro:
17799 + void function (int n) { verify (n < 0); }
17801 + * For the verify macro, the struct verify_type__ will need to
17802 + somehow be embedded into a declaration. To be portable, this
17803 + declaration must declare an object, a constant, a function, or a
17804 + typedef name. If the declared entity uses the type directly,
17807 + struct dummy {...};
17808 + typedef struct {...} dummy;
17809 + extern struct {...} *dummy;
17810 + extern void dummy (struct {...} *);
17811 + extern struct {...} *dummy (void);
17813 + two uses of the verify macro would yield colliding declarations
17814 + if the entity names are not disambiguated. A workaround is to
17815 + attach the current line number to the entity name:
17817 + #define GL_CONCAT0(x, y) x##y
17818 + #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
17819 + extern struct {...} * GL_CONCAT(dummy,__LINE__);
17821 + But this has the problem that two invocations of verify from
17822 + within the same macro would collide, since the __LINE__ value
17823 + would be the same for both invocations.
17825 + A solution is to use the sizeof operator. It yields a number,
17826 + getting rid of the identity of the type. Declarations like
17828 + extern int dummy [sizeof (struct {...})];
17829 + extern void dummy (int [sizeof (struct {...})]);
17830 + extern int (*dummy (void)) [sizeof (struct {...})];
17834 + * Should the implementation use a named struct or an unnamed struct?
17835 + Which of the following alternatives can be used?
17837 + extern int dummy [sizeof (struct {...})];
17838 + extern int dummy [sizeof (struct verify_type__ {...})];
17839 + extern void dummy (int [sizeof (struct {...})]);
17840 + extern void dummy (int [sizeof (struct verify_type__ {...})]);
17841 + extern int (*dummy (void)) [sizeof (struct {...})];
17842 + extern int (*dummy (void)) [sizeof (struct verify_type__ {...})];
17844 + In the second and sixth case, the struct type is exported to the
17845 + outer scope; two such declarations therefore collide. GCC warns
17846 + about the first, third, and fourth cases. So the only remaining
17847 + possibility is the fifth case:
17849 + extern int (*dummy (void)) [sizeof (struct {...})];
17851 + * This implementation exploits the fact that GCC does not warn about
17852 + the last declaration mentioned above. If a future version of GCC
17853 + introduces a warning for this, the problem could be worked around
17854 + by using code specialized to GCC, e.g.,:
17856 + #if 4 <= __GNUC__
17857 + # define verify(R) \
17858 + extern int (* verify_function__ (void)) \
17859 + [__builtin_constant_p (R) && (R) ? 1 : -1]
17862 + * In C++, any struct definition inside sizeof is invalid.
17863 + Use a template type to work around the problem. */
17866 +/* Verify requirement R at compile-time, as an integer constant expression.
17869 +# ifdef __cplusplus
17871 + struct verify_type__ { unsigned int verify_error_if_negative_size__: w; };
17872 +# define verify_true(R) \
17873 + (!!sizeof (verify_type__<(R) ? 1 : -1>))
17875 +# define verify_true(R) \
17877 + (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; }))
17880 +/* Verify requirement R at compile-time, as a declaration without a
17883 +# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
17886 diff -urN gtk-vnc-0.3.7.dan3/link-warning.h gtk-vnc-0.3.7.gnulib/link-warning.h
17887 --- gtk-vnc-0.3.7.dan3/link-warning.h 1970-01-01 01:00:00.000000000 +0100
17888 +++ gtk-vnc-0.3.7.gnulib/link-warning.h 2008-10-09 15:24:52.000000000 +0100
17890 +/* GL_LINK_WARNING("literal string") arranges to emit the literal string as
17891 + a linker warning on most glibc systems.
17892 + We use a linker warning rather than a preprocessor warning, because
17893 + #warning cannot be used inside macros. */
17894 +#ifndef GL_LINK_WARNING
17895 + /* This works on platforms with GNU ld and ELF object format.
17896 + Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
17897 + Testing __ELF__ guarantees the ELF object format.
17898 + Testing __GNUC__ is necessary for the compound expression syntax. */
17899 +# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
17900 +# define GL_LINK_WARNING(message) \
17901 + GL_LINK_WARNING1 (__FILE__, __LINE__, message)
17902 +# define GL_LINK_WARNING1(file, line, message) \
17903 + GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */
17904 +# define GL_LINK_WARNING2(file, line, message) \
17905 + GL_LINK_WARNING3 (file ":" #line ": warning: " message)
17906 +# define GL_LINK_WARNING3(message) \
17907 + ({ static const char warning[sizeof (message)] \
17908 + __attribute__ ((__unused__, \
17909 + __section__ (".gnu.warning"), \
17910 + __aligned__ (1))) \
17911 + = message "\n"; \
17915 +# define GL_LINK_WARNING(message) ((void) 0)