1 diff -urN gtk-vnc-0.3.7.mingw/bootstrap gtk-vnc-0.3.7.gnulib/bootstrap
2 --- gtk-vnc-0.3.7.mingw/bootstrap 2008-10-09 12:19:03.000000000 +0100
3 +++ gtk-vnc-0.3.7.gnulib/bootstrap 2008-10-09 12:33:37.000000000 +0100
15 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/alloca.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/alloca.in.h
16 --- gtk-vnc-0.3.7.mingw/gnulib/lib/alloca.in.h 1970-01-01 01:00:00.000000000 +0100
17 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/alloca.in.h 2008-10-09 12:24:39.000000000 +0100
19 +/* Memory allocation on the stack.
21 + Copyright (C) 1995, 1999, 2001-2004, 2006-2008 Free Software
24 + This program is free software; you can redistribute it and/or modify it
25 + under the terms of the GNU Lesser General Public License as published
26 + by the Free Software Foundation; either version 2.1, or (at your option)
29 + This program is distributed in the hope that it will be useful,
30 + but WITHOUT ANY WARRANTY; without even the implied warranty of
31 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
32 + General Public License for more details.
34 + You should have received a copy of the GNU Lesser General Public
35 + License along with this program; if not, write to the Free Software
36 + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
39 +/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
40 + means there is a real alloca function. */
44 +/* alloca (N) returns a pointer to N bytes of memory
45 + allocated on the stack, which will last until the function returns.
46 + Use of alloca should be avoided:
47 + - inside arguments of function calls - undefined behaviour,
48 + - in inline functions - the allocation may actually last until the
49 + calling function returns,
50 + - for huge N (say, N >= 65536) - you never know how large (or small)
51 + the stack is, and when the stack cannot fulfill the memory allocation
52 + request, the program just crashes.
57 +# define alloca __builtin_alloca
59 +# define alloca __alloca
60 +# elif defined _MSC_VER
62 +# define alloca _alloca
63 +# elif defined __DECC && defined __VMS
64 +# define alloca __ALLOCA
70 +void *alloca (size_t);
74 +#endif /* _GL_ALLOCA_H */
75 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/arpa_inet.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/arpa_inet.in.h
76 --- gtk-vnc-0.3.7.mingw/gnulib/lib/arpa_inet.in.h 1970-01-01 01:00:00.000000000 +0100
77 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/arpa_inet.in.h 2008-10-09 12:24:39.000000000 +0100
79 +/* A GNU-like <arpa/inet.h>.
81 + Copyright (C) 2005-2006, 2008 Free Software Foundation, Inc.
83 + This program is free software; you can redistribute it and/or modify
84 + it under the terms of the GNU Lesser General Public License as published by
85 + the Free Software Foundation; either version 2.1, or (at your option)
88 + This program is distributed in the hope that it will be useful,
89 + but WITHOUT ANY WARRANTY; without even the implied warranty of
90 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
91 + GNU Lesser General Public License for more details.
93 + You should have received a copy of the GNU Lesser General Public License
94 + along with this program; if not, write to the Free Software Foundation,
95 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
97 +#ifndef _GL_ARPA_INET_H
99 +/* Gnulib's sys/socket.h is responsible for pulling in winsock2.h etc
101 +#include <sys/socket.h>
103 +#if @HAVE_ARPA_INET_H@
105 +@PRAGMA_SYSTEM_HEADER@
107 +/* The include_next requires a split double-inclusion guard. */
108 +# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
112 +#ifndef _GL_ARPA_INET_H
113 +#define _GL_ARPA_INET_H
115 +/* The definition of GL_LINK_WARNING is copied here. */
117 +#if @GNULIB_INET_NTOP@
118 +# if !@HAVE_DECL_INET_NTOP@
119 +/* Converts an internet address from internal format to a printable,
120 + presentable format.
121 + AF is an internet address family, such as AF_INET or AF_INET6.
122 + SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
124 + DST points to a buffer having room for CNT bytes.
125 + The printable representation of the address (in numeric form, not
126 + surrounded by [...], no reverse DNS is done) is placed in DST, and
127 + DST is returned. If an error occurs, the return value is NULL and
128 + errno is set. If CNT bytes are not sufficient to hold the result,
129 + the return value is NULL and errno is set to ENOSPC. A good value
132 + For more details, see the POSIX:2001 specification
133 + <http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
134 +extern const char *inet_ntop (int af, const void *restrict src,
135 + char *restrict dst, socklen_t cnt);
137 +#elif defined GNULIB_POSIXCHECK
139 +# define inet_ntop(af,src,dst,cnt) \
140 + (GL_LINK_WARNING ("inet_ntop is unportable - " \
141 + "use gnulib module inet_ntop for portability"), \
142 + inet_ntop (af, src, dst, cnt))
145 +#if @GNULIB_INET_PTON@
146 +# if !@HAVE_DECL_INET_PTON@
147 +extern int inet_pton (int af, const char *restrict src, void *restrict dst);
149 +#elif defined GNULIB_POSIXCHECK
151 +# define inet_pton(af,src,dst) \
152 + (GL_LINK_WARNING ("inet_pton is unportable - " \
153 + "use gnulib module inet_pton for portability"), \
154 + inet_pton (af, src, dst))
157 +#endif /* _GL_ARPA_INET_H */
158 +#endif /* _GL_ARPA_INET_H */
159 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/asnprintf.c gtk-vnc-0.3.7.gnulib/gnulib/lib/asnprintf.c
160 --- gtk-vnc-0.3.7.mingw/gnulib/lib/asnprintf.c 1970-01-01 01:00:00.000000000 +0100
161 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/asnprintf.c 2008-10-09 12:24:39.000000000 +0100
163 +/* Formatted output to strings.
164 + Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
166 + This program is free software; you can redistribute it and/or modify
167 + it under the terms of the GNU Lesser General Public License as published by
168 + the Free Software Foundation; either version 2.1, or (at your option)
171 + This program is distributed in the hope that it will be useful,
172 + but WITHOUT ANY WARRANTY; without even the implied warranty of
173 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
174 + GNU Lesser General Public License for more details.
176 + You should have received a copy of the GNU Lesser General Public License along
177 + with this program; if not, write to the Free Software Foundation,
178 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
182 +/* Specification. */
183 +#include "vasnprintf.h"
188 +asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
193 + va_start (args, format);
194 + result = vasnprintf (resultbuf, lengthp, format, args);
198 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/dummy.c gtk-vnc-0.3.7.gnulib/gnulib/lib/dummy.c
199 --- gtk-vnc-0.3.7.mingw/gnulib/lib/dummy.c 1970-01-01 01:00:00.000000000 +0100
200 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/dummy.c 2008-10-09 12:24:39.000000000 +0100
202 +/* A dummy file, to prevent empty libraries from breaking builds.
203 + Copyright (C) 2004, 2007 Free Software Foundation, Inc.
205 + This program is free software: you can redistribute it and/or modify
206 + it under the terms of the GNU Lesser General Public License as published by
207 + the Free Software Foundation; either version 2.1 of the License, or
208 + (at your option) any later version.
210 + This program is distributed in the hope that it will be useful,
211 + but WITHOUT ANY WARRANTY; without even the implied warranty of
212 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
213 + GNU Lesser General Public License for more details.
215 + You should have received a copy of the GNU Lesser General Public License
216 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
218 +/* Some systems, reportedly OpenBSD and Mac OS X, refuse to create
219 + libraries without any object files. You might get an error like:
221 + > ar cru .libs/libgl.a
222 + > ar: no archive members specified
224 + Compiling this file, and adding its object file to the library, will
225 + prevent the library from being empty. */
227 +/* Some systems, such as Solaris with cc 5.0, refuse to work with libraries
228 + that don't export any symbol. You might get an error like:
231 + > ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a
233 + Compiling this file, and adding its object file to the library, will
234 + prevent the library from exporting no symbols. */
237 +/* This declaration ensures that the library will export at least 1 symbol. */
238 +int gl_dummy_symbol;
240 +/* This declaration is solely to ensure that after preprocessing
241 + this file is never empty. */
244 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/errno.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/errno.in.h
245 --- gtk-vnc-0.3.7.mingw/gnulib/lib/errno.in.h 1970-01-01 01:00:00.000000000 +0100
246 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/errno.in.h 2008-10-09 12:24:39.000000000 +0100
248 +/* A POSIX-like <errno.h>.
250 + Copyright (C) 2008 Free Software Foundation, Inc.
252 + This program is free software; you can redistribute it and/or modify
253 + it under the terms of the GNU Lesser General Public License as published by
254 + the Free Software Foundation; either version 2.1, or (at your option)
257 + This program is distributed in the hope that it will be useful,
258 + but WITHOUT ANY WARRANTY; without even the implied warranty of
259 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
260 + GNU Lesser General Public License for more details.
262 + You should have received a copy of the GNU Lesser General Public License
263 + along with this program; if not, write to the Free Software Foundation,
264 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
268 +@PRAGMA_SYSTEM_HEADER@
270 +/* The include_next requires a split double-inclusion guard. */
271 +#@INCLUDE_NEXT@ @NEXT_ERRNO_H@
277 +/* On native Windows platforms, many macros are not defined. */
278 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
280 +/* POSIX says that EAGAIN and EWOULDBLOCK may have the same value. */
281 +# define EWOULDBLOCK EAGAIN
283 +/* Values >= 100 seem safe to use. */
284 +# define ETXTBSY 100
285 +# define GNULIB_defined_ETXTBSY 1
287 +/* These are intentionally the same values as the WSA* error numbers, defined
288 + in <winsock2.h>. */
289 +# define EINPROGRESS 10036
290 +# define EALREADY 10037
291 +# define ENOTSOCK 10038
292 +# define EDESTADDRREQ 10039
293 +# define EMSGSIZE 10040
294 +# define EPROTOTYPE 10041
295 +# define ENOPROTOOPT 10042
296 +# define EPROTONOSUPPORT 10043
297 +# define ESOCKTNOSUPPORT 10044 /* not required by POSIX */
298 +# define EOPNOTSUPP 10045
299 +# define EPFNOSUPPORT 10046 /* not required by POSIX */
300 +# define EAFNOSUPPORT 10047
301 +# define EADDRINUSE 10048
302 +# define EADDRNOTAVAIL 10049
303 +# define ENETDOWN 10050
304 +# define ENETUNREACH 10051
305 +# define ENETRESET 10052
306 +# define ECONNABORTED 10053
307 +# define ECONNRESET 10054
308 +# define ENOBUFS 10055
309 +# define EISCONN 10056
310 +# define ENOTCONN 10057
311 +# define ESHUTDOWN 10058 /* not required by POSIX */
312 +# define ETOOMANYREFS 10059 /* not required by POSIX */
313 +# define ETIMEDOUT 10060
314 +# define ECONNREFUSED 10061
315 +# define ELOOP 10062
316 +# define EHOSTDOWN 10064 /* not required by POSIX */
317 +# define EHOSTUNREACH 10065
318 +# define EPROCLIM 10067 /* not required by POSIX */
319 +# define EUSERS 10068 /* not required by POSIX */
320 +# define EDQUOT 10069
321 +# define ESTALE 10070
322 +# define EREMOTE 10071 /* not required by POSIX */
323 +# define GNULIB_defined_ESOCK 1
328 +/* On OSF/1 5.1, when _XOPEN_SOURCE_EXTENDED is not defined, the macros
329 + EMULTIHOP, ENOLINK, EOVERFLOW are not defined. */
330 +# if @EMULTIHOP_HIDDEN@
331 +# define EMULTIHOP @EMULTIHOP_VALUE@
332 +# define GNULIB_defined_EMULTIHOP 1
334 +# if @ENOLINK_HIDDEN@
335 +# define ENOLINK @ENOLINK_VALUE@
336 +# define GNULIB_defined_ENOLINK 1
338 +# if @EOVERFLOW_HIDDEN@
339 +# define EOVERFLOW @EOVERFLOW_VALUE@
340 +# define GNULIB_defined_EOVERFLOW 1
344 +/* On OpenBSD 4.0 and on native Windows, the macros ENOMSG, EIDRM, ENOLINK,
345 + EPROTO, EMULTIHOP, EBADMSG, EOVERFLOW, ENOTSUP, ECANCELED are not defined.
346 + Define them here. Values >= 2000 seem safe to use: Solaris ESTALE = 151,
347 + HP-UX EWOULDBLOCK = 246, IRIX EDQUOT = 1133.
349 + Note: When one of these systems defines some of these macros some day,
350 + binaries will have to be recompiled so that they recognizes the new
351 + errno values from the system. */
354 +# define ENOMSG 2000
355 +# define GNULIB_defined_ENOMSG 1
360 +# define GNULIB_defined_EIDRM 1
364 +# define ENOLINK 2002
365 +# define GNULIB_defined_ENOLINK 1
369 +# define EPROTO 2003
370 +# define GNULIB_defined_EPROTO 1
374 +# define EMULTIHOP 2004
375 +# define GNULIB_defined_EMULTIHOP 1
379 +# define EBADMSG 2005
380 +# define GNULIB_defined_EBADMSG 1
384 +# define EOVERFLOW 2006
385 +# define GNULIB_defined_EOVERFLOW 1
389 +# define ENOTSUP 2007
390 +# define GNULIB_defined_ENOTSUP 1
394 +# define ECANCELED 2008
395 +# define GNULIB_defined_ECANCELED 1
399 +#endif /* _GL_ERRNO_H */
400 +#endif /* _GL_ERRNO_H */
401 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/float+.h gtk-vnc-0.3.7.gnulib/gnulib/lib/float+.h
402 --- gtk-vnc-0.3.7.mingw/gnulib/lib/float+.h 1970-01-01 01:00:00.000000000 +0100
403 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/float+.h 2008-10-09 12:24:39.000000000 +0100
405 +/* Supplemental information about the floating-point formats.
406 + Copyright (C) 2007 Free Software Foundation, Inc.
407 + Written by Bruno Haible <bruno@clisp.org>, 2007.
409 + This program is free software; you can redistribute it and/or modify
410 + it under the terms of the GNU Lesser General Public License as published by
411 + the Free Software Foundation; either version 2.1, or (at your option)
414 + This program is distributed in the hope that it will be useful,
415 + but WITHOUT ANY WARRANTY; without even the implied warranty of
416 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
417 + GNU Lesser General Public License for more details.
419 + You should have received a copy of the GNU Lesser General Public License
420 + along with this program; if not, write to the Free Software Foundation,
421 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
423 +#ifndef _FLOATPLUS_H
424 +#define _FLOATPLUS_H
429 +/* Number of bits in the mantissa of a floating-point number, including the
432 +# define FLT_MANT_BIT FLT_MANT_DIG
433 +# define DBL_MANT_BIT DBL_MANT_DIG
434 +# define LDBL_MANT_BIT LDBL_MANT_DIG
435 +#elif FLT_RADIX == 4
436 +# define FLT_MANT_BIT (FLT_MANT_DIG * 2)
437 +# define DBL_MANT_BIT (DBL_MANT_DIG * 2)
438 +# define LDBL_MANT_BIT (LDBL_MANT_DIG * 2)
439 +#elif FLT_RADIX == 16
440 +# define FLT_MANT_BIT (FLT_MANT_DIG * 4)
441 +# define DBL_MANT_BIT (DBL_MANT_DIG * 4)
442 +# define LDBL_MANT_BIT (LDBL_MANT_DIG * 4)
445 +/* Bit mask that can be used to mask the exponent, as an unsigned number. */
446 +#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7)
447 +#define DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7)
448 +#define LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7)
450 +/* Number of bits used for the exponent of a floating-point number, including
451 + the exponent's sign. */
452 +#define FLT_EXP_BIT \
453 + (FLT_EXP_MASK < 0x100 ? 8 : \
454 + FLT_EXP_MASK < 0x200 ? 9 : \
455 + FLT_EXP_MASK < 0x400 ? 10 : \
456 + FLT_EXP_MASK < 0x800 ? 11 : \
457 + FLT_EXP_MASK < 0x1000 ? 12 : \
458 + FLT_EXP_MASK < 0x2000 ? 13 : \
459 + FLT_EXP_MASK < 0x4000 ? 14 : \
460 + FLT_EXP_MASK < 0x8000 ? 15 : \
461 + FLT_EXP_MASK < 0x10000 ? 16 : \
462 + FLT_EXP_MASK < 0x20000 ? 17 : \
463 + FLT_EXP_MASK < 0x40000 ? 18 : \
464 + FLT_EXP_MASK < 0x80000 ? 19 : \
465 + FLT_EXP_MASK < 0x100000 ? 20 : \
466 + FLT_EXP_MASK < 0x200000 ? 21 : \
467 + FLT_EXP_MASK < 0x400000 ? 22 : \
468 + FLT_EXP_MASK < 0x800000 ? 23 : \
469 + FLT_EXP_MASK < 0x1000000 ? 24 : \
470 + FLT_EXP_MASK < 0x2000000 ? 25 : \
471 + FLT_EXP_MASK < 0x4000000 ? 26 : \
472 + FLT_EXP_MASK < 0x8000000 ? 27 : \
473 + FLT_EXP_MASK < 0x10000000 ? 28 : \
474 + FLT_EXP_MASK < 0x20000000 ? 29 : \
475 + FLT_EXP_MASK < 0x40000000 ? 30 : \
476 + FLT_EXP_MASK <= 0x7fffffff ? 31 : \
478 +#define DBL_EXP_BIT \
479 + (DBL_EXP_MASK < 0x100 ? 8 : \
480 + DBL_EXP_MASK < 0x200 ? 9 : \
481 + DBL_EXP_MASK < 0x400 ? 10 : \
482 + DBL_EXP_MASK < 0x800 ? 11 : \
483 + DBL_EXP_MASK < 0x1000 ? 12 : \
484 + DBL_EXP_MASK < 0x2000 ? 13 : \
485 + DBL_EXP_MASK < 0x4000 ? 14 : \
486 + DBL_EXP_MASK < 0x8000 ? 15 : \
487 + DBL_EXP_MASK < 0x10000 ? 16 : \
488 + DBL_EXP_MASK < 0x20000 ? 17 : \
489 + DBL_EXP_MASK < 0x40000 ? 18 : \
490 + DBL_EXP_MASK < 0x80000 ? 19 : \
491 + DBL_EXP_MASK < 0x100000 ? 20 : \
492 + DBL_EXP_MASK < 0x200000 ? 21 : \
493 + DBL_EXP_MASK < 0x400000 ? 22 : \
494 + DBL_EXP_MASK < 0x800000 ? 23 : \
495 + DBL_EXP_MASK < 0x1000000 ? 24 : \
496 + DBL_EXP_MASK < 0x2000000 ? 25 : \
497 + DBL_EXP_MASK < 0x4000000 ? 26 : \
498 + DBL_EXP_MASK < 0x8000000 ? 27 : \
499 + DBL_EXP_MASK < 0x10000000 ? 28 : \
500 + DBL_EXP_MASK < 0x20000000 ? 29 : \
501 + DBL_EXP_MASK < 0x40000000 ? 30 : \
502 + DBL_EXP_MASK <= 0x7fffffff ? 31 : \
504 +#define LDBL_EXP_BIT \
505 + (LDBL_EXP_MASK < 0x100 ? 8 : \
506 + LDBL_EXP_MASK < 0x200 ? 9 : \
507 + LDBL_EXP_MASK < 0x400 ? 10 : \
508 + LDBL_EXP_MASK < 0x800 ? 11 : \
509 + LDBL_EXP_MASK < 0x1000 ? 12 : \
510 + LDBL_EXP_MASK < 0x2000 ? 13 : \
511 + LDBL_EXP_MASK < 0x4000 ? 14 : \
512 + LDBL_EXP_MASK < 0x8000 ? 15 : \
513 + LDBL_EXP_MASK < 0x10000 ? 16 : \
514 + LDBL_EXP_MASK < 0x20000 ? 17 : \
515 + LDBL_EXP_MASK < 0x40000 ? 18 : \
516 + LDBL_EXP_MASK < 0x80000 ? 19 : \
517 + LDBL_EXP_MASK < 0x100000 ? 20 : \
518 + LDBL_EXP_MASK < 0x200000 ? 21 : \
519 + LDBL_EXP_MASK < 0x400000 ? 22 : \
520 + LDBL_EXP_MASK < 0x800000 ? 23 : \
521 + LDBL_EXP_MASK < 0x1000000 ? 24 : \
522 + LDBL_EXP_MASK < 0x2000000 ? 25 : \
523 + LDBL_EXP_MASK < 0x4000000 ? 26 : \
524 + LDBL_EXP_MASK < 0x8000000 ? 27 : \
525 + LDBL_EXP_MASK < 0x10000000 ? 28 : \
526 + LDBL_EXP_MASK < 0x20000000 ? 29 : \
527 + LDBL_EXP_MASK < 0x40000000 ? 30 : \
528 + LDBL_EXP_MASK <= 0x7fffffff ? 31 : \
531 +/* Number of bits used for a floating-point number: the mantissa (not
532 + counting the "hidden bit", since it may or may not be explicit), the
533 + exponent, and the sign. */
534 +#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1)
535 +#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1)
536 +#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1)
538 +/* Number of bytes used for a floating-point number.
539 + This can be smaller than the 'sizeof'. For example, on i386 systems,
540 + 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence
541 + LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but
542 + sizeof (long double) = 12 or = 16. */
543 +#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
544 +#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
545 +#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT)
547 +/* Verify that SIZEOF_FLT <= sizeof (float) etc. */
548 +typedef int verify_sizeof_flt[2 * (SIZEOF_FLT <= sizeof (float)) - 1];
549 +typedef int verify_sizeof_dbl[2 * (SIZEOF_DBL <= sizeof (double)) - 1];
550 +typedef int verify_sizeof_ldbl[2 * (SIZEOF_LDBL <= sizeof (long double)) - 1];
552 +#endif /* _FLOATPLUS_H */
553 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/float.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/float.in.h
554 --- gtk-vnc-0.3.7.mingw/gnulib/lib/float.in.h 1970-01-01 01:00:00.000000000 +0100
555 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/float.in.h 2008-10-09 12:24:39.000000000 +0100
557 +/* A correct <float.h>.
559 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
561 + This program is free software: you can redistribute it and/or modify
562 + it under the terms of the GNU Lesser General Public License as published by
563 + the Free Software Foundation; either version 2.1 of the License, or
564 + (at your option) any later version.
566 + This program is distributed in the hope that it will be useful,
567 + but WITHOUT ANY WARRANTY; without even the implied warranty of
568 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
569 + GNU Lesser General Public License for more details.
571 + You should have received a copy of the GNU Lesser General Public License
572 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
576 +@PRAGMA_SYSTEM_HEADER@
578 +/* The include_next requires a split double-inclusion guard. */
579 +#@INCLUDE_NEXT@ @NEXT_FLOAT_H@
584 +/* 'long double' properties. */
585 +#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
586 +/* Number of mantissa units, in base FLT_RADIX. */
587 +# undef LDBL_MANT_DIG
588 +# define LDBL_MANT_DIG 64
589 +/* Number of decimal digits that is sufficient for representing a number. */
591 +# define LDBL_DIG 18
592 +/* x-1 where x is the smallest representable number > 1. */
593 +# undef LDBL_EPSILON
594 +# define LDBL_EPSILON 1.0842021724855044340E-19L
595 +/* Minimum e such that FLT_RADIX^(e-1) is a normalized number. */
596 +# undef LDBL_MIN_EXP
597 +# define LDBL_MIN_EXP (-16381)
598 +/* Maximum e such that FLT_RADIX^(e-1) is a representable finite number. */
599 +# undef LDBL_MAX_EXP
600 +# define LDBL_MAX_EXP 16384
601 +/* Minimum positive normalized number. */
603 +# define LDBL_MIN 3.3621031431120935063E-4932L
604 +/* Maximum representable finite number. */
606 +# define LDBL_MAX 1.1897314953572317650E+4932L
607 +/* Minimum e such that 10^e is in the range of normalized numbers. */
608 +# undef LDBL_MIN_10_EXP
609 +# define LDBL_MIN_10_EXP (-4931)
610 +/* Maximum e such that 10^e is in the range of representable finite numbers. */
611 +# undef LDBL_MAX_10_EXP
612 +# define LDBL_MAX_10_EXP 4932
615 +#endif /* _GL_FLOAT_H */
616 +#endif /* _GL_FLOAT_H */
617 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/gai_strerror.c gtk-vnc-0.3.7.gnulib/gnulib/lib/gai_strerror.c
618 --- gtk-vnc-0.3.7.mingw/gnulib/lib/gai_strerror.c 1970-01-01 01:00:00.000000000 +0100
619 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/gai_strerror.c 2008-10-09 12:24:39.000000000 +0100
621 +/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
622 + This file is part of the GNU C Library.
623 + Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
625 + This program is free software; you can redistribute it and/or modify
626 + it under the terms of the GNU Lesser General Public License as published by
627 + the Free Software Foundation; either version 2.1, or (at your option)
630 + This program is distributed in the hope that it will be useful,
631 + but WITHOUT ANY WARRANTY; without even the implied warranty of
632 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
633 + GNU Lesser General Public License for more details.
635 + You should have received a copy of the GNU Lesser General Public License
636 + along with this program; if not, write to the Free Software Foundation,
637 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
640 +# include <config.h>
641 +# include "getaddrinfo.h"
650 +# include <libintl.h>
652 +# include "gettext.h"
653 +# define _(String) gettext (String)
654 +# define N_(String) String
664 + { EAI_ADDRFAMILY, N_("Address family for hostname not supported") },
665 + { EAI_AGAIN, N_("Temporary failure in name resolution") },
666 + { EAI_BADFLAGS, N_("Bad value for ai_flags") },
667 + { EAI_FAIL, N_("Non-recoverable failure in name resolution") },
668 + { EAI_FAMILY, N_("ai_family not supported") },
669 + { EAI_MEMORY, N_("Memory allocation failure") },
670 + { EAI_NODATA, N_("No address associated with hostname") },
671 + { EAI_NONAME, N_("Name or service not known") },
672 + { EAI_SERVICE, N_("Servname not supported for ai_socktype") },
673 + { EAI_SOCKTYPE, N_("ai_socktype not supported") },
674 + { EAI_SYSTEM, N_("System error") },
675 + { EAI_OVERFLOW, N_("Argument buffer too small") },
677 + { EAI_INPROGRESS, N_("Processing request in progress") },
678 + { EAI_CANCELED, N_("Request canceled") },
679 + { EAI_NOTCANCELED, N_("Request not canceled") },
680 + { EAI_ALLDONE, N_("All requests done") },
681 + { EAI_INTR, N_("Interrupted by a signal") },
682 + { EAI_IDN_ENCODE, N_("Parameter string not correctly encoded") }
687 +gai_strerror (int code)
690 + for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i)
691 + if (values[i].code == code)
692 + return _(values[i].msg);
694 + return _("Unknown error");
697 +libc_hidden_def (gai_strerror)
699 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/getaddrinfo.c gtk-vnc-0.3.7.gnulib/gnulib/lib/getaddrinfo.c
700 --- gtk-vnc-0.3.7.mingw/gnulib/lib/getaddrinfo.c 1970-01-01 01:00:00.000000000 +0100
701 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/getaddrinfo.c 2008-10-09 12:24:39.000000000 +0100
703 +/* Get address information (partial implementation).
704 + Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007, 2008 Free Software
706 + Contributed by Simon Josefsson <simon@josefsson.org>.
708 + This program is free software; you can redistribute it and/or modify
709 + it under the terms of the GNU Lesser General Public License as published by
710 + the Free Software Foundation; either version 2.1, or (at your option)
713 + This program is distributed in the hope that it will be useful,
714 + but WITHOUT ANY WARRANTY; without even the implied warranty of
715 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
716 + GNU Lesser General Public License for more details.
718 + You should have received a copy of the GNU Lesser General Public License
719 + along with this program; if not, write to the Free Software Foundation,
720 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
724 +#include "getaddrinfo.h"
726 +#if HAVE_NETINET_IN_H
727 +# include <netinet/in.h>
730 +/* Get inet_ntop. */
731 +#include <arpa/inet.h>
736 +/* Get memcpy, strdup. */
742 +#include <stdbool.h>
744 +#include "gettext.h"
745 +#define _(String) gettext (String)
746 +#define N_(String) String
748 +/* BeOS has AF_INET, but not PF_INET. */
750 +# define PF_INET AF_INET
752 +/* BeOS also lacks PF_UNSPEC. */
754 +# define PF_UNSPEC 0
757 +#if defined _WIN32 || defined __WIN32__
758 +# define WIN32_NATIVE
762 +typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
763 + const struct addrinfo*,
764 + struct addrinfo**);
765 +typedef void (WSAAPI *freeaddrinfo_func) (struct addrinfo*);
766 +typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr*,
767 + socklen_t, char*, DWORD,
768 + char*, DWORD, int);
770 +static getaddrinfo_func getaddrinfo_ptr = NULL;
771 +static freeaddrinfo_func freeaddrinfo_ptr = NULL;
772 +static getnameinfo_func getnameinfo_ptr = NULL;
777 + static int done = 0;
781 + return getaddrinfo_ptr ? 1 : 0;
785 + h = GetModuleHandle ("ws2_32.dll");
789 + getaddrinfo_ptr = (getaddrinfo_func) GetProcAddress (h, "getaddrinfo");
790 + freeaddrinfo_ptr = (freeaddrinfo_func) GetProcAddress (h, "freeaddrinfo");
791 + getnameinfo_ptr = (getnameinfo_func) GetProcAddress (h, "getnameinfo");
794 + /* If either is missing, something is odd. */
795 + if (!getaddrinfo_ptr || !freeaddrinfo_ptr || !getnameinfo_ptr)
797 + getaddrinfo_ptr = NULL;
798 + freeaddrinfo_ptr = NULL;
799 + getnameinfo_ptr = NULL;
808 +validate_family (int family)
810 + /* FIXME: Support more families. */
812 + if (family == PF_INET)
816 + if (family == PF_INET6)
819 + if (family == PF_UNSPEC)
824 +/* Translate name of a service location and/or a service name to set of
825 + socket addresses. */
827 +getaddrinfo (const char *restrict nodename,
828 + const char *restrict servname,
829 + const struct addrinfo *restrict hints,
830 + struct addrinfo **restrict res)
832 + struct addrinfo *tmp;
834 + struct hostent *he;
839 + struct addrinfo addrinfo;
840 + struct sockaddr_in6 sockaddr_in6;
845 + struct addrinfo addrinfo;
846 + struct sockaddr_in sockaddr_in;
851 + if (use_win32_p ())
852 + return getaddrinfo_ptr (nodename, servname, hints, res);
855 + if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE)))
856 + /* FIXME: Support more flags. */
857 + return EAI_BADFLAGS;
859 + if (hints && !validate_family (hints->ai_family))
863 + hints->ai_socktype != SOCK_STREAM && hints->ai_socktype != SOCK_DGRAM)
864 + /* FIXME: Support other socktype. */
865 + return EAI_SOCKTYPE; /* FIXME: Better return code? */
869 + if (!(hints->ai_flags & AI_PASSIVE))
873 + nodename = (hints->ai_family == AF_INET6) ? "::" : "0.0.0.0";
875 + nodename = "0.0.0.0";
881 + struct servent *se = NULL;
882 + const char *proto =
883 + (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
885 + if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV))
886 + /* FIXME: Use getservbyname_r if available. */
887 + se = getservbyname (servname, proto);
892 + if (!(*servname >= '0' && *servname <= '9'))
894 + port = strtoul (servname, &c, 10);
895 + if (*c || port > 0xffff)
897 + port = htons (port);
903 + /* FIXME: Use gethostbyname_r if available. */
904 + he = gethostbyname (nodename);
905 + if (!he || he->h_addr_list[0] == NULL)
908 + switch (he->h_addrtype)
912 + size = sizeof (struct v6_pair);
918 + size = sizeof (struct v4_pair);
926 + storage = calloc (1, size);
930 + switch (he->h_addrtype)
935 + struct v6_pair *p = storage;
936 + struct sockaddr_in6 *sinp = &p->sockaddr_in6;
937 + tmp = &p->addrinfo;
940 + sinp->sin6_port = port;
942 + if (he->h_length != sizeof (sinp->sin6_addr))
945 + return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */
948 + memcpy (&sinp->sin6_addr, he->h_addr_list[0], sizeof sinp->sin6_addr);
950 + tmp->ai_addr = (struct sockaddr *) sinp;
951 + tmp->ai_addrlen = sizeof *sinp;
959 + struct v4_pair *p = storage;
960 + struct sockaddr_in *sinp = &p->sockaddr_in;
961 + tmp = &p->addrinfo;
964 + sinp->sin_port = port;
966 + if (he->h_length != sizeof (sinp->sin_addr))
969 + return EAI_SYSTEM; /* FIXME: Better return code? Set errno? */
972 + memcpy (&sinp->sin_addr, he->h_addr_list[0], sizeof sinp->sin_addr);
974 + tmp->ai_addr = (struct sockaddr *) sinp;
975 + tmp->ai_addrlen = sizeof *sinp;
985 + if (hints && hints->ai_flags & AI_CANONNAME)
993 + tmp->ai_canonname = strdup (cn);
994 + if (!tmp->ai_canonname)
1001 + tmp->ai_protocol = (hints) ? hints->ai_protocol : 0;
1002 + tmp->ai_socktype = (hints) ? hints->ai_socktype : 0;
1003 + tmp->ai_addr->sa_family = he->h_addrtype;
1004 + tmp->ai_family = he->h_addrtype;
1006 + /* FIXME: If more than one address, create linked list of addrinfo's. */
1013 +/* Free `addrinfo' structure AI including associated storage. */
1015 +freeaddrinfo (struct addrinfo *ai)
1017 +#ifdef WIN32_NATIVE
1018 + if (use_win32_p ())
1020 + freeaddrinfo_ptr (ai);
1027 + struct addrinfo *cur;
1032 + free (cur->ai_canonname);
1037 +int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
1038 + char *restrict node, socklen_t nodelen,
1039 + char *restrict service, socklen_t servicelen,
1042 +#ifdef WIN32_NATIVE
1043 + if (use_win32_p ())
1044 + return getnameinfo_ptr (sa, salen, node, nodelen,
1045 + service, servicelen, flags);
1048 + /* FIXME: Support other flags. */
1049 + if ((node && nodelen > 0 && !(flags & NI_NUMERICHOST)) ||
1050 + (service && servicelen > 0 && !(flags & NI_NUMERICHOST)) ||
1051 + (flags & ~(NI_NUMERICHOST|NI_NUMERICSERV)))
1052 + return EAI_BADFLAGS;
1054 + if (sa == NULL || salen < sizeof (sa->sa_family))
1055 + return EAI_FAMILY;
1057 + switch (sa->sa_family)
1061 + if (salen < sizeof (struct sockaddr_in))
1062 + return EAI_FAMILY;
1067 + if (salen < sizeof (struct sockaddr_in6))
1068 + return EAI_FAMILY;
1072 + return EAI_FAMILY;
1075 + if (node && nodelen > 0 && flags & NI_NUMERICHOST)
1077 + switch (sa->sa_family)
1081 + if (!inet_ntop (AF_INET,
1082 + &(((const struct sockaddr_in *) sa)->sin_addr),
1084 + return EAI_SYSTEM;
1090 + if (!inet_ntop (AF_INET6,
1091 + &(((const struct sockaddr_in6 *) sa)->sin6_addr),
1093 + return EAI_SYSTEM;
1098 + return EAI_FAMILY;
1102 + if (service && servicelen > 0 && flags & NI_NUMERICSERV)
1103 + switch (sa->sa_family)
1112 + unsigned short int port
1113 + = ntohs (((const struct sockaddr_in *) sa)->sin_port);
1114 + if (servicelen <= snprintf (service, servicelen, "%u", port))
1115 + return EAI_OVERFLOW;
1122 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/getaddrinfo.h gtk-vnc-0.3.7.gnulib/gnulib/lib/getaddrinfo.h
1123 --- gtk-vnc-0.3.7.mingw/gnulib/lib/getaddrinfo.h 1970-01-01 01:00:00.000000000 +0100
1124 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/getaddrinfo.h 2008-10-09 12:24:39.000000000 +0100
1126 +/* Get address information.
1127 + Copyright (C) 1996-2002, 2003, 2004, 2005, 2006, 2008
1128 + Free Software Foundation, Inc.
1129 + Contributed by Simon Josefsson <simon@josefsson.org>.
1131 + This program is free software; you can redistribute it and/or modify
1132 + it under the terms of the GNU Lesser General Public License as published by
1133 + the Free Software Foundation; either version 2.1, or (at your option)
1134 + any later version.
1136 + This program is distributed in the hope that it will be useful,
1137 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1138 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1139 + GNU Lesser General Public License for more details.
1141 + You should have received a copy of the GNU Lesser General Public License
1142 + along with this program; if not, write to the Free Software Foundation,
1143 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
1145 +#ifndef GETADDRINFO_H
1146 +#define GETADDRINFO_H
1148 +/* sys/socket.h in i386-unknown-freebsd4.10 and
1149 + powerpc-apple-darwin5.5 require sys/types.h, so include it first.
1150 + Then we'll also get 'socklen_t' and 'struct sockaddr' which are
1152 +#include <sys/types.h>
1153 +/* Get all getaddrinfo related declarations, if available. */
1154 +#include <sys/socket.h>
1155 +#ifdef HAVE_NETDB_H
1156 +# include <netdb.h>
1159 +#ifndef HAVE_STRUCT_ADDRINFO
1161 +/* Structure to contain information about address of a service provider. */
1164 + int ai_flags; /* Input flags. */
1165 + int ai_family; /* Protocol family for socket. */
1166 + int ai_socktype; /* Socket type. */
1167 + int ai_protocol; /* Protocol for socket. */
1168 + socklen_t ai_addrlen; /* Length of socket address. */
1169 + struct sockaddr *ai_addr; /* Socket address for socket. */
1170 + char *ai_canonname; /* Canonical name for service location. */
1171 + struct addrinfo *ai_next; /* Pointer to next in list. */
1175 +/* Possible values for `ai_flags' field in `addrinfo' structure. */
1177 +# define AI_PASSIVE 0x0001 /* Socket address is intended for `bind'. */
1179 +#ifndef AI_CANONNAME
1180 +# define AI_CANONNAME 0x0002 /* Request for canonical name. */
1182 +#ifndef AI_NUMERICSERV
1183 +# define AI_NUMERICSERV 0x0400 /* Don't use name resolution. */
1187 +/* The commented out definitions below are not yet implemented in the
1188 + GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact,
1189 + cause conflicts on systems with a getaddrinfo() function which does not
1192 + If they are restored, be sure to protect the definitions with #ifndef. */
1193 +#define AI_NUMERICHOST 0x0004 /* Don't use name resolution. */
1194 +#define AI_V4MAPPED 0x0008 /* IPv4 mapped addresses are acceptable. */
1195 +#define AI_ALL 0x0010 /* Return IPv4 mapped and IPv6 addresses. */
1196 +#define AI_ADDRCONFIG 0x0020 /* Use configuration of this host to choose
1197 + returned address type.. */
1200 +/* Error values for `getaddrinfo' function. */
1201 +#ifndef EAI_BADFLAGS
1202 +# define EAI_BADFLAGS -1 /* Invalid value for `ai_flags' field. */
1203 +# define EAI_NONAME -2 /* NAME or SERVICE is unknown. */
1204 +# define EAI_AGAIN -3 /* Temporary failure in name resolution. */
1205 +# define EAI_FAIL -4 /* Non-recoverable failure in name res. */
1206 +# define EAI_NODATA -5 /* No address associated with NAME. */
1207 +# define EAI_FAMILY -6 /* `ai_family' not supported. */
1208 +# define EAI_SOCKTYPE -7 /* `ai_socktype' not supported. */
1209 +# define EAI_SERVICE -8 /* SERVICE not supported for `ai_socktype'. */
1210 +# define EAI_MEMORY -10 /* Memory allocation failure. */
1213 +/* Since EAI_NODATA is deprecated by RFC3493, some systems (at least
1214 + FreeBSD, which does define EAI_BADFLAGS) have removed the definition
1215 + in favor of EAI_NONAME. */
1216 +#if !defined EAI_NODATA && defined EAI_NONAME
1217 +# define EAI_NODATA EAI_NONAME
1220 +#ifndef EAI_OVERFLOW
1221 +/* Not defined on mingw32. */
1222 +# define EAI_OVERFLOW -12 /* Argument buffer overflow. */
1224 +#ifndef EAI_ADDRFAMILY
1225 +/* Not defined on mingw32. */
1226 +# define EAI_ADDRFAMILY -9 /* Address family for NAME not supported. */
1229 +/* Not defined on mingw32. */
1230 +# define EAI_SYSTEM -11 /* System error returned in `errno'. */
1234 +# ifndef EAI_INPROGRESS
1235 +# define EAI_INPROGRESS -100 /* Processing request in progress. */
1236 +# define EAI_CANCELED -101 /* Request canceled. */
1237 +# define EAI_NOTCANCELED -102 /* Request not canceled. */
1238 +# define EAI_ALLDONE -103 /* All requests done. */
1239 +# define EAI_INTR -104 /* Interrupted by a signal. */
1240 +# define EAI_IDN_ENCODE -105 /* IDN encoding failed. */
1244 +#if !HAVE_DECL_GETADDRINFO
1245 +/* Translate name of a service location and/or a service name to set of
1247 + For more details, see the POSIX:2001 specification
1248 + <http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
1249 +extern int getaddrinfo (const char *restrict nodename,
1250 + const char *restrict servname,
1251 + const struct addrinfo *restrict hints,
1252 + struct addrinfo **restrict res);
1255 +#if !HAVE_DECL_FREEADDRINFO
1256 +/* Free `addrinfo' structure AI including associated storage.
1257 + For more details, see the POSIX:2001 specification
1258 + <http://www.opengroup.org/susv3xsh/getaddrinfo.html>. */
1259 +extern void freeaddrinfo (struct addrinfo *ai);
1262 +#if !HAVE_DECL_GAI_STRERROR
1263 +/* Convert error return from getaddrinfo() to a string.
1264 + For more details, see the POSIX:2001 specification
1265 + <http://www.opengroup.org/susv3xsh/gai_strerror.html>. */
1266 +extern const char *gai_strerror (int ecode);
1269 +#if !HAVE_DECL_GETNAMEINFO
1270 +/* Convert socket address to printable node and service names.
1271 + For more details, see the POSIX:2001 specification
1272 + <http://www.opengroup.org/susv3xsh/getnameinfo.html>. */
1273 +extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
1274 + char *restrict node, socklen_t nodelen,
1275 + char *restrict service, socklen_t servicelen,
1280 +/* Possible flags for getnameinfo. */
1281 +#ifndef NI_NUMERICHOST
1282 +# define NI_NUMERICHOST 1
1284 +#ifndef NI_NUMERICSERV
1285 +# define NI_NUMERICSERV 2
1288 +#endif /* GETADDRINFO_H */
1289 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/gettext.h gtk-vnc-0.3.7.gnulib/gnulib/lib/gettext.h
1290 --- gtk-vnc-0.3.7.mingw/gnulib/lib/gettext.h 1970-01-01 01:00:00.000000000 +0100
1291 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/gettext.h 2008-10-09 12:24:39.000000000 +0100
1293 +/* Convenience header for conditional use of GNU <libintl.h>.
1294 + Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
1296 + This program is free software; you can redistribute it and/or modify
1297 + it under the terms of the GNU Lesser General Public License as published by
1298 + the Free Software Foundation; either version 2.1, or (at your option)
1299 + any later version.
1301 + This program is distributed in the hope that it will be useful,
1302 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1303 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1304 + GNU Lesser General Public License for more details.
1306 + You should have received a copy of the GNU Lesser General Public License along
1307 + with this program; if not, write to the Free Software Foundation,
1308 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
1310 +#ifndef _LIBGETTEXT_H
1311 +#define _LIBGETTEXT_H 1
1313 +/* NLS can be disabled through the configure --disable-nls option. */
1316 +/* Get declarations of GNU message catalog functions. */
1317 +# include <libintl.h>
1319 +/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
1320 + the gettext() and ngettext() macros. This is an alternative to calling
1321 + textdomain(), and is useful for libraries. */
1322 +# ifdef DEFAULT_TEXT_DOMAIN
1324 +# define gettext(Msgid) \
1325 + dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
1327 +# define ngettext(Msgid1, Msgid2, N) \
1328 + dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
1333 +/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
1334 + chokes if dcgettext is defined as a macro. So include it now, to make
1335 + later inclusions of <locale.h> a NOP. We don't include <libintl.h>
1336 + as well because people using "gettext.h" will not include <libintl.h>,
1337 + and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
1340 +# include <locale.h>
1343 +/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
1344 + <libintl.h>, which chokes if dcgettext is defined as a macro. So include
1345 + it now, to make later inclusions of <libintl.h> a NOP. */
1346 +#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
1347 +# include <cstdlib>
1348 +# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
1349 +# include <libintl.h>
1354 + The casts to 'const char *' serve the purpose of producing warnings
1355 + for invalid uses of the value returned from these functions.
1356 + On pre-ANSI systems without 'const', the config.h file is supposed to
1357 + contain "#define const". */
1358 +# define gettext(Msgid) ((const char *) (Msgid))
1359 +# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
1360 +# define dcgettext(Domainname, Msgid, Category) \
1361 + ((void) (Category), dgettext (Domainname, Msgid))
1362 +# define ngettext(Msgid1, Msgid2, N) \
1364 + ? ((void) (Msgid2), (const char *) (Msgid1)) \
1365 + : ((void) (Msgid1), (const char *) (Msgid2)))
1366 +# define dngettext(Domainname, Msgid1, Msgid2, N) \
1367 + ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
1368 +# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
1369 + ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
1370 +# define textdomain(Domainname) ((const char *) (Domainname))
1371 +# define bindtextdomain(Domainname, Dirname) \
1372 + ((void) (Domainname), (const char *) (Dirname))
1373 +# define bind_textdomain_codeset(Domainname, Codeset) \
1374 + ((void) (Domainname), (const char *) (Codeset))
1378 +/* A pseudo function call that serves as a marker for the automated
1379 + extraction of messages, but does not call gettext(). The run-time
1380 + translation is done at a different place in the code.
1381 + The argument, String, should be a literal string. Concatenated strings
1382 + and other string expressions won't work.
1383 + The macro's expansion is not parenthesized, so that it is suitable as
1384 + initializer for static 'char[]' or 'const char[]' variables. */
1385 +#define gettext_noop(String) String
1387 +/* The separator between msgctxt and msgid in a .mo file. */
1388 +#define GETTEXT_CONTEXT_GLUE "\004"
1390 +/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
1391 + MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be
1392 + short and rarely need to change.
1393 + The letter 'p' stands for 'particular' or 'special'. */
1394 +#ifdef DEFAULT_TEXT_DOMAIN
1395 +# define pgettext(Msgctxt, Msgid) \
1396 + pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
1398 +# define pgettext(Msgctxt, Msgid) \
1399 + pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
1401 +#define dpgettext(Domainname, Msgctxt, Msgid) \
1402 + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
1403 +#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
1404 + pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
1405 +#ifdef DEFAULT_TEXT_DOMAIN
1406 +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
1407 + npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
1409 +# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
1410 + npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
1412 +#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
1413 + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
1414 +#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
1415 + npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
1424 +static const char *
1425 +pgettext_aux (const char *domain,
1426 + const char *msg_ctxt_id, const char *msgid,
1429 + const char *translation = dcgettext (domain, msg_ctxt_id, category);
1430 + if (translation == msg_ctxt_id)
1433 + return translation;
1443 +static const char *
1444 +npgettext_aux (const char *domain,
1445 + const char *msg_ctxt_id, const char *msgid,
1446 + const char *msgid_plural, unsigned long int n,
1449 + const char *translation =
1450 + dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
1451 + if (translation == msg_ctxt_id || translation == msgid_plural)
1452 + return (n == 1 ? msgid : msgid_plural);
1454 + return translation;
1457 +/* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID
1458 + can be arbitrary expressions. But for string literals these macros are
1459 + less efficient than those above. */
1461 +#include <string.h>
1463 +#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
1464 + (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
1465 + /* || __STDC_VERSION__ >= 199901L */ )
1467 +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1468 +#include <stdlib.h>
1471 +#define pgettext_expr(Msgctxt, Msgid) \
1472 + dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
1473 +#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
1474 + dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
1483 +static const char *
1484 +dcpgettext_expr (const char *domain,
1485 + const char *msgctxt, const char *msgid,
1488 + size_t msgctxt_len = strlen (msgctxt) + 1;
1489 + size_t msgid_len = strlen (msgid) + 1;
1490 + const char *translation;
1491 +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1492 + char msg_ctxt_id[msgctxt_len + msgid_len];
1495 + char *msg_ctxt_id =
1496 + (msgctxt_len + msgid_len <= sizeof (buf)
1498 + : (char *) malloc (msgctxt_len + msgid_len));
1499 + if (msg_ctxt_id != NULL)
1502 + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
1503 + msg_ctxt_id[msgctxt_len - 1] = '\004';
1504 + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
1505 + translation = dcgettext (domain, msg_ctxt_id, category);
1506 +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1507 + if (msg_ctxt_id != buf)
1508 + free (msg_ctxt_id);
1510 + if (translation != msg_ctxt_id)
1511 + return translation;
1516 +#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
1517 + dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
1518 +#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
1519 + dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
1528 +static const char *
1529 +dcnpgettext_expr (const char *domain,
1530 + const char *msgctxt, const char *msgid,
1531 + const char *msgid_plural, unsigned long int n,
1534 + size_t msgctxt_len = strlen (msgctxt) + 1;
1535 + size_t msgid_len = strlen (msgid) + 1;
1536 + const char *translation;
1537 +#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1538 + char msg_ctxt_id[msgctxt_len + msgid_len];
1541 + char *msg_ctxt_id =
1542 + (msgctxt_len + msgid_len <= sizeof (buf)
1544 + : (char *) malloc (msgctxt_len + msgid_len));
1545 + if (msg_ctxt_id != NULL)
1548 + memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
1549 + msg_ctxt_id[msgctxt_len - 1] = '\004';
1550 + memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
1551 + translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
1552 +#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
1553 + if (msg_ctxt_id != buf)
1554 + free (msg_ctxt_id);
1556 + if (!(translation == msg_ctxt_id || translation == msgid_plural))
1557 + return translation;
1559 + return (n == 1 ? msgid : msgid_plural);
1562 +#endif /* _LIBGETTEXT_H */
1563 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/inet_ntop.c gtk-vnc-0.3.7.gnulib/gnulib/lib/inet_ntop.c
1564 --- gtk-vnc-0.3.7.mingw/gnulib/lib/inet_ntop.c 1970-01-01 01:00:00.000000000 +0100
1565 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/inet_ntop.c 2008-10-09 12:24:39.000000000 +0100
1567 +/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
1569 + Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
1571 + This program is free software; you can redistribute it and/or modify
1572 + it under the terms of the GNU Lesser General Public License as published by
1573 + the Free Software Foundation; either version 2.1, or (at your option)
1574 + any later version.
1576 + This program is distributed in the hope that it will be useful,
1577 + but WITHOUT ANY WARRANTY; without even the implied warranty of
1578 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1579 + GNU Lesser General Public License for more details.
1581 + You should have received a copy of the GNU Lesser General Public License
1582 + along with this program; if not, write to the Free Software Foundation,
1583 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
1586 + * Copyright (c) 1996-1999 by Internet Software Consortium.
1588 + * Permission to use, copy, modify, and distribute this software for any
1589 + * purpose with or without fee is hereby granted, provided that the above
1590 + * copyright notice and this permission notice appear in all copies.
1592 + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
1593 + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
1594 + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
1595 + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
1596 + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
1597 + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
1598 + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
1602 +#include <config.h>
1604 +/* Specification. */
1605 +#include <arpa/inet.h>
1608 +#include <string.h>
1611 +#ifndef EAFNOSUPPORT
1612 +# define EAFNOSUPPORT EINVAL
1615 +#define NS_IN6ADDRSZ 16
1616 +#define NS_INT16SZ 2
1619 + * WARNING: Don't even consider trying to compile this on a system where
1620 + * sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX.
1622 +typedef int verify_int_size[2 * sizeof (int) - 7];
1624 +static const char *inet_ntop4 (const unsigned char *src, char *dst, socklen_t size);
1626 +static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t size);
1631 + * inet_ntop(af, src, dst, size)
1632 + * convert a network format address to presentation format.
1634 + * pointer to presentation format address (`dst'), or NULL (see errno).
1636 + * Paul Vixie, 1996.
1639 +inet_ntop (int af, const void *restrict src,
1640 + char *restrict dst, socklen_t cnt)
1646 + return (inet_ntop4 (src, dst, cnt));
1651 + return (inet_ntop6 (src, dst, cnt));
1655 + errno = EAFNOSUPPORT;
1662 + * inet_ntop4(src, dst, size)
1663 + * format an IPv4 address
1665 + * `dst' (as a const)
1667 + * (1) uses no statics
1668 + * (2) takes a u_char* not an in_addr as input
1670 + * Paul Vixie, 1996.
1672 +static const char *
1673 +inet_ntop4 (const unsigned char *src, char *dst, socklen_t size)
1675 + char tmp[sizeof "255.255.255.255"];
1678 + len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]);
1688 + return strcpy (dst, tmp);
1694 + * inet_ntop6(src, dst, size)
1695 + * convert IPv6 binary address into presentation (printable) format
1697 + * Paul Vixie, 1996.
1699 +static const char *
1700 +inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
1703 + * Note that int32_t and int16_t need only be "at least" large enough
1704 + * to contain a value of the specified size. On some systems, like
1705 + * Crays, there is no such thing as an integer variable with 16 bits.
1706 + * Keep this in mind if you think this function should have been coded
1707 + * to use pointer overlays. All the world's not a VAX.
1709 + char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
1714 + unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
1719 + * Copy the input (bytewise) array into a wordwise array.
1720 + * Find the longest run of 0x00's in src[] for :: shorthanding.
1722 + memset (words, '\0', sizeof words);
1723 + for (i = 0; i < NS_IN6ADDRSZ; i += 2)
1724 + words[i / 2] = (src[i] << 8) | src[i + 1];
1727 + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
1729 + if (words[i] == 0)
1731 + if (cur.base == -1)
1732 + cur.base = i, cur.len = 1;
1738 + if (cur.base != -1)
1740 + if (best.base == -1 || cur.len > best.len)
1746 + if (cur.base != -1)
1748 + if (best.base == -1 || cur.len > best.len)
1751 + if (best.base != -1 && best.len < 2)
1755 + * Format the result.
1758 + for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
1760 + /* Are we inside the best run of 0x00's? */
1761 + if (best.base != -1 && i >= best.base && i < (best.base + best.len))
1763 + if (i == best.base)
1767 + /* Are we following an initial run of 0x00s or any real hex? */
1770 + /* Is this address an encapsulated IPv4? */
1771 + if (i == 6 && best.base == 0 &&
1772 + (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
1774 + if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
1776 + tp += strlen (tp);
1780 + int len = sprintf (tp, "%x", words[i]);
1786 + /* Was it a trailing run of 0x00's? */
1787 + if (best.base != -1 && (best.base + best.len) ==
1788 + (NS_IN6ADDRSZ / NS_INT16SZ))
1793 + * Check for overflow, copy, and we're done.
1795 + if ((socklen_t) (tp - tmp) > size)
1801 + return strcpy (dst, tmp);
1805 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/Makefile.am gtk-vnc-0.3.7.gnulib/gnulib/lib/Makefile.am
1806 --- gtk-vnc-0.3.7.mingw/gnulib/lib/Makefile.am 1970-01-01 01:00:00.000000000 +0100
1807 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/Makefile.am 2008-10-09 12:33:42.000000000 +0100
1809 +## DO NOT EDIT! GENERATED AUTOMATICALLY!
1810 +## Process this file with automake to produce Makefile.in.
1811 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
1813 +# This file is free software, distributed under the terms of the GNU
1814 +# General Public License. As a special exception to the GNU General
1815 +# Public License, this file may be distributed as part of a program
1816 +# that contains a configuration script generated by Autoconf, under
1817 +# the same distribution terms as the rest of that program.
1819 +# Generated by gnulib-tool.
1820 +# 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 recv send socket vc-list-files
1822 +AUTOMAKE_OPTIONS = 1.5 gnits
1827 +noinst_LTLIBRARIES =
1831 +MOSTLYCLEANFILES = core *.stackdump
1835 +MAINTAINERCLEANFILES =
1839 +noinst_LTLIBRARIES += libgnu.la
1841 +libgnu_la_SOURCES =
1842 +libgnu_la_LIBADD = $(gl_LTLIBOBJS)
1843 +libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
1844 +EXTRA_libgnu_la_SOURCES =
1845 +libgnu_la_LDFLAGS = $(AM_LDFLAGS)
1847 +## begin gnulib module alloca-opt
1849 +BUILT_SOURCES += $(ALLOCA_H)
1851 +# We need the following in order to create <alloca.h> when the system
1852 +# doesn't have one that works with the given compiler.
1853 +alloca.h: alloca.in.h
1854 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1855 + cat $(srcdir)/alloca.in.h; \
1858 +MOSTLYCLEANFILES += alloca.h alloca.h-t
1860 +EXTRA_DIST += alloca.in.h
1862 +## end gnulib module alloca-opt
1864 +## begin gnulib module arpa_inet
1866 +BUILT_SOURCES += $(ARPA_INET_H)
1868 +# We need the following in order to create <arpa/inet.h> when the system
1869 +# doesn't have one.
1873 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1874 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1875 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1876 + -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
1877 + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
1878 + -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \
1879 + -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
1880 + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
1881 + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
1882 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
1883 + < $(srcdir)/arpa_inet.in.h; \
1886 +MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
1887 +MOSTLYCLEANDIRS += arpa
1889 +EXTRA_DIST += arpa_inet.in.h
1891 +## end gnulib module arpa_inet
1893 +## begin gnulib module connect
1896 +EXTRA_DIST += winsock.c
1898 +EXTRA_libgnu_la_SOURCES += winsock.c
1900 +## end gnulib module connect
1902 +## begin gnulib module errno
1904 +BUILT_SOURCES += $(ERRNO_H)
1906 +# We need the following in order to create <errno.h> when the system
1907 +# doesn't have one that is POSIX compliant.
1908 +errno.h: errno.in.h
1910 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
1911 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1912 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1913 + -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
1914 + -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
1915 + -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
1916 + -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
1917 + -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
1918 + -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
1919 + -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
1920 + < $(srcdir)/errno.in.h; \
1923 +MOSTLYCLEANFILES += errno.h errno.h-t
1925 +EXTRA_DIST += errno.in.h
1927 +## end gnulib module errno
1929 +## begin gnulib module float
1931 +BUILT_SOURCES += $(FLOAT_H)
1933 +# We need the following in order to create <float.h> when the system
1934 +# doesn't have one that works with the given compiler.
1935 +float.h: float.in.h
1937 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
1938 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1939 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1940 + -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
1941 + < $(srcdir)/float.in.h; \
1944 +MOSTLYCLEANFILES += float.h float.h-t
1946 +EXTRA_DIST += float.in.h
1948 +## end gnulib module float
1950 +## begin gnulib module getaddrinfo
1953 +EXTRA_DIST += gai_strerror.c getaddrinfo.c getaddrinfo.h
1955 +EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c
1957 +## end gnulib module getaddrinfo
1959 +## begin gnulib module gettext-h
1961 +libgnu_la_SOURCES += gettext.h
1963 +## end gnulib module gettext-h
1965 +## begin gnulib module inet_ntop
1968 +EXTRA_DIST += inet_ntop.c
1970 +EXTRA_libgnu_la_SOURCES += inet_ntop.c
1972 +## end gnulib module inet_ntop
1974 +## begin gnulib module link-warning
1976 +LINK_WARNING_H=$(top_srcdir)/./link-warning.h
1978 +EXTRA_DIST += $(top_srcdir)/./link-warning.h
1980 +## end gnulib module link-warning
1982 +## begin gnulib module netinet_in
1984 +BUILT_SOURCES += $(NETINET_IN_H)
1986 +# We need the following in order to create <netinet/in.h> when the system
1987 +# doesn't have one.
1988 +netinet/in.h: netinet_in.in.h
1991 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
1992 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
1993 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
1994 + -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
1995 + -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
1996 + < $(srcdir)/netinet_in.in.h; \
1999 +MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
2000 +MOSTLYCLEANDIRS += netinet
2002 +EXTRA_DIST += netinet_in.in.h
2004 +## end gnulib module netinet_in
2006 +## begin gnulib module recv
2009 +EXTRA_DIST += winsock.c
2011 +EXTRA_libgnu_la_SOURCES += winsock.c
2013 +## end gnulib module recv
2015 +## begin gnulib module send
2018 +EXTRA_DIST += winsock.c
2020 +EXTRA_libgnu_la_SOURCES += winsock.c
2022 +## end gnulib module send
2024 +## begin gnulib module size_max
2026 +libgnu_la_SOURCES += size_max.h
2028 +## end gnulib module size_max
2030 +## begin gnulib module snprintf
2033 +EXTRA_DIST += snprintf.c
2035 +EXTRA_libgnu_la_SOURCES += snprintf.c
2037 +## end gnulib module snprintf
2039 +## begin gnulib module socket
2042 +EXTRA_DIST += winsock.c
2044 +EXTRA_libgnu_la_SOURCES += winsock.c
2046 +## end gnulib module socket
2048 +## begin gnulib module stdbool
2050 +BUILT_SOURCES += $(STDBOOL_H)
2052 +# We need the following in order to create <stdbool.h> when the system
2053 +# doesn't have one that works.
2054 +stdbool.h: stdbool.in.h
2056 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2057 + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
2060 +MOSTLYCLEANFILES += stdbool.h stdbool.h-t
2062 +EXTRA_DIST += stdbool.in.h
2064 +## end gnulib module stdbool
2066 +## begin gnulib module stdint
2068 +BUILT_SOURCES += $(STDINT_H)
2070 +# We need the following in order to create <stdint.h> when the system
2071 +# doesn't have one that works with the given compiler.
2072 +stdint.h: stdint.in.h
2074 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2075 + sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
2076 + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2077 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2078 + -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
2079 + -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
2080 + -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
2081 + -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
2082 + -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
2083 + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
2084 + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
2085 + -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
2086 + -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
2087 + -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
2088 + -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
2089 + -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
2090 + -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
2091 + -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
2092 + -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
2093 + -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
2094 + -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
2095 + -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
2096 + -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
2097 + -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
2098 + < $(srcdir)/stdint.in.h; \
2101 +MOSTLYCLEANFILES += stdint.h stdint.h-t
2103 +EXTRA_DIST += stdint.in.h
2105 +## end gnulib module stdint
2107 +## begin gnulib module stdio
2109 +BUILT_SOURCES += stdio.h
2111 +# We need the following in order to create <stdio.h> when the system
2112 +# doesn't have one that works with the given compiler.
2113 +stdio.h: stdio.in.h
2115 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
2116 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2117 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2118 + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
2119 + -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
2120 + -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
2121 + -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
2122 + -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
2123 + -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
2124 + -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
2125 + -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
2126 + -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
2127 + -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
2128 + -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
2129 + -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
2130 + -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
2131 + -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
2132 + -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
2133 + -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
2134 + -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
2135 + -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
2136 + -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
2137 + -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
2138 + -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
2139 + -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
2140 + -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
2141 + -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
2142 + -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
2143 + -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
2144 + -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
2145 + -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
2146 + -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
2147 + -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
2148 + -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
2149 + -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
2150 + -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
2151 + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
2152 + -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
2153 + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
2154 + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
2155 + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
2156 + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
2157 + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
2158 + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
2159 + -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
2160 + -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
2161 + -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
2162 + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
2163 + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
2164 + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
2165 + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
2166 + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
2167 + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
2168 + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
2169 + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
2170 + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
2171 + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
2172 + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
2173 + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
2174 + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
2175 + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
2176 + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
2177 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2178 + < $(srcdir)/stdio.in.h; \
2181 +MOSTLYCLEANFILES += stdio.h stdio.h-t
2183 +EXTRA_DIST += stdio-write.c stdio.in.h
2185 +EXTRA_libgnu_la_SOURCES += stdio-write.c
2187 +## end gnulib module stdio
2189 +## begin gnulib module sys_socket
2191 +BUILT_SOURCES += $(SYS_SOCKET_H)
2193 +# We need the following in order to create <sys/socket.h> when the system
2194 +# doesn't have one that works with the given compiler.
2195 +sys/socket.h: sys_socket.in.h
2197 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2198 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2199 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2200 + -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
2201 + -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
2202 + -e 's|@''GNULIB_SOCKET''@|$(GNULIB_SOCKET)|g' \
2203 + -e 's|@''GNULIB_CONNECT''@|$(GNULIB_CONNECT)|g' \
2204 + -e 's|@''GNULIB_ACCEPT''@|$(GNULIB_ACCEPT)|g' \
2205 + -e 's|@''GNULIB_BIND''@|$(GNULIB_BIND)|g' \
2206 + -e 's|@''GNULIB_GETPEERNAME''@|$(GNULIB_GETPEERNAME)|g' \
2207 + -e 's|@''GNULIB_GETSOCKNAME''@|$(GNULIB_GETSOCKNAME)|g' \
2208 + -e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \
2209 + -e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \
2210 + -e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \
2211 + -e 's|@''GNULIB_SEND''@|$()GNULIB_SEND|g' \
2212 + -e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \
2213 + -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
2214 + -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
2215 + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
2216 + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
2217 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2218 + < $(srcdir)/sys_socket.in.h; \
2221 +MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
2222 +MOSTLYCLEANDIRS += sys
2224 +EXTRA_DIST += sys_socket.in.h winsock.c
2226 +EXTRA_libgnu_la_SOURCES += winsock.c
2228 +## end gnulib module sys_socket
2230 +## begin gnulib module vasnprintf
2233 +EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
2235 +EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
2237 +## end gnulib module vasnprintf
2239 +## begin gnulib module vc-list-files
2242 +EXTRA_DIST += $(top_srcdir)/./vc-list-files
2244 +## end gnulib module vc-list-files
2246 +## begin gnulib module wchar
2248 +BUILT_SOURCES += $(WCHAR_H)
2250 +# We need the following in order to create <wchar.h> when the system
2251 +# version does not work standalone.
2252 +wchar.h: wchar.in.h
2254 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2255 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2256 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2257 + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
2258 + -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
2259 + -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
2260 + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
2261 + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
2262 + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
2263 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2264 + < $(srcdir)/wchar.in.h; \
2267 +MOSTLYCLEANFILES += wchar.h wchar.h-t
2269 +EXTRA_DIST += wchar.in.h
2271 +## end gnulib module wchar
2273 +## begin gnulib module xsize
2275 +libgnu_la_SOURCES += xsize.h
2277 +## end gnulib module xsize
2279 +## begin gnulib module dummy
2281 +libgnu_la_SOURCES += dummy.c
2283 +## end gnulib module dummy
2286 +mostlyclean-local: mostlyclean-generic
2287 + @for dir in '' $(MOSTLYCLEANDIRS); do \
2288 + if test -n "$$dir" && test -d $$dir; then \
2289 + echo "rmdir $$dir"; rmdir $$dir; \
2293 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/Makefile.am~ gtk-vnc-0.3.7.gnulib/gnulib/lib/Makefile.am~
2294 --- gtk-vnc-0.3.7.mingw/gnulib/lib/Makefile.am~ 1970-01-01 01:00:00.000000000 +0100
2295 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/Makefile.am~ 2008-10-09 12:24:40.000000000 +0100
2297 +## DO NOT EDIT! GENERATED AUTOMATICALLY!
2298 +## Process this file with automake to produce Makefile.in.
2299 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
2301 +# This file is free software, distributed under the terms of the GNU
2302 +# General Public License. As a special exception to the GNU General
2303 +# Public License, this file may be distributed as part of a program
2304 +# that contains a configuration script generated by Autoconf, under
2305 +# the same distribution terms as the rest of that program.
2307 +# Generated by gnulib-tool.
2308 +# 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 getaddrinfo vc-list-files
2310 +AUTOMAKE_OPTIONS = 1.5 gnits
2315 +noinst_LTLIBRARIES =
2319 +MOSTLYCLEANFILES = core *.stackdump
2323 +MAINTAINERCLEANFILES =
2327 +noinst_LTLIBRARIES += libgnu.la
2329 +libgnu_la_SOURCES =
2330 +libgnu_la_LIBADD = $(gl_LTLIBOBJS)
2331 +libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
2332 +EXTRA_libgnu_la_SOURCES =
2333 +libgnu_la_LDFLAGS = $(AM_LDFLAGS)
2335 +## begin gnulib module alloca-opt
2337 +BUILT_SOURCES += $(ALLOCA_H)
2339 +# We need the following in order to create <alloca.h> when the system
2340 +# doesn't have one that works with the given compiler.
2341 +alloca.h: alloca.in.h
2342 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2343 + cat $(srcdir)/alloca.in.h; \
2346 +MOSTLYCLEANFILES += alloca.h alloca.h-t
2348 +EXTRA_DIST += alloca.in.h
2350 +## end gnulib module alloca-opt
2352 +## begin gnulib module arpa_inet
2354 +BUILT_SOURCES += $(ARPA_INET_H)
2356 +# We need the following in order to create <arpa/inet.h> when the system
2357 +# doesn't have one.
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_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
2365 + -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
2366 + -e 's|@''GNULIB_INET_NTOP''@|$(GNULIB_INET_NTOP)|g' \
2367 + -e 's|@''GNULIB_INET_PTON''@|$(GNULIB_INET_PTON)|g' \
2368 + -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
2369 + -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
2370 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2371 + < $(srcdir)/arpa_inet.in.h; \
2374 +MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
2375 +MOSTLYCLEANDIRS += arpa
2377 +EXTRA_DIST += arpa_inet.in.h
2379 +## end gnulib module arpa_inet
2381 +## begin gnulib module errno
2383 +BUILT_SOURCES += $(ERRNO_H)
2385 +# We need the following in order to create <errno.h> when the system
2386 +# doesn't have one that is POSIX compliant.
2387 +errno.h: errno.in.h
2389 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
2390 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2391 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2392 + -e 's|@''NEXT_ERRNO_H''@|$(NEXT_ERRNO_H)|g' \
2393 + -e 's|@''EMULTIHOP_HIDDEN''@|$(EMULTIHOP_HIDDEN)|g' \
2394 + -e 's|@''EMULTIHOP_VALUE''@|$(EMULTIHOP_VALUE)|g' \
2395 + -e 's|@''ENOLINK_HIDDEN''@|$(ENOLINK_HIDDEN)|g' \
2396 + -e 's|@''ENOLINK_VALUE''@|$(ENOLINK_VALUE)|g' \
2397 + -e 's|@''EOVERFLOW_HIDDEN''@|$(EOVERFLOW_HIDDEN)|g' \
2398 + -e 's|@''EOVERFLOW_VALUE''@|$(EOVERFLOW_VALUE)|g' \
2399 + < $(srcdir)/errno.in.h; \
2402 +MOSTLYCLEANFILES += errno.h errno.h-t
2404 +EXTRA_DIST += errno.in.h
2406 +## end gnulib module errno
2408 +## begin gnulib module float
2410 +BUILT_SOURCES += $(FLOAT_H)
2412 +# We need the following in order to create <float.h> when the system
2413 +# doesn't have one that works with the given compiler.
2414 +float.h: float.in.h
2416 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
2417 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2418 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2419 + -e 's|@''NEXT_FLOAT_H''@|$(NEXT_FLOAT_H)|g' \
2420 + < $(srcdir)/float.in.h; \
2423 +MOSTLYCLEANFILES += float.h float.h-t
2425 +EXTRA_DIST += float.in.h
2427 +## end gnulib module float
2429 +## begin gnulib module getaddrinfo
2432 +EXTRA_DIST += gai_strerror.c getaddrinfo.c getaddrinfo.h
2434 +EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c
2436 +## end gnulib module getaddrinfo
2438 +## begin gnulib module gettext-h
2440 +libgnu_la_SOURCES += gettext.h
2442 +## end gnulib module gettext-h
2444 +## begin gnulib module inet_ntop
2447 +EXTRA_DIST += inet_ntop.c
2449 +EXTRA_libgnu_la_SOURCES += inet_ntop.c
2451 +## end gnulib module inet_ntop
2453 +## begin gnulib module link-warning
2455 +LINK_WARNING_H=$(top_srcdir)/./link-warning.h
2457 +EXTRA_DIST += $(top_srcdir)/./link-warning.h
2459 +## end gnulib module link-warning
2461 +## begin gnulib module netinet_in
2463 +BUILT_SOURCES += $(NETINET_IN_H)
2465 +# We need the following in order to create <netinet/in.h> when the system
2466 +# doesn't have one.
2467 +netinet/in.h: netinet_in.in.h
2470 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2471 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2472 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2473 + -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
2474 + -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
2475 + < $(srcdir)/netinet_in.in.h; \
2478 +MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
2479 +MOSTLYCLEANDIRS += netinet
2481 +EXTRA_DIST += netinet_in.in.h
2483 +## end gnulib module netinet_in
2485 +## begin gnulib module size_max
2487 +libgnu_la_SOURCES += size_max.h
2489 +## end gnulib module size_max
2491 +## begin gnulib module snprintf
2494 +EXTRA_DIST += snprintf.c
2496 +EXTRA_libgnu_la_SOURCES += snprintf.c
2498 +## end gnulib module snprintf
2500 +## begin gnulib module stdbool
2502 +BUILT_SOURCES += $(STDBOOL_H)
2504 +# We need the following in order to create <stdbool.h> when the system
2505 +# doesn't have one that works.
2506 +stdbool.h: stdbool.in.h
2508 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2509 + sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool.in.h; \
2512 +MOSTLYCLEANFILES += stdbool.h stdbool.h-t
2514 +EXTRA_DIST += stdbool.in.h
2516 +## end gnulib module stdbool
2518 +## begin gnulib module stdint
2520 +BUILT_SOURCES += $(STDINT_H)
2522 +# We need the following in order to create <stdint.h> when the system
2523 +# doesn't have one that works with the given compiler.
2524 +stdint.h: stdint.in.h
2526 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2527 + sed -e 's/@''HAVE_STDINT_H''@/$(HAVE_STDINT_H)/g' \
2528 + -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2529 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2530 + -e 's|@''NEXT_STDINT_H''@|$(NEXT_STDINT_H)|g' \
2531 + -e 's/@''HAVE_SYS_TYPES_H''@/$(HAVE_SYS_TYPES_H)/g' \
2532 + -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
2533 + -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
2534 + -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
2535 + -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
2536 + -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
2537 + -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
2538 + -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
2539 + -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@/$(BITSIZEOF_SIG_ATOMIC_T)/g' \
2540 + -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@/$(HAVE_SIGNED_SIG_ATOMIC_T)/g' \
2541 + -e 's/@''SIG_ATOMIC_T_SUFFIX''@/$(SIG_ATOMIC_T_SUFFIX)/g' \
2542 + -e 's/@''BITSIZEOF_SIZE_T''@/$(BITSIZEOF_SIZE_T)/g' \
2543 + -e 's/@''SIZE_T_SUFFIX''@/$(SIZE_T_SUFFIX)/g' \
2544 + -e 's/@''BITSIZEOF_WCHAR_T''@/$(BITSIZEOF_WCHAR_T)/g' \
2545 + -e 's/@''HAVE_SIGNED_WCHAR_T''@/$(HAVE_SIGNED_WCHAR_T)/g' \
2546 + -e 's/@''WCHAR_T_SUFFIX''@/$(WCHAR_T_SUFFIX)/g' \
2547 + -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
2548 + -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
2549 + -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
2550 + < $(srcdir)/stdint.in.h; \
2553 +MOSTLYCLEANFILES += stdint.h stdint.h-t
2555 +EXTRA_DIST += stdint.in.h
2557 +## end gnulib module stdint
2559 +## begin gnulib module stdio
2561 +BUILT_SOURCES += stdio.h
2563 +# We need the following in order to create <stdio.h> when the system
2564 +# doesn't have one that works with the given compiler.
2565 +stdio.h: stdio.in.h
2567 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
2568 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2569 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2570 + -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
2571 + -e 's|@''GNULIB_FPRINTF''@|$(GNULIB_FPRINTF)|g' \
2572 + -e 's|@''GNULIB_FPRINTF_POSIX''@|$(GNULIB_FPRINTF_POSIX)|g' \
2573 + -e 's|@''GNULIB_PRINTF''@|$(GNULIB_PRINTF)|g' \
2574 + -e 's|@''GNULIB_PRINTF_POSIX''@|$(GNULIB_PRINTF_POSIX)|g' \
2575 + -e 's|@''GNULIB_SNPRINTF''@|$(GNULIB_SNPRINTF)|g' \
2576 + -e 's|@''GNULIB_SPRINTF_POSIX''@|$(GNULIB_SPRINTF_POSIX)|g' \
2577 + -e 's|@''GNULIB_VFPRINTF''@|$(GNULIB_VFPRINTF)|g' \
2578 + -e 's|@''GNULIB_VFPRINTF_POSIX''@|$(GNULIB_VFPRINTF_POSIX)|g' \
2579 + -e 's|@''GNULIB_VPRINTF''@|$(GNULIB_VPRINTF)|g' \
2580 + -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \
2581 + -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \
2582 + -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \
2583 + -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \
2584 + -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \
2585 + -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \
2586 + -e 's|@''GNULIB_FOPEN''@|$(GNULIB_FOPEN)|g' \
2587 + -e 's|@''GNULIB_FREOPEN''@|$(GNULIB_FREOPEN)|g' \
2588 + -e 's|@''GNULIB_FSEEK''@|$(GNULIB_FSEEK)|g' \
2589 + -e 's|@''GNULIB_FSEEKO''@|$(GNULIB_FSEEKO)|g' \
2590 + -e 's|@''GNULIB_FTELL''@|$(GNULIB_FTELL)|g' \
2591 + -e 's|@''GNULIB_FTELLO''@|$(GNULIB_FTELLO)|g' \
2592 + -e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
2593 + -e 's|@''GNULIB_FPUTC''@|$(GNULIB_FPUTC)|g' \
2594 + -e 's|@''GNULIB_PUTC''@|$(GNULIB_PUTC)|g' \
2595 + -e 's|@''GNULIB_PUTCHAR''@|$(GNULIB_PUTCHAR)|g' \
2596 + -e 's|@''GNULIB_FPUTS''@|$(GNULIB_FPUTS)|g' \
2597 + -e 's|@''GNULIB_PUTS''@|$(GNULIB_PUTS)|g' \
2598 + -e 's|@''GNULIB_FWRITE''@|$(GNULIB_FWRITE)|g' \
2599 + -e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
2600 + -e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
2601 + -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
2602 + -e 's|@''GNULIB_STDIO_H_SIGPIPE''@|$(GNULIB_STDIO_H_SIGPIPE)|g' \
2603 + -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
2604 + -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
2605 + -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
2606 + -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
2607 + -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
2608 + -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
2609 + -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
2610 + -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
2611 + -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
2612 + -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
2613 + -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
2614 + -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
2615 + -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
2616 + -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
2617 + -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
2618 + -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
2619 + -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
2620 + -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
2621 + -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
2622 + -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
2623 + -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
2624 + -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
2625 + -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
2626 + -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
2627 + -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
2628 + -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
2629 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2630 + < $(srcdir)/stdio.in.h; \
2633 +MOSTLYCLEANFILES += stdio.h stdio.h-t
2635 +EXTRA_DIST += stdio-write.c stdio.in.h
2637 +EXTRA_libgnu_la_SOURCES += stdio-write.c
2639 +## end gnulib module stdio
2641 +## begin gnulib module sys_socket
2643 +BUILT_SOURCES += $(SYS_SOCKET_H)
2645 +# We need the following in order to create <sys/socket.h> when the system
2646 +# doesn't have one that works with the given compiler.
2647 +sys/socket.h: sys_socket.in.h
2649 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2650 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2651 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2652 + -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
2653 + -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
2654 + -e 's|@''GNULIB_SOCKET''@|$(GNULIB_SOCKET)|g' \
2655 + -e 's|@''GNULIB_CONNECT''@|$(GNULIB_CONNECT)|g' \
2656 + -e 's|@''GNULIB_ACCEPT''@|$(GNULIB_ACCEPT)|g' \
2657 + -e 's|@''GNULIB_BIND''@|$(GNULIB_BIND)|g' \
2658 + -e 's|@''GNULIB_GETPEERNAME''@|$(GNULIB_GETPEERNAME)|g' \
2659 + -e 's|@''GNULIB_GETSOCKNAME''@|$(GNULIB_GETSOCKNAME)|g' \
2660 + -e 's|@''GNULIB_GETSOCKOPT''@|$(GNULIB_GETSOCKOPT)|g' \
2661 + -e 's|@''GNULIB_LISTEN''@|$(GNULIB_LISTEN)|g' \
2662 + -e 's|@''GNULIB_RECV''@|$(GNULIB_RECV)|g' \
2663 + -e 's|@''GNULIB_SEND''@|$()GNULIB_SEND|g' \
2664 + -e 's|@''GNULIB_RECVFROM''@|$(GNULIB_RECVFROM)|g' \
2665 + -e 's|@''GNULIB_SENDTO''@|$(GNULIB_SENDTO)|g' \
2666 + -e 's|@''GNULIB_SETSOCKOPT''@|$(GNULIB_SETSOCKOPT)|g' \
2667 + -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
2668 + -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
2669 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2670 + < $(srcdir)/sys_socket.in.h; \
2673 +MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
2674 +MOSTLYCLEANDIRS += sys
2676 +EXTRA_DIST += sys_socket.in.h winsock.c
2678 +EXTRA_libgnu_la_SOURCES += winsock.c
2680 +## end gnulib module sys_socket
2682 +## begin gnulib module vasnprintf
2685 +EXTRA_DIST += asnprintf.c float+.h printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
2687 +EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
2689 +## end gnulib module vasnprintf
2691 +## begin gnulib module vc-list-files
2694 +EXTRA_DIST += $(top_srcdir)/./vc-list-files
2696 +## end gnulib module vc-list-files
2698 +## begin gnulib module wchar
2700 +BUILT_SOURCES += $(WCHAR_H)
2702 +# We need the following in order to create <wchar.h> when the system
2703 +# version does not work standalone.
2704 +wchar.h: wchar.in.h
2706 + { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
2707 + sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
2708 + -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
2709 + -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
2710 + -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
2711 + -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \
2712 + -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
2713 + -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
2714 + -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
2715 + -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
2716 + < $(srcdir)/wchar.in.h; \
2719 +MOSTLYCLEANFILES += wchar.h wchar.h-t
2721 +EXTRA_DIST += wchar.in.h
2723 +## end gnulib module wchar
2725 +## begin gnulib module xsize
2727 +libgnu_la_SOURCES += xsize.h
2729 +## end gnulib module xsize
2731 +## begin gnulib module dummy
2733 +libgnu_la_SOURCES += dummy.c
2735 +## end gnulib module dummy
2738 +mostlyclean-local: mostlyclean-generic
2739 + @for dir in '' $(MOSTLYCLEANDIRS); do \
2740 + if test -n "$$dir" && test -d $$dir; then \
2741 + echo "rmdir $$dir"; rmdir $$dir; \
2745 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/netinet_in.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/netinet_in.in.h
2746 --- gtk-vnc-0.3.7.mingw/gnulib/lib/netinet_in.in.h 1970-01-01 01:00:00.000000000 +0100
2747 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/netinet_in.in.h 2008-10-09 12:24:39.000000000 +0100
2749 +/* Substitute for <netinet/in.h>.
2750 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
2752 + This program is free software; you can redistribute it and/or modify
2753 + it under the terms of the GNU Lesser General Public License as published by
2754 + the Free Software Foundation; either version 2.1, or (at your option)
2755 + any later version.
2757 + This program is distributed in the hope that it will be useful,
2758 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2759 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2760 + GNU Lesser General Public License for more details.
2762 + You should have received a copy of the GNU Lesser General Public License
2763 + along with this program; if not, write to the Free Software Foundation,
2764 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2766 +#ifndef _GL_NETINET_IN_H
2768 +#if @HAVE_NETINET_IN_H@
2770 +@PRAGMA_SYSTEM_HEADER@
2772 +/* On many platforms, <netinet/in.h> assumes prior inclusion of
2774 +# include <sys/types.h>
2776 +/* The include_next requires a split double-inclusion guard. */
2777 +# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@
2781 +#ifndef _GL_NETINET_IN_H
2782 +#define _GL_NETINET_IN_H
2784 +#if !@HAVE_NETINET_IN_H@
2786 +/* A platform that lacks <netinet/in.h>. */
2788 +# include <sys/socket.h>
2792 +#endif /* _GL_NETINET_IN_H */
2793 +#endif /* _GL_NETINET_IN_H */
2794 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/printf-args.c gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-args.c
2795 --- gtk-vnc-0.3.7.mingw/gnulib/lib/printf-args.c 1970-01-01 01:00:00.000000000 +0100
2796 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-args.c 2008-10-09 12:24:39.000000000 +0100
2798 +/* Decomposed printf argument list.
2799 + Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
2801 + This program is free software; you can redistribute it and/or modify
2802 + it under the terms of the GNU Lesser General Public License as published by
2803 + the Free Software Foundation; either version 2.1, or (at your option)
2804 + any later version.
2806 + This program is distributed in the hope that it will be useful,
2807 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2808 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2809 + GNU Lesser General Public License for more details.
2811 + You should have received a copy of the GNU Lesser General Public License along
2812 + with this program; if not, write to the Free Software Foundation,
2813 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
2815 +/* This file can be parametrized with the following macros:
2816 + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
2817 + PRINTF_FETCHARGS Name of the function to be defined.
2818 + STATIC Set to 'static' to declare the function static. */
2820 +#ifndef PRINTF_FETCHARGS
2821 +# include <config.h>
2824 +/* Specification. */
2825 +#ifndef PRINTF_FETCHARGS
2826 +# include "printf-args.h"
2833 +PRINTF_FETCHARGS (va_list args, arguments *a)
2838 + for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
2842 + ap->a.a_schar = va_arg (args, /*signed char*/ int);
2845 + ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
2848 + ap->a.a_short = va_arg (args, /*short*/ int);
2851 + ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
2854 + ap->a.a_int = va_arg (args, int);
2857 + ap->a.a_uint = va_arg (args, unsigned int);
2859 + case TYPE_LONGINT:
2860 + ap->a.a_longint = va_arg (args, long int);
2862 + case TYPE_ULONGINT:
2863 + ap->a.a_ulongint = va_arg (args, unsigned long int);
2865 +#if HAVE_LONG_LONG_INT
2866 + case TYPE_LONGLONGINT:
2867 + ap->a.a_longlongint = va_arg (args, long long int);
2869 + case TYPE_ULONGLONGINT:
2870 + ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
2874 + ap->a.a_double = va_arg (args, double);
2876 + case TYPE_LONGDOUBLE:
2877 + ap->a.a_longdouble = va_arg (args, long double);
2880 + ap->a.a_char = va_arg (args, int);
2883 + case TYPE_WIDE_CHAR:
2884 + /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
2885 + default argument promotions", this is not the case in mingw32,
2886 + where wint_t is 'unsigned short'. */
2887 + ap->a.a_wide_char =
2888 + (sizeof (wint_t) < sizeof (int)
2889 + ? va_arg (args, int)
2890 + : va_arg (args, wint_t));
2894 + ap->a.a_string = va_arg (args, const char *);
2895 + /* A null pointer is an invalid argument for "%s", but in practice
2896 + it occurs quite frequently in printf statements that produce
2897 + debug output. Use a fallback in this case. */
2898 + if (ap->a.a_string == NULL)
2899 + ap->a.a_string = "(NULL)";
2902 + case TYPE_WIDE_STRING:
2903 + ap->a.a_wide_string = va_arg (args, const wchar_t *);
2904 + /* A null pointer is an invalid argument for "%ls", but in practice
2905 + it occurs quite frequently in printf statements that produce
2906 + debug output. Use a fallback in this case. */
2907 + if (ap->a.a_wide_string == NULL)
2909 + static const wchar_t wide_null_string[] =
2912 + (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
2916 + ap->a.a_wide_string = wide_null_string;
2920 + case TYPE_POINTER:
2921 + ap->a.a_pointer = va_arg (args, void *);
2923 + case TYPE_COUNT_SCHAR_POINTER:
2924 + ap->a.a_count_schar_pointer = va_arg (args, signed char *);
2926 + case TYPE_COUNT_SHORT_POINTER:
2927 + ap->a.a_count_short_pointer = va_arg (args, short *);
2929 + case TYPE_COUNT_INT_POINTER:
2930 + ap->a.a_count_int_pointer = va_arg (args, int *);
2932 + case TYPE_COUNT_LONGINT_POINTER:
2933 + ap->a.a_count_longint_pointer = va_arg (args, long int *);
2935 +#if HAVE_LONG_LONG_INT
2936 + case TYPE_COUNT_LONGLONGINT_POINTER:
2937 + ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
2940 +#if ENABLE_UNISTDIO
2941 + /* The unistdio extensions. */
2942 + case TYPE_U8_STRING:
2943 + ap->a.a_u8_string = va_arg (args, const uint8_t *);
2944 + /* A null pointer is an invalid argument for "%U", but in practice
2945 + it occurs quite frequently in printf statements that produce
2946 + debug output. Use a fallback in this case. */
2947 + if (ap->a.a_u8_string == NULL)
2949 + static const uint8_t u8_null_string[] =
2950 + { '(', 'N', 'U', 'L', 'L', ')', 0 };
2951 + ap->a.a_u8_string = u8_null_string;
2954 + case TYPE_U16_STRING:
2955 + ap->a.a_u16_string = va_arg (args, const uint16_t *);
2956 + /* A null pointer is an invalid argument for "%lU", but in practice
2957 + it occurs quite frequently in printf statements that produce
2958 + debug output. Use a fallback in this case. */
2959 + if (ap->a.a_u16_string == NULL)
2961 + static const uint16_t u16_null_string[] =
2962 + { '(', 'N', 'U', 'L', 'L', ')', 0 };
2963 + ap->a.a_u16_string = u16_null_string;
2966 + case TYPE_U32_STRING:
2967 + ap->a.a_u32_string = va_arg (args, const uint32_t *);
2968 + /* A null pointer is an invalid argument for "%llU", but in practice
2969 + it occurs quite frequently in printf statements that produce
2970 + debug output. Use a fallback in this case. */
2971 + if (ap->a.a_u32_string == NULL)
2973 + static const uint32_t u32_null_string[] =
2974 + { '(', 'N', 'U', 'L', 'L', ')', 0 };
2975 + ap->a.a_u32_string = u32_null_string;
2980 + /* Unknown type. */
2985 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/printf-args.h gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-args.h
2986 --- gtk-vnc-0.3.7.mingw/gnulib/lib/printf-args.h 1970-01-01 01:00:00.000000000 +0100
2987 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-args.h 2008-10-09 12:24:39.000000000 +0100
2989 +/* Decomposed printf argument list.
2990 + Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc.
2992 + This program is free software; you can redistribute it and/or modify
2993 + it under the terms of the GNU Lesser General Public License as published by
2994 + the Free Software Foundation; either version 2.1, or (at your option)
2995 + any later version.
2997 + This program is distributed in the hope that it will be useful,
2998 + but WITHOUT ANY WARRANTY; without even the implied warranty of
2999 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3000 + GNU Lesser General Public License for more details.
3002 + You should have received a copy of the GNU Lesser General Public License along
3003 + with this program; if not, write to the Free Software Foundation,
3004 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3006 +#ifndef _PRINTF_ARGS_H
3007 +#define _PRINTF_ARGS_H
3009 +/* This file can be parametrized with the following macros:
3010 + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
3011 + PRINTF_FETCHARGS Name of the function to be declared.
3012 + STATIC Set to 'static' to declare the function static. */
3014 +/* Default parameters. */
3015 +#ifndef PRINTF_FETCHARGS
3016 +# define PRINTF_FETCHARGS printf_fetchargs
3020 +#include <stddef.h>
3024 +# include <stddef.h>
3029 +# include <wchar.h>
3033 +#include <stdarg.h>
3036 +/* Argument types */
3048 +#if HAVE_LONG_LONG_INT
3050 + TYPE_ULONGLONGINT,
3063 + TYPE_COUNT_SCHAR_POINTER,
3064 + TYPE_COUNT_SHORT_POINTER,
3065 + TYPE_COUNT_INT_POINTER,
3066 + TYPE_COUNT_LONGINT_POINTER
3067 +#if HAVE_LONG_LONG_INT
3068 +, TYPE_COUNT_LONGLONGINT_POINTER
3070 +#if ENABLE_UNISTDIO
3071 + /* The unistdio extensions. */
3078 +/* Polymorphic argument */
3084 + signed char a_schar;
3085 + unsigned char a_uchar;
3087 + unsigned short a_ushort;
3089 + unsigned int a_uint;
3090 + long int a_longint;
3091 + unsigned long int a_ulongint;
3092 +#if HAVE_LONG_LONG_INT
3093 + long long int a_longlongint;
3094 + unsigned long long int a_ulonglongint;
3098 + long double a_longdouble;
3101 + wint_t a_wide_char;
3103 + const char* a_string;
3105 + const wchar_t* a_wide_string;
3108 + signed char * a_count_schar_pointer;
3109 + short * a_count_short_pointer;
3110 + int * a_count_int_pointer;
3111 + long int * a_count_longint_pointer;
3112 +#if HAVE_LONG_LONG_INT
3113 + long long int * a_count_longlongint_pointer;
3115 +#if ENABLE_UNISTDIO
3116 + /* The unistdio extensions. */
3117 + const uint8_t * a_u8_string;
3118 + const uint16_t * a_u16_string;
3119 + const uint32_t * a_u32_string;
3134 +/* Fetch the arguments, putting them into a. */
3140 +int PRINTF_FETCHARGS (va_list args, arguments *a);
3142 +#endif /* _PRINTF_ARGS_H */
3143 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/printf-parse.c gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-parse.c
3144 --- gtk-vnc-0.3.7.mingw/gnulib/lib/printf-parse.c 1970-01-01 01:00:00.000000000 +0100
3145 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-parse.c 2008-10-09 12:24:39.000000000 +0100
3147 +/* Formatted output to strings.
3148 + Copyright (C) 1999-2000, 2002-2003, 2006-2008 Free Software Foundation, Inc.
3150 + This program is free software; you can redistribute it and/or modify
3151 + it under the terms of the GNU Lesser General Public License as published by
3152 + the Free Software Foundation; either version 2.1, or (at your option)
3153 + any later version.
3155 + This program is distributed in the hope that it will be useful,
3156 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3157 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3158 + GNU Lesser General Public License for more details.
3160 + You should have received a copy of the GNU Lesser General Public License along
3161 + with this program; if not, write to the Free Software Foundation,
3162 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3164 +/* This file can be parametrized with the following macros:
3165 + CHAR_T The element type of the format string.
3166 + CHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
3167 + in the format string are ASCII.
3168 + DIRECTIVE Structure denoting a format directive.
3169 + Depends on CHAR_T.
3170 + DIRECTIVES Structure denoting the set of format directives of a
3171 + format string. Depends on CHAR_T.
3172 + PRINTF_PARSE Function that parses a format string.
3173 + Depends on CHAR_T.
3174 + STATIC Set to 'static' to declare the function static.
3175 + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions. */
3177 +#ifndef PRINTF_PARSE
3178 +# include <config.h>
3181 +/* Specification. */
3182 +#ifndef PRINTF_PARSE
3183 +# include "printf-parse.h"
3186 +/* Default parameters. */
3187 +#ifndef PRINTF_PARSE
3188 +# define PRINTF_PARSE printf_parse
3189 +# define CHAR_T char
3190 +# define DIRECTIVE char_directive
3191 +# define DIRECTIVES char_directives
3194 +/* Get size_t, NULL. */
3195 +#include <stddef.h>
3197 +/* Get intmax_t. */
3198 +#if defined IN_LIBINTL || defined IN_LIBASPRINTF
3199 +# if HAVE_STDINT_H_WITH_UINTMAX
3200 +# include <stdint.h>
3202 +# if HAVE_INTTYPES_H_WITH_UINTMAX
3203 +# include <inttypes.h>
3206 +# include <stdint.h>
3209 +/* malloc(), realloc(), free(). */
3210 +#include <stdlib.h>
3215 +/* Checked size_t computations. */
3218 +#if CHAR_T_ONLY_ASCII
3220 +# include "c-ctype.h"
3227 +PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
3229 + const CHAR_T *cp = format; /* pointer into format */
3230 + size_t arg_posn = 0; /* number of regular arguments consumed */
3231 + size_t d_allocated; /* allocated elements of d->dir */
3232 + size_t a_allocated; /* allocated elements of a->arg */
3233 + size_t max_width_length = 0;
3234 + size_t max_precision_length = 0;
3238 + d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
3239 + if (d->dir == NULL)
3240 + /* Out of memory. */
3241 + goto out_of_memory_1;
3247 +#define REGISTER_ARG(_index_,_type_) \
3249 + size_t n = (_index_); \
3250 + if (n >= a_allocated) \
3252 + size_t memory_size; \
3253 + argument *memory; \
3255 + a_allocated = xtimes (a_allocated, 2); \
3256 + if (a_allocated <= n) \
3257 + a_allocated = xsum (n, 1); \
3258 + memory_size = xtimes (a_allocated, sizeof (argument)); \
3259 + if (size_overflow_p (memory_size)) \
3260 + /* Overflow, would lead to out of memory. */ \
3261 + goto out_of_memory; \
3262 + memory = (argument *) (a->arg \
3263 + ? realloc (a->arg, memory_size) \
3264 + : malloc (memory_size)); \
3265 + if (memory == NULL) \
3266 + /* Out of memory. */ \
3267 + goto out_of_memory; \
3268 + a->arg = memory; \
3270 + while (a->count <= n) \
3271 + a->arg[a->count++].type = TYPE_NONE; \
3272 + if (a->arg[n].type == TYPE_NONE) \
3273 + a->arg[n].type = (_type_); \
3274 + else if (a->arg[n].type != (_type_)) \
3275 + /* Ambiguous type for positional argument. */ \
3279 + while (*cp != '\0')
3284 + size_t arg_index = ARG_NONE;
3285 + DIRECTIVE *dp = &d->dir[d->count]; /* pointer to next directive */
3287 + /* Initialize the next directive. */
3288 + dp->dir_start = cp - 1;
3290 + dp->width_start = NULL;
3291 + dp->width_end = NULL;
3292 + dp->width_arg_index = ARG_NONE;
3293 + dp->precision_start = NULL;
3294 + dp->precision_end = NULL;
3295 + dp->precision_arg_index = ARG_NONE;
3296 + dp->arg_index = ARG_NONE;
3298 + /* Test for positional argument. */
3299 + if (*cp >= '0' && *cp <= '9')
3303 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3309 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3310 + n = xsum (xtimes (n, 10), *np - '0');
3312 + /* Positional argument 0. */
3314 + if (size_overflow_p (n))
3315 + /* n too large, would lead to out of memory later. */
3317 + arg_index = n - 1;
3322 + /* Read the flags. */
3327 + dp->flags |= FLAG_GROUP;
3330 + else if (*cp == '-')
3332 + dp->flags |= FLAG_LEFT;
3335 + else if (*cp == '+')
3337 + dp->flags |= FLAG_SHOWSIGN;
3340 + else if (*cp == ' ')
3342 + dp->flags |= FLAG_SPACE;
3345 + else if (*cp == '#')
3347 + dp->flags |= FLAG_ALT;
3350 + else if (*cp == '0')
3352 + dp->flags |= FLAG_ZERO;
3359 + /* Parse the field width. */
3362 + dp->width_start = cp;
3364 + dp->width_end = cp;
3365 + if (max_width_length < 1)
3366 + max_width_length = 1;
3368 + /* Test for positional argument. */
3369 + if (*cp >= '0' && *cp <= '9')
3373 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3379 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3380 + n = xsum (xtimes (n, 10), *np - '0');
3382 + /* Positional argument 0. */
3384 + if (size_overflow_p (n))
3385 + /* n too large, would lead to out of memory later. */
3387 + dp->width_arg_index = n - 1;
3391 + if (dp->width_arg_index == ARG_NONE)
3393 + dp->width_arg_index = arg_posn++;
3394 + if (dp->width_arg_index == ARG_NONE)
3395 + /* arg_posn wrapped around. */
3398 + REGISTER_ARG (dp->width_arg_index, TYPE_INT);
3400 + else if (*cp >= '0' && *cp <= '9')
3402 + size_t width_length;
3404 + dp->width_start = cp;
3405 + for (; *cp >= '0' && *cp <= '9'; cp++)
3407 + dp->width_end = cp;
3408 + width_length = dp->width_end - dp->width_start;
3409 + if (max_width_length < width_length)
3410 + max_width_length = width_length;
3413 + /* Parse the precision. */
3419 + dp->precision_start = cp - 1;
3421 + dp->precision_end = cp;
3422 + if (max_precision_length < 2)
3423 + max_precision_length = 2;
3425 + /* Test for positional argument. */
3426 + if (*cp >= '0' && *cp <= '9')
3430 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3436 + for (np = cp; *np >= '0' && *np <= '9'; np++)
3437 + n = xsum (xtimes (n, 10), *np - '0');
3439 + /* Positional argument 0. */
3441 + if (size_overflow_p (n))
3442 + /* n too large, would lead to out of memory
3445 + dp->precision_arg_index = n - 1;
3449 + if (dp->precision_arg_index == ARG_NONE)
3451 + dp->precision_arg_index = arg_posn++;
3452 + if (dp->precision_arg_index == ARG_NONE)
3453 + /* arg_posn wrapped around. */
3456 + REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
3460 + size_t precision_length;
3462 + dp->precision_start = cp - 1;
3463 + for (; *cp >= '0' && *cp <= '9'; cp++)
3465 + dp->precision_end = cp;
3466 + precision_length = dp->precision_end - dp->precision_start;
3467 + if (max_precision_length < precision_length)
3468 + max_precision_length = precision_length;
3475 + /* Parse argument type/size specifiers. */
3483 + flags |= (1 << (flags & 1));
3486 + else if (*cp == 'L')
3491 + else if (*cp == 'l')
3496 + else if (*cp == 'j')
3498 + if (sizeof (intmax_t) > sizeof (long))
3500 + /* intmax_t = long long */
3503 + else if (sizeof (intmax_t) > sizeof (int))
3505 + /* intmax_t = long */
3510 + else if (*cp == 'z' || *cp == 'Z')
3512 + /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
3513 + because the warning facility in gcc-2.95.2 understands
3514 + only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784). */
3515 + if (sizeof (size_t) > sizeof (long))
3517 + /* size_t = long long */
3520 + else if (sizeof (size_t) > sizeof (int))
3522 + /* size_t = long */
3527 + else if (*cp == 't')
3529 + if (sizeof (ptrdiff_t) > sizeof (long))
3531 + /* ptrdiff_t = long long */
3534 + else if (sizeof (ptrdiff_t) > sizeof (int))
3536 + /* ptrdiff_t = long */
3541 +#if defined __APPLE__ && defined __MACH__
3542 + /* On MacOS X 10.3, PRIdMAX is defined as "qd".
3543 + We cannot change it to "lld" because PRIdMAX must also
3544 + be understood by the system's printf routines. */
3545 + else if (*cp == 'q')
3547 + if (64 / 8 > sizeof (long))
3549 + /* int64_t = long long */
3554 + /* int64_t = long */
3560 +#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
3561 + /* On native Win32, PRIdMAX is defined as "I64d".
3562 + We cannot change it to "lld" because PRIdMAX must also
3563 + be understood by the system's printf routines. */
3564 + else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
3566 + if (64 / 8 > sizeof (long))
3568 + /* __int64 = long long */
3573 + /* __int64 = long */
3583 + /* Read the conversion character. */
3587 + case 'd': case 'i':
3588 +#if HAVE_LONG_LONG_INT
3589 + /* If 'long long' exists and is larger than 'long': */
3590 + if (flags >= 16 || (flags & 4))
3591 + type = TYPE_LONGLONGINT;
3594 + /* If 'long long' exists and is the same as 'long', we parse
3595 + "lld" into TYPE_LONGINT. */
3597 + type = TYPE_LONGINT;
3598 + else if (flags & 2)
3599 + type = TYPE_SCHAR;
3600 + else if (flags & 1)
3601 + type = TYPE_SHORT;
3605 + case 'o': case 'u': case 'x': case 'X':
3606 +#if HAVE_LONG_LONG_INT
3607 + /* If 'long long' exists and is larger than 'long': */
3608 + if (flags >= 16 || (flags & 4))
3609 + type = TYPE_ULONGLONGINT;
3612 + /* If 'unsigned long long' exists and is the same as
3613 + 'unsigned long', we parse "llu" into TYPE_ULONGINT. */
3615 + type = TYPE_ULONGINT;
3616 + else if (flags & 2)
3617 + type = TYPE_UCHAR;
3618 + else if (flags & 1)
3619 + type = TYPE_USHORT;
3623 + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
3624 + case 'a': case 'A':
3625 + if (flags >= 16 || (flags & 4))
3626 + type = TYPE_LONGDOUBLE;
3628 + type = TYPE_DOUBLE;
3633 + type = TYPE_WIDE_CHAR;
3642 + type = TYPE_WIDE_CHAR;
3649 + type = TYPE_WIDE_STRING;
3654 + type = TYPE_STRING;
3658 + type = TYPE_WIDE_STRING;
3663 + type = TYPE_POINTER;
3666 +#if HAVE_LONG_LONG_INT
3667 + /* If 'long long' exists and is larger than 'long': */
3668 + if (flags >= 16 || (flags & 4))
3669 + type = TYPE_COUNT_LONGLONGINT_POINTER;
3672 + /* If 'long long' exists and is the same as 'long', we parse
3673 + "lln" into TYPE_COUNT_LONGINT_POINTER. */
3675 + type = TYPE_COUNT_LONGINT_POINTER;
3676 + else if (flags & 2)
3677 + type = TYPE_COUNT_SCHAR_POINTER;
3678 + else if (flags & 1)
3679 + type = TYPE_COUNT_SHORT_POINTER;
3681 + type = TYPE_COUNT_INT_POINTER;
3683 +#if ENABLE_UNISTDIO
3684 + /* The unistdio extensions. */
3687 + type = TYPE_U32_STRING;
3688 + else if (flags >= 8)
3689 + type = TYPE_U16_STRING;
3691 + type = TYPE_U8_STRING;
3698 + /* Unknown conversion character. */
3703 + if (type != TYPE_NONE)
3705 + dp->arg_index = arg_index;
3706 + if (dp->arg_index == ARG_NONE)
3708 + dp->arg_index = arg_posn++;
3709 + if (dp->arg_index == ARG_NONE)
3710 + /* arg_posn wrapped around. */
3713 + REGISTER_ARG (dp->arg_index, type);
3715 + dp->conversion = c;
3720 + if (d->count >= d_allocated)
3722 + size_t memory_size;
3723 + DIRECTIVE *memory;
3725 + d_allocated = xtimes (d_allocated, 2);
3726 + memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
3727 + if (size_overflow_p (memory_size))
3728 + /* Overflow, would lead to out of memory. */
3729 + goto out_of_memory;
3730 + memory = (DIRECTIVE *) realloc (d->dir, memory_size);
3731 + if (memory == NULL)
3732 + /* Out of memory. */
3733 + goto out_of_memory;
3737 +#if CHAR_T_ONLY_ASCII
3738 + else if (!c_isascii (c))
3740 + /* Non-ASCII character. Not supported. */
3745 + d->dir[d->count].dir_start = cp;
3747 + d->max_width_length = max_width_length;
3748 + d->max_precision_length = max_precision_length;
3769 +#undef PRINTF_PARSE
3772 +#undef CHAR_T_ONLY_ASCII
3774 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/printf-parse.h gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-parse.h
3775 --- gtk-vnc-0.3.7.mingw/gnulib/lib/printf-parse.h 1970-01-01 01:00:00.000000000 +0100
3776 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/printf-parse.h 2008-10-09 12:24:39.000000000 +0100
3778 +/* Parse printf format string.
3779 + Copyright (C) 1999, 2002-2003, 2005, 2007 Free Software Foundation, Inc.
3781 + This program is free software; you can redistribute it and/or modify
3782 + it under the terms of the GNU Lesser General Public License as published by
3783 + the Free Software Foundation; either version 2.1, or (at your option)
3784 + any later version.
3786 + This program is distributed in the hope that it will be useful,
3787 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3788 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3789 + GNU Lesser General Public License for more details.
3791 + You should have received a copy of the GNU Lesser General Public License along
3792 + with this program; if not, write to the Free Software Foundation,
3793 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3795 +#ifndef _PRINTF_PARSE_H
3796 +#define _PRINTF_PARSE_H
3798 +/* This file can be parametrized with the following macros:
3799 + ENABLE_UNISTDIO Set to 1 to enable the unistdio extensions.
3800 + STATIC Set to 'static' to declare the function static. */
3802 +#include "printf-args.h"
3806 +#define FLAG_GROUP 1 /* ' flag */
3807 +#define FLAG_LEFT 2 /* - flag */
3808 +#define FLAG_SHOWSIGN 4 /* + flag */
3809 +#define FLAG_SPACE 8 /* space flag */
3810 +#define FLAG_ALT 16 /* # flag */
3811 +#define FLAG_ZERO 32
3813 +/* arg_index value indicating that no argument is consumed. */
3814 +#define ARG_NONE (~(size_t)0)
3816 +/* xxx_directive: A parsed directive.
3817 + xxx_directives: A parsed format string. */
3819 +/* A parsed directive. */
3822 + const char* dir_start;
3823 + const char* dir_end;
3825 + const char* width_start;
3826 + const char* width_end;
3827 + size_t width_arg_index;
3828 + const char* precision_start;
3829 + const char* precision_end;
3830 + size_t precision_arg_index;
3831 + 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 */
3836 +/* A parsed format string. */
3840 + char_directive *dir;
3841 + size_t max_width_length;
3842 + size_t max_precision_length;
3846 +#if ENABLE_UNISTDIO
3848 +/* A parsed directive. */
3851 + const uint8_t* dir_start;
3852 + const uint8_t* dir_end;
3854 + const uint8_t* width_start;
3855 + const uint8_t* width_end;
3856 + size_t width_arg_index;
3857 + const uint8_t* precision_start;
3858 + const uint8_t* precision_end;
3859 + size_t precision_arg_index;
3860 + 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 */
3865 +/* A parsed format string. */
3869 + u8_directive *dir;
3870 + size_t max_width_length;
3871 + size_t max_precision_length;
3875 +/* A parsed directive. */
3878 + const uint16_t* dir_start;
3879 + const uint16_t* dir_end;
3881 + const uint16_t* width_start;
3882 + const uint16_t* width_end;
3883 + size_t width_arg_index;
3884 + const uint16_t* precision_start;
3885 + const uint16_t* precision_end;
3886 + size_t precision_arg_index;
3887 + 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 */
3892 +/* A parsed format string. */
3896 + u16_directive *dir;
3897 + size_t max_width_length;
3898 + size_t max_precision_length;
3902 +/* A parsed directive. */
3905 + const uint32_t* dir_start;
3906 + const uint32_t* dir_end;
3908 + const uint32_t* width_start;
3909 + const uint32_t* width_end;
3910 + size_t width_arg_index;
3911 + const uint32_t* precision_start;
3912 + const uint32_t* precision_end;
3913 + size_t precision_arg_index;
3914 + 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 */
3919 +/* A parsed format string. */
3923 + u32_directive *dir;
3924 + size_t max_width_length;
3925 + size_t max_precision_length;
3932 +/* Parses the format string. Fills in the number N of directives, and fills
3933 + in directives[0], ..., directives[N-1], and sets directives[N].dir_start
3934 + to the end of the format string. Also fills in the arg_type fields of the
3935 + arguments and the needed count of arguments. */
3936 +#if ENABLE_UNISTDIO
3938 + ulc_printf_parse (const char *format, char_directives *d, arguments *a);
3940 + u8_printf_parse (const uint8_t *format, u8_directives *d, arguments *a);
3942 + u16_printf_parse (const uint16_t *format, u16_directives *d,
3945 + u32_printf_parse (const uint32_t *format, u32_directives *d,
3953 +int printf_parse (const char *format, char_directives *d, arguments *a);
3956 +#endif /* _PRINTF_PARSE_H */
3957 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/size_max.h gtk-vnc-0.3.7.gnulib/gnulib/lib/size_max.h
3958 --- gtk-vnc-0.3.7.mingw/gnulib/lib/size_max.h 1970-01-01 01:00:00.000000000 +0100
3959 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/size_max.h 2008-10-09 12:24:39.000000000 +0100
3961 +/* size_max.h -- declare SIZE_MAX through system headers
3962 + Copyright (C) 2005-2006 Free Software Foundation, Inc.
3963 + Written by Simon Josefsson.
3965 + This program is free software; you can redistribute it and/or modify
3966 + it under the terms of the GNU Lesser General Public License as published by
3967 + the Free Software Foundation; either version 2.1, or (at your option)
3968 + any later version.
3970 + This program is distributed in the hope that it will be useful,
3971 + but WITHOUT ANY WARRANTY; without even the implied warranty of
3972 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3973 + GNU Lesser General Public License for more details.
3975 + You should have received a copy of the GNU Lesser General Public License
3976 + along with this program; if not, write to the Free Software Foundation,
3977 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
3979 +#ifndef GNULIB_SIZE_MAX_H
3980 +#define GNULIB_SIZE_MAX_H
3982 +/* Get SIZE_MAX declaration on systems like Solaris 7/8/9. */
3983 +# include <limits.h>
3984 +/* Get SIZE_MAX declaration on systems like glibc 2. */
3986 +# include <stdint.h>
3988 +/* On systems where these include files don't define it, SIZE_MAX is defined
3991 +#endif /* GNULIB_SIZE_MAX_H */
3992 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/snprintf.c gtk-vnc-0.3.7.gnulib/gnulib/lib/snprintf.c
3993 --- gtk-vnc-0.3.7.mingw/gnulib/lib/snprintf.c 1970-01-01 01:00:00.000000000 +0100
3994 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/snprintf.c 2008-10-09 12:24:39.000000000 +0100
3996 +/* Formatted output to strings.
3997 + Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc.
3998 + Written by Simon Josefsson and Paul Eggert.
4000 + This program is free software; you can redistribute it and/or modify
4001 + it under the terms of the GNU Lesser General Public License as published by
4002 + the Free Software Foundation; either version 2.1, or (at your option)
4003 + any later version.
4005 + This program is distributed in the hope that it will be useful,
4006 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4007 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4008 + GNU Lesser General Public License for more details.
4010 + You should have received a copy of the GNU Lesser General Public License along
4011 + with this program; if not, write to the Free Software Foundation,
4012 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
4014 +#include <config.h>
4016 +/* Specification. */
4020 +#include <limits.h>
4021 +#include <stdarg.h>
4022 +#include <stdlib.h>
4023 +#include <string.h>
4025 +#include "vasnprintf.h"
4027 +/* Print formatted output to string STR. Similar to sprintf, but
4028 + additional length SIZE limit how much is written into STR. Returns
4029 + string length of formatted string (which may be larger than SIZE).
4030 + STR may be NULL, in which case nothing will be written. On error,
4031 + return a negative value. */
4033 +snprintf (char *str, size_t size, const char *format, ...)
4037 + size_t lenbuf = size;
4040 + va_start (args, format);
4041 + output = vasnprintf (str, &lenbuf, format, args);
4048 + if (output != str)
4052 + size_t pruned_len = (len < size ? len : size - 1);
4053 + memcpy (str, output, pruned_len);
4054 + str[pruned_len] = '\0';
4060 + if (INT_MAX < len)
4062 + errno = EOVERFLOW;
4068 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/stdbool.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/stdbool.in.h
4069 --- gtk-vnc-0.3.7.mingw/gnulib/lib/stdbool.in.h 1970-01-01 01:00:00.000000000 +0100
4070 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdbool.in.h 2008-10-09 12:24:39.000000000 +0100
4072 +/* Copyright (C) 2001-2003, 2006-2008 Free Software Foundation, Inc.
4073 + Written by Bruno Haible <haible@clisp.cons.org>, 2001.
4075 + This program is free software; you can redistribute it and/or modify
4076 + it under the terms of the GNU Lesser General Public License as published by
4077 + the Free Software Foundation; either version 2.1, or (at your option)
4078 + any later version.
4080 + This program is distributed in the hope that it will be useful,
4081 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4082 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4083 + GNU Lesser General Public License for more details.
4085 + You should have received a copy of the GNU Lesser General Public License
4086 + along with this program; if not, write to the Free Software Foundation,
4087 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
4089 +#ifndef _GL_STDBOOL_H
4090 +#define _GL_STDBOOL_H
4092 +/* ISO C 99 <stdbool.h> for platforms that lack it. */
4094 +/* Usage suggestions:
4096 + Programs that use <stdbool.h> should be aware of some limitations
4097 + and standards compliance issues.
4099 + Standards compliance:
4101 + - <stdbool.h> must be #included before 'bool', 'false', 'true'
4104 + - You cannot assume that sizeof (bool) == 1.
4106 + - Programs should not undefine the macros bool, true, and false,
4107 + as C99 lists that as an "obsolescent feature".
4109 + Limitations of this substitute, when used in a C89 environment:
4111 + - <stdbool.h> must be #included before the '_Bool' type can be used.
4113 + - You cannot assume that _Bool is a typedef; it might be a macro.
4115 + - Bit-fields of type 'bool' are not supported. Portable code
4116 + should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
4118 + - In C99, casts and automatic conversions to '_Bool' or 'bool' are
4119 + performed in such a way that every nonzero value gets converted
4120 + to 'true', and zero gets converted to 'false'. This doesn't work
4121 + with this substitute. With this substitute, only the values 0 and 1
4122 + give the expected result when converted to _Bool' or 'bool'.
4124 + Also, it is suggested that programs use 'bool' rather than '_Bool';
4125 + this isn't required, but 'bool' is more common. */
4128 +/* 7.16. Boolean type and values */
4130 +/* BeOS <sys/socket.h> already #defines false 0, true 1. We use the same
4131 + definitions below, but temporarily we have to #undef them. */
4132 +#if defined __BEOS__ && !defined __HAIKU__
4133 +# include <OS.h> /* defines bool but not _Bool */
4138 +/* For the sake of symbolic names in gdb, we define true and false as
4139 + enum constants, not only as macros.
4140 + It is tempting to write
4141 + typedef enum { false = 0, true = 1 } _Bool;
4142 + so that gdb prints values of type 'bool' symbolically. But if we do
4143 + this, values of type '_Bool' may promote to 'int' or 'unsigned int'
4144 + (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
4145 + (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the
4146 + enum; this ensures that '_Bool' promotes to 'int'. */
4147 +#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__)
4148 + /* A compiler known to have 'bool'. */
4149 + /* If the compiler already has both 'bool' and '_Bool', we can assume they
4150 + are the same types. */
4152 +typedef bool _Bool;
4155 +# if !defined __GNUC__
4156 + /* If @HAVE__BOOL@:
4157 + Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
4158 + the built-in _Bool type is used. See
4159 + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
4160 + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
4161 + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
4162 + Similar bugs are likely with other compilers as well; this file
4163 + wouldn't be used if <stdbool.h> was working.
4164 + So we override the _Bool type.
4166 + Need to define _Bool ourselves. As 'signed char' or as an enum type?
4167 + Use of a typedef, with SunPRO C, leads to a stupid
4168 + "warning: _Bool is a keyword in ISO C99".
4169 + Use of an enum type, with IRIX cc, leads to a stupid
4170 + "warning(1185): enumerated type mixed with another type".
4171 + Even the existence of an enum type, without a typedef,
4172 + "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
4173 + The only benefit of the enum, debuggability, is not important
4174 + with these compilers. So use 'signed char' and no enum. */
4175 +# define _Bool signed char
4177 + /* With this compiler, trust the _Bool type if the compiler has it. */
4179 +typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
4185 +/* The other macros must be usable in preprocessor directives. */
4188 +#define __bool_true_false_are_defined 1
4190 +#endif /* _GL_STDBOOL_H */
4191 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/stdint.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/stdint.in.h
4192 --- gtk-vnc-0.3.7.mingw/gnulib/lib/stdint.in.h 1970-01-01 01:00:00.000000000 +0100
4193 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdint.in.h 2008-10-09 12:24:39.000000000 +0100
4195 +/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc.
4196 + Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
4197 + This file is part of gnulib.
4199 + This program is free software; you can redistribute it and/or modify
4200 + it under the terms of the GNU Lesser General Public License as published by
4201 + the Free Software Foundation; either version 2.1, or (at your option)
4202 + any later version.
4204 + This program is distributed in the hope that it will be useful,
4205 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4206 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4207 + GNU Lesser General Public License for more details.
4209 + You should have received a copy of the GNU Lesser General Public License
4210 + along with this program; if not, write to the Free Software Foundation,
4211 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
4214 + * ISO C 99 <stdint.h> for platforms that lack it.
4215 + * <http://www.opengroup.org/susv3xbd/stdint.h.html>
4218 +#ifndef _GL_STDINT_H
4220 +/* When including a system file that in turn includes <inttypes.h>,
4221 + use the system <inttypes.h>, not our substitute. This avoids
4222 + problems with (for example) VMS, whose <sys/bitypes.h> includes
4224 +#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
4226 +/* Get those types that are already defined in other system include
4227 + files, so that we can "#define int8_t signed char" below without
4228 + worrying about a later system include file containing a "typedef
4229 + signed char int8_t;" that will get messed up by our macro. Our
4230 + macros should all be consistent with the system versions, except
4231 + for the "fast" types and macros, which we recommend against using
4232 + in public interfaces due to compiler differences. */
4234 +#if @HAVE_STDINT_H@
4235 +# if defined __sgi && ! defined __c99
4236 + /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
4237 + with "This header file is to be used only for c99 mode compilations"
4239 +# define __STDINT_H__
4241 + /* Other systems may have an incomplete or buggy <stdint.h>.
4242 + Include it before <inttypes.h>, since any "#include <stdint.h>"
4243 + in <inttypes.h> would reinclude us, skipping our contents because
4244 + _GL_STDINT_H is defined.
4245 + The include_next requires a split double-inclusion guard. */
4246 +@PRAGMA_SYSTEM_HEADER@
4247 +# @INCLUDE_NEXT@ @NEXT_STDINT_H@
4250 +#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
4251 +#define _GL_STDINT_H
4253 +/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
4254 + IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
4255 + AIX 5.2 <sys/types.h> isn't needed and causes troubles.
4256 + MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
4257 + relies on the system <stdint.h> definitions, so include
4258 + <sys/types.h> after @NEXT_STDINT_H@. */
4259 +#if @HAVE_SYS_TYPES_H@ && ! defined _AIX
4260 +# include <sys/types.h>
4263 +/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
4264 +#include <limits.h>
4266 +#if @HAVE_INTTYPES_H@
4267 + /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
4268 + int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
4269 + <inttypes.h> also defines intptr_t and uintptr_t. */
4270 +# include <inttypes.h>
4271 +#elif @HAVE_SYS_INTTYPES_H@
4272 + /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
4273 + the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
4274 +# include <sys/inttypes.h>
4277 +#if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
4278 + /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
4279 + int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
4280 + included by <sys/types.h>. */
4281 +# include <sys/bitypes.h>
4284 +#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
4286 +/* Get WCHAR_MIN, WCHAR_MAX. */
4287 +# if ! (defined WCHAR_MIN && defined WCHAR_MAX)
4288 +# include <wchar.h>
4293 +#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
4295 +/* Minimum and maximum values for a integer type under the usual assumption.
4296 + Return an unspecified value if BITS == 0, adding a check to pacify
4297 + picky compilers. */
4299 +#define _STDINT_MIN(signed, bits, zero) \
4300 + ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
4302 +#define _STDINT_MAX(signed, bits, zero) \
4304 + ? ~ _STDINT_MIN (signed, bits, zero) \
4305 + : /* The expression for the unsigned case. The subtraction of (signed) \
4306 + is a nop in the unsigned case and avoids "signed integer overflow" \
4307 + warnings in the signed case. */ \
4308 + ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
4310 +/* 7.18.1.1. Exact-width integer types */
4312 +/* Here we assume a standard architecture where the hardware integer
4313 + types have 8, 16, 32, optionally 64 bits. */
4317 +#define int8_t signed char
4318 +#define uint8_t unsigned char
4322 +#define int16_t short int
4323 +#define uint16_t unsigned short int
4327 +#define int32_t int
4328 +#define uint32_t unsigned int
4330 +/* Do not undefine int64_t if gnulib is not being used with 64-bit
4331 + types, since otherwise it breaks platforms like Tandem/NSK. */
4332 +#if LONG_MAX >> 31 >> 31 == 1
4334 +# define int64_t long int
4335 +# define GL_INT64_T
4336 +#elif defined _MSC_VER
4338 +# define int64_t __int64
4339 +# define GL_INT64_T
4340 +#elif @HAVE_LONG_LONG_INT@
4342 +# define int64_t long long int
4343 +# define GL_INT64_T
4346 +#if ULONG_MAX >> 31 >> 31 >> 1 == 1
4348 +# define uint64_t unsigned long int
4349 +# define GL_UINT64_T
4350 +#elif defined _MSC_VER
4352 +# define uint64_t unsigned __int64
4353 +# define GL_UINT64_T
4354 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@
4356 +# define uint64_t unsigned long long int
4357 +# define GL_UINT64_T
4360 +/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
4366 +/* 7.18.1.2. Minimum-width integer types */
4368 +/* Here we assume a standard architecture where the hardware integer
4369 + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
4370 + are the same as the corresponding N_t types. */
4372 +#undef int_least8_t
4373 +#undef uint_least8_t
4374 +#undef int_least16_t
4375 +#undef uint_least16_t
4376 +#undef int_least32_t
4377 +#undef uint_least32_t
4378 +#undef int_least64_t
4379 +#undef uint_least64_t
4380 +#define int_least8_t int8_t
4381 +#define uint_least8_t uint8_t
4382 +#define int_least16_t int16_t
4383 +#define uint_least16_t uint16_t
4384 +#define int_least32_t int32_t
4385 +#define uint_least32_t uint32_t
4387 +# define int_least64_t int64_t
4390 +# define uint_least64_t uint64_t
4393 +/* 7.18.1.3. Fastest minimum-width integer types */
4395 +/* Note: Other <stdint.h> substitutes may define these types differently.
4396 + It is not recommended to use these types in public header files. */
4398 +/* Here we assume a standard architecture where the hardware integer
4399 + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
4400 + are taken from the same list of types. Assume that 'long int'
4401 + is fast enough for all narrower integers. */
4404 +#undef uint_fast8_t
4405 +#undef int_fast16_t
4406 +#undef uint_fast16_t
4407 +#undef int_fast32_t
4408 +#undef uint_fast32_t
4409 +#undef int_fast64_t
4410 +#undef uint_fast64_t
4411 +#define int_fast8_t long int
4412 +#define uint_fast8_t unsigned int_fast8_t
4413 +#define int_fast16_t long int
4414 +#define uint_fast16_t unsigned int_fast16_t
4415 +#define int_fast32_t long int
4416 +#define uint_fast32_t unsigned int_fast32_t
4418 +# define int_fast64_t int64_t
4421 +# define uint_fast64_t uint64_t
4424 +/* 7.18.1.4. Integer types capable of holding object pointers */
4428 +#define intptr_t long int
4429 +#define uintptr_t unsigned long int
4431 +/* 7.18.1.5. Greatest-width integer types */
4433 +/* Note: These types are compiler dependent. It may be unwise to use them in
4434 + public header files. */
4437 +#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
4438 +# define intmax_t long long int
4439 +#elif defined GL_INT64_T
4440 +# define intmax_t int64_t
4442 +# define intmax_t long int
4446 +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
4447 +# define uintmax_t unsigned long long int
4448 +#elif defined GL_UINT64_T
4449 +# define uintmax_t uint64_t
4451 +# define uintmax_t unsigned long int
4454 +/* Verify that intmax_t and uintmax_t have the same size. Too much code
4455 + breaks if this is not the case. If this check fails, the reason is likely
4456 + to be found in the autoconf macros. */
4457 +typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1];
4459 +/* 7.18.2. Limits of specified-width integer types */
4461 +#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
4463 +/* 7.18.2.1. Limits of exact-width integer types */
4465 +/* Here we assume a standard architecture where the hardware integer
4466 + types have 8, 16, 32, optionally 64 bits. */
4471 +#define INT8_MIN (~ INT8_MAX)
4472 +#define INT8_MAX 127
4473 +#define UINT8_MAX 255
4478 +#define INT16_MIN (~ INT16_MAX)
4479 +#define INT16_MAX 32767
4480 +#define UINT16_MAX 65535
4485 +#define INT32_MIN (~ INT32_MAX)
4486 +#define INT32_MAX 2147483647
4487 +#define UINT32_MAX 4294967295U
4492 +/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
4493 + evaluates the latter incorrectly in preprocessor expressions. */
4494 +# define INT64_MIN (- INTMAX_C (1) << 63)
4495 +# define INT64_MAX INTMAX_C (9223372036854775807)
4500 +# define UINT64_MAX UINTMAX_C (18446744073709551615)
4503 +/* 7.18.2.2. Limits of minimum-width integer types */
4505 +/* Here we assume a standard architecture where the hardware integer
4506 + types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
4507 + are the same as the corresponding N_t types. */
4509 +#undef INT_LEAST8_MIN
4510 +#undef INT_LEAST8_MAX
4511 +#undef UINT_LEAST8_MAX
4512 +#define INT_LEAST8_MIN INT8_MIN
4513 +#define INT_LEAST8_MAX INT8_MAX
4514 +#define UINT_LEAST8_MAX UINT8_MAX
4516 +#undef INT_LEAST16_MIN
4517 +#undef INT_LEAST16_MAX
4518 +#undef UINT_LEAST16_MAX
4519 +#define INT_LEAST16_MIN INT16_MIN
4520 +#define INT_LEAST16_MAX INT16_MAX
4521 +#define UINT_LEAST16_MAX UINT16_MAX
4523 +#undef INT_LEAST32_MIN
4524 +#undef INT_LEAST32_MAX
4525 +#undef UINT_LEAST32_MAX
4526 +#define INT_LEAST32_MIN INT32_MIN
4527 +#define INT_LEAST32_MAX INT32_MAX
4528 +#define UINT_LEAST32_MAX UINT32_MAX
4530 +#undef INT_LEAST64_MIN
4531 +#undef INT_LEAST64_MAX
4533 +# define INT_LEAST64_MIN INT64_MIN
4534 +# define INT_LEAST64_MAX INT64_MAX
4537 +#undef UINT_LEAST64_MAX
4539 +# define UINT_LEAST64_MAX UINT64_MAX
4542 +/* 7.18.2.3. Limits of fastest minimum-width integer types */
4544 +/* Here we assume a standard architecture where the hardware integer
4545 + types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
4546 + are taken from the same list of types. */
4548 +#undef INT_FAST8_MIN
4549 +#undef INT_FAST8_MAX
4550 +#undef UINT_FAST8_MAX
4551 +#define INT_FAST8_MIN LONG_MIN
4552 +#define INT_FAST8_MAX LONG_MAX
4553 +#define UINT_FAST8_MAX ULONG_MAX
4555 +#undef INT_FAST16_MIN
4556 +#undef INT_FAST16_MAX
4557 +#undef UINT_FAST16_MAX
4558 +#define INT_FAST16_MIN LONG_MIN
4559 +#define INT_FAST16_MAX LONG_MAX
4560 +#define UINT_FAST16_MAX ULONG_MAX
4562 +#undef INT_FAST32_MIN
4563 +#undef INT_FAST32_MAX
4564 +#undef UINT_FAST32_MAX
4565 +#define INT_FAST32_MIN LONG_MIN
4566 +#define INT_FAST32_MAX LONG_MAX
4567 +#define UINT_FAST32_MAX ULONG_MAX
4569 +#undef INT_FAST64_MIN
4570 +#undef INT_FAST64_MAX
4572 +# define INT_FAST64_MIN INT64_MIN
4573 +# define INT_FAST64_MAX INT64_MAX
4576 +#undef UINT_FAST64_MAX
4578 +# define UINT_FAST64_MAX UINT64_MAX
4581 +/* 7.18.2.4. Limits of integer types capable of holding object pointers */
4586 +#define INTPTR_MIN LONG_MIN
4587 +#define INTPTR_MAX LONG_MAX
4588 +#define UINTPTR_MAX ULONG_MAX
4590 +/* 7.18.2.5. Limits of greatest-width integer types */
4595 +# define INTMAX_MIN INT64_MIN
4596 +# define INTMAX_MAX INT64_MAX
4598 +# define INTMAX_MIN INT32_MIN
4599 +# define INTMAX_MAX INT32_MAX
4604 +# define UINTMAX_MAX UINT64_MAX
4606 +# define UINTMAX_MAX UINT32_MAX
4609 +/* 7.18.3. Limits of other integer types */
4611 +/* ptrdiff_t limits */
4614 +#define PTRDIFF_MIN \
4615 + _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
4616 +#define PTRDIFF_MAX \
4617 + _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
4619 +/* sig_atomic_t limits */
4620 +#undef SIG_ATOMIC_MIN
4621 +#undef SIG_ATOMIC_MAX
4622 +#define SIG_ATOMIC_MIN \
4623 + _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
4624 + 0@SIG_ATOMIC_T_SUFFIX@)
4625 +#define SIG_ATOMIC_MAX \
4626 + _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
4627 + 0@SIG_ATOMIC_T_SUFFIX@)
4632 +#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
4634 +/* wchar_t limits */
4637 +#define WCHAR_MIN \
4638 + _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
4639 +#define WCHAR_MAX \
4640 + _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
4642 +/* wint_t limits */
4646 + _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
4648 + _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
4650 +#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
4652 +/* 7.18.4. Macros for integer constants */
4654 +#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
4656 +/* 7.18.4.1. Macros for minimum-width integer constants */
4657 +/* According to ISO C 99 Technical Corrigendum 1 */
4659 +/* Here we assume a standard architecture where the hardware integer
4660 + types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
4664 +#define INT8_C(x) x
4665 +#define UINT8_C(x) x
4669 +#define INT16_C(x) x
4670 +#define UINT16_C(x) x
4674 +#define INT32_C(x) x
4675 +#define UINT32_C(x) x ## U
4679 +#if LONG_MAX >> 31 >> 31 == 1
4680 +# define INT64_C(x) x##L
4681 +#elif defined _MSC_VER
4682 +# define INT64_C(x) x##i64
4683 +#elif @HAVE_LONG_LONG_INT@
4684 +# define INT64_C(x) x##LL
4686 +#if ULONG_MAX >> 31 >> 31 >> 1 == 1
4687 +# define UINT64_C(x) x##UL
4688 +#elif defined _MSC_VER
4689 +# define UINT64_C(x) x##ui64
4690 +#elif @HAVE_UNSIGNED_LONG_LONG_INT@
4691 +# define UINT64_C(x) x##ULL
4694 +/* 7.18.4.2. Macros for greatest-width integer constants */
4697 +#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
4698 +# define INTMAX_C(x) x##LL
4699 +#elif defined GL_INT64_T
4700 +# define INTMAX_C(x) INT64_C(x)
4702 +# define INTMAX_C(x) x##L
4706 +#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
4707 +# define UINTMAX_C(x) x##ULL
4708 +#elif defined GL_UINT64_T
4709 +# define UINTMAX_C(x) UINT64_C(x)
4711 +# define UINTMAX_C(x) x##UL
4714 +#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
4716 +#endif /* _GL_STDINT_H */
4717 +#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
4718 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/stdio.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/stdio.in.h
4719 --- gtk-vnc-0.3.7.mingw/gnulib/lib/stdio.in.h 1970-01-01 01:00:00.000000000 +0100
4720 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdio.in.h 2008-10-09 12:24:39.000000000 +0100
4722 +/* A GNU-like <stdio.h>.
4724 + Copyright (C) 2004, 2007-2008 Free Software Foundation, Inc.
4726 + This program is free software; you can redistribute it and/or modify
4727 + it under the terms of the GNU Lesser General Public License as published by
4728 + the Free Software Foundation; either version 2.1, or (at your option)
4729 + any later version.
4731 + This program is distributed in the hope that it will be useful,
4732 + but WITHOUT ANY WARRANTY; without even the implied warranty of
4733 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4734 + GNU Lesser General Public License for more details.
4736 + You should have received a copy of the GNU Lesser General Public License
4737 + along with this program; if not, write to the Free Software Foundation,
4738 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
4740 +@PRAGMA_SYSTEM_HEADER@
4742 +#if defined __need_FILE || defined __need___FILE
4743 +/* Special invocation convention inside glibc header files. */
4745 +#@INCLUDE_NEXT@ @NEXT_STDIO_H@
4748 +/* Normal invocation convention. */
4750 +#ifndef _GL_STDIO_H
4752 +/* The include_next requires a split double-inclusion guard. */
4753 +#@INCLUDE_NEXT@ @NEXT_STDIO_H@
4755 +#ifndef _GL_STDIO_H
4756 +#define _GL_STDIO_H
4758 +#include <stdarg.h>
4759 +#include <stddef.h>
4761 +#if (@GNULIB_FSEEKO@ && @REPLACE_FSEEKO@) \
4762 + || (@GNULIB_FTELLO@ && @REPLACE_FTELLO@) \
4763 + || (@GNULIB_GETDELIM@ && !@HAVE_DECL_GETDELIM@) \
4764 + || (@GNULIB_GETLINE@ && (!@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@))
4765 +/* Get off_t and ssize_t. */
4766 +# include <sys/types.h>
4769 +#ifndef __attribute__
4770 +/* This feature is available in gcc versions 2.5 and later. */
4771 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
4772 +# define __attribute__(Spec) /* empty */
4774 +/* The __-protected variants of `format' and `printf' attributes
4775 + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
4776 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
4777 +# define __format__ format
4778 +# define __printf__ printf
4783 +/* The definition of GL_LINK_WARNING is copied here. */
4791 +#if @GNULIB_FPRINTF_POSIX@
4792 +# if @REPLACE_FPRINTF@
4793 +# define fprintf rpl_fprintf
4794 +extern int fprintf (FILE *fp, const char *format, ...)
4795 + __attribute__ ((__format__ (__printf__, 2, 3)));
4797 +#elif @GNULIB_FPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4798 +# define fprintf rpl_fprintf
4799 +extern int fprintf (FILE *fp, const char *format, ...)
4800 + __attribute__ ((__format__ (__printf__, 2, 3)));
4801 +#elif defined GNULIB_POSIXCHECK
4804 + (GL_LINK_WARNING ("fprintf is not always POSIX compliant - " \
4805 + "use gnulib module fprintf-posix for portable " \
4806 + "POSIX compliance"), \
4810 +#if @GNULIB_VFPRINTF_POSIX@
4811 +# if @REPLACE_VFPRINTF@
4812 +# define vfprintf rpl_vfprintf
4813 +extern int vfprintf (FILE *fp, const char *format, va_list args)
4814 + __attribute__ ((__format__ (__printf__, 2, 0)));
4816 +#elif @GNULIB_VFPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4817 +# define vfprintf rpl_vfprintf
4818 +extern int vfprintf (FILE *fp, const char *format, va_list args)
4819 + __attribute__ ((__format__ (__printf__, 2, 0)));
4820 +#elif defined GNULIB_POSIXCHECK
4822 +# define vfprintf(s,f,a) \
4823 + (GL_LINK_WARNING ("vfprintf is not always POSIX compliant - " \
4824 + "use gnulib module vfprintf-posix for portable " \
4825 + "POSIX compliance"), \
4826 + vfprintf (s, f, a))
4829 +#if @GNULIB_PRINTF_POSIX@
4830 +# if @REPLACE_PRINTF@
4831 +/* Don't break __attribute__((format(printf,M,N))). */
4832 +# define printf __printf__
4833 +extern int printf (const char *format, ...)
4834 + __attribute__ ((__format__ (__printf__, 1, 2)));
4836 +#elif @GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4837 +/* Don't break __attribute__((format(printf,M,N))). */
4838 +# define printf __printf__
4839 +extern int printf (const char *format, ...)
4840 + __attribute__ ((__format__ (__printf__, 1, 2)));
4841 +#elif defined GNULIB_POSIXCHECK
4844 + (GL_LINK_WARNING ("printf is not always POSIX compliant - " \
4845 + "use gnulib module printf-posix for portable " \
4846 + "POSIX compliance"), \
4848 +/* Don't break __attribute__((format(printf,M,N))). */
4849 +# define format(kind,m,n) format (__##kind##__, m, n)
4850 +# define __format__(kind,m,n) __format__ (__##kind##__, m, n)
4851 +# define ____printf____ __printf__
4852 +# define ____scanf____ __scanf__
4853 +# define ____strftime____ __strftime__
4854 +# define ____strfmon____ __strfmon__
4857 +#if @GNULIB_VPRINTF_POSIX@
4858 +# if @REPLACE_VPRINTF@
4859 +# define vprintf rpl_vprintf
4860 +extern int vprintf (const char *format, va_list args)
4861 + __attribute__ ((__format__ (__printf__, 1, 0)));
4863 +#elif @GNULIB_VPRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
4864 +# define vprintf rpl_vprintf
4865 +extern int vprintf (const char *format, va_list args)
4866 + __attribute__ ((__format__ (__printf__, 1, 0)));
4867 +#elif defined GNULIB_POSIXCHECK
4869 +# define vprintf(f,a) \
4870 + (GL_LINK_WARNING ("vprintf is not always POSIX compliant - " \
4871 + "use gnulib module vprintf-posix for portable " \
4872 + "POSIX compliance"), \
4876 +#if @GNULIB_SNPRINTF@
4877 +# if @REPLACE_SNPRINTF@
4878 +# define snprintf rpl_snprintf
4880 +# if @REPLACE_SNPRINTF@ || !@HAVE_DECL_SNPRINTF@
4881 +extern int snprintf (char *str, size_t size, const char *format, ...)
4882 + __attribute__ ((__format__ (__printf__, 3, 4)));
4884 +#elif defined GNULIB_POSIXCHECK
4886 +# define snprintf \
4887 + (GL_LINK_WARNING ("snprintf is unportable - " \
4888 + "use gnulib module snprintf for portability"), \
4892 +#if @GNULIB_VSNPRINTF@
4893 +# if @REPLACE_VSNPRINTF@
4894 +# define vsnprintf rpl_vsnprintf
4896 +# if @REPLACE_VSNPRINTF@ || !@HAVE_DECL_VSNPRINTF@
4897 +extern int vsnprintf (char *str, size_t size, const char *format, va_list args)
4898 + __attribute__ ((__format__ (__printf__, 3, 0)));
4900 +#elif defined GNULIB_POSIXCHECK
4902 +# define vsnprintf(b,s,f,a) \
4903 + (GL_LINK_WARNING ("vsnprintf is unportable - " \
4904 + "use gnulib module vsnprintf for portability"), \
4905 + vsnprintf (b, s, f, a))
4908 +#if @GNULIB_SPRINTF_POSIX@
4909 +# if @REPLACE_SPRINTF@
4910 +# define sprintf rpl_sprintf
4911 +extern int sprintf (char *str, const char *format, ...)
4912 + __attribute__ ((__format__ (__printf__, 2, 3)));
4914 +#elif defined GNULIB_POSIXCHECK
4917 + (GL_LINK_WARNING ("sprintf is not always POSIX compliant - " \
4918 + "use gnulib module sprintf-posix for portable " \
4919 + "POSIX compliance"), \
4923 +#if @GNULIB_VSPRINTF_POSIX@
4924 +# if @REPLACE_VSPRINTF@
4925 +# define vsprintf rpl_vsprintf
4926 +extern int vsprintf (char *str, const char *format, va_list args)
4927 + __attribute__ ((__format__ (__printf__, 2, 0)));
4929 +#elif defined GNULIB_POSIXCHECK
4931 +# define vsprintf(b,f,a) \
4932 + (GL_LINK_WARNING ("vsprintf is not always POSIX compliant - " \
4933 + "use gnulib module vsprintf-posix for portable " \
4934 + "POSIX compliance"), \
4935 + vsprintf (b, f, a))
4938 +#if @GNULIB_VASPRINTF@
4939 +# if @REPLACE_VASPRINTF@
4940 +# define asprintf rpl_asprintf
4941 +# define vasprintf rpl_vasprintf
4943 +# if @REPLACE_VASPRINTF@ || !@HAVE_VASPRINTF@
4944 + /* Write formatted output to a string dynamically allocated with malloc().
4945 + If the memory allocation succeeds, store the address of the string in
4946 + *RESULT and return the number of resulting bytes, excluding the trailing
4947 + NUL. Upon memory allocation error, or some other error, return -1. */
4948 + extern int asprintf (char **result, const char *format, ...)
4949 + __attribute__ ((__format__ (__printf__, 2, 3)));
4950 + extern int vasprintf (char **result, const char *format, va_list args)
4951 + __attribute__ ((__format__ (__printf__, 2, 0)));
4955 +#if @GNULIB_OBSTACK_PRINTF@
4956 +# if @REPLACE_OBSTACK_PRINTF@
4957 +# define obstack_printf rpl_osbtack_printf
4958 +# define obstack_vprintf rpl_obstack_vprintf
4960 +# if @REPLACE_OBSTACK_PRINTF@ || !@HAVE_DECL_OBSTACK_PRINTF@
4962 + /* Grow an obstack with formatted output. Return the number of
4963 + bytes added to OBS. No trailing nul byte is added, and the
4964 + object should be closed with obstack_finish before use. Upon
4965 + memory allocation error, call obstack_alloc_failed_handler. Upon
4966 + other error, return -1. */
4967 + extern int obstack_printf (struct obstack *obs, const char *format, ...)
4968 + __attribute__ ((__format__ (__printf__, 2, 3)));
4969 + extern int obstack_vprintf (struct obstack *obs, const char *format,
4971 + __attribute__ ((__format__ (__printf__, 2, 0)));
4976 +# if @REPLACE_FOPEN@
4978 +# define fopen rpl_fopen
4979 +extern FILE * fopen (const char *filename, const char *mode);
4981 +#elif defined GNULIB_POSIXCHECK
4983 +# define fopen(f,m) \
4984 + (GL_LINK_WARNING ("fopen on Win32 platforms is not POSIX compatible - " \
4985 + "use gnulib module fopen for portability"), \
4989 +#if @GNULIB_FREOPEN@
4990 +# if @REPLACE_FREOPEN@
4992 +# define freopen rpl_freopen
4993 +extern FILE * freopen (const char *filename, const char *mode, FILE *stream);
4995 +#elif defined GNULIB_POSIXCHECK
4997 +# define freopen(f,m,s) \
4998 + (GL_LINK_WARNING ("freopen on Win32 platforms is not POSIX compatible - " \
4999 + "use gnulib module freopen for portability"), \
5000 + freopen (f, m, s))
5003 +#if @GNULIB_FSEEKO@
5004 +# if @REPLACE_FSEEKO@
5005 +/* Provide fseek, fseeko functions that are aware of a preceding
5006 + fflush(), and which detect pipes. */
5007 +# define fseeko rpl_fseeko
5008 +extern int fseeko (FILE *fp, off_t offset, int whence);
5009 +# define fseek(fp, offset, whence) fseeko (fp, (off_t)(offset), whence)
5011 +#elif defined GNULIB_POSIXCHECK
5013 +# define fseeko(f,o,w) \
5014 + (GL_LINK_WARNING ("fseeko is unportable - " \
5015 + "use gnulib module fseeko for portability"), \
5019 +#if @GNULIB_FSEEK@ && @REPLACE_FSEEK@
5020 +extern int rpl_fseek (FILE *fp, long offset, int whence);
5022 +# if defined GNULIB_POSIXCHECK
5023 +# define fseek(f,o,w) \
5024 + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
5025 + "on 32-bit platforms - " \
5026 + "use fseeko function for handling of large files"), \
5027 + rpl_fseek (f, o, w))
5029 +# define fseek rpl_fseek
5031 +#elif defined GNULIB_POSIXCHECK
5033 +# define fseek(f,o,w) \
5034 + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \
5035 + "on 32-bit platforms - " \
5036 + "use fseeko function for handling of large files"), \
5041 +#if @GNULIB_FTELLO@
5042 +# if @REPLACE_FTELLO@
5043 +# define ftello rpl_ftello
5044 +extern off_t ftello (FILE *fp);
5045 +# define ftell(fp) ftello (fp)
5047 +#elif defined GNULIB_POSIXCHECK
5049 +# define ftello(f) \
5050 + (GL_LINK_WARNING ("ftello is unportable - " \
5051 + "use gnulib module ftello for portability"), \
5055 +#if @GNULIB_FTELL@ && @REPLACE_FTELL@
5056 +extern long rpl_ftell (FILE *fp);
5058 +# if GNULIB_POSIXCHECK
5059 +# define ftell(f) \
5060 + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
5061 + "on 32-bit platforms - " \
5062 + "use ftello function for handling of large files"), \
5065 +# define ftell rpl_ftell
5067 +#elif defined GNULIB_POSIXCHECK
5069 +# define ftell(f) \
5070 + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \
5071 + "on 32-bit platforms - " \
5072 + "use ftello function for handling of large files"), \
5077 +#if @GNULIB_FFLUSH@
5078 +# if @REPLACE_FFLUSH@
5079 +# define fflush rpl_fflush
5080 + /* Flush all pending data on STREAM according to POSIX rules. Both
5081 + output and seekable input streams are supported.
5082 + Note! LOSS OF DATA can occur if fflush is applied on an input stream
5083 + that is _not_seekable_ or on an update stream that is _not_seekable_
5084 + and in which the most recent operation was input. Seekability can
5085 + be tested with lseek(fileno(fp),0,SEEK_CUR). */
5086 + extern int fflush (FILE *gl_stream);
5088 +#elif defined GNULIB_POSIXCHECK
5090 +# define fflush(f) \
5091 + (GL_LINK_WARNING ("fflush is not always POSIX compliant - " \
5092 + "use gnulib module fflush for portable " \
5093 + "POSIX compliance"), \
5097 +#if @GNULIB_FPUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
5099 +# define fputc rpl_fputc
5100 +extern int fputc (int c, FILE *stream);
5103 +#if @GNULIB_PUTC@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
5105 +# define putc rpl_fputc
5106 +extern int putc (int c, FILE *stream);
5109 +#if @GNULIB_PUTCHAR@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
5111 +# define putchar rpl_putchar
5112 +extern int putchar (int c);
5115 +#if @GNULIB_FPUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
5117 +# define fputs rpl_fputs
5118 +extern int fputs (const char *string, FILE *stream);
5121 +#if @GNULIB_PUTS@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
5123 +# define puts rpl_puts
5124 +extern int puts (const char *string);
5127 +#if @GNULIB_FWRITE@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@
5129 +# define fwrite rpl_fwrite
5130 +extern size_t fwrite (const void *ptr, size_t s, size_t n, FILE *stream);
5133 +#if @GNULIB_GETDELIM@
5134 +# if !@HAVE_DECL_GETDELIM@
5135 +/* Read input, up to (and including) the next occurrence of DELIMITER, from
5136 + STREAM, store it in *LINEPTR (and NUL-terminate it).
5137 + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
5138 + bytes of space. It is realloc'd as necessary.
5139 + Return the number of bytes read and stored at *LINEPTR (not including the
5140 + NUL terminator), or -1 on error or EOF. */
5141 +extern ssize_t getdelim (char **lineptr, size_t *linesize, int delimiter,
5144 +#elif defined GNULIB_POSIXCHECK
5146 +# define getdelim(l, s, d, f) \
5147 + (GL_LINK_WARNING ("getdelim is unportable - " \
5148 + "use gnulib module getdelim for portability"), \
5149 + getdelim (l, s, d, f))
5152 +#if @GNULIB_GETLINE@
5153 +# if @REPLACE_GETLINE@
5155 +# define getline rpl_getline
5157 +# if !@HAVE_DECL_GETLINE@ || @REPLACE_GETLINE@
5158 +/* Read a line, up to (and including) the next newline, from STREAM, store it
5159 + in *LINEPTR (and NUL-terminate it).
5160 + *LINEPTR is a pointer returned from malloc (or NULL), pointing to *LINESIZE
5161 + bytes of space. It is realloc'd as necessary.
5162 + Return the number of bytes read and stored at *LINEPTR (not including the
5163 + NUL terminator), or -1 on error or EOF. */
5164 +extern ssize_t getline (char **lineptr, size_t *linesize, FILE *stream);
5166 +#elif defined GNULIB_POSIXCHECK
5168 +# define getline(l, s, f) \
5169 + (GL_LINK_WARNING ("getline is unportable - " \
5170 + "use gnulib module getline for portability"), \
5171 + getline (l, s, f))
5174 +#if @GNULIB_PERROR@
5175 +# if @REPLACE_PERROR@
5176 +# define perror rpl_perror
5177 +/* Print a message to standard error, describing the value of ERRNO,
5178 + (if STRING is not NULL and not empty) prefixed with STRING and ": ",
5179 + and terminated with a newline. */
5180 +extern void perror (const char *string);
5182 +#elif defined GNULIB_POSIXCHECK
5184 +# define perror(s) \
5185 + (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
5186 + "use gnulib module perror for portability"), \
5194 +#endif /* _GL_STDIO_H */
5195 +#endif /* _GL_STDIO_H */
5197 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/stdio-write.c gtk-vnc-0.3.7.gnulib/gnulib/lib/stdio-write.c
5198 --- gtk-vnc-0.3.7.mingw/gnulib/lib/stdio-write.c 1970-01-01 01:00:00.000000000 +0100
5199 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/stdio-write.c 2008-10-09 12:24:39.000000000 +0100
5201 +/* POSIX compatible FILE stream write function.
5202 + Copyright (C) 2008 Free Software Foundation, Inc.
5203 + Written by Bruno Haible <bruno@clisp.org>, 2008.
5205 + This program is free software: you can redistribute it and/or modify
5206 + it under the terms of the GNU Lesser General Public License as published by
5207 + the Free Software Foundation; either version 2.1 of the License, or
5208 + (at your option) any later version.
5210 + This program is distributed in the hope that it will be useful,
5211 + but WITHOUT ANY WARRANTY; without even the implied warranty of
5212 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5213 + GNU Lesser General Public License for more details.
5215 + You should have received a copy of the GNU Lesser General Public License
5216 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
5218 +#include <config.h>
5220 +/* Specification. */
5223 +/* Replace these functions only if module 'sigpipe' is requested. */
5226 +/* On native Windows platforms, SIGPIPE does not exist. When write() is
5227 + called on a pipe with no readers, WriteFile() fails with error
5228 + GetLastError() = ERROR_NO_DATA, and write() in consequence fails with
5229 + error EINVAL. This write() function is at the basis of the function
5230 + which flushes the buffer of a FILE stream. */
5232 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
5234 +# include <errno.h>
5235 +# include <signal.h>
5238 +# define WIN32_LEAN_AND_MEAN /* avoid including junk */
5239 +# include <windows.h>
5241 +# define CALL_WITH_SIGPIPE_EMULATION(RETTYPE, EXPRESSION, FAILED) \
5242 + if (ferror (stream)) \
5243 + return (EXPRESSION); \
5247 + SetLastError (0); \
5248 + ret = (EXPRESSION); \
5249 + if (FAILED && GetLastError () == ERROR_NO_DATA && ferror (stream)) \
5251 + int fd = fileno (stream); \
5253 + && GetFileType ((HANDLE) _get_osfhandle (fd)) == FILE_TYPE_PIPE)\
5255 + /* Try to raise signal SIGPIPE. */ \
5256 + raise (SIGPIPE); \
5257 + /* If it is currently blocked or ignored, change errno from \
5258 + EINVAL to EPIPE. */ \
5265 +# if !REPLACE_PRINTF_POSIX /* avoid collision with printf.c */
5267 +printf (const char *format, ...)
5272 + va_start (args, format);
5273 + retval = vfprintf (stdout, format, args);
5280 +# if !REPLACE_FPRINTF_POSIX /* avoid collision with fprintf.c */
5282 +fprintf (FILE *stream, const char *format, ...)
5287 + va_start (args, format);
5288 + retval = vfprintf (stream, format, args);
5295 +# if !REPLACE_VFPRINTF_POSIX /* avoid collision with vprintf.c */
5297 +vprintf (const char *format, va_list args)
5299 + return vfprintf (stdout, format, args);
5303 +# if !REPLACE_VPRINTF_POSIX /* avoid collision with vfprintf.c */
5305 +vfprintf (FILE *stream, const char *format, va_list args)
5308 + CALL_WITH_SIGPIPE_EMULATION (int, vfprintf (stream, format, args), ret == EOF)
5315 + return fputc (c, stdout);
5319 +fputc (int c, FILE *stream)
5322 + CALL_WITH_SIGPIPE_EMULATION (int, fputc (c, stream), ret == EOF)
5326 +fputs (const char *string, FILE *stream)
5329 + CALL_WITH_SIGPIPE_EMULATION (int, fputs (string, stream), ret == EOF)
5333 +puts (const char *string)
5336 + FILE *stream = stdout;
5337 + CALL_WITH_SIGPIPE_EMULATION (int, puts (string), ret == EOF)
5341 +fwrite (const void *ptr, size_t s, size_t n, FILE *stream)
5344 + CALL_WITH_SIGPIPE_EMULATION (size_t, fwrite (ptr, s, n, stream), ret < n)
5349 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/sys_socket.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/sys_socket.in.h
5350 --- gtk-vnc-0.3.7.mingw/gnulib/lib/sys_socket.in.h 1970-01-01 01:00:00.000000000 +0100
5351 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/sys_socket.in.h 2008-10-09 12:24:39.000000000 +0100
5353 +/* Provide a sys/socket header file for systems lacking it (read: MinGW)
5354 + and for systems where it is incomplete.
5355 + Copyright (C) 2005-2008 Free Software Foundation, Inc.
5356 + Written by Simon Josefsson.
5358 + This program is free software; you can redistribute it and/or modify
5359 + it under the terms of the GNU Lesser General Public License as published by
5360 + the Free Software Foundation; either version 2.1, or (at your option)
5361 + any later version.
5363 + This program is distributed in the hope that it will be useful,
5364 + but WITHOUT ANY WARRANTY; without even the implied warranty of
5365 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5366 + GNU Lesser General Public License for more details.
5368 + You should have received a copy of the GNU Lesser General Public License
5369 + along with this program; if not, write to the Free Software Foundation,
5370 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
5372 +/* This file is supposed to be used on platforms that lack <sys/socket.h>,
5373 + on platforms where <sys/socket.h> cannot be included standalone, and on
5374 + platforms where <sys/socket.h> does not provide all necessary definitions.
5375 + It is intended to provide definitions and prototypes needed by an
5378 +#ifndef _GL_SYS_SOCKET_H
5380 +#if @HAVE_SYS_SOCKET_H@
5382 +@PRAGMA_SYSTEM_HEADER@
5384 +/* On many platforms, <sys/socket.h> assumes prior inclusion of
5386 +# include <sys/types.h>
5388 +/* The include_next requires a split double-inclusion guard. */
5389 +# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
5393 +#ifndef _GL_SYS_SOCKET_H
5394 +#define _GL_SYS_SOCKET_H
5396 +#if @HAVE_SYS_SOCKET_H@
5398 +/* A platform that has <sys/socket.h>. */
5400 +/* For shutdown(). */
5401 +# if !defined SHUT_RD
5404 +# if !defined SHUT_WR
5407 +# if !defined SHUT_RDWR
5408 +# define SHUT_RDWR 2
5414 +# error "Cygwin does have a sys/socket.h, doesn't it?!?"
5417 +/* A platform that lacks <sys/socket.h>.
5419 + Currently only MinGW is supported. See the gnulib manual regarding
5420 + Windows sockets. MinGW has the header files winsock2.h and
5421 + ws2tcpip.h that declare the sys/socket.h definitions we need. Note
5422 + that you can influence which definitions you get by setting the
5423 + WINVER symbol before including these two files. For example,
5424 + getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
5425 + symbol is set indiriectly through WINVER). You can set this by
5426 + adding AC_DEFINE(WINVER, 0x0501) to configure.ac. Note that your
5427 + code may not run on older Windows releases then. My Windows 2000
5428 + box was not able to run the code, for example. The situation is
5429 + slightly confusing because:
5430 + http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp
5431 + suggests that getaddrinfo should be available on all Windows
5435 +# if @HAVE_WINSOCK2_H@
5436 +# include <winsock2.h>
5438 +# if @HAVE_WS2TCPIP_H@
5439 +# include <ws2tcpip.h>
5442 +/* For shutdown(). */
5443 +# if !defined SHUT_RD && defined SD_RECEIVE
5444 +# define SHUT_RD SD_RECEIVE
5446 +# if !defined SHUT_WR && defined SD_SEND
5447 +# define SHUT_WR SD_SEND
5449 +# if !defined SHUT_RDWR && defined SD_BOTH
5450 +# define SHUT_RDWR SD_BOTH
5453 +/* The definition of GL_LINK_WARNING is copied here. */
5455 +# if @HAVE_WINSOCK2_H@
5456 +/* Include headers needed by the emulation code. */
5457 +# include <sys/types.h>
5460 +typedef int socklen_t;
5464 +# ifdef __cplusplus
5468 +# if @HAVE_WINSOCK2_H@
5470 +/* Re-define FD_ISSET to avoid a WSA call while we are not using
5471 + network sockets. */
5473 +rpl_fd_isset (int fd, fd_set * set)
5479 + for (i = 0; i < set->fd_count; i++)
5480 + if (set->fd_array[i] == fd)
5487 +# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
5491 +/* Wrap everything else to use libc file descriptors for sockets. */
5493 +# if @HAVE_WINSOCK2_H@
5495 +# define close rpl_close
5496 +extern int rpl_close(int);
5499 +# if @GNULIB_SOCKET@
5500 +# if @HAVE_WINSOCK2_H@
5502 +# define socket rpl_socket
5503 +extern int rpl_socket (int, int, int protocol);
5505 +# elif @HAVE_WINSOCK2_H@
5507 +# define socket socket_used_without_requesting_gnulib_module_socket
5508 +# elif defined GNULIB_POSIXCHECK
5510 +# define socket(d,t,p) \
5511 + (GL_LINK_WARNING ("socket is not always POSIX compliant - " \
5512 + "use gnulib module socket for portability"), \
5516 +# if @GNULIB_CONNECT@
5517 +# if @HAVE_WINSOCK2_H@
5519 +# define connect rpl_connect
5520 +extern int rpl_connect (int, struct sockaddr *, int);
5522 +# elif @HAVE_WINSOCK2_H@
5524 +# define connect socket_used_without_requesting_gnulib_module_connect
5525 +# elif defined GNULIB_POSIXCHECK
5527 +# define connect(s,a,l) \
5528 + (GL_LINK_WARNING ("connect is not always POSIX compliant - " \
5529 + "use gnulib module connect for portability"), \
5530 + connect (s, a, l))
5533 +# if @GNULIB_ACCEPT@
5534 +# if @HAVE_WINSOCK2_H@
5536 +# define accept rpl_accept
5537 +extern int rpl_accept (int, struct sockaddr *, int *);
5539 +# elif @HAVE_WINSOCK2_H@
5541 +# define accept accept_used_without_requesting_gnulib_module_accept
5542 +# elif defined GNULIB_POSIXCHECK
5544 +# define accept(s,a,l) \
5545 + (GL_LINK_WARNING ("accept is not always POSIX compliant - " \
5546 + "use gnulib module accept for portability"), \
5551 +# if @HAVE_WINSOCK2_H@
5553 +# define bind rpl_bind
5554 +extern int rpl_bind (int, struct sockaddr *, int);
5556 +# elif @HAVE_WINSOCK2_H@
5558 +# define bind bind_used_without_requesting_gnulib_module_bind
5559 +# elif defined GNULIB_POSIXCHECK
5561 +# define bind(s,a,l) \
5562 + (GL_LINK_WARNING ("bind is not always POSIX compliant - " \
5563 + "use gnulib module bind for portability"), \
5567 +# if @GNULIB_GETPEERNAME@
5568 +# if @HAVE_WINSOCK2_H@
5569 +# undef getpeername
5570 +# define getpeername rpl_getpeername
5571 +extern int rpl_getpeername (int, struct sockaddr *, int *);
5573 +# elif @HAVE_WINSOCK2_H@
5574 +# undef getpeername
5575 +# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
5576 +# elif defined GNULIB_POSIXCHECK
5577 +# undef getpeername
5578 +# define getpeername(s,a,l) \
5579 + (GL_LINK_WARNING ("getpeername is not always POSIX compliant - " \
5580 + "use gnulib module getpeername for portability"), \
5581 + getpeername (s, a, l))
5584 +# if @GNULIB_GETSOCKNAME@
5585 +# if @HAVE_WINSOCK2_H@
5586 +# undef getsockname
5587 +# define getsockname rpl_getsockname
5588 +extern int rpl_getsockname (int, struct sockaddr *, int *);
5590 +# elif @HAVE_WINSOCK2_H@
5591 +# undef getsockname
5592 +# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
5593 +# elif defined GNULIB_POSIXCHECK
5594 +# undef getsockname
5595 +# define getsockname(s,a,l) \
5596 + (GL_LINK_WARNING ("getsockname is not always POSIX compliant - " \
5597 + "use gnulib module getsockname for portability"), \
5598 + getsockname (s, a, l))
5601 +# if @GNULIB_GETSOCKOPT@
5602 +# if @HAVE_WINSOCK2_H@
5604 +# define getsockopt rpl_getsockopt
5605 +extern int rpl_getsockopt (int, int, int, void *, int *);
5607 +# elif @HAVE_WINSOCK2_H@
5609 +# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
5610 +# elif defined GNULIB_POSIXCHECK
5612 +# define getsockopt(s,lvl,o,v,l) \
5613 + (GL_LINK_WARNING ("getsockopt is not always POSIX compliant - " \
5614 + "use gnulib module getsockopt for portability"), \
5615 + getsockopt (s, lvl, o, v, l))
5618 +# if @GNULIB_LISTEN@
5619 +# if @HAVE_WINSOCK2_H@
5621 +# define listen rpl_listen
5622 +extern int rpl_listen (int, int);
5624 +# elif @HAVE_WINSOCK2_H@
5626 +# define listen listen_used_without_requesting_gnulib_module_listen
5627 +# elif defined GNULIB_POSIXCHECK
5629 +# define listen(s,b) \
5630 + (GL_LINK_WARNING ("listen is not always POSIX compliant - " \
5631 + "use gnulib module listen for portability"), \
5635 +# if @HAVE_WINSOCK2_H@
5637 +# define ioctl rpl_ioctl
5638 +extern int rpl_ioctl (int, unsigned long, char *);
5642 +# if @HAVE_WINSOCK2_H@
5644 +# define recv rpl_recv
5645 +extern int rpl_recv (int, void *, int, int);
5647 +# elif @HAVE_WINSOCK2_H@
5649 +# define recv recv_used_without_requesting_gnulib_module_recv
5650 +# elif defined GNULIB_POSIXCHECK
5652 +# define recv(s,b,n,f) \
5653 + (GL_LINK_WARNING ("recv is not always POSIX compliant - " \
5654 + "use gnulib module recv for portability"), \
5655 + recv (s, b, n, f))
5659 +# if @HAVE_WINSOCK2_H@
5661 +# define send rpl_send
5662 +extern int rpl_send (int, const void *, int, int);
5664 +# elif @HAVE_WINSOCK2_H@
5666 +# define send send_used_without_requesting_gnulib_module_send
5667 +# elif defined GNULIB_POSIXCHECK
5669 +# define send(s,b,n,f) \
5670 + (GL_LINK_WARNING ("send is not always POSIX compliant - " \
5671 + "use gnulib module send for portability"), \
5672 + send (s, b, n, f))
5675 +# if @GNULIB_RECVFROM@
5676 +# if @HAVE_WINSOCK2_H@
5678 +# define recvfrom rpl_recvfrom
5679 +extern int rpl_recvfrom (int, void *, int, int, struct sockaddr *, int *);
5681 +# elif @HAVE_WINSOCK2_H@
5683 +# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
5684 +# elif defined GNULIB_POSIXCHECK
5686 +# define recvfrom(s,b,n,f,a,l) \
5687 + (GL_LINK_WARNING ("recvfrom is not always POSIX compliant - " \
5688 + "use gnulib module recvfrom for portability"), \
5689 + recvfrom (s, b, n, f, a, l))
5692 +# if @GNULIB_SENDTO@
5693 +# if @HAVE_WINSOCK2_H@
5695 +# define sendto rpl_sendto
5696 +extern int rpl_sendto (int, const void *, int, int, struct sockaddr *, int);
5698 +# elif @HAVE_WINSOCK2_H@
5700 +# define sendto sendto_used_without_requesting_gnulib_module_sendto
5701 +# elif defined GNULIB_POSIXCHECK
5703 +# define sendto(s,b,n,f,a,l) \
5704 + (GL_LINK_WARNING ("sendto is not always POSIX compliant - " \
5705 + "use gnulib module sendto for portability"), \
5706 + sendto (s, b, n, f, a, l))
5709 +# if @GNULIB_SETSOCKOPT@
5710 +# if @HAVE_WINSOCK2_H@
5712 +# define setsockopt rpl_setsockopt
5713 +extern int rpl_setsockopt (int, int, int, const void *, int);
5715 +# elif @HAVE_WINSOCK2_H@
5717 +# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
5718 +# elif defined GNULIB_POSIXCHECK
5720 +# define setsockopt(s,lvl,o,v,l) \
5721 + (GL_LINK_WARNING ("setsockopt is not always POSIX compliant - " \
5722 + "use gnulib module setsockopt for portability"), \
5723 + setsockopt (s, lvl, o, v, l))
5726 +# if @HAVE_WINSOCK2_H@
5728 +# define select select_used_without_including_sys_select_h
5731 +# ifdef __cplusplus
5735 +#endif /* HAVE_SYS_SOCKET_H */
5737 +#endif /* _GL_SYS_SOCKET_H */
5738 +#endif /* _GL_SYS_SOCKET_H */
5739 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/vasnprintf.c gtk-vnc-0.3.7.gnulib/gnulib/lib/vasnprintf.c
5740 --- gtk-vnc-0.3.7.mingw/gnulib/lib/vasnprintf.c 1970-01-01 01:00:00.000000000 +0100
5741 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/vasnprintf.c 2008-10-09 12:24:39.000000000 +0100
5743 +/* vsprintf with automatic memory allocation.
5744 + Copyright (C) 1999, 2002-2008 Free Software Foundation, Inc.
5746 + This program is free software; you can redistribute it and/or modify
5747 + it under the terms of the GNU Lesser General Public License as published by
5748 + the Free Software Foundation; either version 2.1, or (at your option)
5749 + any later version.
5751 + This program is distributed in the hope that it will be useful,
5752 + but WITHOUT ANY WARRANTY; without even the implied warranty of
5753 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5754 + GNU Lesser General Public License for more details.
5756 + You should have received a copy of the GNU Lesser General Public License along
5757 + with this program; if not, write to the Free Software Foundation,
5758 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
5760 +/* This file can be parametrized with the following macros:
5761 + VASNPRINTF The name of the function being defined.
5762 + FCHAR_T The element type of the format string.
5763 + DCHAR_T The element type of the destination (result) string.
5764 + FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
5765 + in the format string are ASCII. MUST be set if
5766 + FCHAR_T and DCHAR_T are not the same type.
5767 + DIRECTIVE Structure denoting a format directive.
5768 + Depends on FCHAR_T.
5769 + DIRECTIVES Structure denoting the set of format directives of a
5770 + format string. Depends on FCHAR_T.
5771 + PRINTF_PARSE Function that parses a format string.
5772 + Depends on FCHAR_T.
5773 + DCHAR_CPY memcpy like function for DCHAR_T[] arrays.
5774 + DCHAR_SET memset like function for DCHAR_T[] arrays.
5775 + DCHAR_MBSNLEN mbsnlen like function for DCHAR_T[] arrays.
5776 + SNPRINTF The system's snprintf (or similar) function.
5777 + This may be either snprintf or swprintf.
5778 + TCHAR_T The element type of the argument and result string
5779 + of the said SNPRINTF function. This may be either
5780 + char or wchar_t. The code exploits that
5781 + sizeof (TCHAR_T) | sizeof (DCHAR_T) and
5782 + alignof (TCHAR_T) <= alignof (DCHAR_T).
5783 + DCHAR_IS_TCHAR Set to 1 if DCHAR_T and TCHAR_T are the same type.
5784 + DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[].
5785 + DCHAR_IS_UINT8_T Set to 1 if DCHAR_T is uint8_t.
5786 + DCHAR_IS_UINT16_T Set to 1 if DCHAR_T is uint16_t.
5787 + DCHAR_IS_UINT32_T Set to 1 if DCHAR_T is uint32_t. */
5789 +/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
5790 + This must come before <config.h> because <config.h> may include
5791 + <features.h>, and once <features.h> has been included, it's too late. */
5792 +#ifndef _GNU_SOURCE
5793 +# define _GNU_SOURCE 1
5797 +# include <config.h>
5800 +# include <alloca.h>
5803 +/* Specification. */
5805 +# if WIDE_CHAR_VERSION
5806 +# include "vasnwprintf.h"
5808 +# include "vasnprintf.h"
5812 +#include <locale.h> /* localeconv() */
5813 +#include <stdio.h> /* snprintf(), sprintf() */
5814 +#include <stdlib.h> /* abort(), malloc(), realloc(), free() */
5815 +#include <string.h> /* memcpy(), strlen() */
5816 +#include <errno.h> /* errno */
5817 +#include <limits.h> /* CHAR_BIT */
5818 +#include <float.h> /* DBL_MAX_EXP, LDBL_MAX_EXP */
5819 +#if HAVE_NL_LANGINFO
5820 +# include <langinfo.h>
5823 +# if WIDE_CHAR_VERSION
5824 +# include "wprintf-parse.h"
5826 +# include "printf-parse.h"
5830 +/* Checked size_t computations. */
5833 +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
5835 +# include "float+.h"
5838 +#if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
5840 +# include "isnand-nolibm.h"
5843 +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE) && !defined IN_LIBINTL
5845 +# include "isnanl-nolibm.h"
5846 +# include "fpucw.h"
5849 +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
5851 +# include "isnand-nolibm.h"
5852 +# include "printf-frexp.h"
5855 +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
5857 +# include "isnanl-nolibm.h"
5858 +# include "printf-frexpl.h"
5859 +# include "fpucw.h"
5864 +# define local_wcslen wcslen
5866 + /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
5867 + a dependency towards this library, here is a local substitute.
5868 + Define this substitute only once, even if this file is included
5869 + twice in the same compilation unit. */
5870 +# ifndef local_wcslen_defined
5871 +# define local_wcslen_defined 1
5873 +local_wcslen (const wchar_t *s)
5875 + const wchar_t *ptr;
5877 + for (ptr = s; *ptr != (wchar_t) 0; ptr++)
5885 +/* Default parameters. */
5887 +# if WIDE_CHAR_VERSION
5888 +# define VASNPRINTF vasnwprintf
5889 +# define FCHAR_T wchar_t
5890 +# define DCHAR_T wchar_t
5891 +# define TCHAR_T wchar_t
5892 +# define DCHAR_IS_TCHAR 1
5893 +# define DIRECTIVE wchar_t_directive
5894 +# define DIRECTIVES wchar_t_directives
5895 +# define PRINTF_PARSE wprintf_parse
5896 +# define DCHAR_CPY wmemcpy
5898 +# define VASNPRINTF vasnprintf
5899 +# define FCHAR_T char
5900 +# define DCHAR_T char
5901 +# define TCHAR_T char
5902 +# define DCHAR_IS_TCHAR 1
5903 +# define DIRECTIVE char_directive
5904 +# define DIRECTIVES char_directives
5905 +# define PRINTF_PARSE printf_parse
5906 +# define DCHAR_CPY memcpy
5909 +#if WIDE_CHAR_VERSION
5910 + /* TCHAR_T is wchar_t. */
5911 +# define USE_SNPRINTF 1
5912 +# if HAVE_DECL__SNWPRINTF
5913 + /* On Windows, the function swprintf() has a different signature than
5914 + on Unix; we use the _snwprintf() function instead. */
5915 +# define SNPRINTF _snwprintf
5918 +# define SNPRINTF swprintf
5921 + /* TCHAR_T is char. */
5922 + /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
5923 + But don't use it on BeOS, since BeOS snprintf produces no output if the
5924 + size argument is >= 0x3000000.
5925 + Also don't use it on Linux libc5, since there snprintf with size = 1
5926 + writes any output without bounds, like sprintf. */
5927 +# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__ && !(__GNU_LIBRARY__ == 1)
5928 +# define USE_SNPRINTF 1
5930 +# define USE_SNPRINTF 0
5932 +# if HAVE_DECL__SNPRINTF
5934 +# define SNPRINTF _snprintf
5937 +# define SNPRINTF snprintf
5938 + /* Here we need to call the native snprintf, not rpl_snprintf. */
5942 +/* Here we need to call the native sprintf, not rpl_sprintf. */
5945 +/* GCC >= 4.0 with -Wall emits unjustified "... may be used uninitialized"
5946 + warnings in this file. Use -Dlint to suppress them. */
5948 +# define IF_LINT(Code) Code
5950 +# define IF_LINT(Code) /* empty */
5953 +/* Avoid some warnings from "gcc -Wshadow".
5954 + This file doesn't use the exp() and remainder() functions. */
5958 +#define remainder rem
5960 +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
5961 +/* Determine the decimal-point character according to the current locale. */
5962 +# ifndef decimal_point_char_defined
5963 +# define decimal_point_char_defined 1
5965 +decimal_point_char ()
5967 + const char *point;
5968 + /* Determine it in a multithread-safe way. We know nl_langinfo is
5969 + multithread-safe on glibc systems, but is not required to be multithread-
5970 + safe by POSIX. sprintf(), however, is multithread-safe. localeconv()
5971 + is rarely multithread-safe. */
5972 +# if HAVE_NL_LANGINFO && __GLIBC__
5973 + point = nl_langinfo (RADIXCHAR);
5976 + sprintf (pointbuf, "%#.0f", 1.0);
5977 + point = &pointbuf[1];
5979 + point = localeconv () -> decimal_point;
5981 + /* The decimal point is always a single byte: either '.' or ','. */
5982 + return (point[0] != '\0' ? point[0] : '.');
5987 +#if NEED_PRINTF_INFINITE_DOUBLE && !NEED_PRINTF_DOUBLE && !defined IN_LIBINTL
5989 +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
5991 +is_infinite_or_zero (double x)
5993 + return isnand (x) || x + x == x;
5998 +#if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
6000 +/* Equivalent to !isfinite(x) || x == 0, but does not require libm. */
6002 +is_infinite_or_zerol (long double x)
6004 + return isnanl (x) || x + x == x;
6009 +#if (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
6011 +/* Converting 'long double' to decimal without rare rounding bugs requires
6012 + real bignums. We use the naming conventions of GNU gmp, but vastly simpler
6013 + (and slower) algorithms. */
6015 +typedef unsigned int mp_limb_t;
6016 +# define GMP_LIMB_BITS 32
6017 +typedef int mp_limb_verify[2 * (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS) - 1];
6019 +typedef unsigned long long mp_twolimb_t;
6020 +# define GMP_TWOLIMB_BITS 64
6021 +typedef int mp_twolimb_verify[2 * (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS) - 1];
6023 +/* Representation of a bignum >= 0. */
6027 + mp_limb_t *limbs; /* Bits in little-endian order, allocated with malloc(). */
6030 +/* Compute the product of two bignums >= 0.
6031 + Return the allocated memory in case of success, NULL in case of memory
6032 + allocation failure. */
6034 +multiply (mpn_t src1, mpn_t src2, mpn_t *dest)
6036 + const mp_limb_t *p1;
6037 + const mp_limb_t *p2;
6041 + if (src1.nlimbs <= src2.nlimbs)
6043 + len1 = src1.nlimbs;
6045 + len2 = src2.nlimbs;
6050 + len1 = src2.nlimbs;
6052 + len2 = src1.nlimbs;
6055 + /* Now 0 <= len1 <= len2. */
6058 + /* src1 or src2 is zero. */
6060 + dest->limbs = (mp_limb_t *) malloc (1);
6064 + /* Here 1 <= len1 <= len2. */
6069 + dlen = len1 + len2;
6070 + dp = (mp_limb_t *) malloc (dlen * sizeof (mp_limb_t));
6073 + for (k = len2; k > 0; )
6075 + for (i = 0; i < len1; i++)
6077 + mp_limb_t digit1 = p1[i];
6078 + mp_twolimb_t carry = 0;
6079 + for (j = 0; j < len2; j++)
6081 + mp_limb_t digit2 = p2[j];
6082 + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
6083 + carry += dp[i + j];
6084 + dp[i + j] = (mp_limb_t) carry;
6085 + carry = carry >> GMP_LIMB_BITS;
6087 + dp[i + len2] = (mp_limb_t) carry;
6090 + while (dlen > 0 && dp[dlen - 1] == 0)
6092 + dest->nlimbs = dlen;
6095 + return dest->limbs;
6098 +/* Compute the quotient of a bignum a >= 0 and a bignum b > 0.
6099 + a is written as a = q * b + r with 0 <= r < b. q is the quotient, r
6101 + Finally, round-to-even is performed: If r > b/2 or if r = b/2 and q is odd,
6103 + Return the allocated memory in case of success, NULL in case of memory
6104 + allocation failure. */
6106 +divide (mpn_t a, mpn_t b, mpn_t *q)
6109 + First normalise a and b: a=[a[m-1],...,a[0]], b=[b[n-1],...,b[0]]
6110 + with m>=0 and n>0 (in base beta = 2^GMP_LIMB_BITS).
6111 + If m<n, then q:=0 and r:=a.
6112 + If m>=n=1, perform a single-precision division:
6115 + {Here (q[m-1]*beta^(m-1)+...+q[j]*beta^j) * b[0] + r*beta^j =
6116 + = a[m-1]*beta^(m-1)+...+a[j]*beta^j und 0<=r<b[0]<beta}
6117 + j:=j-1, r:=r*beta+a[j], q[j]:=floor(r/b[0]), r:=r-b[0]*q[j].
6118 + Normalise [q[m-1],...,q[0]], yields q.
6119 + If m>=n>1, perform a multiple-precision division:
6120 + We have a/b < beta^(m-n+1).
6121 + s:=intDsize-1-(hightest bit in b[n-1]), 0<=s<intDsize.
6122 + Shift a and b left by s bits, copying them. r:=a.
6123 + r=[r[m],...,r[0]], b=[b[n-1],...,b[0]] with b[n-1]>=beta/2.
6124 + For j=m-n,...,0: {Here 0 <= r < b*beta^(j+1).}
6126 + q* := floor((r[j+n]*beta+r[j+n-1])/b[n-1]).
6127 + In case of overflow (q* >= beta) set q* := beta-1.
6128 + Compute c2 := ((r[j+n]*beta+r[j+n-1]) - q* * b[n-1])*beta + r[j+n-2]
6129 + and c3 := b[n-2] * q*.
6130 + {We have 0 <= c2 < 2*beta^2, even 0 <= c2 < beta^2 if no overflow
6131 + occurred. Furthermore 0 <= c3 < beta^2.
6132 + If there was overflow and
6133 + r[j+n]*beta+r[j+n-1] - q* * b[n-1] >= beta, i.e. c2 >= beta^2,
6134 + the next test can be skipped.}
6135 + While c3 > c2, {Here 0 <= c2 < c3 < beta^2}
6136 + Put q* := q* - 1, c2 := c2 + b[n-1]*beta, c3 := c3 - b[n-2].
6138 + Put r := r - b * q* * beta^j. In detail:
6139 + [r[n+j],...,r[j]] := [r[n+j],...,r[j]] - q* * [b[n-1],...,b[0]].
6140 + hence: u:=0, for i:=0 to n-1 do
6141 + u := u + q* * b[i],
6142 + r[j+i]:=r[j+i]-(u mod beta) (+ beta, if carry),
6143 + u:=u div beta (+ 1, if carry in subtraction)
6145 + {Since always u = (q* * [b[i-1],...,b[0]] div beta^i) + 1
6147 + the carry u does not overflow.}
6148 + If a negative carry occurs, put q* := q* - 1
6149 + and [r[n+j],...,r[j]] := [r[n+j],...,r[j]] + [0,b[n-1],...,b[0]].
6151 + Normalise [q[m-n],..,q[0]]; this yields the quotient q.
6152 + Shift [r[n-1],...,r[0]] right by s bits and normalise; this yields the
6154 + The room for q[j] can be allocated at the memory location of r[n+j].
6155 + Finally, round-to-even:
6156 + Shift r left by 1 bit.
6157 + If r > b or if r = b and q[0] is odd, q := q+1.
6159 + const mp_limb_t *a_ptr = a.limbs;
6160 + size_t a_len = a.nlimbs;
6161 + const mp_limb_t *b_ptr = b.limbs;
6162 + size_t b_len = b.nlimbs;
6163 + mp_limb_t *roomptr;
6164 + mp_limb_t *tmp_roomptr = NULL;
6170 + /* Allocate room for a_len+2 digits.
6171 + (Need a_len+1 digits for the real division and 1 more digit for the
6172 + final rounding of q.) */
6173 + roomptr = (mp_limb_t *) malloc ((a_len + 2) * sizeof (mp_limb_t));
6174 + if (roomptr == NULL)
6177 + /* Normalise a. */
6178 + while (a_len > 0 && a_ptr[a_len - 1] == 0)
6181 + /* Normalise b. */
6185 + /* Division by zero. */
6187 + if (b_ptr[b_len - 1] == 0)
6193 + /* Here m = a_len >= 0 and n = b_len > 0. */
6195 + if (a_len < b_len)
6197 + /* m<n: trivial case. q=0, r := copy of a. */
6200 + memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
6201 + q_ptr = roomptr + a_len;
6204 + else if (b_len == 1)
6206 + /* n=1: single precision division.
6207 + beta^(m-1) <= a < beta^m ==> beta^(m-2) <= a/b < beta^m */
6209 + q_ptr = roomptr + 1;
6211 + mp_limb_t den = b_ptr[0];
6212 + mp_limb_t remainder = 0;
6213 + const mp_limb_t *sourceptr = a_ptr + a_len;
6214 + mp_limb_t *destptr = q_ptr + a_len;
6216 + for (count = a_len; count > 0; count--)
6218 + mp_twolimb_t num =
6219 + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--sourceptr;
6220 + *--destptr = num / den;
6221 + remainder = num % den;
6223 + /* Normalise and store r. */
6224 + if (remainder > 0)
6226 + r_ptr[0] = remainder;
6231 + /* Normalise q. */
6233 + if (q_ptr[q_len - 1] == 0)
6239 + /* n>1: multiple precision division.
6240 + beta^(m-1) <= a < beta^m, beta^(n-1) <= b < beta^n ==>
6241 + beta^(m-n-1) <= a/b < beta^(m-n+1). */
6242 + /* Determine s. */
6245 + mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
6247 + if (msd >= 0x10000)
6273 + /* 0 <= s < GMP_LIMB_BITS.
6274 + Copy b, shifting it left by s bits. */
6277 + tmp_roomptr = (mp_limb_t *) malloc (b_len * sizeof (mp_limb_t));
6278 + if (tmp_roomptr == NULL)
6284 + const mp_limb_t *sourceptr = b_ptr;
6285 + mp_limb_t *destptr = tmp_roomptr;
6286 + mp_twolimb_t accu = 0;
6288 + for (count = b_len; count > 0; count--)
6290 + accu += (mp_twolimb_t) *sourceptr++ << s;
6291 + *destptr++ = (mp_limb_t) accu;
6292 + accu = accu >> GMP_LIMB_BITS;
6294 + /* accu must be zero, since that was how s was determined. */
6298 + b_ptr = tmp_roomptr;
6300 + /* Copy a, shifting it left by s bits, yields r.
6302 + At the beginning: r = roomptr[0..a_len],
6303 + at the end: r = roomptr[0..b_len-1], q = roomptr[b_len..a_len] */
6307 + memcpy (r_ptr, a_ptr, a_len * sizeof (mp_limb_t));
6312 + const mp_limb_t *sourceptr = a_ptr;
6313 + mp_limb_t *destptr = r_ptr;
6314 + mp_twolimb_t accu = 0;
6316 + for (count = a_len; count > 0; count--)
6318 + accu += (mp_twolimb_t) *sourceptr++ << s;
6319 + *destptr++ = (mp_limb_t) accu;
6320 + accu = accu >> GMP_LIMB_BITS;
6322 + *destptr++ = (mp_limb_t) accu;
6324 + q_ptr = roomptr + b_len;
6325 + q_len = a_len - b_len + 1; /* q will have m-n+1 limbs */
6327 + size_t j = a_len - b_len; /* m-n */
6328 + mp_limb_t b_msd = b_ptr[b_len - 1]; /* b[n-1] */
6329 + mp_limb_t b_2msd = b_ptr[b_len - 2]; /* b[n-2] */
6330 + mp_twolimb_t b_msdd = /* b[n-1]*beta+b[n-2] */
6331 + ((mp_twolimb_t) b_msd << GMP_LIMB_BITS) | b_2msd;
6332 + /* Division loop, traversed m-n+1 times.
6333 + j counts down, b is unchanged, beta/2 <= b[n-1] < beta. */
6338 + if (r_ptr[j + b_len] < b_msd) /* r[j+n] < b[n-1] ? */
6340 + /* Divide r[j+n]*beta+r[j+n-1] by b[n-1], no overflow. */
6341 + mp_twolimb_t num =
6342 + ((mp_twolimb_t) r_ptr[j + b_len] << GMP_LIMB_BITS)
6343 + | r_ptr[j + b_len - 1];
6344 + q_star = num / b_msd;
6349 + /* Overflow, hence r[j+n]*beta+r[j+n-1] >= beta*b[n-1]. */
6350 + q_star = (mp_limb_t)~(mp_limb_t)0; /* q* = beta-1 */
6351 + /* Test whether r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] >= beta
6352 + <==> r[j+n]*beta+r[j+n-1] + b[n-1] >= beta*b[n-1]+beta
6353 + <==> b[n-1] < floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta)
6355 + If yes, jump directly to the subtraction loop.
6356 + (Otherwise, r[j+n]*beta+r[j+n-1] - (beta-1)*b[n-1] < beta
6357 + <==> floor((r[j+n]*beta+r[j+n-1]+b[n-1])/beta) = b[n-1] ) */
6358 + if (r_ptr[j + b_len] > b_msd
6359 + || (c1 = r_ptr[j + b_len - 1] + b_msd) < b_msd)
6360 + /* r[j+n] >= b[n-1]+1 or
6361 + r[j+n] = b[n-1] and the addition r[j+n-1]+b[n-1] gives a
6366 + c1 = (r[j+n]*beta+r[j+n-1]) - q* * b[n-1] (>=0, <beta). */
6368 + mp_twolimb_t c2 = /* c1*beta+r[j+n-2] */
6369 + ((mp_twolimb_t) c1 << GMP_LIMB_BITS) | r_ptr[j + b_len - 2];
6370 + mp_twolimb_t c3 = /* b[n-2] * q* */
6371 + (mp_twolimb_t) b_2msd * (mp_twolimb_t) q_star;
6372 + /* While c2 < c3, increase c2 and decrease c3.
6373 + Consider c3-c2. While it is > 0, decrease it by
6374 + b[n-1]*beta+b[n-2]. Because of b[n-1]*beta+b[n-2] >= beta^2/2
6375 + this can happen only twice. */
6378 + q_star = q_star - 1; /* q* := q* - 1 */
6379 + if (c3 - c2 > b_msdd)
6380 + q_star = q_star - 1; /* q* := q* - 1 */
6386 + /* Subtract r := r - b * q* * beta^j. */
6389 + const mp_limb_t *sourceptr = b_ptr;
6390 + mp_limb_t *destptr = r_ptr + j;
6391 + mp_twolimb_t carry = 0;
6393 + for (count = b_len; count > 0; count--)
6395 + /* Here 0 <= carry <= q*. */
6398 + + (mp_twolimb_t) q_star * (mp_twolimb_t) *sourceptr++
6399 + + (mp_limb_t) ~(*destptr);
6400 + /* Here 0 <= carry <= beta*q* + beta-1. */
6401 + *destptr++ = ~(mp_limb_t) carry;
6402 + carry = carry >> GMP_LIMB_BITS; /* <= q* */
6404 + cr = (mp_limb_t) carry;
6406 + /* Subtract cr from r_ptr[j + b_len], then forget about
6407 + r_ptr[j + b_len]. */
6408 + if (cr > r_ptr[j + b_len])
6410 + /* Subtraction gave a carry. */
6411 + q_star = q_star - 1; /* q* := q* - 1 */
6414 + const mp_limb_t *sourceptr = b_ptr;
6415 + mp_limb_t *destptr = r_ptr + j;
6416 + mp_limb_t carry = 0;
6418 + for (count = b_len; count > 0; count--)
6420 + mp_limb_t source1 = *sourceptr++;
6421 + mp_limb_t source2 = *destptr;
6422 + *destptr++ = source1 + source2 + carry;
6425 + ? source1 >= (mp_limb_t) ~source2
6426 + : source1 > (mp_limb_t) ~source2);
6429 + /* Forget about the carry and about r[j+n]. */
6432 + /* q* is determined. Store it as q[j]. */
6433 + q_ptr[j] = q_star;
6440 + /* Normalise q. */
6441 + if (q_ptr[q_len - 1] == 0)
6443 +# if 0 /* Not needed here, since we need r only to compare it with b/2, and
6444 + b is shifted left by s bits. */
6445 + /* Shift r right by s bits. */
6448 + mp_limb_t ptr = r_ptr + r_len;
6449 + mp_twolimb_t accu = 0;
6451 + for (count = r_len; count > 0; count--)
6453 + accu = (mp_twolimb_t) (mp_limb_t) accu << GMP_LIMB_BITS;
6454 + accu += (mp_twolimb_t) *--ptr << (GMP_LIMB_BITS - s);
6455 + *ptr = (mp_limb_t) (accu >> GMP_LIMB_BITS);
6459 + /* Normalise r. */
6460 + while (r_len > 0 && r_ptr[r_len - 1] == 0)
6463 + /* Compare r << 1 with b. */
6464 + if (r_len > b_len)
6471 + (i <= r_len && i > 0 ? r_ptr[i - 1] >> (GMP_LIMB_BITS - 1) : 0)
6472 + | (i < r_len ? r_ptr[i] << 1 : 0);
6473 + mp_limb_t b_i = (i < b_len ? b_ptr[i] : 0);
6483 + if (q_len > 0 && ((q_ptr[0] & 1) != 0))
6488 + for (i = 0; i < q_len; i++)
6489 + if (++(q_ptr[i]) != 0)
6491 + q_ptr[q_len++] = 1;
6494 + if (tmp_roomptr != NULL)
6495 + free (tmp_roomptr);
6497 + q->nlimbs = q_len;
6501 +/* Convert a bignum a >= 0, multiplied with 10^extra_zeroes, to decimal
6503 + Destroys the contents of a.
6504 + Return the allocated memory - containing the decimal digits in low-to-high
6505 + order, terminated with a NUL character - in case of success, NULL in case
6506 + of memory allocation failure. */
6508 +convert_to_decimal (mpn_t a, size_t extra_zeroes)
6510 + mp_limb_t *a_ptr = a.limbs;
6511 + size_t a_len = a.nlimbs;
6512 + /* 0.03345 is slightly larger than log(2)/(9*log(10)). */
6513 + size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1);
6514 + char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes));
6515 + if (c_ptr != NULL)
6517 + char *d_ptr = c_ptr;
6518 + for (; extra_zeroes > 0; extra_zeroes--)
6522 + /* Divide a by 10^9, in-place. */
6523 + mp_limb_t remainder = 0;
6524 + mp_limb_t *ptr = a_ptr + a_len;
6526 + for (count = a_len; count > 0; count--)
6528 + mp_twolimb_t num =
6529 + ((mp_twolimb_t) remainder << GMP_LIMB_BITS) | *--ptr;
6530 + *ptr = num / 1000000000;
6531 + remainder = num % 1000000000;
6533 + /* Store the remainder as 9 decimal digits. */
6534 + for (count = 9; count > 0; count--)
6536 + *d_ptr++ = '0' + (remainder % 10);
6537 + remainder = remainder / 10;
6539 + /* Normalize a. */
6540 + if (a_ptr[a_len - 1] == 0)
6543 + /* Remove leading zeroes. */
6544 + while (d_ptr > c_ptr && d_ptr[-1] == '0')
6546 + /* But keep at least one zero. */
6547 + if (d_ptr == c_ptr)
6549 + /* Terminate the string. */
6555 +# if NEED_PRINTF_LONG_DOUBLE
6557 +/* Assuming x is finite and >= 0:
6558 + write x as x = 2^e * m, where m is a bignum.
6559 + Return the allocated memory in case of success, NULL in case of memory
6560 + allocation failure. */
6562 +decode_long_double (long double x, int *ep, mpn_t *mp)
6569 + /* Allocate memory for result. */
6570 + m.nlimbs = (LDBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
6571 + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
6572 + if (m.limbs == NULL)
6574 + /* Split into exponential part and mantissa. */
6575 + y = frexpl (x, &exp);
6576 + if (!(y >= 0.0L && y < 1.0L))
6578 + /* x = 2^exp * y = 2^(exp - LDBL_MANT_BIT) * (y * LDBL_MANT_BIT), and the
6579 + latter is an integer. */
6580 + /* Convert the mantissa (y * LDBL_MANT_BIT) to a sequence of limbs.
6581 + I'm not sure whether it's safe to cast a 'long double' value between
6582 + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
6583 + 'long double' values between 0 and 2^16 (to 'unsigned int' or 'int',
6584 + doesn't matter). */
6585 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) != 0
6586 +# if (LDBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
6589 + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % (GMP_LIMB_BITS / 2));
6592 + if (!(y >= 0.0L && y < 1.0L))
6594 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6597 + if (!(y >= 0.0L && y < 1.0L))
6599 + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
6604 + y *= (mp_limb_t) 1 << (LDBL_MANT_BIT % GMP_LIMB_BITS);
6607 + if (!(y >= 0.0L && y < 1.0L))
6609 + m.limbs[LDBL_MANT_BIT / GMP_LIMB_BITS] = d;
6613 + for (i = LDBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
6616 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6619 + if (!(y >= 0.0L && y < 1.0L))
6621 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6624 + if (!(y >= 0.0L && y < 1.0L))
6626 + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
6628 +#if 0 /* On FreeBSD 6.1/x86, 'long double' numbers sometimes have excess
6634 + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
6637 + *ep = exp - LDBL_MANT_BIT;
6643 +# if NEED_PRINTF_DOUBLE
6645 +/* Assuming x is finite and >= 0:
6646 + write x as x = 2^e * m, where m is a bignum.
6647 + Return the allocated memory in case of success, NULL in case of memory
6648 + allocation failure. */
6650 +decode_double (double x, int *ep, mpn_t *mp)
6657 + /* Allocate memory for result. */
6658 + m.nlimbs = (DBL_MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS;
6659 + m.limbs = (mp_limb_t *) malloc (m.nlimbs * sizeof (mp_limb_t));
6660 + if (m.limbs == NULL)
6662 + /* Split into exponential part and mantissa. */
6663 + y = frexp (x, &exp);
6664 + if (!(y >= 0.0 && y < 1.0))
6666 + /* x = 2^exp * y = 2^(exp - DBL_MANT_BIT) * (y * DBL_MANT_BIT), and the
6667 + latter is an integer. */
6668 + /* Convert the mantissa (y * DBL_MANT_BIT) to a sequence of limbs.
6669 + I'm not sure whether it's safe to cast a 'double' value between
6670 + 2^31 and 2^32 to 'unsigned int', therefore play safe and cast only
6671 + 'double' values between 0 and 2^16 (to 'unsigned int' or 'int',
6672 + doesn't matter). */
6673 +# if (DBL_MANT_BIT % GMP_LIMB_BITS) != 0
6674 +# if (DBL_MANT_BIT % GMP_LIMB_BITS) > GMP_LIMB_BITS / 2
6677 + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % (GMP_LIMB_BITS / 2));
6680 + if (!(y >= 0.0 && y < 1.0))
6682 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6685 + if (!(y >= 0.0 && y < 1.0))
6687 + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = (hi << (GMP_LIMB_BITS / 2)) | lo;
6692 + y *= (mp_limb_t) 1 << (DBL_MANT_BIT % GMP_LIMB_BITS);
6695 + if (!(y >= 0.0 && y < 1.0))
6697 + m.limbs[DBL_MANT_BIT / GMP_LIMB_BITS] = d;
6701 + for (i = DBL_MANT_BIT / GMP_LIMB_BITS; i > 0; )
6704 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6707 + if (!(y >= 0.0 && y < 1.0))
6709 + y *= (mp_limb_t) 1 << (GMP_LIMB_BITS / 2);
6712 + if (!(y >= 0.0 && y < 1.0))
6714 + m.limbs[--i] = (hi << (GMP_LIMB_BITS / 2)) | lo;
6719 + while (m.nlimbs > 0 && m.limbs[m.nlimbs - 1] == 0)
6722 + *ep = exp - DBL_MANT_BIT;
6728 +/* Assuming x = 2^e * m is finite and >= 0, and n is an integer:
6729 + Returns the decimal representation of round (x * 10^n).
6730 + Return the allocated memory - containing the decimal digits in low-to-high
6731 + order, terminated with a NUL character - in case of success, NULL in case
6732 + of memory allocation failure. */
6734 +scale10_round_decimal_decoded (int e, mpn_t m, void *memory, int n)
6737 + size_t extra_zeroes;
6738 + unsigned int abs_n;
6739 + unsigned int abs_s;
6740 + mp_limb_t *pow5_ptr;
6742 + unsigned int s_limbs;
6743 + unsigned int s_bits;
6749 + if (memory == NULL)
6751 + /* x = 2^e * m, hence
6752 + y = round (2^e * 10^n * m) = round (2^(e+n) * 5^n * m)
6753 + = round (2^s * 5^n * m). */
6756 + /* Factor out a common power of 10 if possible. */
6757 + if (s > 0 && n > 0)
6759 + extra_zeroes = (s < n ? s : n);
6760 + s -= extra_zeroes;
6761 + n -= extra_zeroes;
6763 + /* Here y = round (2^s * 5^n * m) * 10^extra_zeroes.
6764 + Before converting to decimal, we need to compute
6765 + z = round (2^s * 5^n * m). */
6766 + /* Compute 5^|n|, possibly shifted by |s| bits if n and s have the same
6767 + sign. 2.322 is slightly larger than log(5)/log(2). */
6768 + abs_n = (n >= 0 ? n : -n);
6769 + abs_s = (s >= 0 ? s : -s);
6770 + pow5_ptr = (mp_limb_t *) malloc (((int)(abs_n * (2.322f / GMP_LIMB_BITS)) + 1
6771 + + abs_s / GMP_LIMB_BITS + 1)
6772 + * sizeof (mp_limb_t));
6773 + if (pow5_ptr == NULL)
6778 + /* Initialize with 1. */
6781 + /* Multiply with 5^|n|. */
6784 + static mp_limb_t const small_pow5[13 + 1] =
6786 + 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 9765625,
6787 + 48828125, 244140625, 1220703125
6790 + for (n13 = 0; n13 <= abs_n; n13 += 13)
6792 + mp_limb_t digit1 = small_pow5[n13 + 13 <= abs_n ? 13 : abs_n - n13];
6794 + mp_twolimb_t carry = 0;
6795 + for (j = 0; j < pow5_len; j++)
6797 + mp_limb_t digit2 = pow5_ptr[j];
6798 + carry += (mp_twolimb_t) digit1 * (mp_twolimb_t) digit2;
6799 + pow5_ptr[j] = (mp_limb_t) carry;
6800 + carry = carry >> GMP_LIMB_BITS;
6803 + pow5_ptr[pow5_len++] = (mp_limb_t) carry;
6806 + s_limbs = abs_s / GMP_LIMB_BITS;
6807 + s_bits = abs_s % GMP_LIMB_BITS;
6808 + if (n >= 0 ? s >= 0 : s <= 0)
6810 + /* Multiply with 2^|s|. */
6813 + mp_limb_t *ptr = pow5_ptr;
6814 + mp_twolimb_t accu = 0;
6816 + for (count = pow5_len; count > 0; count--)
6818 + accu += (mp_twolimb_t) *ptr << s_bits;
6819 + *ptr++ = (mp_limb_t) accu;
6820 + accu = accu >> GMP_LIMB_BITS;
6824 + *ptr = (mp_limb_t) accu;
6831 + for (count = pow5_len; count > 0;)
6834 + pow5_ptr[s_limbs + count] = pow5_ptr[count];
6836 + for (count = s_limbs; count > 0;)
6839 + pow5_ptr[count] = 0;
6841 + pow5_len += s_limbs;
6843 + pow5.limbs = pow5_ptr;
6844 + pow5.nlimbs = pow5_len;
6847 + /* Multiply m with pow5. No division needed. */
6848 + z_memory = multiply (m, pow5, &z);
6852 + /* Divide m by pow5 and round. */
6853 + z_memory = divide (m, pow5, &z);
6858 + pow5.limbs = pow5_ptr;
6859 + pow5.nlimbs = pow5_len;
6863 + Multiply m with pow5, then divide by 2^|s|. */
6865 + mpn_t denominator;
6867 + tmp_memory = multiply (m, pow5, &numerator);
6868 + if (tmp_memory == NULL)
6874 + /* Construct 2^|s|. */
6876 + mp_limb_t *ptr = pow5_ptr + pow5_len;
6878 + for (i = 0; i < s_limbs; i++)
6880 + ptr[s_limbs] = (mp_limb_t) 1 << s_bits;
6881 + denominator.limbs = ptr;
6882 + denominator.nlimbs = s_limbs + 1;
6884 + z_memory = divide (numerator, denominator, &z);
6885 + free (tmp_memory);
6890 + Multiply m with 2^s, then divide by pow5. */
6892 + mp_limb_t *num_ptr;
6893 + num_ptr = (mp_limb_t *) malloc ((m.nlimbs + s_limbs + 1)
6894 + * sizeof (mp_limb_t));
6895 + if (num_ptr == NULL)
6902 + mp_limb_t *destptr = num_ptr;
6905 + for (i = 0; i < s_limbs; i++)
6910 + const mp_limb_t *sourceptr = m.limbs;
6911 + mp_twolimb_t accu = 0;
6913 + for (count = m.nlimbs; count > 0; count--)
6915 + accu += (mp_twolimb_t) *sourceptr++ << s_bits;
6916 + *destptr++ = (mp_limb_t) accu;
6917 + accu = accu >> GMP_LIMB_BITS;
6920 + *destptr++ = (mp_limb_t) accu;
6924 + const mp_limb_t *sourceptr = m.limbs;
6926 + for (count = m.nlimbs; count > 0; count--)
6927 + *destptr++ = *sourceptr++;
6929 + numerator.limbs = num_ptr;
6930 + numerator.nlimbs = destptr - num_ptr;
6932 + z_memory = divide (numerator, pow5, &z);
6939 + /* Here y = round (x * 10^n) = z * 10^extra_zeroes. */
6941 + if (z_memory == NULL)
6943 + digits = convert_to_decimal (z, extra_zeroes);
6948 +# if NEED_PRINTF_LONG_DOUBLE
6950 +/* Assuming x is finite and >= 0, and n is an integer:
6951 + Returns the decimal representation of round (x * 10^n).
6952 + Return the allocated memory - containing the decimal digits in low-to-high
6953 + order, terminated with a NUL character - in case of success, NULL in case
6954 + of memory allocation failure. */
6956 +scale10_round_decimal_long_double (long double x, int n)
6958 + int e IF_LINT(= 0);
6960 + void *memory = decode_long_double (x, &e, &m);
6961 + return scale10_round_decimal_decoded (e, m, memory, n);
6966 +# if NEED_PRINTF_DOUBLE
6968 +/* Assuming x is finite and >= 0, and n is an integer:
6969 + Returns the decimal representation of round (x * 10^n).
6970 + Return the allocated memory - containing the decimal digits in low-to-high
6971 + order, terminated with a NUL character - in case of success, NULL in case
6972 + of memory allocation failure. */
6974 +scale10_round_decimal_double (double x, int n)
6976 + int e IF_LINT(= 0);
6978 + void *memory = decode_double (x, &e, &m);
6979 + return scale10_round_decimal_decoded (e, m, memory, n);
6984 +# if NEED_PRINTF_LONG_DOUBLE
6986 +/* Assuming x is finite and > 0:
6987 + Return an approximation for n with 10^n <= x < 10^(n+1).
6988 + The approximation is usually the right n, but may be off by 1 sometimes. */
6990 +floorlog10l (long double x)
6997 + /* Split into exponential part and mantissa. */
6998 + y = frexpl (x, &exp);
6999 + if (!(y >= 0.0L && y < 1.0L))
7005 + while (y < (1.0L / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
7007 + y *= 1.0L * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
7008 + exp -= GMP_LIMB_BITS;
7010 + if (y < (1.0L / (1 << 16)))
7012 + y *= 1.0L * (1 << 16);
7015 + if (y < (1.0L / (1 << 8)))
7017 + y *= 1.0L * (1 << 8);
7020 + if (y < (1.0L / (1 << 4)))
7022 + y *= 1.0L * (1 << 4);
7025 + if (y < (1.0L / (1 << 2)))
7027 + y *= 1.0L * (1 << 2);
7030 + if (y < (1.0L / (1 << 1)))
7032 + y *= 1.0L * (1 << 1);
7036 + if (!(y >= 0.5L && y < 1.0L))
7038 + /* Compute an approximation for l = log2(x) = exp + log2(y). */
7041 + if (z < 0.70710678118654752444)
7043 + z *= 1.4142135623730950488;
7046 + if (z < 0.8408964152537145431)
7048 + z *= 1.1892071150027210667;
7051 + if (z < 0.91700404320467123175)
7053 + z *= 1.0905077326652576592;
7056 + if (z < 0.9576032806985736469)
7058 + z *= 1.0442737824274138403;
7061 + /* Now 0.95 <= z <= 1.01. */
7063 + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
7064 + Four terms are enough to get an approximation with error < 10^-7. */
7065 + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
7066 + /* Finally multiply with log(2)/log(10), yields an approximation for
7068 + l *= 0.30102999566398119523;
7069 + /* Round down to the next integer. */
7070 + return (int) l + (l < 0 ? -1 : 0);
7075 +# if NEED_PRINTF_DOUBLE
7077 +/* Assuming x is finite and > 0:
7078 + Return an approximation for n with 10^n <= x < 10^(n+1).
7079 + The approximation is usually the right n, but may be off by 1 sometimes. */
7081 +floorlog10 (double x)
7088 + /* Split into exponential part and mantissa. */
7089 + y = frexp (x, &exp);
7090 + if (!(y >= 0.0 && y < 1.0))
7096 + while (y < (1.0 / (1 << (GMP_LIMB_BITS / 2)) / (1 << (GMP_LIMB_BITS / 2))))
7098 + y *= 1.0 * (1 << (GMP_LIMB_BITS / 2)) * (1 << (GMP_LIMB_BITS / 2));
7099 + exp -= GMP_LIMB_BITS;
7101 + if (y < (1.0 / (1 << 16)))
7103 + y *= 1.0 * (1 << 16);
7106 + if (y < (1.0 / (1 << 8)))
7108 + y *= 1.0 * (1 << 8);
7111 + if (y < (1.0 / (1 << 4)))
7113 + y *= 1.0 * (1 << 4);
7116 + if (y < (1.0 / (1 << 2)))
7118 + y *= 1.0 * (1 << 2);
7121 + if (y < (1.0 / (1 << 1)))
7123 + y *= 1.0 * (1 << 1);
7127 + if (!(y >= 0.5 && y < 1.0))
7129 + /* Compute an approximation for l = log2(x) = exp + log2(y). */
7132 + if (z < 0.70710678118654752444)
7134 + z *= 1.4142135623730950488;
7137 + if (z < 0.8408964152537145431)
7139 + z *= 1.1892071150027210667;
7142 + if (z < 0.91700404320467123175)
7144 + z *= 1.0905077326652576592;
7147 + if (z < 0.9576032806985736469)
7149 + z *= 1.0442737824274138403;
7152 + /* Now 0.95 <= z <= 1.01. */
7154 + /* log2(1-z) = 1/log(2) * (- z - z^2/2 - z^3/3 - z^4/4 - ...)
7155 + Four terms are enough to get an approximation with error < 10^-7. */
7156 + l -= 1.4426950408889634074 * z * (1.0 + z * (0.5 + z * ((1.0 / 3) + z * 0.25)));
7157 + /* Finally multiply with log(2)/log(10), yields an approximation for
7159 + l *= 0.30102999566398119523;
7160 + /* Round down to the next integer. */
7161 + return (int) l + (l < 0 ? -1 : 0);
7166 +/* Tests whether a string of digits consists of exactly PRECISION zeroes and
7167 + a single '1' digit. */
7169 +is_borderline (const char *digits, size_t precision)
7171 + for (; precision > 0; precision--, digits++)
7172 + if (*digits != '0')
7174 + if (*digits != '1')
7177 + return *digits == '\0';
7183 +VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
7184 + const FCHAR_T *format, va_list args)
7189 + if (PRINTF_PARSE (format, &d, &a) < 0)
7190 + /* errno is already set. */
7193 +#define CLEANUP() \
7198 + if (PRINTF_FETCHARGS (args, &a) < 0)
7206 + size_t buf_neededlength;
7208 + TCHAR_T *buf_malloced;
7209 + const FCHAR_T *cp;
7212 + /* Output string accumulator. */
7217 + /* Allocate a small buffer that will hold a directive passed to
7218 + sprintf or snprintf. */
7219 + buf_neededlength =
7220 + xsum4 (7, d.max_width_length, d.max_precision_length, 6);
7222 + if (buf_neededlength < 4000 / sizeof (TCHAR_T))
7224 + buf = (TCHAR_T *) alloca (buf_neededlength * sizeof (TCHAR_T));
7225 + buf_malloced = NULL;
7230 + size_t buf_memsize = xtimes (buf_neededlength, sizeof (TCHAR_T));
7231 + if (size_overflow_p (buf_memsize))
7232 + goto out_of_memory_1;
7233 + buf = (TCHAR_T *) malloc (buf_memsize);
7235 + goto out_of_memory_1;
7236 + buf_malloced = buf;
7239 + if (resultbuf != NULL)
7241 + result = resultbuf;
7242 + allocated = *lengthp;
7251 + result is either == resultbuf or == NULL or malloc-allocated.
7252 + If length > 0, then result != NULL. */
7254 + /* Ensures that allocated >= needed. Aborts through a jump to
7255 + out_of_memory if needed is SIZE_MAX or otherwise too big. */
7256 +#define ENSURE_ALLOCATION(needed) \
7257 + if ((needed) > allocated) \
7259 + size_t memory_size; \
7260 + DCHAR_T *memory; \
7262 + allocated = (allocated > 0 ? xtimes (allocated, 2) : 12); \
7263 + if ((needed) > allocated) \
7264 + allocated = (needed); \
7265 + memory_size = xtimes (allocated, sizeof (DCHAR_T)); \
7266 + if (size_overflow_p (memory_size)) \
7267 + goto out_of_memory; \
7268 + if (result == resultbuf || result == NULL) \
7269 + memory = (DCHAR_T *) malloc (memory_size); \
7271 + memory = (DCHAR_T *) realloc (result, memory_size); \
7272 + if (memory == NULL) \
7273 + goto out_of_memory; \
7274 + if (result == resultbuf && length > 0) \
7275 + DCHAR_CPY (memory, result, length); \
7276 + result = memory; \
7279 + for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
7281 + if (cp != dp->dir_start)
7283 + size_t n = dp->dir_start - cp;
7284 + size_t augmented_length = xsum (length, n);
7286 + ENSURE_ALLOCATION (augmented_length);
7287 + /* This copies a piece of FCHAR_T[] into a DCHAR_T[]. Here we
7288 + need that the format string contains only ASCII characters
7289 + if FCHAR_T and DCHAR_T are not the same type. */
7290 + if (sizeof (FCHAR_T) == sizeof (DCHAR_T))
7292 + DCHAR_CPY (result + length, (const DCHAR_T *) cp, n);
7293 + length = augmented_length;
7298 + result[length++] = (unsigned char) *cp++;
7305 + /* Execute a single directive. */
7306 + if (dp->conversion == '%')
7308 + size_t augmented_length;
7310 + if (!(dp->arg_index == ARG_NONE))
7312 + augmented_length = xsum (length, 1);
7313 + ENSURE_ALLOCATION (augmented_length);
7314 + result[length] = '%';
7315 + length = augmented_length;
7319 + if (!(dp->arg_index != ARG_NONE))
7322 + if (dp->conversion == 'n')
7324 + switch (a.arg[dp->arg_index].type)
7326 + case TYPE_COUNT_SCHAR_POINTER:
7327 + *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
7329 + case TYPE_COUNT_SHORT_POINTER:
7330 + *a.arg[dp->arg_index].a.a_count_short_pointer = length;
7332 + case TYPE_COUNT_INT_POINTER:
7333 + *a.arg[dp->arg_index].a.a_count_int_pointer = length;
7335 + case TYPE_COUNT_LONGINT_POINTER:
7336 + *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
7338 +#if HAVE_LONG_LONG_INT
7339 + case TYPE_COUNT_LONGLONGINT_POINTER:
7340 + *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
7347 +#if ENABLE_UNISTDIO
7348 + /* The unistdio extensions. */
7349 + else if (dp->conversion == 'U')
7351 + arg_type type = a.arg[dp->arg_index].type;
7352 + int flags = dp->flags;
7355 + int has_precision;
7360 + if (dp->width_start != dp->width_end)
7362 + if (dp->width_arg_index != ARG_NONE)
7366 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
7368 + arg = a.arg[dp->width_arg_index].a.a_int;
7371 + /* "A negative field width is taken as a '-' flag
7372 + followed by a positive field width." */
7373 + flags |= FLAG_LEFT;
7374 + width = (unsigned int) (-arg);
7381 + const FCHAR_T *digitp = dp->width_start;
7384 + width = xsum (xtimes (width, 10), *digitp++ - '0');
7385 + while (digitp != dp->width_end);
7390 + has_precision = 0;
7392 + if (dp->precision_start != dp->precision_end)
7394 + if (dp->precision_arg_index != ARG_NONE)
7398 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
7400 + arg = a.arg[dp->precision_arg_index].a.a_int;
7401 + /* "A negative precision is taken as if the precision
7406 + has_precision = 1;
7411 + const FCHAR_T *digitp = dp->precision_start + 1;
7414 + while (digitp != dp->precision_end)
7415 + precision = xsum (xtimes (precision, 10), *digitp++ - '0');
7416 + has_precision = 1;
7422 + case TYPE_U8_STRING:
7424 + const uint8_t *arg = a.arg[dp->arg_index].a.a_u8_string;
7425 + const uint8_t *arg_end;
7426 + size_t characters;
7428 + if (has_precision)
7430 + /* Use only PRECISION characters, from the left. */
7433 + for (; precision > 0; precision--)
7435 + int count = u8_strmblen (arg_end);
7440 + if (!(result == resultbuf || result == NULL))
7442 + if (buf_malloced != NULL)
7443 + free (buf_malloced);
7452 + else if (has_width)
7454 + /* Use the entire string, and count the number of
7460 + int count = u8_strmblen (arg_end);
7465 + if (!(result == resultbuf || result == NULL))
7467 + if (buf_malloced != NULL)
7468 + free (buf_malloced);
7479 + /* Use the entire string. */
7480 + arg_end = arg + u8_strlen (arg);
7481 + /* The number of characters doesn't matter. */
7485 + if (has_width && width > characters
7486 + && !(dp->flags & FLAG_LEFT))
7488 + size_t n = width - characters;
7489 + ENSURE_ALLOCATION (xsum (length, n));
7490 + DCHAR_SET (result + length, ' ', n);
7494 +# if DCHAR_IS_UINT8_T
7496 + size_t n = arg_end - arg;
7497 + ENSURE_ALLOCATION (xsum (length, n));
7498 + DCHAR_CPY (result + length, arg, n);
7503 + DCHAR_T *converted = result + length;
7504 + size_t converted_len = allocated - length;
7505 +# if DCHAR_IS_TCHAR
7506 + /* Convert from UTF-8 to locale encoding. */
7507 + if (u8_conv_to_encoding (locale_charset (),
7508 + iconveh_question_mark,
7509 + arg, arg_end - arg, NULL,
7510 + &converted, &converted_len)
7513 + /* Convert from UTF-8 to UTF-16/UTF-32. */
7515 + U8_TO_DCHAR (arg, arg_end - arg,
7516 + converted, &converted_len);
7517 + if (converted == NULL)
7520 + int saved_errno = errno;
7521 + if (!(result == resultbuf || result == NULL))
7523 + if (buf_malloced != NULL)
7524 + free (buf_malloced);
7526 + errno = saved_errno;
7529 + if (converted != result + length)
7531 + ENSURE_ALLOCATION (xsum (length, converted_len));
7532 + DCHAR_CPY (result + length, converted, converted_len);
7535 + length += converted_len;
7539 + if (has_width && width > characters
7540 + && (dp->flags & FLAG_LEFT))
7542 + size_t n = width - characters;
7543 + ENSURE_ALLOCATION (xsum (length, n));
7544 + DCHAR_SET (result + length, ' ', n);
7550 + case TYPE_U16_STRING:
7552 + const uint16_t *arg = a.arg[dp->arg_index].a.a_u16_string;
7553 + const uint16_t *arg_end;
7554 + size_t characters;
7556 + if (has_precision)
7558 + /* Use only PRECISION characters, from the left. */
7561 + for (; precision > 0; precision--)
7563 + int count = u16_strmblen (arg_end);
7568 + if (!(result == resultbuf || result == NULL))
7570 + if (buf_malloced != NULL)
7571 + free (buf_malloced);
7580 + else if (has_width)
7582 + /* Use the entire string, and count the number of
7588 + int count = u16_strmblen (arg_end);
7593 + if (!(result == resultbuf || result == NULL))
7595 + if (buf_malloced != NULL)
7596 + free (buf_malloced);
7607 + /* Use the entire string. */
7608 + arg_end = arg + u16_strlen (arg);
7609 + /* The number of characters doesn't matter. */
7613 + if (has_width && width > characters
7614 + && !(dp->flags & FLAG_LEFT))
7616 + size_t n = width - characters;
7617 + ENSURE_ALLOCATION (xsum (length, n));
7618 + DCHAR_SET (result + length, ' ', n);
7622 +# if DCHAR_IS_UINT16_T
7624 + size_t n = arg_end - arg;
7625 + ENSURE_ALLOCATION (xsum (length, n));
7626 + DCHAR_CPY (result + length, arg, n);
7631 + DCHAR_T *converted = result + length;
7632 + size_t converted_len = allocated - length;
7633 +# if DCHAR_IS_TCHAR
7634 + /* Convert from UTF-16 to locale encoding. */
7635 + if (u16_conv_to_encoding (locale_charset (),
7636 + iconveh_question_mark,
7637 + arg, arg_end - arg, NULL,
7638 + &converted, &converted_len)
7641 + /* Convert from UTF-16 to UTF-8/UTF-32. */
7643 + U16_TO_DCHAR (arg, arg_end - arg,
7644 + converted, &converted_len);
7645 + if (converted == NULL)
7648 + int saved_errno = errno;
7649 + if (!(result == resultbuf || result == NULL))
7651 + if (buf_malloced != NULL)
7652 + free (buf_malloced);
7654 + errno = saved_errno;
7657 + if (converted != result + length)
7659 + ENSURE_ALLOCATION (xsum (length, converted_len));
7660 + DCHAR_CPY (result + length, converted, converted_len);
7663 + length += converted_len;
7667 + if (has_width && width > characters
7668 + && (dp->flags & FLAG_LEFT))
7670 + size_t n = width - characters;
7671 + ENSURE_ALLOCATION (xsum (length, n));
7672 + DCHAR_SET (result + length, ' ', n);
7678 + case TYPE_U32_STRING:
7680 + const uint32_t *arg = a.arg[dp->arg_index].a.a_u32_string;
7681 + const uint32_t *arg_end;
7682 + size_t characters;
7684 + if (has_precision)
7686 + /* Use only PRECISION characters, from the left. */
7689 + for (; precision > 0; precision--)
7691 + int count = u32_strmblen (arg_end);
7696 + if (!(result == resultbuf || result == NULL))
7698 + if (buf_malloced != NULL)
7699 + free (buf_malloced);
7708 + else if (has_width)
7710 + /* Use the entire string, and count the number of
7716 + int count = u32_strmblen (arg_end);
7721 + if (!(result == resultbuf || result == NULL))
7723 + if (buf_malloced != NULL)
7724 + free (buf_malloced);
7735 + /* Use the entire string. */
7736 + arg_end = arg + u32_strlen (arg);
7737 + /* The number of characters doesn't matter. */
7741 + if (has_width && width > characters
7742 + && !(dp->flags & FLAG_LEFT))
7744 + size_t n = width - characters;
7745 + ENSURE_ALLOCATION (xsum (length, n));
7746 + DCHAR_SET (result + length, ' ', n);
7750 +# if DCHAR_IS_UINT32_T
7752 + size_t n = arg_end - arg;
7753 + ENSURE_ALLOCATION (xsum (length, n));
7754 + DCHAR_CPY (result + length, arg, n);
7759 + DCHAR_T *converted = result + length;
7760 + size_t converted_len = allocated - length;
7761 +# if DCHAR_IS_TCHAR
7762 + /* Convert from UTF-32 to locale encoding. */
7763 + if (u32_conv_to_encoding (locale_charset (),
7764 + iconveh_question_mark,
7765 + arg, arg_end - arg, NULL,
7766 + &converted, &converted_len)
7769 + /* Convert from UTF-32 to UTF-8/UTF-16. */
7771 + U32_TO_DCHAR (arg, arg_end - arg,
7772 + converted, &converted_len);
7773 + if (converted == NULL)
7776 + int saved_errno = errno;
7777 + if (!(result == resultbuf || result == NULL))
7779 + if (buf_malloced != NULL)
7780 + free (buf_malloced);
7782 + errno = saved_errno;
7785 + if (converted != result + length)
7787 + ENSURE_ALLOCATION (xsum (length, converted_len));
7788 + DCHAR_CPY (result + length, converted, converted_len);
7791 + length += converted_len;
7795 + if (has_width && width > characters
7796 + && (dp->flags & FLAG_LEFT))
7798 + size_t n = width - characters;
7799 + ENSURE_ALLOCATION (xsum (length, n));
7800 + DCHAR_SET (result + length, ' ', n);
7811 +#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
7812 + else if ((dp->conversion == 'a' || dp->conversion == 'A')
7813 +# if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
7815 +# if NEED_PRINTF_DOUBLE
7816 + || a.arg[dp->arg_index].type == TYPE_DOUBLE
7818 +# if NEED_PRINTF_LONG_DOUBLE
7819 + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
7825 + arg_type type = a.arg[dp->arg_index].type;
7826 + int flags = dp->flags;
7829 + int has_precision;
7831 + size_t tmp_length;
7832 + DCHAR_T tmpbuf[700];
7839 + if (dp->width_start != dp->width_end)
7841 + if (dp->width_arg_index != ARG_NONE)
7845 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
7847 + arg = a.arg[dp->width_arg_index].a.a_int;
7850 + /* "A negative field width is taken as a '-' flag
7851 + followed by a positive field width." */
7852 + flags |= FLAG_LEFT;
7853 + width = (unsigned int) (-arg);
7860 + const FCHAR_T *digitp = dp->width_start;
7863 + width = xsum (xtimes (width, 10), *digitp++ - '0');
7864 + while (digitp != dp->width_end);
7869 + has_precision = 0;
7871 + if (dp->precision_start != dp->precision_end)
7873 + if (dp->precision_arg_index != ARG_NONE)
7877 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
7879 + arg = a.arg[dp->precision_arg_index].a.a_int;
7880 + /* "A negative precision is taken as if the precision
7885 + has_precision = 1;
7890 + const FCHAR_T *digitp = dp->precision_start + 1;
7893 + while (digitp != dp->precision_end)
7894 + precision = xsum (xtimes (precision, 10), *digitp++ - '0');
7895 + has_precision = 1;
7899 + /* Allocate a temporary buffer of sufficient size. */
7900 + if (type == TYPE_LONGDOUBLE)
7902 + (unsigned int) ((LDBL_DIG + 1)
7903 + * 0.831 /* decimal -> hexadecimal */
7905 + + 1; /* turn floor into ceil */
7908 + (unsigned int) ((DBL_DIG + 1)
7909 + * 0.831 /* decimal -> hexadecimal */
7911 + + 1; /* turn floor into ceil */
7912 + if (tmp_length < precision)
7913 + tmp_length = precision;
7914 + /* Account for sign, decimal point etc. */
7915 + tmp_length = xsum (tmp_length, 12);
7917 + if (tmp_length < width)
7918 + tmp_length = width;
7920 + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
7922 + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
7926 + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
7928 + if (size_overflow_p (tmp_memsize))
7929 + /* Overflow, would lead to out of memory. */
7930 + goto out_of_memory;
7931 + tmp = (DCHAR_T *) malloc (tmp_memsize);
7933 + /* Out of memory. */
7934 + goto out_of_memory;
7939 + if (type == TYPE_LONGDOUBLE)
7941 +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE
7942 + long double arg = a.arg[dp->arg_index].a.a_longdouble;
7946 + if (dp->conversion == 'A')
7948 + *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
7952 + *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
7958 + DECL_LONG_DOUBLE_ROUNDING
7960 + BEGIN_LONG_DOUBLE_ROUNDING ();
7962 + if (signbit (arg)) /* arg < 0.0L or negative zero */
7970 + else if (flags & FLAG_SHOWSIGN)
7972 + else if (flags & FLAG_SPACE)
7975 + if (arg > 0.0L && arg + arg == arg)
7977 + if (dp->conversion == 'A')
7979 + *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
7983 + *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
7989 + long double mantissa;
7992 + mantissa = printf_frexpl (arg, &exponent);
8000 + && precision < (unsigned int) ((LDBL_DIG + 1) * 0.831) + 1)
8002 + /* Round the mantissa. */
8003 + long double tail = mantissa;
8006 + for (q = precision; ; q--)
8008 + int digit = (int) tail;
8012 + if (digit & 1 ? tail >= 0.5L : tail > 0.5L)
8021 + for (q = precision; q > 0; q--)
8027 + *p++ = dp->conversion - 'A' + 'X';
8032 + digit = (int) mantissa;
8033 + mantissa -= digit;
8034 + *p++ = '0' + digit;
8035 + if ((flags & FLAG_ALT)
8036 + || mantissa > 0.0L || precision > 0)
8038 + *p++ = decimal_point_char ();
8039 + /* This loop terminates because we assume
8040 + that FLT_RADIX is a power of 2. */
8041 + while (mantissa > 0.0L)
8043 + mantissa *= 16.0L;
8044 + digit = (int) mantissa;
8045 + mantissa -= digit;
8049 + : dp->conversion - 10);
8050 + if (precision > 0)
8053 + while (precision > 0)
8060 + *p++ = dp->conversion - 'A' + 'P';
8061 +# if WIDE_CHAR_VERSION
8063 + static const wchar_t decimal_format[] =
8064 + { '%', '+', 'd', '\0' };
8065 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
8067 + while (*p != '\0')
8070 + if (sizeof (DCHAR_T) == 1)
8072 + sprintf ((char *) p, "%+d", exponent);
8073 + while (*p != '\0')
8078 + char expbuf[6 + 1];
8080 + sprintf (expbuf, "%+d", exponent);
8081 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
8087 + END_LONG_DOUBLE_ROUNDING ();
8095 +# if NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_DOUBLE
8096 + double arg = a.arg[dp->arg_index].a.a_double;
8100 + if (dp->conversion == 'A')
8102 + *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
8106 + *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
8113 + if (signbit (arg)) /* arg < 0.0 or negative zero */
8121 + else if (flags & FLAG_SHOWSIGN)
8123 + else if (flags & FLAG_SPACE)
8126 + if (arg > 0.0 && arg + arg == arg)
8128 + if (dp->conversion == 'A')
8130 + *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
8134 + *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
8143 + mantissa = printf_frexp (arg, &exponent);
8151 + && precision < (unsigned int) ((DBL_DIG + 1) * 0.831) + 1)
8153 + /* Round the mantissa. */
8154 + double tail = mantissa;
8157 + for (q = precision; ; q--)
8159 + int digit = (int) tail;
8163 + if (digit & 1 ? tail >= 0.5 : tail > 0.5)
8172 + for (q = precision; q > 0; q--)
8178 + *p++ = dp->conversion - 'A' + 'X';
8183 + digit = (int) mantissa;
8184 + mantissa -= digit;
8185 + *p++ = '0' + digit;
8186 + if ((flags & FLAG_ALT)
8187 + || mantissa > 0.0 || precision > 0)
8189 + *p++ = decimal_point_char ();
8190 + /* This loop terminates because we assume
8191 + that FLT_RADIX is a power of 2. */
8192 + while (mantissa > 0.0)
8195 + digit = (int) mantissa;
8196 + mantissa -= digit;
8200 + : dp->conversion - 10);
8201 + if (precision > 0)
8204 + while (precision > 0)
8211 + *p++ = dp->conversion - 'A' + 'P';
8212 +# if WIDE_CHAR_VERSION
8214 + static const wchar_t decimal_format[] =
8215 + { '%', '+', 'd', '\0' };
8216 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
8218 + while (*p != '\0')
8221 + if (sizeof (DCHAR_T) == 1)
8223 + sprintf ((char *) p, "%+d", exponent);
8224 + while (*p != '\0')
8229 + char expbuf[6 + 1];
8231 + sprintf (expbuf, "%+d", exponent);
8232 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
8242 + /* The generated string now extends from tmp to p, with the
8243 + zero padding insertion point being at pad_ptr. */
8244 + if (has_width && p - tmp < width)
8246 + size_t pad = width - (p - tmp);
8247 + DCHAR_T *end = p + pad;
8249 + if (flags & FLAG_LEFT)
8251 + /* Pad with spaces on the right. */
8252 + for (; pad > 0; pad--)
8255 + else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
8257 + /* Pad with zeroes. */
8260 + while (p > pad_ptr)
8262 + for (; pad > 0; pad--)
8267 + /* Pad with spaces on the left. */
8272 + for (; pad > 0; pad--)
8280 + size_t count = p - tmp;
8282 + if (count >= tmp_length)
8283 + /* tmp_length was incorrectly calculated - fix the
8287 + /* Make room for the result. */
8288 + if (count >= allocated - length)
8290 + size_t n = xsum (length, count);
8292 + ENSURE_ALLOCATION (n);
8295 + /* Append the result. */
8296 + memcpy (result + length, tmp, count * sizeof (DCHAR_T));
8297 + if (tmp != tmpbuf)
8303 +#if (NEED_PRINTF_INFINITE_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
8304 + else if ((dp->conversion == 'f' || dp->conversion == 'F'
8305 + || dp->conversion == 'e' || dp->conversion == 'E'
8306 + || dp->conversion == 'g' || dp->conversion == 'G'
8307 + || dp->conversion == 'a' || dp->conversion == 'A')
8309 +# if NEED_PRINTF_DOUBLE
8310 + || a.arg[dp->arg_index].type == TYPE_DOUBLE
8311 +# elif NEED_PRINTF_INFINITE_DOUBLE
8312 + || (a.arg[dp->arg_index].type == TYPE_DOUBLE
8313 + /* The systems (mingw) which produce wrong output
8314 + for Inf, -Inf, and NaN also do so for -0.0.
8315 + Therefore we treat this case here as well. */
8316 + && is_infinite_or_zero (a.arg[dp->arg_index].a.a_double))
8318 +# if NEED_PRINTF_LONG_DOUBLE
8319 + || a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
8320 +# elif NEED_PRINTF_INFINITE_LONG_DOUBLE
8321 + || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
8322 + /* Some systems produce wrong output for Inf,
8323 + -Inf, and NaN. Some systems in this category
8324 + (IRIX 5.3) also do so for -0.0. Therefore we
8325 + treat this case here as well. */
8326 + && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble))
8330 +# if (NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && (NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE)
8331 + arg_type type = a.arg[dp->arg_index].type;
8333 + int flags = dp->flags;
8336 + int has_precision;
8338 + size_t tmp_length;
8339 + DCHAR_T tmpbuf[700];
8346 + if (dp->width_start != dp->width_end)
8348 + if (dp->width_arg_index != ARG_NONE)
8352 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
8354 + arg = a.arg[dp->width_arg_index].a.a_int;
8357 + /* "A negative field width is taken as a '-' flag
8358 + followed by a positive field width." */
8359 + flags |= FLAG_LEFT;
8360 + width = (unsigned int) (-arg);
8367 + const FCHAR_T *digitp = dp->width_start;
8370 + width = xsum (xtimes (width, 10), *digitp++ - '0');
8371 + while (digitp != dp->width_end);
8376 + has_precision = 0;
8378 + if (dp->precision_start != dp->precision_end)
8380 + if (dp->precision_arg_index != ARG_NONE)
8384 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
8386 + arg = a.arg[dp->precision_arg_index].a.a_int;
8387 + /* "A negative precision is taken as if the precision
8392 + has_precision = 1;
8397 + const FCHAR_T *digitp = dp->precision_start + 1;
8400 + while (digitp != dp->precision_end)
8401 + precision = xsum (xtimes (precision, 10), *digitp++ - '0');
8402 + has_precision = 1;
8406 + /* POSIX specifies the default precision to be 6 for %f, %F,
8407 + %e, %E, but not for %g, %G. Implementations appear to use
8408 + the same default precision also for %g, %G. But for %a, %A,
8409 + the default precision is 0. */
8410 + if (!has_precision)
8411 + if (!(dp->conversion == 'a' || dp->conversion == 'A'))
8414 + /* Allocate a temporary buffer of sufficient size. */
8415 +# if NEED_PRINTF_DOUBLE && NEED_PRINTF_LONG_DOUBLE
8416 + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : DBL_DIG + 1);
8417 +# elif NEED_PRINTF_INFINITE_DOUBLE && NEED_PRINTF_LONG_DOUBLE
8418 + tmp_length = (type == TYPE_LONGDOUBLE ? LDBL_DIG + 1 : 0);
8419 +# elif NEED_PRINTF_LONG_DOUBLE
8420 + tmp_length = LDBL_DIG + 1;
8421 +# elif NEED_PRINTF_DOUBLE
8422 + tmp_length = DBL_DIG + 1;
8426 + if (tmp_length < precision)
8427 + tmp_length = precision;
8428 +# if NEED_PRINTF_LONG_DOUBLE
8429 +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
8430 + if (type == TYPE_LONGDOUBLE)
8432 + if (dp->conversion == 'f' || dp->conversion == 'F')
8434 + long double arg = a.arg[dp->arg_index].a.a_longdouble;
8435 + if (!(isnanl (arg) || arg + arg == arg))
8437 + /* arg is finite and nonzero. */
8438 + int exponent = floorlog10l (arg < 0 ? -arg : arg);
8439 + if (exponent >= 0 && tmp_length < exponent + precision)
8440 + tmp_length = exponent + precision;
8444 +# if NEED_PRINTF_DOUBLE
8445 +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
8446 + if (type == TYPE_DOUBLE)
8448 + if (dp->conversion == 'f' || dp->conversion == 'F')
8450 + double arg = a.arg[dp->arg_index].a.a_double;
8451 + if (!(isnand (arg) || arg + arg == arg))
8453 + /* arg is finite and nonzero. */
8454 + int exponent = floorlog10 (arg < 0 ? -arg : arg);
8455 + if (exponent >= 0 && tmp_length < exponent + precision)
8456 + tmp_length = exponent + precision;
8460 + /* Account for sign, decimal point etc. */
8461 + tmp_length = xsum (tmp_length, 12);
8463 + if (tmp_length < width)
8464 + tmp_length = width;
8466 + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
8468 + if (tmp_length <= sizeof (tmpbuf) / sizeof (DCHAR_T))
8472 + size_t tmp_memsize = xtimes (tmp_length, sizeof (DCHAR_T));
8474 + if (size_overflow_p (tmp_memsize))
8475 + /* Overflow, would lead to out of memory. */
8476 + goto out_of_memory;
8477 + tmp = (DCHAR_T *) malloc (tmp_memsize);
8479 + /* Out of memory. */
8480 + goto out_of_memory;
8486 +# if NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE
8487 +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
8488 + if (type == TYPE_LONGDOUBLE)
8491 + long double arg = a.arg[dp->arg_index].a.a_longdouble;
8495 + if (dp->conversion >= 'A' && dp->conversion <= 'Z')
8497 + *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
8501 + *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
8507 + DECL_LONG_DOUBLE_ROUNDING
8509 + BEGIN_LONG_DOUBLE_ROUNDING ();
8511 + if (signbit (arg)) /* arg < 0.0L or negative zero */
8519 + else if (flags & FLAG_SHOWSIGN)
8521 + else if (flags & FLAG_SPACE)
8524 + if (arg > 0.0L && arg + arg == arg)
8526 + if (dp->conversion >= 'A' && dp->conversion <= 'Z')
8528 + *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
8532 + *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
8537 +# if NEED_PRINTF_LONG_DOUBLE
8540 + if (dp->conversion == 'f' || dp->conversion == 'F')
8546 + scale10_round_decimal_long_double (arg, precision);
8547 + if (digits == NULL)
8549 + END_LONG_DOUBLE_ROUNDING ();
8550 + goto out_of_memory;
8552 + ndigits = strlen (digits);
8554 + if (ndigits > precision)
8558 + *p++ = digits[ndigits];
8560 + while (ndigits > precision);
8563 + /* Here ndigits <= precision. */
8564 + if ((flags & FLAG_ALT) || precision > 0)
8566 + *p++ = decimal_point_char ();
8567 + for (; precision > ndigits; precision--)
8569 + while (ndigits > 0)
8572 + *p++ = digits[ndigits];
8578 + else if (dp->conversion == 'e' || dp->conversion == 'E')
8586 + if ((flags & FLAG_ALT) || precision > 0)
8588 + *p++ = decimal_point_char ();
8589 + for (; precision > 0; precision--)
8600 + exponent = floorlog10l (arg);
8605 + scale10_round_decimal_long_double (arg,
8606 + (int)precision - exponent);
8607 + if (digits == NULL)
8609 + END_LONG_DOUBLE_ROUNDING ();
8610 + goto out_of_memory;
8612 + ndigits = strlen (digits);
8614 + if (ndigits == precision + 1)
8616 + if (ndigits < precision
8617 + || ndigits > precision + 2)
8618 + /* The exponent was not guessed
8619 + precisely enough. */
8622 + /* None of two values of exponent is
8623 + the right one. Prevent an endless
8627 + if (ndigits == precision)
8633 + /* Here ndigits = precision+1. */
8634 + if (is_borderline (digits, precision))
8636 + /* Maybe the exponent guess was too high
8637 + and a smaller exponent can be reached
8638 + by turning a 10...0 into 9...9x. */
8640 + scale10_round_decimal_long_double (arg,
8641 + (int)precision - exponent + 1);
8642 + if (digits2 == NULL)
8645 + END_LONG_DOUBLE_ROUNDING ();
8646 + goto out_of_memory;
8648 + if (strlen (digits2) == precision + 1)
8657 + /* Here ndigits = precision+1. */
8659 + *p++ = digits[--ndigits];
8660 + if ((flags & FLAG_ALT) || precision > 0)
8662 + *p++ = decimal_point_char ();
8663 + while (ndigits > 0)
8666 + *p++ = digits[ndigits];
8673 + *p++ = dp->conversion; /* 'e' or 'E' */
8674 +# if WIDE_CHAR_VERSION
8676 + static const wchar_t decimal_format[] =
8677 + { '%', '+', '.', '2', 'd', '\0' };
8678 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
8680 + while (*p != '\0')
8683 + if (sizeof (DCHAR_T) == 1)
8685 + sprintf ((char *) p, "%+.2d", exponent);
8686 + while (*p != '\0')
8691 + char expbuf[6 + 1];
8693 + sprintf (expbuf, "%+.2d", exponent);
8694 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
8699 + else if (dp->conversion == 'g' || dp->conversion == 'G')
8701 + if (precision == 0)
8703 + /* precision >= 1. */
8706 + /* The exponent is 0, >= -4, < precision.
8707 + Use fixed-point notation. */
8709 + size_t ndigits = precision;
8710 + /* Number of trailing zeroes that have to be
8713 + (flags & FLAG_ALT ? 0 : precision - 1);
8717 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
8719 + *p++ = decimal_point_char ();
8720 + while (ndigits > nzeroes)
8736 + exponent = floorlog10l (arg);
8741 + scale10_round_decimal_long_double (arg,
8742 + (int)(precision - 1) - exponent);
8743 + if (digits == NULL)
8745 + END_LONG_DOUBLE_ROUNDING ();
8746 + goto out_of_memory;
8748 + ndigits = strlen (digits);
8750 + if (ndigits == precision)
8752 + if (ndigits < precision - 1
8753 + || ndigits > precision + 1)
8754 + /* The exponent was not guessed
8755 + precisely enough. */
8758 + /* None of two values of exponent is
8759 + the right one. Prevent an endless
8763 + if (ndigits < precision)
8769 + /* Here ndigits = precision. */
8770 + if (is_borderline (digits, precision - 1))
8772 + /* Maybe the exponent guess was too high
8773 + and a smaller exponent can be reached
8774 + by turning a 10...0 into 9...9x. */
8776 + scale10_round_decimal_long_double (arg,
8777 + (int)(precision - 1) - exponent + 1);
8778 + if (digits2 == NULL)
8781 + END_LONG_DOUBLE_ROUNDING ();
8782 + goto out_of_memory;
8784 + if (strlen (digits2) == precision)
8793 + /* Here ndigits = precision. */
8795 + /* Determine the number of trailing zeroes
8796 + that have to be dropped. */
8798 + if ((flags & FLAG_ALT) == 0)
8799 + while (nzeroes < ndigits
8800 + && digits[nzeroes] == '0')
8803 + /* The exponent is now determined. */
8804 + if (exponent >= -4
8805 + && exponent < (long)precision)
8807 + /* Fixed-point notation:
8808 + max(exponent,0)+1 digits, then the
8809 + decimal point, then the remaining
8810 + digits without trailing zeroes. */
8811 + if (exponent >= 0)
8813 + size_t count = exponent + 1;
8814 + /* Note: count <= precision = ndigits. */
8815 + for (; count > 0; count--)
8816 + *p++ = digits[--ndigits];
8817 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
8819 + *p++ = decimal_point_char ();
8820 + while (ndigits > nzeroes)
8823 + *p++ = digits[ndigits];
8829 + size_t count = -exponent - 1;
8831 + *p++ = decimal_point_char ();
8832 + for (; count > 0; count--)
8834 + while (ndigits > nzeroes)
8837 + *p++ = digits[ndigits];
8843 + /* Exponential notation. */
8844 + *p++ = digits[--ndigits];
8845 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
8847 + *p++ = decimal_point_char ();
8848 + while (ndigits > nzeroes)
8851 + *p++ = digits[ndigits];
8854 + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
8855 +# if WIDE_CHAR_VERSION
8857 + static const wchar_t decimal_format[] =
8858 + { '%', '+', '.', '2', 'd', '\0' };
8859 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
8861 + while (*p != '\0')
8864 + if (sizeof (DCHAR_T) == 1)
8866 + sprintf ((char *) p, "%+.2d", exponent);
8867 + while (*p != '\0')
8872 + char expbuf[6 + 1];
8874 + sprintf (expbuf, "%+.2d", exponent);
8875 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
8887 + /* arg is finite. */
8888 + if (!(arg == 0.0L))
8893 + if (dp->conversion == 'f' || dp->conversion == 'F')
8896 + if ((flags & FLAG_ALT) || precision > 0)
8898 + *p++ = decimal_point_char ();
8899 + for (; precision > 0; precision--)
8903 + else if (dp->conversion == 'e' || dp->conversion == 'E')
8906 + if ((flags & FLAG_ALT) || precision > 0)
8908 + *p++ = decimal_point_char ();
8909 + for (; precision > 0; precision--)
8912 + *p++ = dp->conversion; /* 'e' or 'E' */
8917 + else if (dp->conversion == 'g' || dp->conversion == 'G')
8920 + if (flags & FLAG_ALT)
8923 + (precision > 0 ? precision - 1 : 0);
8924 + *p++ = decimal_point_char ();
8925 + for (; ndigits > 0; --ndigits)
8929 + else if (dp->conversion == 'a' || dp->conversion == 'A')
8932 + *p++ = dp->conversion - 'A' + 'X';
8935 + if ((flags & FLAG_ALT) || precision > 0)
8937 + *p++ = decimal_point_char ();
8938 + for (; precision > 0; precision--)
8941 + *p++ = dp->conversion - 'A' + 'P';
8950 + END_LONG_DOUBLE_ROUNDING ();
8953 +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
8957 +# if NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE
8959 + double arg = a.arg[dp->arg_index].a.a_double;
8963 + if (dp->conversion >= 'A' && dp->conversion <= 'Z')
8965 + *p++ = 'N'; *p++ = 'A'; *p++ = 'N';
8969 + *p++ = 'n'; *p++ = 'a'; *p++ = 'n';
8976 + if (signbit (arg)) /* arg < 0.0 or negative zero */
8984 + else if (flags & FLAG_SHOWSIGN)
8986 + else if (flags & FLAG_SPACE)
8989 + if (arg > 0.0 && arg + arg == arg)
8991 + if (dp->conversion >= 'A' && dp->conversion <= 'Z')
8993 + *p++ = 'I'; *p++ = 'N'; *p++ = 'F';
8997 + *p++ = 'i'; *p++ = 'n'; *p++ = 'f';
9002 +# if NEED_PRINTF_DOUBLE
9005 + if (dp->conversion == 'f' || dp->conversion == 'F')
9011 + scale10_round_decimal_double (arg, precision);
9012 + if (digits == NULL)
9013 + goto out_of_memory;
9014 + ndigits = strlen (digits);
9016 + if (ndigits > precision)
9020 + *p++ = digits[ndigits];
9022 + while (ndigits > precision);
9025 + /* Here ndigits <= precision. */
9026 + if ((flags & FLAG_ALT) || precision > 0)
9028 + *p++ = decimal_point_char ();
9029 + for (; precision > ndigits; precision--)
9031 + while (ndigits > 0)
9034 + *p++ = digits[ndigits];
9040 + else if (dp->conversion == 'e' || dp->conversion == 'E')
9048 + if ((flags & FLAG_ALT) || precision > 0)
9050 + *p++ = decimal_point_char ();
9051 + for (; precision > 0; precision--)
9062 + exponent = floorlog10 (arg);
9067 + scale10_round_decimal_double (arg,
9068 + (int)precision - exponent);
9069 + if (digits == NULL)
9070 + goto out_of_memory;
9071 + ndigits = strlen (digits);
9073 + if (ndigits == precision + 1)
9075 + if (ndigits < precision
9076 + || ndigits > precision + 2)
9077 + /* The exponent was not guessed
9078 + precisely enough. */
9081 + /* None of two values of exponent is
9082 + the right one. Prevent an endless
9086 + if (ndigits == precision)
9092 + /* Here ndigits = precision+1. */
9093 + if (is_borderline (digits, precision))
9095 + /* Maybe the exponent guess was too high
9096 + and a smaller exponent can be reached
9097 + by turning a 10...0 into 9...9x. */
9099 + scale10_round_decimal_double (arg,
9100 + (int)precision - exponent + 1);
9101 + if (digits2 == NULL)
9104 + goto out_of_memory;
9106 + if (strlen (digits2) == precision + 1)
9115 + /* Here ndigits = precision+1. */
9117 + *p++ = digits[--ndigits];
9118 + if ((flags & FLAG_ALT) || precision > 0)
9120 + *p++ = decimal_point_char ();
9121 + while (ndigits > 0)
9124 + *p++ = digits[ndigits];
9131 + *p++ = dp->conversion; /* 'e' or 'E' */
9132 +# if WIDE_CHAR_VERSION
9134 + static const wchar_t decimal_format[] =
9135 + /* Produce the same number of exponent digits
9136 + as the native printf implementation. */
9137 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9138 + { '%', '+', '.', '3', 'd', '\0' };
9140 + { '%', '+', '.', '2', 'd', '\0' };
9142 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
9144 + while (*p != '\0')
9148 + static const char decimal_format[] =
9149 + /* Produce the same number of exponent digits
9150 + as the native printf implementation. */
9151 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9156 + if (sizeof (DCHAR_T) == 1)
9158 + sprintf ((char *) p, decimal_format, exponent);
9159 + while (*p != '\0')
9164 + char expbuf[6 + 1];
9166 + sprintf (expbuf, decimal_format, exponent);
9167 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
9173 + else if (dp->conversion == 'g' || dp->conversion == 'G')
9175 + if (precision == 0)
9177 + /* precision >= 1. */
9180 + /* The exponent is 0, >= -4, < precision.
9181 + Use fixed-point notation. */
9183 + size_t ndigits = precision;
9184 + /* Number of trailing zeroes that have to be
9187 + (flags & FLAG_ALT ? 0 : precision - 1);
9191 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9193 + *p++ = decimal_point_char ();
9194 + while (ndigits > nzeroes)
9210 + exponent = floorlog10 (arg);
9215 + scale10_round_decimal_double (arg,
9216 + (int)(precision - 1) - exponent);
9217 + if (digits == NULL)
9218 + goto out_of_memory;
9219 + ndigits = strlen (digits);
9221 + if (ndigits == precision)
9223 + if (ndigits < precision - 1
9224 + || ndigits > precision + 1)
9225 + /* The exponent was not guessed
9226 + precisely enough. */
9229 + /* None of two values of exponent is
9230 + the right one. Prevent an endless
9234 + if (ndigits < precision)
9240 + /* Here ndigits = precision. */
9241 + if (is_borderline (digits, precision - 1))
9243 + /* Maybe the exponent guess was too high
9244 + and a smaller exponent can be reached
9245 + by turning a 10...0 into 9...9x. */
9247 + scale10_round_decimal_double (arg,
9248 + (int)(precision - 1) - exponent + 1);
9249 + if (digits2 == NULL)
9252 + goto out_of_memory;
9254 + if (strlen (digits2) == precision)
9263 + /* Here ndigits = precision. */
9265 + /* Determine the number of trailing zeroes
9266 + that have to be dropped. */
9268 + if ((flags & FLAG_ALT) == 0)
9269 + while (nzeroes < ndigits
9270 + && digits[nzeroes] == '0')
9273 + /* The exponent is now determined. */
9274 + if (exponent >= -4
9275 + && exponent < (long)precision)
9277 + /* Fixed-point notation:
9278 + max(exponent,0)+1 digits, then the
9279 + decimal point, then the remaining
9280 + digits without trailing zeroes. */
9281 + if (exponent >= 0)
9283 + size_t count = exponent + 1;
9284 + /* Note: count <= precision = ndigits. */
9285 + for (; count > 0; count--)
9286 + *p++ = digits[--ndigits];
9287 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9289 + *p++ = decimal_point_char ();
9290 + while (ndigits > nzeroes)
9293 + *p++ = digits[ndigits];
9299 + size_t count = -exponent - 1;
9301 + *p++ = decimal_point_char ();
9302 + for (; count > 0; count--)
9304 + while (ndigits > nzeroes)
9307 + *p++ = digits[ndigits];
9313 + /* Exponential notation. */
9314 + *p++ = digits[--ndigits];
9315 + if ((flags & FLAG_ALT) || ndigits > nzeroes)
9317 + *p++ = decimal_point_char ();
9318 + while (ndigits > nzeroes)
9321 + *p++ = digits[ndigits];
9324 + *p++ = dp->conversion - 'G' + 'E'; /* 'e' or 'E' */
9325 +# if WIDE_CHAR_VERSION
9327 + static const wchar_t decimal_format[] =
9328 + /* Produce the same number of exponent digits
9329 + as the native printf implementation. */
9330 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9331 + { '%', '+', '.', '3', 'd', '\0' };
9333 + { '%', '+', '.', '2', 'd', '\0' };
9335 + SNPRINTF (p, 6 + 1, decimal_format, exponent);
9337 + while (*p != '\0')
9341 + static const char decimal_format[] =
9342 + /* Produce the same number of exponent digits
9343 + as the native printf implementation. */
9344 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9349 + if (sizeof (DCHAR_T) == 1)
9351 + sprintf ((char *) p, decimal_format, exponent);
9352 + while (*p != '\0')
9357 + char expbuf[6 + 1];
9359 + sprintf (expbuf, decimal_format, exponent);
9360 + for (ep = expbuf; (*p = *ep) != '\0'; ep++)
9373 + /* arg is finite. */
9374 + if (!(arg == 0.0))
9379 + if (dp->conversion == 'f' || dp->conversion == 'F')
9382 + if ((flags & FLAG_ALT) || precision > 0)
9384 + *p++ = decimal_point_char ();
9385 + for (; precision > 0; precision--)
9389 + else if (dp->conversion == 'e' || dp->conversion == 'E')
9392 + if ((flags & FLAG_ALT) || precision > 0)
9394 + *p++ = decimal_point_char ();
9395 + for (; precision > 0; precision--)
9398 + *p++ = dp->conversion; /* 'e' or 'E' */
9400 + /* Produce the same number of exponent digits as
9401 + the native printf implementation. */
9402 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9408 + else if (dp->conversion == 'g' || dp->conversion == 'G')
9411 + if (flags & FLAG_ALT)
9414 + (precision > 0 ? precision - 1 : 0);
9415 + *p++ = decimal_point_char ();
9416 + for (; ndigits > 0; --ndigits)
9428 + /* The generated string now extends from tmp to p, with the
9429 + zero padding insertion point being at pad_ptr. */
9430 + if (has_width && p - tmp < width)
9432 + size_t pad = width - (p - tmp);
9433 + DCHAR_T *end = p + pad;
9435 + if (flags & FLAG_LEFT)
9437 + /* Pad with spaces on the right. */
9438 + for (; pad > 0; pad--)
9441 + else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
9443 + /* Pad with zeroes. */
9446 + while (p > pad_ptr)
9448 + for (; pad > 0; pad--)
9453 + /* Pad with spaces on the left. */
9458 + for (; pad > 0; pad--)
9466 + size_t count = p - tmp;
9468 + if (count >= tmp_length)
9469 + /* tmp_length was incorrectly calculated - fix the
9473 + /* Make room for the result. */
9474 + if (count >= allocated - length)
9476 + size_t n = xsum (length, count);
9478 + ENSURE_ALLOCATION (n);
9481 + /* Append the result. */
9482 + memcpy (result + length, tmp, count * sizeof (DCHAR_T));
9483 + if (tmp != tmpbuf)
9491 + arg_type type = a.arg[dp->arg_index].type;
9492 + int flags = dp->flags;
9493 +#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
9497 +#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
9498 + int has_precision;
9501 +#if NEED_PRINTF_UNBOUNDED_PRECISION
9502 + int prec_ourselves;
9504 +# define prec_ourselves 0
9506 +#if NEED_PRINTF_FLAG_LEFTADJUST
9507 +# define pad_ourselves 1
9508 +#elif !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
9509 + int pad_ourselves;
9511 +# define pad_ourselves 0
9514 + unsigned int prefix_count;
9515 + int prefixes[2] IF_LINT (= { 0 });
9517 + size_t tmp_length;
9518 + TCHAR_T tmpbuf[700];
9522 +#if !USE_SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
9525 + if (dp->width_start != dp->width_end)
9527 + if (dp->width_arg_index != ARG_NONE)
9531 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
9533 + arg = a.arg[dp->width_arg_index].a.a_int;
9536 + /* "A negative field width is taken as a '-' flag
9537 + followed by a positive field width." */
9538 + flags |= FLAG_LEFT;
9539 + width = (unsigned int) (-arg);
9546 + const FCHAR_T *digitp = dp->width_start;
9549 + width = xsum (xtimes (width, 10), *digitp++ - '0');
9550 + while (digitp != dp->width_end);
9556 +#if !USE_SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
9557 + has_precision = 0;
9559 + if (dp->precision_start != dp->precision_end)
9561 + if (dp->precision_arg_index != ARG_NONE)
9565 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
9567 + arg = a.arg[dp->precision_arg_index].a.a_int;
9568 + /* "A negative precision is taken as if the precision
9573 + has_precision = 1;
9578 + const FCHAR_T *digitp = dp->precision_start + 1;
9581 + while (digitp != dp->precision_end)
9582 + precision = xsum (xtimes (precision, 10), *digitp++ - '0');
9583 + has_precision = 1;
9588 + /* Decide whether to handle the precision ourselves. */
9589 +#if NEED_PRINTF_UNBOUNDED_PRECISION
9590 + switch (dp->conversion)
9592 + case 'd': case 'i': case 'u':
9594 + case 'x': case 'X': case 'p':
9595 + prec_ourselves = has_precision && (precision > 0);
9598 + prec_ourselves = 0;
9603 + /* Decide whether to perform the padding ourselves. */
9604 +#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
9605 + switch (dp->conversion)
9607 +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
9608 + /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
9609 + to perform the padding after this conversion. Functions
9610 + with unistdio extensions perform the padding based on
9611 + character count rather than element count. */
9612 + case 'c': case 's':
9614 +# if NEED_PRINTF_FLAG_ZERO
9615 + case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
9616 + case 'a': case 'A':
9618 + pad_ourselves = 1;
9621 + pad_ourselves = prec_ourselves;
9627 + /* Allocate a temporary buffer of sufficient size for calling
9630 + switch (dp->conversion)
9633 + case 'd': case 'i': case 'u':
9634 +# if HAVE_LONG_LONG_INT
9635 + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
9637 + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
9638 + * 0.30103 /* binary -> decimal */
9640 + + 1; /* turn floor into ceil */
9643 + if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
9645 + (unsigned int) (sizeof (unsigned long) * CHAR_BIT
9646 + * 0.30103 /* binary -> decimal */
9648 + + 1; /* turn floor into ceil */
9651 + (unsigned int) (sizeof (unsigned int) * CHAR_BIT
9652 + * 0.30103 /* binary -> decimal */
9654 + + 1; /* turn floor into ceil */
9655 + if (tmp_length < precision)
9656 + tmp_length = precision;
9657 + /* Multiply by 2, as an estimate for FLAG_GROUP. */
9658 + tmp_length = xsum (tmp_length, tmp_length);
9659 + /* Add 1, to account for a leading sign. */
9660 + tmp_length = xsum (tmp_length, 1);
9664 +# if HAVE_LONG_LONG_INT
9665 + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
9667 + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
9668 + * 0.333334 /* binary -> octal */
9670 + + 1; /* turn floor into ceil */
9673 + if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
9675 + (unsigned int) (sizeof (unsigned long) * CHAR_BIT
9676 + * 0.333334 /* binary -> octal */
9678 + + 1; /* turn floor into ceil */
9681 + (unsigned int) (sizeof (unsigned int) * CHAR_BIT
9682 + * 0.333334 /* binary -> octal */
9684 + + 1; /* turn floor into ceil */
9685 + if (tmp_length < precision)
9686 + tmp_length = precision;
9687 + /* Add 1, to account for a leading sign. */
9688 + tmp_length = xsum (tmp_length, 1);
9691 + case 'x': case 'X':
9692 +# if HAVE_LONG_LONG_INT
9693 + if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
9695 + (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
9696 + * 0.25 /* binary -> hexadecimal */
9698 + + 1; /* turn floor into ceil */
9701 + if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
9703 + (unsigned int) (sizeof (unsigned long) * CHAR_BIT
9704 + * 0.25 /* binary -> hexadecimal */
9706 + + 1; /* turn floor into ceil */
9709 + (unsigned int) (sizeof (unsigned int) * CHAR_BIT
9710 + * 0.25 /* binary -> hexadecimal */
9712 + + 1; /* turn floor into ceil */
9713 + if (tmp_length < precision)
9714 + tmp_length = precision;
9715 + /* Add 2, to account for a leading sign or alternate form. */
9716 + tmp_length = xsum (tmp_length, 2);
9719 + case 'f': case 'F':
9720 + if (type == TYPE_LONGDOUBLE)
9722 + (unsigned int) (LDBL_MAX_EXP
9723 + * 0.30103 /* binary -> decimal */
9724 + * 2 /* estimate for FLAG_GROUP */
9726 + + 1 /* turn floor into ceil */
9727 + + 10; /* sign, decimal point etc. */
9730 + (unsigned int) (DBL_MAX_EXP
9731 + * 0.30103 /* binary -> decimal */
9732 + * 2 /* estimate for FLAG_GROUP */
9734 + + 1 /* turn floor into ceil */
9735 + + 10; /* sign, decimal point etc. */
9736 + tmp_length = xsum (tmp_length, precision);
9739 + case 'e': case 'E': case 'g': case 'G':
9741 + 12; /* sign, decimal point, exponent etc. */
9742 + tmp_length = xsum (tmp_length, precision);
9745 + case 'a': case 'A':
9746 + if (type == TYPE_LONGDOUBLE)
9748 + (unsigned int) (LDBL_DIG
9749 + * 0.831 /* decimal -> hexadecimal */
9751 + + 1; /* turn floor into ceil */
9754 + (unsigned int) (DBL_DIG
9755 + * 0.831 /* decimal -> hexadecimal */
9757 + + 1; /* turn floor into ceil */
9758 + if (tmp_length < precision)
9759 + tmp_length = precision;
9760 + /* Account for sign, decimal point etc. */
9761 + tmp_length = xsum (tmp_length, 12);
9765 +# if HAVE_WINT_T && !WIDE_CHAR_VERSION
9766 + if (type == TYPE_WIDE_CHAR)
9767 + tmp_length = MB_CUR_MAX;
9775 + if (type == TYPE_WIDE_STRING)
9778 + local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
9780 +# if !WIDE_CHAR_VERSION
9781 + tmp_length = xtimes (tmp_length, MB_CUR_MAX);
9786 + tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
9791 + (unsigned int) (sizeof (void *) * CHAR_BIT
9792 + * 0.25 /* binary -> hexadecimal */
9794 + + 1 /* turn floor into ceil */
9795 + + 2; /* account for leading 0x */
9802 + if (!pad_ourselves)
9804 +# if ENABLE_UNISTDIO
9805 + /* Padding considers the number of characters, therefore
9806 + the number of elements after padding may be
9807 + > max (tmp_length, width)
9809 + <= tmp_length + width. */
9810 + tmp_length = xsum (tmp_length, width);
9812 + /* Padding considers the number of elements,
9814 + if (tmp_length < width)
9815 + tmp_length = width;
9819 + tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
9822 + if (tmp_length <= sizeof (tmpbuf) / sizeof (TCHAR_T))
9826 + size_t tmp_memsize = xtimes (tmp_length, sizeof (TCHAR_T));
9828 + if (size_overflow_p (tmp_memsize))
9829 + /* Overflow, would lead to out of memory. */
9830 + goto out_of_memory;
9831 + tmp = (TCHAR_T *) malloc (tmp_memsize);
9833 + /* Out of memory. */
9834 + goto out_of_memory;
9838 + /* Construct the format string for calling snprintf or
9842 +#if NEED_PRINTF_FLAG_GROUPING
9843 + /* The underlying implementation doesn't support the ' flag.
9844 + Produce no grouping characters in this case; this is
9845 + acceptable because the grouping is locale dependent. */
9847 + if (flags & FLAG_GROUP)
9850 + if (flags & FLAG_LEFT)
9852 + if (flags & FLAG_SHOWSIGN)
9854 + if (flags & FLAG_SPACE)
9856 + if (flags & FLAG_ALT)
9858 + if (!pad_ourselves)
9860 + if (flags & FLAG_ZERO)
9862 + if (dp->width_start != dp->width_end)
9864 + size_t n = dp->width_end - dp->width_start;
9865 + /* The width specification is known to consist only
9866 + of standard ASCII characters. */
9867 + if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
9869 + memcpy (fbp, dp->width_start, n * sizeof (TCHAR_T));
9874 + const FCHAR_T *mp = dp->width_start;
9876 + *fbp++ = (unsigned char) *mp++;
9881 + if (!prec_ourselves)
9883 + if (dp->precision_start != dp->precision_end)
9885 + size_t n = dp->precision_end - dp->precision_start;
9886 + /* The precision specification is known to consist only
9887 + of standard ASCII characters. */
9888 + if (sizeof (FCHAR_T) == sizeof (TCHAR_T))
9890 + memcpy (fbp, dp->precision_start, n * sizeof (TCHAR_T));
9895 + const FCHAR_T *mp = dp->precision_start;
9897 + *fbp++ = (unsigned char) *mp++;
9905 +#if HAVE_LONG_LONG_INT
9906 + case TYPE_LONGLONGINT:
9907 + case TYPE_ULONGLONGINT:
9908 +# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
9918 + case TYPE_LONGINT:
9919 + case TYPE_ULONGINT:
9921 + case TYPE_WIDE_CHAR:
9924 + case TYPE_WIDE_STRING:
9928 + case TYPE_LONGDOUBLE:
9934 +#if NEED_PRINTF_DIRECTIVE_F
9935 + if (dp->conversion == 'F')
9939 + *fbp = dp->conversion;
9941 +# if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
9946 + /* On glibc2 systems from glibc >= 2.3 - probably also older
9947 + ones - we know that snprintf's returns value conforms to
9948 + ISO C 99: the gl_SNPRINTF_DIRECTIVE_N test passes.
9949 + Therefore we can avoid using %n in this situation.
9950 + On glibc2 systems from 2004-10-18 or newer, the use of %n
9951 + in format strings in writable memory may crash the program
9952 + (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
9953 + in this situation. */
9954 + /* On native Win32 systems (such as mingw), we can avoid using
9956 + - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
9957 + snprintf does not write more than the specified number
9958 + of bytes. (snprintf (buf, 3, "%d %d", 4567, 89) writes
9959 + '4', '5', '6' into buf, not '4', '5', '\0'.)
9960 + - Although the gl_SNPRINTF_RETVAL_C99 test fails, snprintf
9961 + allows us to recognize the case of an insufficient
9962 + buffer size: it returns -1 in this case.
9963 + On native Win32 systems (such as mingw) where the OS is
9964 + Windows Vista, the use of %n in format strings by default
9965 + crashes the program. See
9966 + <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
9967 + <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx>
9968 + So we should avoid %n in this situation. */
9975 + /* Construct the arguments for calling snprintf or sprintf. */
9977 + if (!pad_ourselves && dp->width_arg_index != ARG_NONE)
9979 + if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
9981 + prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
9983 + if (!prec_ourselves && dp->precision_arg_index != ARG_NONE)
9985 + if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
9987 + prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
9991 + /* The SNPRINTF result is appended after result[0..length].
9992 + The latter is an array of DCHAR_T; SNPRINTF appends an
9993 + array of TCHAR_T to it. This is possible because
9994 + sizeof (TCHAR_T) divides sizeof (DCHAR_T) and
9995 + alignof (TCHAR_T) <= alignof (DCHAR_T). */
9996 +# define TCHARS_PER_DCHAR (sizeof (DCHAR_T) / sizeof (TCHAR_T))
9997 + /* Ensure that maxlen below will be >= 2. Needed on BeOS,
9998 + where an snprintf() with maxlen==1 acts like sprintf(). */
9999 + ENSURE_ALLOCATION (xsum (length,
10000 + (2 + TCHARS_PER_DCHAR - 1)
10001 + / TCHARS_PER_DCHAR));
10002 + /* Prepare checking whether snprintf returns the count
10004 + *(TCHAR_T *) (result + length) = '\0';
10012 + int retcount = 0;
10013 + size_t maxlen = allocated - length;
10014 + /* SNPRINTF can fail if its second argument is
10016 + if (maxlen > INT_MAX / TCHARS_PER_DCHAR)
10017 + maxlen = INT_MAX / TCHARS_PER_DCHAR;
10018 + maxlen = maxlen * TCHARS_PER_DCHAR;
10019 +# define SNPRINTF_BUF(arg) \
10020 + switch (prefix_count) \
10023 + retcount = SNPRINTF ((TCHAR_T *) (result + length), \
10028 + retcount = SNPRINTF ((TCHAR_T *) (result + length), \
10030 + prefixes[0], arg, &count); \
10033 + retcount = SNPRINTF ((TCHAR_T *) (result + length), \
10035 + prefixes[0], prefixes[1], arg, \
10042 +# define SNPRINTF_BUF(arg) \
10043 + switch (prefix_count) \
10046 + count = sprintf (tmp, buf, arg); \
10049 + count = sprintf (tmp, buf, prefixes[0], arg); \
10052 + count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
10064 + int arg = a.arg[dp->arg_index].a.a_schar;
10065 + SNPRINTF_BUF (arg);
10070 + unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
10071 + SNPRINTF_BUF (arg);
10076 + int arg = a.arg[dp->arg_index].a.a_short;
10077 + SNPRINTF_BUF (arg);
10080 + case TYPE_USHORT:
10082 + unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
10083 + SNPRINTF_BUF (arg);
10088 + int arg = a.arg[dp->arg_index].a.a_int;
10089 + SNPRINTF_BUF (arg);
10094 + unsigned int arg = a.arg[dp->arg_index].a.a_uint;
10095 + SNPRINTF_BUF (arg);
10098 + case TYPE_LONGINT:
10100 + long int arg = a.arg[dp->arg_index].a.a_longint;
10101 + SNPRINTF_BUF (arg);
10104 + case TYPE_ULONGINT:
10106 + unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
10107 + SNPRINTF_BUF (arg);
10110 +#if HAVE_LONG_LONG_INT
10111 + case TYPE_LONGLONGINT:
10113 + long long int arg = a.arg[dp->arg_index].a.a_longlongint;
10114 + SNPRINTF_BUF (arg);
10117 + case TYPE_ULONGLONGINT:
10119 + unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
10120 + SNPRINTF_BUF (arg);
10124 + case TYPE_DOUBLE:
10126 + double arg = a.arg[dp->arg_index].a.a_double;
10127 + SNPRINTF_BUF (arg);
10130 + case TYPE_LONGDOUBLE:
10132 + long double arg = a.arg[dp->arg_index].a.a_longdouble;
10133 + SNPRINTF_BUF (arg);
10138 + int arg = a.arg[dp->arg_index].a.a_char;
10139 + SNPRINTF_BUF (arg);
10143 + case TYPE_WIDE_CHAR:
10145 + wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
10146 + SNPRINTF_BUF (arg);
10150 + case TYPE_STRING:
10152 + const char *arg = a.arg[dp->arg_index].a.a_string;
10153 + SNPRINTF_BUF (arg);
10157 + case TYPE_WIDE_STRING:
10159 + const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
10160 + SNPRINTF_BUF (arg);
10164 + case TYPE_POINTER:
10166 + void *arg = a.arg[dp->arg_index].a.a_pointer;
10167 + SNPRINTF_BUF (arg);
10175 + /* Portability: Not all implementations of snprintf()
10176 + are ISO C 99 compliant. Determine the number of
10177 + bytes that snprintf() has produced or would have
10181 + /* Verify that snprintf() has NUL-terminated its
10183 + if (count < maxlen
10184 + && ((TCHAR_T *) (result + length)) [count] != '\0')
10186 + /* Portability hack. */
10187 + if (retcount > count)
10188 + count = retcount;
10192 + /* snprintf() doesn't understand the '%n'
10194 + if (fbp[1] != '\0')
10196 + /* Don't use the '%n' directive; instead, look
10197 + at the snprintf() return value. */
10203 + /* Look at the snprintf() return value. */
10204 + if (retcount < 0)
10206 + /* HP-UX 10.20 snprintf() is doubly deficient:
10207 + It doesn't understand the '%n' directive,
10208 + *and* it returns -1 (rather than the length
10209 + that would have been required) when the
10210 + buffer is too small. */
10211 + size_t bigger_need =
10212 + xsum (xtimes (allocated, 2), 12);
10213 + ENSURE_ALLOCATION (bigger_need);
10217 + count = retcount;
10222 + /* Attempt to handle failure. */
10225 + if (!(result == resultbuf || result == NULL))
10227 + if (buf_malloced != NULL)
10228 + free (buf_malloced);
10235 + /* Handle overflow of the allocated buffer.
10236 + If such an overflow occurs, a C99 compliant snprintf()
10237 + returns a count >= maxlen. However, a non-compliant
10238 + snprintf() function returns only count = maxlen - 1. To
10239 + cover both cases, test whether count >= maxlen - 1. */
10240 + if ((unsigned int) count + 1 >= maxlen)
10242 + /* If maxlen already has attained its allowed maximum,
10243 + allocating more memory will not increase maxlen.
10244 + Instead of looping, bail out. */
10245 + if (maxlen == INT_MAX / TCHARS_PER_DCHAR)
10249 + /* Need at least (count + 1) * sizeof (TCHAR_T)
10250 + bytes. (The +1 is for the trailing NUL.)
10251 + But ask for (count + 2) * sizeof (TCHAR_T)
10252 + bytes, so that in the next round, we likely get
10253 + maxlen > (unsigned int) count + 1
10254 + and so we don't get here again.
10255 + And allocate proportionally, to avoid looping
10256 + eternally if snprintf() reports a too small
10259 + xmax (xsum (length,
10260 + ((unsigned int) count + 2
10261 + + TCHARS_PER_DCHAR - 1)
10262 + / TCHARS_PER_DCHAR),
10263 + xtimes (allocated, 2));
10265 + ENSURE_ALLOCATION (n);
10271 +#if NEED_PRINTF_UNBOUNDED_PRECISION
10272 + if (prec_ourselves)
10274 + /* Handle the precision. */
10275 + TCHAR_T *prec_ptr =
10277 + (TCHAR_T *) (result + length);
10281 + size_t prefix_count;
10284 + prefix_count = 0;
10285 + /* Put the additional zeroes after the sign. */
10287 + && (*prec_ptr == '-' || *prec_ptr == '+'
10288 + || *prec_ptr == ' '))
10289 + prefix_count = 1;
10290 + /* Put the additional zeroes after the 0x prefix if
10291 + (flags & FLAG_ALT) || (dp->conversion == 'p'). */
10292 + else if (count >= 2
10293 + && prec_ptr[0] == '0'
10294 + && (prec_ptr[1] == 'x' || prec_ptr[1] == 'X'))
10295 + prefix_count = 2;
10297 + move = count - prefix_count;
10298 + if (precision > move)
10300 + /* Insert zeroes. */
10301 + size_t insert = precision - move;
10302 + TCHAR_T *prec_end;
10307 + (count + insert + TCHARS_PER_DCHAR - 1)
10308 + / TCHARS_PER_DCHAR);
10309 + length += (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
10310 + ENSURE_ALLOCATION (n);
10311 + length -= (count + TCHARS_PER_DCHAR - 1) / TCHARS_PER_DCHAR;
10312 + prec_ptr = (TCHAR_T *) (result + length);
10315 + prec_end = prec_ptr + count;
10316 + prec_ptr += prefix_count;
10318 + while (prec_end > prec_ptr)
10321 + prec_end[insert] = prec_end[0];
10324 + prec_end += insert;
10326 + *--prec_end = '0';
10327 + while (prec_end > prec_ptr);
10335 + if (count >= tmp_length)
10336 + /* tmp_length was incorrectly calculated - fix the
10341 +#if !DCHAR_IS_TCHAR
10342 + /* Convert from TCHAR_T[] to DCHAR_T[]. */
10343 + if (dp->conversion == 'c' || dp->conversion == 's')
10345 + /* type = TYPE_CHAR or TYPE_WIDE_CHAR or TYPE_STRING
10346 + TYPE_WIDE_STRING.
10347 + The result string is not certainly ASCII. */
10348 + const TCHAR_T *tmpsrc;
10350 + size_t tmpdst_len;
10351 + /* This code assumes that TCHAR_T is 'char'. */
10352 + typedef int TCHAR_T_verify
10353 + [2 * (sizeof (TCHAR_T) == 1) - 1];
10355 + tmpsrc = (TCHAR_T *) (result + length);
10361 + if (DCHAR_CONV_FROM_ENCODING (locale_charset (),
10362 + iconveh_question_mark,
10365 + &tmpdst, &tmpdst_len)
10368 + int saved_errno = errno;
10369 + if (!(result == resultbuf || result == NULL))
10371 + if (buf_malloced != NULL)
10372 + free (buf_malloced);
10374 + errno = saved_errno;
10377 + ENSURE_ALLOCATION (xsum (length, tmpdst_len));
10378 + DCHAR_CPY (result + length, tmpdst, tmpdst_len);
10380 + count = tmpdst_len;
10384 + /* The result string is ASCII.
10385 + Simple 1:1 conversion. */
10387 + /* If sizeof (DCHAR_T) == sizeof (TCHAR_T), it's a
10388 + no-op conversion, in-place on the array starting
10389 + at (result + length). */
10390 + if (sizeof (DCHAR_T) != sizeof (TCHAR_T))
10393 + const TCHAR_T *tmpsrc;
10398 + if (result == resultbuf)
10400 + tmpsrc = (TCHAR_T *) (result + length);
10401 + /* ENSURE_ALLOCATION will not move tmpsrc
10402 + (because it's part of resultbuf). */
10403 + ENSURE_ALLOCATION (xsum (length, count));
10407 + /* ENSURE_ALLOCATION will move the array
10408 + (because it uses realloc(). */
10409 + ENSURE_ALLOCATION (xsum (length, count));
10410 + tmpsrc = (TCHAR_T *) (result + length);
10414 + ENSURE_ALLOCATION (xsum (length, count));
10416 + tmpdst = result + length;
10417 + /* Copy backwards, because of overlapping. */
10420 + for (n = count; n > 0; n--)
10421 + *--tmpdst = (unsigned char) *--tmpsrc;
10426 +#if DCHAR_IS_TCHAR && !USE_SNPRINTF
10427 + /* Make room for the result. */
10428 + if (count > allocated - length)
10430 + /* Need at least count elements. But allocate
10431 + proportionally. */
10433 + xmax (xsum (length, count), xtimes (allocated, 2));
10435 + ENSURE_ALLOCATION (n);
10439 + /* Here count <= allocated - length. */
10441 + /* Perform padding. */
10442 +#if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
10443 + if (pad_ourselves && has_width)
10446 +# if ENABLE_UNISTDIO
10447 + /* Outside POSIX, it's preferrable to compare the width
10448 + against the number of _characters_ of the converted
10450 + w = DCHAR_MBSNLEN (result + length, count);
10452 + /* The width is compared against the number of _bytes_
10453 + of the converted value, says POSIX. */
10458 + size_t pad = width - w;
10460 + /* Make room for the result. */
10461 + if (xsum (count, pad) > allocated - length)
10463 + /* Need at least count + pad elements. But
10464 + allocate proportionally. */
10466 + xmax (xsum3 (length, count, pad),
10467 + xtimes (allocated, 2));
10471 + ENSURE_ALLOCATION (n);
10474 + ENSURE_ALLOCATION (n);
10477 + /* Here count + pad <= allocated - length. */
10480 +# if !DCHAR_IS_TCHAR || USE_SNPRINTF
10481 + DCHAR_T * const rp = result + length;
10483 + DCHAR_T * const rp = tmp;
10485 + DCHAR_T *p = rp + count;
10486 + DCHAR_T *end = p + pad;
10487 + DCHAR_T *pad_ptr;
10488 +# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
10489 + if (dp->conversion == 'c'
10490 + || dp->conversion == 's')
10491 + /* No zero-padding for string directives. */
10496 + pad_ptr = (*rp == '-' ? rp + 1 : rp);
10497 + /* No zero-padding of "inf" and "nan". */
10498 + if ((*pad_ptr >= 'A' && *pad_ptr <= 'Z')
10499 + || (*pad_ptr >= 'a' && *pad_ptr <= 'z'))
10502 + /* The generated string now extends from rp to p,
10503 + with the zero padding insertion point being at
10506 + count = count + pad; /* = end - rp */
10508 + if (flags & FLAG_LEFT)
10510 + /* Pad with spaces on the right. */
10511 + for (; pad > 0; pad--)
10514 + else if ((flags & FLAG_ZERO) && pad_ptr != NULL)
10516 + /* Pad with zeroes. */
10517 + DCHAR_T *q = end;
10519 + while (p > pad_ptr)
10521 + for (; pad > 0; pad--)
10526 + /* Pad with spaces on the left. */
10527 + DCHAR_T *q = end;
10531 + for (; pad > 0; pad--)
10539 + /* Here still count <= allocated - length. */
10541 +#if !DCHAR_IS_TCHAR || USE_SNPRINTF
10542 + /* The snprintf() result did fit. */
10544 + /* Append the sprintf() result. */
10545 + memcpy (result + length, tmp, count * sizeof (DCHAR_T));
10548 + if (tmp != tmpbuf)
10552 +#if NEED_PRINTF_DIRECTIVE_F
10553 + if (dp->conversion == 'F')
10555 + /* Convert the %f result to upper case for %F. */
10556 + DCHAR_T *rp = result + length;
10558 + for (rc = count; rc > 0; rc--, rp++)
10559 + if (*rp >= 'a' && *rp <= 'z')
10560 + *rp = *rp - 'a' + 'A';
10571 + /* Add the final NUL. */
10572 + ENSURE_ALLOCATION (xsum (length, 1));
10573 + result[length] = '\0';
10575 + if (result != resultbuf && length + 1 < allocated)
10577 + /* Shrink the allocated memory if possible. */
10580 + memory = (DCHAR_T *) realloc (result, (length + 1) * sizeof (DCHAR_T));
10581 + if (memory != NULL)
10585 + if (buf_malloced != NULL)
10586 + free (buf_malloced);
10588 + *lengthp = length;
10589 + /* Note that we can produce a big string of a length > INT_MAX. POSIX
10590 + says that snprintf() fails with errno = EOVERFLOW in this case, but
10591 + that's only because snprintf() returns an 'int'. This function does
10592 + not have this limitation. */
10597 + if (!(result == resultbuf || result == NULL))
10599 + if (buf_malloced != NULL)
10600 + free (buf_malloced);
10602 + errno = EOVERFLOW;
10607 + if (!(result == resultbuf || result == NULL))
10609 + if (buf_malloced != NULL)
10610 + free (buf_malloced);
10618 +#undef TCHARS_PER_DCHAR
10620 +#undef USE_SNPRINTF
10622 +#undef PRINTF_PARSE
10625 +#undef DCHAR_IS_TCHAR
10630 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/vasnprintf.h gtk-vnc-0.3.7.gnulib/gnulib/lib/vasnprintf.h
10631 --- gtk-vnc-0.3.7.mingw/gnulib/lib/vasnprintf.h 1970-01-01 01:00:00.000000000 +0100
10632 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/vasnprintf.h 2008-10-09 12:24:39.000000000 +0100
10634 +/* vsprintf with automatic memory allocation.
10635 + Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc.
10637 + This program is free software; you can redistribute it and/or modify
10638 + it under the terms of the GNU Lesser General Public License as published by
10639 + the Free Software Foundation; either version 2.1, or (at your option)
10640 + any later version.
10642 + This program is distributed in the hope that it will be useful,
10643 + but WITHOUT ANY WARRANTY; without even the implied warranty of
10644 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10645 + GNU Lesser General Public License for more details.
10647 + You should have received a copy of the GNU Lesser General Public License along
10648 + with this program; if not, write to the Free Software Foundation,
10649 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
10651 +#ifndef _VASNPRINTF_H
10652 +#define _VASNPRINTF_H
10654 +/* Get va_list. */
10655 +#include <stdarg.h>
10658 +#include <stddef.h>
10660 +#ifndef __attribute__
10661 +/* This feature is available in gcc versions 2.5 and later. */
10662 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
10663 +# define __attribute__(Spec) /* empty */
10665 +/* The __-protected variants of `format' and `printf' attributes
10666 + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
10667 +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
10668 +# define __format__ format
10669 +# define __printf__ printf
10673 +#ifdef __cplusplus
10677 +/* Write formatted output to a string dynamically allocated with malloc().
10678 + You can pass a preallocated buffer for the result in RESULTBUF and its
10679 + size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
10680 + If successful, return the address of the string (this may be = RESULTBUF
10681 + if no dynamic memory allocation was necessary) and set *LENGTHP to the
10682 + number of resulting bytes, excluding the trailing NUL. Upon error, set
10683 + errno and return NULL.
10685 + When dynamic memory allocation occurs, the preallocated buffer is left
10686 + alone (with possibly modified contents). This makes it possible to use
10687 + a statically allocated or stack-allocated buffer, like this:
10690 + size_t len = sizeof (buf);
10691 + char *output = vasnprintf (buf, &len, format, args);
10692 + if (output == NULL)
10693 + ... error handling ...;
10696 + ... use the output string ...;
10697 + if (output != buf)
10701 +#if REPLACE_VASNPRINTF
10702 +# define asnprintf rpl_asnprintf
10703 +# define vasnprintf rpl_vasnprintf
10705 +extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
10706 + __attribute__ ((__format__ (__printf__, 3, 4)));
10707 +extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
10708 + __attribute__ ((__format__ (__printf__, 3, 0)));
10710 +#ifdef __cplusplus
10714 +#endif /* _VASNPRINTF_H */
10715 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/wchar.in.h gtk-vnc-0.3.7.gnulib/gnulib/lib/wchar.in.h
10716 --- gtk-vnc-0.3.7.mingw/gnulib/lib/wchar.in.h 1970-01-01 01:00:00.000000000 +0100
10717 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/wchar.in.h 2008-10-09 12:24:39.000000000 +0100
10719 +/* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
10721 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
10723 + This program is free software; you can redistribute it and/or modify
10724 + it under the terms of the GNU Lesser General Public License as published by
10725 + the Free Software Foundation; either version 2.1, or (at your option)
10726 + any later version.
10728 + This program is distributed in the hope that it will be useful,
10729 + but WITHOUT ANY WARRANTY; without even the implied warranty of
10730 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10731 + GNU Lesser General Public License for more details.
10733 + You should have received a copy of the GNU Lesser General Public License
10734 + along with this program; if not, write to the Free Software Foundation,
10735 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
10737 +/* Written by Eric Blake. */
10740 + * ISO C 99 <wchar.h> for platforms that have issues.
10741 + * <http://www.opengroup.org/susv3xbd/wchar.h.html>
10743 + * For now, this just ensures proper prerequisite inclusion order and
10744 + * the declaration of wcwidth().
10747 +@PRAGMA_SYSTEM_HEADER@
10749 +#ifdef __need_mbstate_t
10750 +/* Special invocation convention inside uClibc header files. */
10752 +#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
10755 +/* Normal invocation convention. */
10757 +#ifndef _GL_WCHAR_H
10759 +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
10761 + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
10762 + included before <wchar.h>. */
10763 +#include <stddef.h>
10764 +#include <stdio.h>
10767 +/* Include the original <wchar.h> if it exists.
10768 + Some builds of uClibc lack it. */
10769 +/* The include_next requires a split double-inclusion guard. */
10770 +#if @HAVE_WCHAR_H@
10771 +# @INCLUDE_NEXT@ @NEXT_WCHAR_H@
10774 +#ifndef _GL_WCHAR_H
10775 +#define _GL_WCHAR_H
10777 +/* The definition of GL_LINK_WARNING is copied here. */
10779 +#ifdef __cplusplus
10784 +/* Define wint_t. (Also done in wctype.in.h.) */
10785 +#if !@HAVE_WINT_T@ && !defined wint_t
10786 +# define wint_t int
10790 +/* Return the number of screen columns needed for WC. */
10791 +#if @GNULIB_WCWIDTH@
10792 +# if @REPLACE_WCWIDTH@
10794 +# define wcwidth rpl_wcwidth
10795 +extern int wcwidth (wchar_t);
10797 +# if !defined wcwidth && !@HAVE_DECL_WCWIDTH@
10798 +/* wcwidth exists but is not declared. */
10799 +extern int wcwidth (int /* actually wchar_t */);
10802 +#elif defined GNULIB_POSIXCHECK
10804 +# define wcwidth(w) \
10805 + (GL_LINK_WARNING ("wcwidth is unportable - " \
10806 + "use gnulib module wcwidth for portability"), \
10811 +#ifdef __cplusplus
10815 +#endif /* _GL_WCHAR_H */
10816 +#endif /* _GL_WCHAR_H */
10818 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/winsock.c gtk-vnc-0.3.7.gnulib/gnulib/lib/winsock.c
10819 --- gtk-vnc-0.3.7.mingw/gnulib/lib/winsock.c 1970-01-01 01:00:00.000000000 +0100
10820 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/winsock.c 2008-10-09 12:24:39.000000000 +0100
10822 +/* winsock.c --- wrappers for Windows socket functions
10824 + Copyright (C) 2008 Free Software Foundation, Inc.
10826 + This program is free software: you can redistribute it and/or modify
10827 + it under the terms of the GNU Lesser General Public License as published by
10828 + the Free Software Foundation; either version 2.1 of the License, or
10829 + (at your option) any later version.
10831 + This program is distributed in the hope that it will be useful,
10832 + but WITHOUT ANY WARRANTY; without even the implied warranty of
10833 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10834 + GNU Lesser General Public License for more details.
10836 + You should have received a copy of the GNU Lesser General Public License
10837 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
10839 +/* Written by Paolo Bonzini */
10841 +#include <config.h>
10842 +#include <stdio.h>
10843 +#include <string.h>
10844 +#include <errno.h>
10845 +#include <fcntl.h>
10847 +#include <sys/socket.h>
10854 +#undef getpeername
10855 +#undef getsockname
10864 +# define FD_TO_SOCKET(fd) ((SOCKET) _get_osfhandle ((fd)))
10865 +# define SOCKET_TO_FD(fh) (_open_osfhandle ((long) (fh), O_RDWR | O_BINARY))
10868 +/* Wrappers for libc functions. */
10871 +rpl_close (int fd)
10873 + SOCKET sock = FD_TO_SOCKET (fd);
10874 + WSANETWORKEVENTS ev;
10876 + ev.lNetworkEvents = 0xDEADBEEF;
10877 + WSAEnumNetworkEvents (sock, NULL, &ev);
10878 + if (ev.lNetworkEvents != 0xDEADBEEF)
10880 + /* FIXME: other applications, like squid, use an undocumented
10881 + _free_osfhnd free function. Instead, here we just close twice
10882 + the file descriptor. I could not get the former to work
10883 + (pb, Sep 22 2008). */
10884 + int r = closesocket (sock);
10889 + return _close (fd);
10893 +/* Wrappers for WinSock functions. */
10895 +static inline void
10896 +set_winsock_errno (void)
10898 + int err = WSAGetLastError ();
10899 + WSASetLastError (0);
10901 + /* Map some WSAE* errors to the runtime library's error codes. */
10904 + case WSA_INVALID_HANDLE:
10907 + case WSA_NOT_ENOUGH_MEMORY:
10910 + case WSA_INVALID_PARAMETER:
10913 + case WSAEWOULDBLOCK:
10914 + errno = EWOULDBLOCK;
10916 + case WSAENAMETOOLONG:
10917 + errno = ENAMETOOLONG;
10919 + case WSAENOTEMPTY:
10920 + errno = ENOTEMPTY;
10923 + errno = (err > 10000 && err < 10025) ? err - 10000 : err;
10930 +rpl_socket (int domain, int type, int protocol)
10932 + /* We have to use WSASocket() to create non-overlapped IO sockets.
10933 + Overlapped IO sockets cannot be used with read/write. */
10934 + SOCKET fh = WSASocket (domain, type, protocol, NULL, 0, 0);
10936 + if (fh == INVALID_SOCKET)
10938 + set_winsock_errno ();
10942 + return SOCKET_TO_FD (fh);
10946 +#if GNULIB_CONNECT
10948 +rpl_connect (int fd, struct sockaddr *sockaddr, int len)
10950 + SOCKET sock = FD_TO_SOCKET (fd);
10951 + int r = connect (sock, sockaddr, len);
10954 + /* EINPROGRESS is not returned by WinSock 2.0; for backwards
10955 + compatibility, connect(2) uses EWOULDBLOCK. */
10956 + if (WSAGetLastError () == WSAEWOULDBLOCK)
10957 + WSASetLastError (WSAEINPROGRESS);
10959 + set_winsock_errno ();
10968 +rpl_accept (int fd, struct sockaddr *addr, int *addrlen)
10970 + SOCKET fh = accept (FD_TO_SOCKET (fd), addr, addrlen);
10971 + if (fh == INVALID_SOCKET)
10973 + set_winsock_errno ();
10977 + return SOCKET_TO_FD (fh);
10983 +rpl_bind (int fd, struct sockaddr *sockaddr, int len)
10985 + SOCKET sock = FD_TO_SOCKET (fd);
10986 + int r = bind (sock, sockaddr, len);
10988 + set_winsock_errno ();
10994 +#if GNULIB_GETPEERNAME
10996 +rpl_getpeername (int fd, struct sockaddr *addr, int *addrlen)
10998 + SOCKET sock = FD_TO_SOCKET (fd);
10999 + int r = getpeername (sock, addr, addrlen);
11001 + set_winsock_errno ();
11007 +#if GNULIB_GETSOCKNAME
11009 +rpl_getsockname (int fd, struct sockaddr *addr, int *addrlen)
11011 + SOCKET sock = FD_TO_SOCKET (fd);
11012 + int r = getsockname (sock, addr, addrlen);
11014 + set_winsock_errno ();
11020 +#if GNULIB_GETSOCKOPT
11022 +rpl_getsockopt (int fd, int level, int optname, void *optval, int *optlen)
11024 + SOCKET sock = FD_TO_SOCKET (fd);
11025 + int r = getsockopt (sock, level, optname, optval, optlen);
11027 + set_winsock_errno ();
11035 +rpl_listen (int fd, int backlog)
11037 + SOCKET sock = FD_TO_SOCKET (fd);
11038 + int r = listen (sock, backlog);
11040 + set_winsock_errno ();
11047 +rpl_ioctl (int fd, unsigned long req, char *buf)
11049 + SOCKET sock = FD_TO_SOCKET (fd);
11050 + int r = ioctlsocket (sock, req, (void *) buf);
11052 + set_winsock_errno ();
11059 +rpl_recv (int fd, void *buf, int len, int flags)
11061 + SOCKET sock = FD_TO_SOCKET (fd);
11062 + int r = recv (sock, buf, len, flags);
11064 + set_winsock_errno ();
11072 +rpl_send (int fd, const void *buf, int len, int flags)
11074 + SOCKET sock = FD_TO_SOCKET (fd);
11075 + int r = send (sock, buf, len, flags);
11077 + set_winsock_errno ();
11083 +#if GNULIB_RECVFROM
11085 +rpl_recvfrom (int fd, void *buf, int len, int flags, struct sockaddr *from,
11088 + int frombufsize = *fromlen;
11089 + SOCKET sock = FD_TO_SOCKET (fd);
11090 + int r = recvfrom (sock, buf, len, flags, from, fromlen);
11093 + set_winsock_errno ();
11095 + /* Winsock recvfrom() only returns a valid 'from' when the socket is
11096 + connectionless. POSIX gives a valid 'from' for all types of sockets. */
11097 + else if (*fromlen == frombufsize)
11098 + rpl_getpeername (fd, from, fromlen);
11106 +rpl_sendto (int fd, const void *buf, int len, int flags,
11107 + struct sockaddr *to, int tolen)
11109 + SOCKET sock = FD_TO_SOCKET (fd);
11110 + int r = sendto (sock, buf, len, flags, to, tolen);
11112 + set_winsock_errno ();
11118 +#if GNULIB_SETSOCKOPT
11120 +rpl_setsockopt (int fd, int level, int optname, const void *optval, int optlen)
11122 + SOCKET sock = FD_TO_SOCKET (fd);
11123 + int r = setsockopt (sock, level, optname, optval, optlen);
11125 + set_winsock_errno ();
11130 diff -urN gtk-vnc-0.3.7.mingw/gnulib/lib/xsize.h gtk-vnc-0.3.7.gnulib/gnulib/lib/xsize.h
11131 --- gtk-vnc-0.3.7.mingw/gnulib/lib/xsize.h 1970-01-01 01:00:00.000000000 +0100
11132 +++ gtk-vnc-0.3.7.gnulib/gnulib/lib/xsize.h 2008-10-09 12:24:39.000000000 +0100
11134 +/* xsize.h -- Checked size_t computations.
11136 + Copyright (C) 2003, 2008 Free Software Foundation, Inc.
11138 + This program is free software; you can redistribute it and/or modify
11139 + it under the terms of the GNU Lesser General Public License as published by
11140 + the Free Software Foundation; either version 2.1, or (at your option)
11141 + any later version.
11143 + This program is distributed in the hope that it will be useful,
11144 + but WITHOUT ANY WARRANTY; without even the implied warranty of
11145 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11146 + GNU Lesser General Public License for more details.
11148 + You should have received a copy of the GNU Lesser General Public License
11149 + along with this program; if not, write to the Free Software Foundation,
11150 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
11156 +#include <stddef.h>
11158 +/* Get SIZE_MAX. */
11159 +#include <limits.h>
11161 +# include <stdint.h>
11164 +/* The size of memory objects is often computed through expressions of
11165 + type size_t. Example:
11166 + void* p = malloc (header_size + n * element_size).
11167 + These computations can lead to overflow. When this happens, malloc()
11168 + returns a piece of memory that is way too small, and the program then
11169 + crashes while attempting to fill the memory.
11170 + To avoid this, the functions and macros in this file check for overflow.
11171 + The convention is that SIZE_MAX represents overflow.
11172 + malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
11173 + implementation that uses mmap --, it's recommended to use size_overflow_p()
11174 + or size_in_bounds_p() before invoking malloc().
11175 + The example thus becomes:
11176 + size_t size = xsum (header_size, xtimes (n, element_size));
11177 + void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
11180 +/* Convert an arbitrary value >= 0 to type size_t. */
11181 +#define xcast_size_t(N) \
11182 + ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
11184 +/* Sum of two sizes, with overflow check. */
11185 +static inline size_t
11187 +__attribute__ ((__pure__))
11189 +xsum (size_t size1, size_t size2)
11191 + size_t sum = size1 + size2;
11192 + return (sum >= size1 ? sum : SIZE_MAX);
11195 +/* Sum of three sizes, with overflow check. */
11196 +static inline size_t
11198 +__attribute__ ((__pure__))
11200 +xsum3 (size_t size1, size_t size2, size_t size3)
11202 + return xsum (xsum (size1, size2), size3);
11205 +/* Sum of four sizes, with overflow check. */
11206 +static inline size_t
11208 +__attribute__ ((__pure__))
11210 +xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
11212 + return xsum (xsum (xsum (size1, size2), size3), size4);
11215 +/* Maximum of two sizes, with overflow check. */
11216 +static inline size_t
11218 +__attribute__ ((__pure__))
11220 +xmax (size_t size1, size_t size2)
11222 + /* No explicit check is needed here, because for any n:
11223 + max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX. */
11224 + return (size1 >= size2 ? size1 : size2);
11227 +/* Multiplication of a count with an element size, with overflow check.
11228 + The count must be >= 0 and the element size must be > 0.
11229 + This is a macro, not an inline function, so that it works correctly even
11230 + when N is of a wider type and N > SIZE_MAX. */
11231 +#define xtimes(N, ELSIZE) \
11232 + ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
11234 +/* Check for overflow. */
11235 +#define size_overflow_p(SIZE) \
11236 + ((SIZE) == SIZE_MAX)
11237 +/* Check against overflow. */
11238 +#define size_in_bounds_p(SIZE) \
11239 + ((SIZE) != SIZE_MAX)
11241 +#endif /* _XSIZE_H */
11242 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/alloca.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/alloca.m4
11243 --- gtk-vnc-0.3.7.mingw/gnulib/m4/alloca.m4 1970-01-01 01:00:00.000000000 +0100
11244 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/alloca.m4 2008-10-09 12:24:39.000000000 +0100
11246 +# alloca.m4 serial 8
11247 +dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc.
11248 +dnl This file is free software; the Free Software Foundation
11249 +dnl gives unlimited permission to copy and/or distribute it,
11250 +dnl with or without modifications, as long as this notice is preserved.
11252 +AC_DEFUN([gl_FUNC_ALLOCA],
11254 + dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
11255 + AC_REQUIRE([AC_PROG_CPP])
11256 + AC_REQUIRE([AC_PROG_EGREP])
11258 + AC_REQUIRE([AC_FUNC_ALLOCA])
11259 + if test $ac_cv_func_alloca_works = no; then
11263 + # Define an additional variable used in the Makefile substitution.
11264 + if test $ac_cv_working_alloca_h = yes; then
11265 + AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
11266 + AC_EGREP_CPP([Need own alloca], [
11267 +#if defined __GNUC__ || defined _AIX || defined _MSC_VER
11270 + ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
11272 + if test $gl_cv_rpl_alloca = yes; then
11273 + dnl OK, alloca can be implemented through a compiler built-in.
11274 + AC_DEFINE([HAVE_ALLOCA], 1,
11275 + [Define to 1 if you have 'alloca' after including <alloca.h>,
11276 + a header that may be supplied by this distribution.])
11277 + ALLOCA_H=alloca.h
11279 + dnl alloca exists as a library function, i.e. it is slow and probably
11280 + dnl a memory leak. Don't define HAVE_ALLOCA in this case.
11284 + ALLOCA_H=alloca.h
11286 + AC_SUBST([ALLOCA_H])
11289 +# Prerequisites of lib/alloca.c.
11290 +# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
11291 +AC_DEFUN([gl_PREREQ_ALLOCA], [:])
11292 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/arpa_inet_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/arpa_inet_h.m4
11293 --- gtk-vnc-0.3.7.mingw/gnulib/m4/arpa_inet_h.m4 1970-01-01 01:00:00.000000000 +0100
11294 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/arpa_inet_h.m4 2008-10-09 12:24:39.000000000 +0100
11296 +# arpa_inet_h.m4 serial 5
11297 +dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc.
11298 +dnl This file is free software; the Free Software Foundation
11299 +dnl gives unlimited permission to copy and/or distribute it,
11300 +dnl with or without modifications, as long as this notice is preserved.
11302 +dnl Written by Simon Josefsson and Bruno Haible
11304 +AC_DEFUN([gl_HEADER_ARPA_INET],
11306 + dnl Use AC_REQUIRE here, so that the default behavior below is expanded
11307 + dnl once only, before all statements that occur in other macros.
11308 + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
11310 + AC_CHECK_HEADERS_ONCE([arpa/inet.h])
11311 + if test $ac_cv_header_arpa_inet_h = yes; then
11312 + HAVE_ARPA_INET_H=1
11314 + ARPA_INET_H='arpa/inet.h'
11315 + HAVE_ARPA_INET_H=0
11317 + AC_SUBST([HAVE_ARPA_INET_H])
11318 + dnl Execute this unconditionally, because ARPA_INET_H may be set by other
11319 + dnl modules, after this code is executed.
11320 + gl_CHECK_NEXT_HEADERS([arpa/inet.h])
11323 +dnl Unconditionally enables the replacement of <arpa/inet.h>.
11324 +AC_DEFUN([gl_REPLACE_ARPA_INET_H],
11326 + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
11327 + ARPA_INET_H='arpa/inet.h'
11330 +AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
11332 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
11333 + AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
11334 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
11337 +AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
11339 + GNULIB_INET_NTOP=0; AC_SUBST([GNULIB_INET_NTOP])
11340 + GNULIB_INET_PTON=0; AC_SUBST([GNULIB_INET_PTON])
11341 + dnl Assume proper GNU behavior unless another module says otherwise.
11342 + HAVE_DECL_INET_NTOP=1; AC_SUBST([HAVE_DECL_INET_NTOP])
11343 + HAVE_DECL_INET_PTON=1; AC_SUBST([HAVE_DECL_INET_PTON])
11344 + ARPA_INET_H=''; AC_SUBST([ARPA_INET_H])
11346 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/errno_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/errno_h.m4
11347 --- gtk-vnc-0.3.7.mingw/gnulib/m4/errno_h.m4 1970-01-01 01:00:00.000000000 +0100
11348 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/errno_h.m4 2008-10-09 12:24:39.000000000 +0100
11350 +# errno_h.m4 serial 1
11351 +dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc.
11352 +dnl This file is free software; the Free Software Foundation
11353 +dnl gives unlimited permission to copy and/or distribute it,
11354 +dnl with or without modifications, as long as this notice is preserved.
11356 +AC_DEFUN([gl_HEADER_ERRNO_H],
11358 + dnl Use AC_REQUIRE here, so that the default behavior below is expanded
11359 + dnl once only, before all statements that occur in other macros.
11360 + AC_REQUIRE([gl_HEADER_ERRNO_H_BODY])
11363 +AC_DEFUN([gl_HEADER_ERRNO_H_BODY],
11365 + AC_REQUIRE([AC_PROG_CC])
11366 + AC_CACHE_CHECK([for complete errno.h], gl_cv_header_errno_h_complete, [
11367 + AC_EGREP_CPP(booboo,[
11368 +#include <errno.h>
11369 +#if !defined ENOMSG
11372 +#if !defined EIDRM
11375 +#if !defined ENOLINK
11378 +#if !defined EPROTO
11381 +#if !defined EMULTIHOP
11384 +#if !defined EBADMSG
11387 +#if !defined EOVERFLOW
11390 +#if !defined ENOTSUP
11393 +#if !defined ECANCELED
11397 + [gl_cv_header_errno_h_complete=no],
11398 + [gl_cv_header_errno_h_complete=yes])
11400 + if test $gl_cv_header_errno_h_complete = yes; then
11403 + gl_CHECK_NEXT_HEADERS([errno.h])
11404 + ERRNO_H='errno.h'
11406 + AC_SUBST([ERRNO_H])
11407 + gl_REPLACE_ERRNO_VALUE([EMULTIHOP])
11408 + gl_REPLACE_ERRNO_VALUE([ENOLINK])
11409 + gl_REPLACE_ERRNO_VALUE([EOVERFLOW])
11412 +# Assuming $1 = EOVERFLOW.
11413 +# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
11414 +# POSIX. But some systems (like OpenBSD 4.0 or AIX 3) don't define it, and
11415 +# some systems (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
11416 +# Check for the value of EOVERFLOW.
11417 +# Set the variables EOVERFLOW_HIDDEN and EOVERFLOW_VALUE.
11418 +AC_DEFUN([gl_REPLACE_ERRNO_VALUE],
11420 + if test -n "$ERRNO_H"; then
11421 + AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [
11422 + AC_EGREP_CPP(yes,[
11423 +#include <errno.h>
11428 + [gl_cv_header_errno_h_]$1[=yes],
11429 + [gl_cv_header_errno_h_]$1[=no])
11430 + if test $gl_cv_header_errno_h_]$1[ = no; then
11431 + AC_EGREP_CPP(yes,[
11432 +#define _XOPEN_SOURCE_EXTENDED 1
11433 +#include <errno.h>
11437 + ], [gl_cv_header_errno_h_]$1[=hidden])
11438 + if test $gl_cv_header_errno_h_]$1[ = hidden; then
11439 + dnl The macro exists but is hidden.
11440 + dnl Define it to the same value.
11441 + AC_COMPUTE_INT([gl_cv_header_errno_h_]$1, $1, [
11442 +#define _XOPEN_SOURCE_EXTENDED 1
11443 +#include <errno.h>
11444 +/* The following two lines are a workaround against an autoconf-2.52 bug. */
11445 +#include <stdio.h>
11446 +#include <stdlib.h>
11451 + case $gl_cv_header_errno_h_]$1[ in
11453 + ]$1[_HIDDEN=0; ]$1[_VALUE=
11456 + ]$1[_HIDDEN=1; ]$1[_VALUE="$gl_cv_header_errno_h_]$1["
11459 + AC_SUBST($1[_HIDDEN])
11460 + AC_SUBST($1[_VALUE])
11463 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/extensions.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/extensions.m4
11464 --- gtk-vnc-0.3.7.mingw/gnulib/m4/extensions.m4 1970-01-01 01:00:00.000000000 +0100
11465 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/extensions.m4 2008-10-09 12:24:39.000000000 +0100
11467 +# serial 5 -*- Autoconf -*-
11468 +# Enable extensions on systems that normally disable them.
11470 +# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
11471 +# This file is free software; the Free Software Foundation
11472 +# gives unlimited permission to copy and/or distribute it,
11473 +# with or without modifications, as long as this notice is preserved.
11475 +# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
11476 +# Autoconf. Perhaps we can remove this once we can assume Autoconf
11477 +# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
11478 +# enough in this area it's likely we'll need to redefine
11479 +# AC_USE_SYSTEM_EXTENSIONS for quite some time.
11481 +# AC_USE_SYSTEM_EXTENSIONS
11482 +# ------------------------
11483 +# Enable extensions on systems that normally disable them,
11484 +# typically due to standards-conformance issues.
11485 +# Remember that #undef in AH_VERBATIM gets replaced with #define by
11486 +# AC_DEFINE. The goal here is to define all known feature-enabling
11487 +# macros, then, if reports of conflicts are made, disable macros that
11488 +# cause problems on some platforms (such as __EXTENSIONS__).
11489 +AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
11490 +[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
11491 +AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
11493 + AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
11494 + if test "$MINIX" = yes; then
11495 + AC_DEFINE([_POSIX_SOURCE], [1],
11496 + [Define to 1 if you need to in order for `stat' and other
11497 + things to work.])
11498 + AC_DEFINE([_POSIX_1_SOURCE], [2],
11499 + [Define to 2 if the system does not provide POSIX.1 features
11500 + except with this defined.])
11501 + AC_DEFINE([_MINIX], [1],
11502 + [Define to 1 if on MINIX.])
11505 + AH_VERBATIM([__EXTENSIONS__],
11506 +[/* Enable extensions on AIX 3, Interix. */
11507 +#ifndef _ALL_SOURCE
11508 +# undef _ALL_SOURCE
11510 +/* Enable GNU extensions on systems that have them. */
11511 +#ifndef _GNU_SOURCE
11512 +# undef _GNU_SOURCE
11514 +/* Enable threading extensions on Solaris. */
11515 +#ifndef _POSIX_PTHREAD_SEMANTICS
11516 +# undef _POSIX_PTHREAD_SEMANTICS
11518 +/* Enable extensions on HP NonStop. */
11519 +#ifndef _TANDEM_SOURCE
11520 +# undef _TANDEM_SOURCE
11522 +/* Enable general extensions on Solaris. */
11523 +#ifndef __EXTENSIONS__
11524 +# undef __EXTENSIONS__
11527 + AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
11528 + [ac_cv_safe_to_define___extensions__],
11529 + [AC_COMPILE_IFELSE(
11530 + [AC_LANG_PROGRAM([[
11531 +# define __EXTENSIONS__ 1
11532 + ]AC_INCLUDES_DEFAULT])],
11533 + [ac_cv_safe_to_define___extensions__=yes],
11534 + [ac_cv_safe_to_define___extensions__=no])])
11535 + test $ac_cv_safe_to_define___extensions__ = yes &&
11536 + AC_DEFINE([__EXTENSIONS__])
11537 + AC_DEFINE([_ALL_SOURCE])
11538 + AC_DEFINE([_GNU_SOURCE])
11539 + AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
11540 + AC_DEFINE([_TANDEM_SOURCE])
11541 +])# AC_USE_SYSTEM_EXTENSIONS
11543 +# gl_USE_SYSTEM_EXTENSIONS
11544 +# ------------------------
11545 +# Enable extensions on systems that normally disable them,
11546 +# typically due to standards-conformance issues.
11547 +AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
11548 + [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
11549 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/float_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/float_h.m4
11550 --- gtk-vnc-0.3.7.mingw/gnulib/m4/float_h.m4 1970-01-01 01:00:00.000000000 +0100
11551 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/float_h.m4 2008-10-09 12:24:39.000000000 +0100
11553 +# float_h.m4 serial 3
11554 +dnl Copyright (C) 2007 Free Software Foundation, Inc.
11555 +dnl This file is free software; the Free Software Foundation
11556 +dnl gives unlimited permission to copy and/or distribute it,
11557 +dnl with or without modifications, as long as this notice is preserved.
11559 +AC_DEFUN([gl_FLOAT_H],
11561 + AC_REQUIRE([AC_PROG_CC])
11562 + AC_REQUIRE([AC_CANONICAL_HOST])
11564 + case "$host_os" in
11565 + beos* | openbsd*)
11567 + gl_CHECK_NEXT_HEADERS([float.h])
11570 + AC_SUBST([FLOAT_H])
11572 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/getaddrinfo.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/getaddrinfo.m4
11573 --- gtk-vnc-0.3.7.mingw/gnulib/m4/getaddrinfo.m4 1970-01-01 01:00:00.000000000 +0100
11574 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/getaddrinfo.m4 2008-10-09 12:24:39.000000000 +0100
11576 +# getaddrinfo.m4 serial 15
11577 +dnl Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
11578 +dnl This file is free software; the Free Software Foundation
11579 +dnl gives unlimited permission to copy and/or distribute it,
11580 +dnl with or without modifications, as long as this notice is preserved.
11582 +AC_DEFUN([gl_GETADDRINFO],
11584 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
11585 + AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
11587 + AC_CHECK_HEADERS_ONCE(netdb.h)
11589 + AC_SEARCH_LIBS(getaddrinfo, [nsl socket])
11590 + AC_CACHE_CHECK([for getaddrinfo], [gl_cv_func_getaddrinfo], [
11592 +#include <sys/types.h>
11593 +#ifdef HAVE_SYS_SOCKET_H
11594 +#include <sys/socket.h>
11596 +#ifdef HAVE_NETDB_H
11597 +#include <netdb.h>
11599 +#include <stddef.h>
11600 +], [getaddrinfo("", "", NULL, NULL);],
11601 + [gl_cv_func_getaddrinfo=yes],
11602 + [gl_cv_func_getaddrinfo=no])])
11603 + if test $gl_cv_func_getaddrinfo = no; then
11604 + AC_CACHE_CHECK(for getaddrinfo in ws2tcpip.h and -lws2_32,
11605 + gl_cv_w32_getaddrinfo, [
11606 + gl_cv_w32_getaddrinfo=no
11607 + am_save_LIBS="$LIBS"
11608 + LIBS="$LIBS -lws2_32"
11610 +#ifdef HAVE_WS2TCPIP_H
11611 +#include <ws2tcpip.h>
11613 +#include <stddef.h>
11614 +], [getaddrinfo(NULL, NULL, NULL, NULL);], gl_cv_w32_getaddrinfo=yes)
11615 + LIBS="$am_save_LIBS"])
11616 + if test "$gl_cv_w32_getaddrinfo" = "yes"; then
11617 + LIBS="$LIBS -lws2_32"
11619 + AC_LIBOBJ(getaddrinfo)
11623 + # We can't use AC_REPLACE_FUNCS here because gai_strerror may be an
11624 + # inline function declared in ws2tcpip.h, so we need to get that
11625 + # header included somehow.
11626 + AC_CACHE_CHECK([for gai_strerror (possibly via ws2tcpip.h)],
11627 + gl_cv_func_gai_strerror, [
11629 +#include <sys/types.h>
11630 +#ifdef HAVE_SYS_SOCKET_H
11631 +#include <sys/socket.h>
11633 +#ifdef HAVE_NETDB_H
11634 +#include <netdb.h>
11636 +#ifdef HAVE_WS2TCPIP_H
11637 +#include <ws2tcpip.h>
11639 +#include <stddef.h>
11640 +], [gai_strerror (NULL);],
11641 + [gl_cv_func_gai_strerror=yes],
11642 + [gl_cv_func_gai_strerror=no])])
11643 + if test $gl_cv_func_gai_strerror = no; then
11644 + AC_LIBOBJ(gai_strerror)
11647 + gl_PREREQ_GETADDRINFO
11650 +# Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c.
11651 +AC_DEFUN([gl_PREREQ_GETADDRINFO], [
11652 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl for HAVE_SYS_SOCKET_H, HAVE_WINSOCK2_H
11653 + AC_SEARCH_LIBS(gethostbyname, [inet nsl])
11654 + AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet])
11655 + AC_CHECK_FUNCS(gethostbyname,, [
11656 + AC_CACHE_CHECK(for gethostbyname in winsock2.h and -lws2_32,
11657 + gl_cv_w32_gethostbyname, [
11658 + gl_cv_w32_gethostbyname=no
11659 + am_save_LIBS="$LIBS"
11660 + LIBS="$LIBS -lws2_32"
11662 +#ifdef HAVE_WINSOCK2_H
11663 +#include <winsock2.h>
11665 +#include <stddef.h>
11666 +], [gethostbyname(NULL);], gl_cv_w32_gethostbyname=yes)
11667 + LIBS="$am_save_LIBS"])
11668 + if test "$gl_cv_w32_gethostbyname" = "yes"; then
11669 + LIBS="$LIBS -lws2_32"
11672 + AC_REQUIRE([AC_C_RESTRICT])
11673 + AC_REQUIRE([gl_SOCKET_FAMILIES])
11674 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
11675 + AC_REQUIRE([AC_C_INLINE])
11676 + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
11677 + AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h)
11678 + AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
11679 + /* sys/types.h is not needed according to POSIX, but the
11680 + sys/socket.h in i386-unknown-freebsd4.10 and
11681 + powerpc-apple-darwin5.5 required it. */
11682 +#include <sys/types.h>
11683 +#ifdef HAVE_SYS_SOCKET_H
11684 +#include <sys/socket.h>
11686 +#ifdef HAVE_NETDB_H
11687 +#include <netdb.h>
11689 +#ifdef HAVE_WS2TCPIP_H
11690 +#include <ws2tcpip.h>
11693 + AC_CHECK_TYPES([struct addrinfo],,,[
11694 +#include <sys/types.h>
11695 +#ifdef HAVE_SYS_SOCKET_H
11696 +#include <sys/socket.h>
11698 +#ifdef HAVE_NETDB_H
11699 +#include <netdb.h>
11701 +#ifdef HAVE_WS2TCPIP_H
11702 +#include <ws2tcpip.h>
11706 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-cache.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-cache.m4
11707 --- gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-cache.m4 1970-01-01 01:00:00.000000000 +0100
11708 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-cache.m4 2008-10-09 12:33:42.000000000 +0100
11710 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
11712 +# This file is free software, distributed under the terms of the GNU
11713 +# General Public License. As a special exception to the GNU General
11714 +# Public License, this file may be distributed as part of a program
11715 +# that contains a configuration script generated by Autoconf, under
11716 +# the same distribution terms as the rest of that program.
11718 +# Generated by gnulib-tool.
11720 +# This file represents the specification of how gnulib-tool is used.
11721 +# It acts as a cache: It is written and read by gnulib-tool.
11722 +# In projects using CVS, this file is meant to be stored in CVS,
11723 +# like the configure.ac and various Makefile.am files.
11726 +# Specification in the form of a command-line invocation:
11727 +# 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 recv send socket vc-list-files
11729 +# Specification in the form of a few gnulib-tool.m4 macro invocations:
11740 +gl_SOURCE_BASE([gnulib/lib])
11741 +gl_M4_BASE([gnulib/m4])
11743 +gl_DOC_BASE([doc])
11744 +gl_TESTS_BASE([gnulib/tests])
11748 +gl_MAKEFILE_NAME([])
11750 +gl_MACRO_PREFIX([gl])
11752 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-cache.m4~ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-cache.m4~
11753 --- gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-cache.m4~ 1970-01-01 01:00:00.000000000 +0100
11754 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-cache.m4~ 2008-10-09 12:24:40.000000000 +0100
11756 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
11758 +# This file is free software, distributed under the terms of the GNU
11759 +# General Public License. As a special exception to the GNU General
11760 +# Public License, this file may be distributed as part of a program
11761 +# that contains a configuration script generated by Autoconf, under
11762 +# the same distribution terms as the rest of that program.
11764 +# Generated by gnulib-tool.
11766 +# This file represents the specification of how gnulib-tool is used.
11767 +# It acts as a cache: It is written and read by gnulib-tool.
11768 +# In projects using CVS, this file is meant to be stored in CVS,
11769 +# like the configure.ac and various Makefile.am files.
11772 +# Specification in the form of a command-line invocation:
11773 +# 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 getaddrinfo vc-list-files
11775 +# Specification in the form of a few gnulib-tool.m4 macro invocations:
11782 +gl_SOURCE_BASE([gnulib/lib])
11783 +gl_M4_BASE([gnulib/m4])
11785 +gl_DOC_BASE([doc])
11786 +gl_TESTS_BASE([gnulib/tests])
11790 +gl_MAKEFILE_NAME([])
11792 +gl_MACRO_PREFIX([gl])
11794 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-common.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-common.m4
11795 --- gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-common.m4 1970-01-01 01:00:00.000000000 +0100
11796 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-common.m4 2008-10-09 12:24:39.000000000 +0100
11798 +# gnulib-common.m4 serial 5
11799 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
11800 +dnl This file is free software; the Free Software Foundation
11801 +dnl gives unlimited permission to copy and/or distribute it,
11802 +dnl with or without modifications, as long as this notice is preserved.
11805 +# is expanded unconditionally through gnulib-tool magic.
11806 +AC_DEFUN([gl_COMMON], [
11807 + dnl Use AC_REQUIRE here, so that the code is expanded once only.
11808 + AC_REQUIRE([gl_COMMON_BODY])
11810 +AC_DEFUN([gl_COMMON_BODY], [
11811 + AH_VERBATIM([isoc99_inline],
11812 +[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
11813 + the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
11814 + earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
11815 + __APPLE__ && __MACH__ test for MacOS X.
11816 + __APPLE_CC__ tests for the Apple compiler and its version.
11817 + __STDC_VERSION__ tests for the C99 mode. */
11818 +#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
11819 +# define __GNUC_STDC_INLINE__ 1
11823 +# gl_MODULE_INDICATOR([modulename])
11824 +# defines a C macro indicating the presence of the given module.
11825 +AC_DEFUN([gl_MODULE_INDICATOR],
11827 + AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
11828 + [Define to 1 when using the gnulib module ]$1[.])
11832 +# is a backport of autoconf-2.59c's m4_foreach_w.
11833 +# Remove this macro when we can assume autoconf >= 2.60.
11834 +m4_ifndef([m4_foreach_w],
11835 + [m4_define([m4_foreach_w],
11836 + [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
11839 +# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
11840 +# Remove this macro when we can assume autoconf >= 2.60.
11841 +m4_ifdef([AC_PROG_MKDIR_P], [], [
11842 + AC_DEFUN([AC_PROG_MKDIR_P],
11843 + [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
11844 + MKDIR_P='$(mkdir_p)'
11845 + AC_SUBST([MKDIR_P])])])
11848 +# This definition overrides the AC_C_RESTRICT macro from autoconf 2.60..2.61,
11849 +# so that mixed use of GNU C and GNU C++ and mixed use of Sun C and Sun C++
11851 +# This definition can be removed once autoconf >= 2.62 can be assumed.
11852 +AC_DEFUN([AC_C_RESTRICT],
11853 +[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict,
11854 + [ac_cv_c_restrict=no
11855 + # The order here caters to the fact that C++ does not require restrict.
11856 + for ac_kw in __restrict __restrict__ _Restrict restrict; do
11857 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
11858 + [[typedef int * int_ptr;
11859 + int foo (int_ptr $ac_kw ip) {
11863 + int * $ac_kw t = s;
11865 + return foo(t)]])],
11866 + [ac_cv_c_restrict=$ac_kw])
11867 + test "$ac_cv_c_restrict" != no && break
11870 + AH_VERBATIM([restrict],
11871 +[/* Define to the equivalent of the C99 'restrict' keyword, or to
11872 + nothing if this is not supported. Do not define if restrict is
11873 + supported directly. */
11875 +/* Work around a bug in Sun C++: it does not support _Restrict, even
11876 + though the corresponding Sun C compiler does, which causes
11877 + "#define restrict _Restrict" in the previous line. Perhaps some future
11878 + version of Sun C++ will work with _Restrict; if so, it'll probably
11879 + define __RESTRICT, just as Sun C does. */
11880 +#if defined __SUNPRO_CC && !defined __RESTRICT
11881 +# define _Restrict
11883 + case $ac_cv_c_restrict in
11885 + no) AC_DEFINE([restrict], []) ;;
11886 + *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
11889 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-comp.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-comp.m4
11890 --- gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-comp.m4 1970-01-01 01:00:00.000000000 +0100
11891 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-comp.m4 2008-10-09 12:33:42.000000000 +0100
11893 +# DO NOT EDIT! GENERATED AUTOMATICALLY!
11894 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
11896 +# This file is free software, distributed under the terms of the GNU
11897 +# General Public License. As a special exception to the GNU General
11898 +# Public License, this file may be distributed as part of a program
11899 +# that contains a configuration script generated by Autoconf, under
11900 +# the same distribution terms as the rest of that program.
11902 +# Generated by gnulib-tool.
11904 +# This file represents the compiled summary of the specification in
11905 +# gnulib-cache.m4. It lists the computed macro invocations that need
11906 +# to be invoked from configure.ac.
11907 +# In projects using CVS, this file can be treated like other built files.
11910 +# This macro should be invoked from ./configure.ac, in the section
11911 +# "Checks for programs", right after AC_PROG_CC, and certainly before
11912 +# any checks for libraries, header files, types and library functions.
11913 +AC_DEFUN([gl_EARLY],
11915 + m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
11916 + m4_pattern_allow([^gl_ES$])dnl a valid locale name
11917 + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
11918 + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
11919 + AC_REQUIRE([AC_PROG_RANLIB])
11920 + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
11923 +# This macro should be invoked from ./configure.ac, in the section
11924 +# "Check for header files, types and library functions".
11925 +AC_DEFUN([gl_INIT],
11927 + AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
11928 + gl_cond_libtool=true
11929 + m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
11930 + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
11931 + m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
11932 + m4_pushdef([gl_LIBSOURCES_LIST], [])
11933 + m4_pushdef([gl_LIBSOURCES_DIR], [])
11935 + gl_source_base='gnulib/lib'
11937 + gl_HEADER_ARPA_INET
11939 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
11940 + if test "$ac_cv_header_winsock2_h" = yes; then
11941 + AC_LIBOBJ([winsock])
11943 + gl_SYS_SOCKET_MODULE_INDICATOR([connect])
11944 + gl_HEADER_ERRNO_H
11947 + AC_SUBST([LIBINTL])
11948 + AC_SUBST([LTLIBINTL])
11950 + gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
11951 + gl_HEADER_NETINET_IN
11953 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
11954 + if test "$ac_cv_header_winsock2_h" = yes; then
11955 + AC_LIBOBJ([winsock])
11957 + gl_SYS_SOCKET_MODULE_INDICATOR([recv])
11958 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
11959 + if test "$ac_cv_header_winsock2_h" = yes; then
11960 + AC_LIBOBJ([winsock])
11962 + gl_SYS_SOCKET_MODULE_INDICATOR([send])
11965 + gl_STDIO_MODULE_INDICATOR([snprintf])
11966 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
11967 + if test "$ac_cv_header_winsock2_h" = yes; then
11968 + AC_LIBOBJ([winsock])
11970 + gl_SYS_SOCKET_MODULE_INDICATOR([socket])
11971 + gl_TYPE_SOCKLEN_T
11975 + gl_HEADER_SYS_SOCKET
11977 + gl_FUNC_VASNPRINTF
11980 + m4_ifval(gl_LIBSOURCES_LIST, [
11981 + m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
11982 + for gl_file in ]gl_LIBSOURCES_LIST[ ; do
11983 + if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
11984 + echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
11988 + m4_if(m4_sysval, [0], [],
11989 + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
11991 + m4_popdef([gl_LIBSOURCES_DIR])
11992 + m4_popdef([gl_LIBSOURCES_LIST])
11993 + m4_popdef([AC_LIBSOURCES])
11994 + m4_popdef([AC_REPLACE_FUNCS])
11995 + m4_popdef([AC_LIBOBJ])
11996 + AC_CONFIG_COMMANDS_PRE([
11999 + if test -n "$gl_LIBOBJS"; then
12000 + # Remove the extension.
12001 + sed_drop_objext='s/\.o$//;s/\.obj$//'
12002 + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
12003 + gl_libobjs="$gl_libobjs $i.$ac_objext"
12004 + gl_ltlibobjs="$gl_ltlibobjs $i.lo"
12007 + AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
12008 + AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
12011 + gltests_ltlibdeps=
12012 + m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
12013 + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
12014 + m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
12015 + m4_pushdef([gltests_LIBSOURCES_LIST], [])
12016 + m4_pushdef([gltests_LIBSOURCES_DIR], [])
12018 + gl_source_base='gnulib/tests'
12021 + AC_CHECK_FUNCS([shutdown])
12022 + abs_aux_dir=`cd "$ac_aux_dir"; pwd`
12023 + AC_SUBST([abs_aux_dir])
12024 + m4_ifval(gltests_LIBSOURCES_LIST, [
12025 + m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
12026 + for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
12027 + if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then
12028 + echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2
12032 + m4_if(m4_sysval, [0], [],
12033 + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
12035 + m4_popdef([gltests_LIBSOURCES_DIR])
12036 + m4_popdef([gltests_LIBSOURCES_LIST])
12037 + m4_popdef([AC_LIBSOURCES])
12038 + m4_popdef([AC_REPLACE_FUNCS])
12039 + m4_popdef([AC_LIBOBJ])
12040 + AC_CONFIG_COMMANDS_PRE([
12042 + gltests_ltlibobjs=
12043 + if test -n "$gltests_LIBOBJS"; then
12044 + # Remove the extension.
12045 + sed_drop_objext='s/\.o$//;s/\.obj$//'
12046 + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
12047 + gltests_libobjs="$gltests_libobjs $i.$ac_objext"
12048 + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
12051 + AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
12052 + AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
12054 + LIBTESTS_LIBDEPS="$gltests_libdeps"
12055 + AC_SUBST([LIBTESTS_LIBDEPS])
12058 +# Like AC_LIBOBJ, except that the module name goes
12059 +# into gl_LIBOBJS instead of into LIBOBJS.
12060 +AC_DEFUN([gl_LIBOBJ], [
12061 + AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
12062 + gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
12065 +# Like AC_REPLACE_FUNCS, except that the module name goes
12066 +# into gl_LIBOBJS instead of into LIBOBJS.
12067 +AC_DEFUN([gl_REPLACE_FUNCS], [
12068 + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
12069 + AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
12072 +# Like AC_LIBSOURCES, except the directory where the source file is
12073 +# expected is derived from the gnulib-tool parameterization,
12074 +# and alloca is special cased (for the alloca-opt module).
12075 +# We could also entirely rely on EXTRA_lib..._SOURCES.
12076 +AC_DEFUN([gl_LIBSOURCES], [
12077 + m4_foreach([_gl_NAME], [$1], [
12078 + m4_if(_gl_NAME, [alloca.c], [], [
12079 + m4_define([gl_LIBSOURCES_DIR], [gnulib/lib])
12080 + m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
12085 +# Like AC_LIBOBJ, except that the module name goes
12086 +# into gltests_LIBOBJS instead of into LIBOBJS.
12087 +AC_DEFUN([gltests_LIBOBJ], [
12088 + AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
12089 + gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
12092 +# Like AC_REPLACE_FUNCS, except that the module name goes
12093 +# into gltests_LIBOBJS instead of into LIBOBJS.
12094 +AC_DEFUN([gltests_REPLACE_FUNCS], [
12095 + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
12096 + AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
12099 +# Like AC_LIBSOURCES, except the directory where the source file is
12100 +# expected is derived from the gnulib-tool parameterization,
12101 +# and alloca is special cased (for the alloca-opt module).
12102 +# We could also entirely rely on EXTRA_lib..._SOURCES.
12103 +AC_DEFUN([gltests_LIBSOURCES], [
12104 + m4_foreach([_gl_NAME], [$1], [
12105 + m4_if(_gl_NAME, [alloca.c], [], [
12106 + m4_define([gltests_LIBSOURCES_DIR], [gnulib/tests])
12107 + m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
12112 +# This macro records the list of files which have been installed by
12113 +# gnulib-tool and may be removed by future gnulib-tool invocations.
12114 +AC_DEFUN([gl_FILE_LIST], [
12115 + build-aux/link-warning.h
12116 + build-aux/vc-list-files
12118 + lib/arpa_inet.in.h
12124 + lib/gai_strerror.c
12125 + lib/getaddrinfo.c
12126 + lib/getaddrinfo.h
12129 + lib/netinet_in.in.h
12130 + lib/printf-args.c
12131 + lib/printf-args.h
12132 + lib/printf-parse.c
12133 + lib/printf-parse.h
12138 + lib/stdio-write.c
12140 + lib/sys_socket.in.h
12147 + m4/arpa_inet_h.m4
12151 + m4/getaddrinfo.m4
12152 + m4/gnulib-common.m4
12153 + m4/include_next.m4
12158 + m4/netinet_in_h.m4
12169 + m4/sys_socket_h.m4
12175 + tests/test-alloca-opt.c
12176 + tests/test-arpa_inet.c
12177 + tests/test-errno.c
12178 + tests/test-getaddrinfo.c
12179 + tests/test-netinet_in.c
12180 + tests/test-snprintf.c
12181 + tests/test-stdbool.c
12182 + tests/test-stdint.c
12183 + tests/test-stdio.c
12184 + tests/test-sys_socket.c
12185 + tests/test-vasnprintf.c
12186 + tests/test-vc-list-files-cvs.sh
12187 + tests/test-vc-list-files-git.sh
12188 + tests/test-wchar.c
12189 + tests=lib/dummy.c
12190 + tests=lib/intprops.h
12191 + tests=lib/verify.h
12193 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-comp.m4~ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-comp.m4~
12194 --- gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-comp.m4~ 1970-01-01 01:00:00.000000000 +0100
12195 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-comp.m4~ 2008-10-09 12:24:40.000000000 +0100
12197 +# DO NOT EDIT! GENERATED AUTOMATICALLY!
12198 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
12200 +# This file is free software, distributed under the terms of the GNU
12201 +# General Public License. As a special exception to the GNU General
12202 +# Public License, this file may be distributed as part of a program
12203 +# that contains a configuration script generated by Autoconf, under
12204 +# the same distribution terms as the rest of that program.
12206 +# Generated by gnulib-tool.
12208 +# This file represents the compiled summary of the specification in
12209 +# gnulib-cache.m4. It lists the computed macro invocations that need
12210 +# to be invoked from configure.ac.
12211 +# In projects using CVS, this file can be treated like other built files.
12214 +# This macro should be invoked from ./configure.ac, in the section
12215 +# "Checks for programs", right after AC_PROG_CC, and certainly before
12216 +# any checks for libraries, header files, types and library functions.
12217 +AC_DEFUN([gl_EARLY],
12219 + m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
12220 + m4_pattern_allow([^gl_ES$])dnl a valid locale name
12221 + m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
12222 + m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
12223 + AC_REQUIRE([AC_PROG_RANLIB])
12224 + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12227 +# This macro should be invoked from ./configure.ac, in the section
12228 +# "Check for header files, types and library functions".
12229 +AC_DEFUN([gl_INIT],
12231 + AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
12232 + gl_cond_libtool=true
12233 + m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
12234 + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
12235 + m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
12236 + m4_pushdef([gl_LIBSOURCES_LIST], [])
12237 + m4_pushdef([gl_LIBSOURCES_DIR], [])
12239 + gl_source_base='gnulib/lib'
12241 + gl_HEADER_ARPA_INET
12243 + gl_HEADER_ERRNO_H
12246 + AC_SUBST([LIBINTL])
12247 + AC_SUBST([LTLIBINTL])
12249 + gl_ARPA_INET_MODULE_INDICATOR([inet_ntop])
12250 + gl_HEADER_NETINET_IN
12254 + gl_STDIO_MODULE_INDICATOR([snprintf])
12255 + gl_TYPE_SOCKLEN_T
12259 + gl_HEADER_SYS_SOCKET
12261 + gl_FUNC_VASNPRINTF
12264 + m4_ifval(gl_LIBSOURCES_LIST, [
12265 + m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
12266 + for gl_file in ]gl_LIBSOURCES_LIST[ ; do
12267 + if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
12268 + echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
12272 + m4_if(m4_sysval, [0], [],
12273 + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
12275 + m4_popdef([gl_LIBSOURCES_DIR])
12276 + m4_popdef([gl_LIBSOURCES_LIST])
12277 + m4_popdef([AC_LIBSOURCES])
12278 + m4_popdef([AC_REPLACE_FUNCS])
12279 + m4_popdef([AC_LIBOBJ])
12280 + AC_CONFIG_COMMANDS_PRE([
12283 + if test -n "$gl_LIBOBJS"; then
12284 + # Remove the extension.
12285 + sed_drop_objext='s/\.o$//;s/\.obj$//'
12286 + for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
12287 + gl_libobjs="$gl_libobjs $i.$ac_objext"
12288 + gl_ltlibobjs="$gl_ltlibobjs $i.lo"
12291 + AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
12292 + AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
12295 + gltests_ltlibdeps=
12296 + m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
12297 + m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
12298 + m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
12299 + m4_pushdef([gltests_LIBSOURCES_LIST], [])
12300 + m4_pushdef([gltests_LIBSOURCES_DIR], [])
12302 + gl_source_base='gnulib/tests'
12305 + AC_CHECK_FUNCS([shutdown])
12306 + abs_aux_dir=`cd "$ac_aux_dir"; pwd`
12307 + AC_SUBST([abs_aux_dir])
12308 + m4_ifval(gltests_LIBSOURCES_LIST, [
12309 + m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ ||
12310 + for gl_file in ]gltests_LIBSOURCES_LIST[ ; do
12311 + if test ! -r ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file ; then
12312 + echo "missing file ]m4_defn([gltests_LIBSOURCES_DIR])[/$gl_file" >&2
12316 + m4_if(m4_sysval, [0], [],
12317 + [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
12319 + m4_popdef([gltests_LIBSOURCES_DIR])
12320 + m4_popdef([gltests_LIBSOURCES_LIST])
12321 + m4_popdef([AC_LIBSOURCES])
12322 + m4_popdef([AC_REPLACE_FUNCS])
12323 + m4_popdef([AC_LIBOBJ])
12324 + AC_CONFIG_COMMANDS_PRE([
12326 + gltests_ltlibobjs=
12327 + if test -n "$gltests_LIBOBJS"; then
12328 + # Remove the extension.
12329 + sed_drop_objext='s/\.o$//;s/\.obj$//'
12330 + for i in `for i in $gltests_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
12331 + gltests_libobjs="$gltests_libobjs $i.$ac_objext"
12332 + gltests_ltlibobjs="$gltests_ltlibobjs $i.lo"
12335 + AC_SUBST([gltests_LIBOBJS], [$gltests_libobjs])
12336 + AC_SUBST([gltests_LTLIBOBJS], [$gltests_ltlibobjs])
12338 + LIBTESTS_LIBDEPS="$gltests_libdeps"
12339 + AC_SUBST([LIBTESTS_LIBDEPS])
12342 +# Like AC_LIBOBJ, except that the module name goes
12343 +# into gl_LIBOBJS instead of into LIBOBJS.
12344 +AC_DEFUN([gl_LIBOBJ], [
12345 + AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
12346 + gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
12349 +# Like AC_REPLACE_FUNCS, except that the module name goes
12350 +# into gl_LIBOBJS instead of into LIBOBJS.
12351 +AC_DEFUN([gl_REPLACE_FUNCS], [
12352 + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
12353 + AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
12356 +# Like AC_LIBSOURCES, except the directory where the source file is
12357 +# expected is derived from the gnulib-tool parameterization,
12358 +# and alloca is special cased (for the alloca-opt module).
12359 +# We could also entirely rely on EXTRA_lib..._SOURCES.
12360 +AC_DEFUN([gl_LIBSOURCES], [
12361 + m4_foreach([_gl_NAME], [$1], [
12362 + m4_if(_gl_NAME, [alloca.c], [], [
12363 + m4_define([gl_LIBSOURCES_DIR], [gnulib/lib])
12364 + m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
12369 +# Like AC_LIBOBJ, except that the module name goes
12370 +# into gltests_LIBOBJS instead of into LIBOBJS.
12371 +AC_DEFUN([gltests_LIBOBJ], [
12372 + AS_LITERAL_IF([$1], [gltests_LIBSOURCES([$1.c])])dnl
12373 + gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
12376 +# Like AC_REPLACE_FUNCS, except that the module name goes
12377 +# into gltests_LIBOBJS instead of into LIBOBJS.
12378 +AC_DEFUN([gltests_REPLACE_FUNCS], [
12379 + m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
12380 + AC_CHECK_FUNCS([$1], , [gltests_LIBOBJ($ac_func)])
12383 +# Like AC_LIBSOURCES, except the directory where the source file is
12384 +# expected is derived from the gnulib-tool parameterization,
12385 +# and alloca is special cased (for the alloca-opt module).
12386 +# We could also entirely rely on EXTRA_lib..._SOURCES.
12387 +AC_DEFUN([gltests_LIBSOURCES], [
12388 + m4_foreach([_gl_NAME], [$1], [
12389 + m4_if(_gl_NAME, [alloca.c], [], [
12390 + m4_define([gltests_LIBSOURCES_DIR], [gnulib/tests])
12391 + m4_append([gltests_LIBSOURCES_LIST], _gl_NAME, [ ])
12396 +# This macro records the list of files which have been installed by
12397 +# gnulib-tool and may be removed by future gnulib-tool invocations.
12398 +AC_DEFUN([gl_FILE_LIST], [
12399 + build-aux/link-warning.h
12400 + build-aux/vc-list-files
12402 + lib/arpa_inet.in.h
12408 + lib/gai_strerror.c
12409 + lib/getaddrinfo.c
12410 + lib/getaddrinfo.h
12413 + lib/netinet_in.in.h
12414 + lib/printf-args.c
12415 + lib/printf-args.h
12416 + lib/printf-parse.c
12417 + lib/printf-parse.h
12422 + lib/stdio-write.c
12424 + lib/sys_socket.in.h
12431 + m4/arpa_inet_h.m4
12435 + m4/getaddrinfo.m4
12436 + m4/gnulib-common.m4
12437 + m4/include_next.m4
12442 + m4/netinet_in_h.m4
12453 + m4/sys_socket_h.m4
12459 + tests/test-alloca-opt.c
12460 + tests/test-arpa_inet.c
12461 + tests/test-errno.c
12462 + tests/test-getaddrinfo.c
12463 + tests/test-netinet_in.c
12464 + tests/test-snprintf.c
12465 + tests/test-stdbool.c
12466 + tests/test-stdint.c
12467 + tests/test-stdio.c
12468 + tests/test-sys_socket.c
12469 + tests/test-vasnprintf.c
12470 + tests/test-vc-list-files-cvs.sh
12471 + tests/test-vc-list-files-git.sh
12472 + tests/test-wchar.c
12473 + tests=lib/dummy.c
12474 + tests=lib/intprops.h
12475 + tests=lib/verify.h
12477 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-tool.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-tool.m4
12478 --- gtk-vnc-0.3.7.mingw/gnulib/m4/gnulib-tool.m4 1970-01-01 01:00:00.000000000 +0100
12479 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/gnulib-tool.m4 2008-10-09 12:24:39.000000000 +0100
12481 +# gnulib-tool.m4 serial 2
12482 +dnl Copyright (C) 2004-2005 Free Software Foundation, Inc.
12483 +dnl This file is free software; the Free Software Foundation
12484 +dnl gives unlimited permission to copy and/or distribute it,
12485 +dnl with or without modifications, as long as this notice is preserved.
12487 +dnl The following macros need not be invoked explicitly.
12488 +dnl Invoking them does nothing except to declare default arguments
12489 +dnl for "gnulib-tool --import".
12491 +dnl Usage: gl_LOCAL_DIR([DIR])
12492 +AC_DEFUN([gl_LOCAL_DIR], [])
12494 +dnl Usage: gl_MODULES([module1 module2 ...])
12495 +AC_DEFUN([gl_MODULES], [])
12497 +dnl Usage: gl_AVOID([module1 module2 ...])
12498 +AC_DEFUN([gl_AVOID], [])
12500 +dnl Usage: gl_SOURCE_BASE([DIR])
12501 +AC_DEFUN([gl_SOURCE_BASE], [])
12503 +dnl Usage: gl_M4_BASE([DIR])
12504 +AC_DEFUN([gl_M4_BASE], [])
12506 +dnl Usage: gl_PO_BASE([DIR])
12507 +AC_DEFUN([gl_PO_BASE], [])
12509 +dnl Usage: gl_DOC_BASE([DIR])
12510 +AC_DEFUN([gl_DOC_BASE], [])
12512 +dnl Usage: gl_TESTS_BASE([DIR])
12513 +AC_DEFUN([gl_TESTS_BASE], [])
12515 +dnl Usage: gl_WITH_TESTS
12516 +AC_DEFUN([gl_WITH_TESTS], [])
12518 +dnl Usage: gl_LIB([LIBNAME])
12519 +AC_DEFUN([gl_LIB], [])
12521 +dnl Usage: gl_LGPL or gl_LGPL([VERSION])
12522 +AC_DEFUN([gl_LGPL], [])
12524 +dnl Usage: gl_MAKEFILE_NAME([FILENAME])
12525 +AC_DEFUN([gl_MAKEFILE_NAME], [])
12527 +dnl Usage: gl_LIBTOOL
12528 +AC_DEFUN([gl_LIBTOOL], [])
12530 +dnl Usage: gl_MACRO_PREFIX([PREFIX])
12531 +AC_DEFUN([gl_MACRO_PREFIX], [])
12533 +dnl Usage: gl_PO_DOMAIN([DOMAIN])
12534 +AC_DEFUN([gl_PO_DOMAIN], [])
12536 +dnl Usage: gl_VC_FILES([BOOLEAN])
12537 +AC_DEFUN([gl_VC_FILES], [])
12538 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/include_next.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/include_next.m4
12539 --- gtk-vnc-0.3.7.mingw/gnulib/m4/include_next.m4 1970-01-01 01:00:00.000000000 +0100
12540 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/include_next.m4 2008-10-09 12:24:39.000000000 +0100
12542 +# include_next.m4 serial 8
12543 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
12544 +dnl This file is free software; the Free Software Foundation
12545 +dnl gives unlimited permission to copy and/or distribute it,
12546 +dnl with or without modifications, as long as this notice is preserved.
12548 +dnl From Paul Eggert and Derek Price.
12550 +dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
12552 +dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
12553 +dnl 'include' otherwise.
12555 +dnl PRAGMA_SYSTEM_HEADER can be used in files that contain #include_next,
12556 +dnl so as to avoid GCC warnings when the gcc option -pedantic is used.
12557 +dnl '#pragma GCC system_header' has the same effect as if the file was found
12558 +dnl through the include search path specified with '-isystem' options (as
12559 +dnl opposed to the search path specified with '-I' options). Namely, gcc
12560 +dnl does not warn about some things, and on some systems (Solaris and Interix)
12561 +dnl __STDC__ evaluates to 0 instead of to 1. The latter is an undesired side
12562 +dnl effect; we are therefore careful to use 'defined __STDC__' or '1' instead
12563 +dnl of plain '__STDC__'.
12565 +AC_DEFUN([gl_INCLUDE_NEXT],
12567 + AC_LANG_PREPROC_REQUIRE()
12568 + AC_CACHE_CHECK([whether the preprocessor supports include_next],
12569 + [gl_cv_have_include_next],
12570 + [rm -rf conftestd1 conftestd2
12571 + mkdir conftestd1 conftestd2
12572 + dnl The include of <stdio.h> is because IBM C 9.0 on AIX 6.1 supports
12573 + dnl include_next when used as first preprocessor directive in a file,
12574 + dnl but not when preceded by another include directive.
12575 + cat <<EOF > conftestd1/conftest.h
12576 +#define DEFINED_IN_CONFTESTD1
12577 +#include <stdio.h>
12578 +#include_next <conftest.h>
12579 +#ifdef DEFINED_IN_CONFTESTD2
12582 +#error "include_next doesn't work"
12585 + cat <<EOF > conftestd2/conftest.h
12586 +#ifndef DEFINED_IN_CONFTESTD1
12587 +#error "include_next test doesn't work"
12589 +#define DEFINED_IN_CONFTESTD2
12591 + save_CPPFLAGS="$CPPFLAGS"
12592 + CPPFLAGS="$CPPFLAGS -Iconftestd1 -Iconftestd2"
12593 + AC_COMPILE_IFELSE([#include <conftest.h>],
12594 + [gl_cv_have_include_next=yes],
12595 + [gl_cv_have_include_next=no])
12596 + CPPFLAGS="$save_CPPFLAGS"
12597 + rm -rf conftestd1 conftestd2
12599 + PRAGMA_SYSTEM_HEADER=
12600 + if test $gl_cv_have_include_next = yes; then
12601 + INCLUDE_NEXT=include_next
12602 + if test -n "$GCC"; then
12603 + PRAGMA_SYSTEM_HEADER='#pragma GCC system_header'
12606 + INCLUDE_NEXT=include
12608 + AC_SUBST([INCLUDE_NEXT])
12609 + AC_SUBST([PRAGMA_SYSTEM_HEADER])
12612 +# gl_CHECK_NEXT_HEADERS(HEADER1 HEADER2 ...)
12613 +# ------------------------------------------
12614 +# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
12615 +# '<foo.h>'; otherwise define it to be
12616 +# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
12617 +# That way, a header file with the following line:
12618 +# #@INCLUDE_NEXT@ @NEXT_FOO_H@
12619 +# behaves (after sed substitution) as if it contained
12620 +# #include_next <foo.h>
12621 +# even if the compiler does not support include_next.
12622 +# The three "///" are to pacify Sun C 5.8, which otherwise would say
12623 +# "warning: #include of /usr/include/... may be non-portable".
12624 +# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
12625 +# Note: This macro assumes that the header file is not empty after
12626 +# preprocessing, i.e. it does not only define preprocessor macros but also
12627 +# provides some type/enum definitions or function/variable declarations.
12628 +AC_DEFUN([gl_CHECK_NEXT_HEADERS],
12630 + AC_REQUIRE([gl_INCLUDE_NEXT])
12631 + AC_CHECK_HEADERS_ONCE([$1])
12633 + m4_foreach_w([gl_HEADER_NAME], [$1],
12634 + [AS_VAR_PUSHDEF([gl_next_header],
12635 + [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
12636 + if test $gl_cv_have_include_next = yes; then
12637 + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
12640 + [absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
12641 + m4_quote(m4_defn([gl_next_header])),
12642 + [AS_VAR_PUSHDEF([gl_header_exists],
12643 + [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))
12644 + if test AS_VAR_GET(gl_header_exists) = yes; then
12645 + AC_LANG_CONFTEST(
12647 + [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
12649 + dnl eval is necessary to expand ac_cpp.
12650 + dnl Ultrix and Pyramid sh refuse to redirect output of eval,
12651 + dnl so use subshell.
12652 + AS_VAR_SET([gl_next_header],
12653 + ['"'`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
12654 + sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{
12655 + s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
12661 + AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
12663 + AS_VAR_POPDEF([gl_header_exists])])
12666 + AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))),
12667 + [AS_VAR_GET([gl_next_header])])
12668 + AS_VAR_POPDEF([gl_next_header])])
12670 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/inet_ntop.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/inet_ntop.m4
12671 --- gtk-vnc-0.3.7.mingw/gnulib/m4/inet_ntop.m4 1970-01-01 01:00:00.000000000 +0100
12672 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/inet_ntop.m4 2008-10-09 12:24:39.000000000 +0100
12674 +# inet_ntop.m4 serial 7
12675 +dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
12676 +dnl This file is free software; the Free Software Foundation
12677 +dnl gives unlimited permission to copy and/or distribute it,
12678 +dnl with or without modifications, as long as this notice is preserved.
12680 +AC_DEFUN([gl_INET_NTOP],
12682 + dnl Persuade Solaris <arpa/inet.h> to declare inet_ntop.
12683 + AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12685 + gl_REPLACE_ARPA_INET_H
12687 + AC_REPLACE_FUNCS(inet_ntop)
12688 + gl_PREREQ_INET_NTOP
12691 +# Prerequisites of lib/inet_ntop.c.
12692 +AC_DEFUN([gl_PREREQ_INET_NTOP], [
12693 + AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
12694 + if test $ac_cv_have_decl_inet_ntop = no; then
12695 + HAVE_DECL_INET_NTOP=0
12697 + AC_REQUIRE([gl_SOCKET_FAMILIES])
12698 + AC_REQUIRE([AC_C_RESTRICT])
12700 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/intmax_t.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/intmax_t.m4
12701 --- gtk-vnc-0.3.7.mingw/gnulib/m4/intmax_t.m4 1970-01-01 01:00:00.000000000 +0100
12702 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/intmax_t.m4 2008-10-09 12:24:39.000000000 +0100
12704 +# intmax_t.m4 serial 6
12705 +dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc.
12706 +dnl This file is free software; the Free Software Foundation
12707 +dnl gives unlimited permission to copy and/or distribute it,
12708 +dnl with or without modifications, as long as this notice is preserved.
12710 +dnl From Paul Eggert.
12714 +# Define intmax_t to 'long' or 'long long'
12715 +# if it is not already defined in <stdint.h> or <inttypes.h>.
12717 +AC_DEFUN([gl_AC_TYPE_INTMAX_T],
12719 + dnl For simplicity, we assume that a header file defines 'intmax_t' if and
12720 + dnl only if it defines 'uintmax_t'.
12721 + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
12722 + AC_REQUIRE([gl_AC_HEADER_STDINT_H])
12723 + if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
12724 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
12725 + test $ac_cv_type_long_long_int = yes \
12726 + && ac_type='long long' \
12727 + || ac_type='long'
12728 + AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
12729 + [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
12731 + AC_DEFINE(HAVE_INTMAX_T, 1,
12732 + [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
12736 +dnl An alternative would be to explicitly test for 'intmax_t'.
12738 +AC_DEFUN([gt_AC_TYPE_INTMAX_T],
12740 + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
12741 + AC_REQUIRE([gl_AC_HEADER_STDINT_H])
12742 + AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
12743 + [AC_TRY_COMPILE([
12744 +#include <stddef.h>
12745 +#include <stdlib.h>
12746 +#if HAVE_STDINT_H_WITH_UINTMAX
12747 +#include <stdint.h>
12749 +#if HAVE_INTTYPES_H_WITH_UINTMAX
12750 +#include <inttypes.h>
12752 +], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
12753 + if test $gt_cv_c_intmax_t = yes; then
12754 + AC_DEFINE(HAVE_INTMAX_T, 1,
12755 + [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
12757 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
12758 + test $ac_cv_type_long_long_int = yes \
12759 + && ac_type='long long' \
12760 + || ac_type='long'
12761 + AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
12762 + [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
12765 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/inttypes_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/inttypes_h.m4
12766 --- gtk-vnc-0.3.7.mingw/gnulib/m4/inttypes_h.m4 1970-01-01 01:00:00.000000000 +0100
12767 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/inttypes_h.m4 2008-10-09 12:24:39.000000000 +0100
12769 +# inttypes_h.m4 serial 7
12770 +dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
12771 +dnl This file is free software; the Free Software Foundation
12772 +dnl gives unlimited permission to copy and/or distribute it,
12773 +dnl with or without modifications, as long as this notice is preserved.
12775 +dnl From Paul Eggert.
12777 +# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
12778 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
12780 +AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
12782 + AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
12784 + [#include <sys/types.h>
12785 +#include <inttypes.h>],
12786 + [uintmax_t i = (uintmax_t) -1; return !i;],
12787 + gl_cv_header_inttypes_h=yes,
12788 + gl_cv_header_inttypes_h=no)])
12789 + if test $gl_cv_header_inttypes_h = yes; then
12790 + AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
12791 + [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
12792 + and declares uintmax_t. ])
12795 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/longlong.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/longlong.m4
12796 --- gtk-vnc-0.3.7.mingw/gnulib/m4/longlong.m4 1970-01-01 01:00:00.000000000 +0100
12797 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/longlong.m4 2008-10-09 12:24:39.000000000 +0100
12799 +# longlong.m4 serial 13
12800 +dnl Copyright (C) 1999-2007 Free Software Foundation, Inc.
12801 +dnl This file is free software; the Free Software Foundation
12802 +dnl gives unlimited permission to copy and/or distribute it,
12803 +dnl with or without modifications, as long as this notice is preserved.
12805 +dnl From Paul Eggert.
12807 +# Define HAVE_LONG_LONG_INT if 'long long int' works.
12808 +# This fixes a bug in Autoconf 2.61, but can be removed once we
12809 +# assume 2.62 everywhere.
12811 +# Note: If the type 'long long int' exists but is only 32 bits large
12812 +# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
12813 +# defined. In this case you can treat 'long long int' like 'long int'.
12815 +AC_DEFUN([AC_TYPE_LONG_LONG_INT],
12817 + AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
12819 + [_AC_TYPE_LONG_LONG_SNIPPET],
12820 + [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
12821 + dnl If cross compiling, assume the bug isn't important, since
12822 + dnl nobody cross compiles for this platform as far as we know.
12824 + [AC_LANG_PROGRAM(
12825 + [[@%:@include <limits.h>
12826 + @%:@ifndef LLONG_MAX
12827 + @%:@ define HALF \
12828 + (1LL << (sizeof (long long int) * CHAR_BIT - 2))
12829 + @%:@ define LLONG_MAX (HALF - 1 + HALF)
12831 + [[long long int n = 1;
12833 + for (i = 0; ; i++)
12835 + long long int m = n << i;
12838 + if (LLONG_MAX / 2 < m)
12842 + [ac_cv_type_long_long_int=yes],
12843 + [ac_cv_type_long_long_int=no],
12844 + [ac_cv_type_long_long_int=yes])],
12845 + [ac_cv_type_long_long_int=no])])
12846 + if test $ac_cv_type_long_long_int = yes; then
12847 + AC_DEFINE([HAVE_LONG_LONG_INT], 1,
12848 + [Define to 1 if the system has the type `long long int'.])
12852 +# Define HAVE_UNSIGNED_LONG_LONG_INT if 'unsigned long long int' works.
12853 +# This fixes a bug in Autoconf 2.61, but can be removed once we
12854 +# assume 2.62 everywhere.
12856 +# Note: If the type 'unsigned long long int' exists but is only 32 bits
12857 +# large (as on some very old compilers), AC_TYPE_UNSIGNED_LONG_LONG_INT
12858 +# will not be defined. In this case you can treat 'unsigned long long int'
12859 +# like 'unsigned long int'.
12861 +AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT],
12863 + AC_CACHE_CHECK([for unsigned long long int],
12864 + [ac_cv_type_unsigned_long_long_int],
12866 + [_AC_TYPE_LONG_LONG_SNIPPET],
12867 + [ac_cv_type_unsigned_long_long_int=yes],
12868 + [ac_cv_type_unsigned_long_long_int=no])])
12869 + if test $ac_cv_type_unsigned_long_long_int = yes; then
12870 + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1,
12871 + [Define to 1 if the system has the type `unsigned long long int'.])
12875 +# Expands to a C program that can be used to test for simultaneous support
12876 +# of 'long long' and 'unsigned long long'. We don't want to say that
12877 +# 'long long' is available if 'unsigned long long' is not, or vice versa,
12878 +# because too many programs rely on the symmetry between signed and unsigned
12879 +# integer types (excluding 'bool').
12880 +AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
12883 + [[/* For now, do not test the preprocessor; as of 2007 there are too many
12884 + implementations with broken preprocessors. Perhaps this can
12885 + be revisited in 2012. In the meantime, code should not expect
12886 + #if to work with literals wider than 32 bits. */
12887 + /* Test literals. */
12888 + long long int ll = 9223372036854775807ll;
12889 + long long int nll = -9223372036854775807LL;
12890 + unsigned long long int ull = 18446744073709551615ULL;
12891 + /* Test constant expressions. */
12892 + typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll)
12894 + typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1
12897 + [[/* Test availability of runtime routines for shift and division. */
12898 + long long int llmax = 9223372036854775807ll;
12899 + unsigned long long int ullmax = 18446744073709551615ull;
12900 + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
12901 + | (llmax / ll) | (llmax % ll)
12902 + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i)
12903 + | (ullmax / ull) | (ullmax % ull));]])
12905 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/netinet_in_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/netinet_in_h.m4
12906 --- gtk-vnc-0.3.7.mingw/gnulib/m4/netinet_in_h.m4 1970-01-01 01:00:00.000000000 +0100
12907 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/netinet_in_h.m4 2008-10-09 12:24:39.000000000 +0100
12909 +# netinet_in_h.m4 serial 4
12910 +dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
12911 +dnl This file is free software; the Free Software Foundation
12912 +dnl gives unlimited permission to copy and/or distribute it,
12913 +dnl with or without modifications, as long as this notice is preserved.
12915 +AC_DEFUN([gl_HEADER_NETINET_IN],
12917 + AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
12918 + [gl_cv_header_netinet_in_h_selfcontained],
12920 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
12921 + [gl_cv_header_netinet_in_h_selfcontained=yes],
12922 + [gl_cv_header_netinet_in_h_selfcontained=no])
12924 + if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
12927 + NETINET_IN_H='netinet/in.h'
12928 + AC_CHECK_HEADERS([netinet/in.h])
12929 + gl_CHECK_NEXT_HEADERS([netinet/in.h])
12930 + if test $ac_cv_header_netinet_in_h = yes; then
12931 + HAVE_NETINET_IN_H=1
12933 + HAVE_NETINET_IN_H=0
12935 + AC_SUBST([HAVE_NETINET_IN_H])
12937 + AC_SUBST([NETINET_IN_H])
12939 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/onceonly.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/onceonly.m4
12940 --- gtk-vnc-0.3.7.mingw/gnulib/m4/onceonly.m4 1970-01-01 01:00:00.000000000 +0100
12941 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/onceonly.m4 2008-10-09 12:24:39.000000000 +0100
12943 +# onceonly.m4 serial 6
12944 +dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc.
12945 +dnl This file is free software, distributed under the terms of the GNU
12946 +dnl General Public License. As a special exception to the GNU General
12947 +dnl Public License, this file may be distributed as part of a program
12948 +dnl that contains a configuration script generated by Autoconf, under
12949 +dnl the same distribution terms as the rest of that program.
12951 +dnl This file defines some "once only" variants of standard autoconf macros.
12952 +dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
12953 +dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
12954 +dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
12955 +dnl AC_REQUIRE([AC_FUNC_STRCOLL]) like AC_FUNC_STRCOLL
12956 +dnl The advantage is that the check for each of the headers/functions/decls
12957 +dnl will be put only once into the 'configure' file. It keeps the size of
12958 +dnl the 'configure' file down, and avoids redundant output when 'configure'
12960 +dnl The drawback is that the checks cannot be conditionalized. If you write
12961 +dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
12962 +dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
12963 +dnl empty, and the check will be inserted before the body of the AC_DEFUNed
12966 +dnl The original code implemented AC_CHECK_HEADERS_ONCE and AC_CHECK_FUNCS_ONCE
12967 +dnl in terms of AC_DEFUN and AC_REQUIRE. This implementation uses diversions to
12968 +dnl named sections DEFAULTS and INIT_PREPARE in order to check all requested
12969 +dnl headers at once, thus reducing the size of 'configure'. It is known to work
12970 +dnl with autoconf 2.57..2.62 at least . The size reduction is ca. 9%.
12972 +dnl Autoconf version 2.59 plus gnulib is required; this file is not needed
12973 +dnl with Autoconf 2.60 or greater. But note that autoconf's implementation of
12974 +dnl AC_CHECK_DECLS_ONCE expects a comma-separated list of symbols as first
12978 +# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
12979 +# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
12980 +AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
12982 + m4_foreach_w([gl_HEADER_NAME], [$1], [
12983 + AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
12984 + [./-], [___])), [
12985 + m4_divert_text([INIT_PREPARE],
12986 + [gl_header_list="$gl_header_list gl_HEADER_NAME"])
12987 + gl_HEADERS_EXPANSION
12988 + AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
12989 + [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
12991 + AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
12995 +m4_define([gl_HEADERS_EXPANSION], [
12996 + m4_divert_text([DEFAULTS], [gl_header_list=])
12997 + AC_CHECK_HEADERS([$gl_header_list])
12998 + m4_define([gl_HEADERS_EXPANSION], [])
13001 +# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
13002 +# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
13003 +AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
13005 + m4_foreach_w([gl_FUNC_NAME], [$1], [
13006 + AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
13007 + m4_divert_text([INIT_PREPARE],
13008 + [gl_func_list="$gl_func_list gl_FUNC_NAME"])
13009 + gl_FUNCS_EXPANSION
13010 + AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
13011 + [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
13013 + AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
13016 +m4_define([gl_FUNCS_EXPANSION], [
13017 + m4_divert_text([DEFAULTS], [gl_func_list=])
13018 + AC_CHECK_FUNCS([$gl_func_list])
13019 + m4_define([gl_FUNCS_EXPANSION], [])
13022 +# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
13023 +# AC_CHECK_DECLS(DECL1, DECL2, ...).
13024 +AC_DEFUN([AC_CHECK_DECLS_ONCE], [
13026 + m4_foreach_w([gl_DECL_NAME], [$1], [
13027 + AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
13028 + AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
13030 + AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
13033 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/printf.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/printf.m4
13034 --- gtk-vnc-0.3.7.mingw/gnulib/m4/printf.m4 1970-01-01 01:00:00.000000000 +0100
13035 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/printf.m4 2008-10-09 12:24:39.000000000 +0100
13037 +# printf.m4 serial 23
13038 +dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc.
13039 +dnl This file is free software; the Free Software Foundation
13040 +dnl gives unlimited permission to copy and/or distribute it,
13041 +dnl with or without modifications, as long as this notice is preserved.
13043 +dnl Test whether the *printf family of functions supports the 'j', 'z', 't',
13044 +dnl 'L' size specifiers. (ISO C99, POSIX:2001)
13045 +dnl Result is gl_cv_func_printf_sizes_c99.
13047 +AC_DEFUN([gl_PRINTF_SIZES_C99],
13049 + AC_REQUIRE([AC_PROG_CC])
13050 + AC_REQUIRE([gl_AC_HEADER_STDINT_H])
13051 + AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
13052 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13053 + AC_CACHE_CHECK([whether printf supports size specifiers as in C99],
13054 + [gl_cv_func_printf_sizes_c99],
13057 +#include <stddef.h>
13058 +#include <stdio.h>
13059 +#include <string.h>
13060 +#include <sys/types.h>
13061 +#if HAVE_STDINT_H_WITH_UINTMAX
13062 +# include <stdint.h>
13064 +#if HAVE_INTTYPES_H_WITH_UINTMAX
13065 +# include <inttypes.h>
13067 +static char buf[100];
13070 +#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
13072 + if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
13073 + || strcmp (buf, "12345671 33") != 0)
13077 + if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
13078 + || strcmp (buf, "12345672 33") != 0)
13081 + if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
13082 + || strcmp (buf, "12345673 33") != 0)
13085 + if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
13086 + || strcmp (buf, "1.5 33") != 0)
13089 +}], [gl_cv_func_printf_sizes_c99=yes], [gl_cv_func_printf_sizes_c99=no],
13092 + case "$host_os" in
13093 + # Guess yes on glibc systems.
13094 + *-gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
13095 + # Guess yes on FreeBSD >= 5.
13096 + freebsd[1-4]*) gl_cv_func_printf_sizes_c99="guessing no";;
13097 + freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
13098 + # Guess yes on MacOS X >= 10.3.
13099 + darwin[1-6].*) gl_cv_func_printf_sizes_c99="guessing no";;
13100 + darwin*) gl_cv_func_printf_sizes_c99="guessing yes";;
13101 + # Guess yes on OpenBSD >= 3.9.
13102 + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
13103 + gl_cv_func_printf_sizes_c99="guessing no";;
13104 + openbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
13105 + # Guess yes on Solaris >= 2.10.
13106 + solaris2.[0-9]*) gl_cv_func_printf_sizes_c99="guessing no";;
13107 + solaris*) gl_cv_func_printf_sizes_c99="guessing yes";;
13108 + # Guess yes on NetBSD >= 3.
13109 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
13110 + gl_cv_func_printf_sizes_c99="guessing no";;
13111 + netbsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
13112 + # If we don't know, assume the worst.
13113 + *) gl_cv_func_printf_sizes_c99="guessing no";;
13115 +changequote([,])dnl
13120 +dnl Test whether the *printf family of functions supports 'long double'
13121 +dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
13122 +dnl Result is gl_cv_func_printf_long_double.
13124 +AC_DEFUN([gl_PRINTF_LONG_DOUBLE],
13126 + AC_REQUIRE([AC_PROG_CC])
13127 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13128 + AC_CACHE_CHECK([whether printf supports 'long double' arguments],
13129 + [gl_cv_func_printf_long_double],
13132 +#include <stdio.h>
13133 +#include <string.h>
13134 +static char buf[10000];
13138 + if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
13139 + || strcmp (buf, "1.750000 33") != 0)
13142 + if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
13143 + || strcmp (buf, "1.750000e+00 33") != 0)
13146 + if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
13147 + || strcmp (buf, "1.75 33") != 0)
13150 +}], [gl_cv_func_printf_long_double=yes], [gl_cv_func_printf_long_double=no],
13153 + case "$host_os" in
13154 + beos*) gl_cv_func_printf_long_double="guessing no";;
13155 + mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
13156 + *) gl_cv_func_printf_long_double="guessing yes";;
13158 +changequote([,])dnl
13163 +dnl Test whether the *printf family of functions supports infinite and NaN
13164 +dnl 'double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
13165 +dnl Result is gl_cv_func_printf_infinite.
13167 +AC_DEFUN([gl_PRINTF_INFINITE],
13169 + AC_REQUIRE([AC_PROG_CC])
13170 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13171 + AC_CACHE_CHECK([whether printf supports infinite 'double' arguments],
13172 + [gl_cv_func_printf_infinite],
13175 +#include <stdio.h>
13176 +#include <string.h>
13178 +strisnan (const char *string, size_t start_index, size_t end_index)
13180 + if (start_index < end_index)
13182 + if (string[start_index] == '-')
13184 + if (start_index + 3 <= end_index
13185 + && memcmp (string + start_index, "nan", 3) == 0)
13187 + start_index += 3;
13188 + if (start_index == end_index
13189 + || (string[start_index] == '(' && string[end_index - 1] == ')'))
13195 +static char buf[10000];
13196 +static double zero = 0.0;
13199 + if (sprintf (buf, "%f", 1.0 / 0.0) < 0
13200 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13202 + if (sprintf (buf, "%f", -1.0 / 0.0) < 0
13203 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13205 + if (sprintf (buf, "%f", zero / zero) < 0
13206 + || !strisnan (buf, 0, strlen (buf)))
13208 + if (sprintf (buf, "%e", 1.0 / 0.0) < 0
13209 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13211 + if (sprintf (buf, "%e", -1.0 / 0.0) < 0
13212 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13214 + if (sprintf (buf, "%e", zero / zero) < 0
13215 + || !strisnan (buf, 0, strlen (buf)))
13217 + if (sprintf (buf, "%g", 1.0 / 0.0) < 0
13218 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13220 + if (sprintf (buf, "%g", -1.0 / 0.0) < 0
13221 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13223 + if (sprintf (buf, "%g", zero / zero) < 0
13224 + || !strisnan (buf, 0, strlen (buf)))
13227 +}], [gl_cv_func_printf_infinite=yes], [gl_cv_func_printf_infinite=no],
13230 + case "$host_os" in
13231 + # Guess yes on glibc systems.
13232 + *-gnu*) gl_cv_func_printf_infinite="guessing yes";;
13233 + # Guess yes on FreeBSD >= 6.
13234 + freebsd[1-5]*) gl_cv_func_printf_infinite="guessing no";;
13235 + freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
13236 + # Guess yes on MacOS X >= 10.3.
13237 + darwin[1-6].*) gl_cv_func_printf_infinite="guessing no";;
13238 + darwin*) gl_cv_func_printf_infinite="guessing yes";;
13239 + # Guess yes on HP-UX >= 11.
13240 + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
13241 + hpux*) gl_cv_func_printf_infinite="guessing yes";;
13242 + # Guess yes on NetBSD >= 3.
13243 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
13244 + gl_cv_func_printf_infinite="guessing no";;
13245 + netbsd*) gl_cv_func_printf_infinite="guessing yes";;
13246 + # Guess yes on BeOS.
13247 + beos*) gl_cv_func_printf_infinite="guessing yes";;
13248 + # If we don't know, assume the worst.
13249 + *) gl_cv_func_printf_infinite="guessing no";;
13251 +changequote([,])dnl
13256 +dnl Test whether the *printf family of functions supports infinite and NaN
13257 +dnl 'long double' arguments in the %f, %e, %g directives. (ISO C99, POSIX:2001)
13258 +dnl Result is gl_cv_func_printf_infinite_long_double.
13260 +AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE],
13262 + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
13263 + AC_REQUIRE([AC_PROG_CC])
13264 + AC_REQUIRE([AC_C_BIGENDIAN])
13265 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13266 + dnl The user can set or unset the variable gl_printf_safe to indicate
13267 + dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
13268 + if test -n "$gl_printf_safe"; then
13269 + AC_DEFINE([CHECK_PRINTF_SAFE], 1,
13270 + [Define if you wish *printf() functions that have a safe handling of
13271 + non-IEEE-754 'long double' values.])
13273 + case "$gl_cv_func_printf_long_double" in
13275 + AC_CACHE_CHECK([whether printf supports infinite 'long double' arguments],
13276 + [gl_cv_func_printf_infinite_long_double],
13280 +#include <float.h>
13281 +#include <stdio.h>
13282 +#include <string.h>
13284 +strisnan (const char *string, size_t start_index, size_t end_index)
13286 + if (start_index < end_index)
13288 + if (string[start_index] == '-')
13290 + if (start_index + 3 <= end_index
13291 + && memcmp (string + start_index, "nan", 3) == 0)
13293 + start_index += 3;
13294 + if (start_index == end_index
13295 + || (string[start_index] == '(' && string[end_index - 1] == ')'))
13301 +static char buf[10000];
13302 +static long double zeroL = 0.0L;
13306 + if (sprintf (buf, "%Lf", 1.0L / 0.0L) < 0
13307 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13309 + if (sprintf (buf, "%Lf", -1.0L / 0.0L) < 0
13310 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13312 + if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
13313 + || !strisnan (buf, 0, strlen (buf)))
13315 + if (sprintf (buf, "%Le", 1.0L / 0.0L) < 0
13316 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13318 + if (sprintf (buf, "%Le", -1.0L / 0.0L) < 0
13319 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13321 + if (sprintf (buf, "%Le", zeroL / zeroL) < 0
13322 + || !strisnan (buf, 0, strlen (buf)))
13324 + if (sprintf (buf, "%Lg", 1.0L / 0.0L) < 0
13325 + || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
13327 + if (sprintf (buf, "%Lg", -1.0L / 0.0L) < 0
13328 + || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
13330 + if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
13331 + || !strisnan (buf, 0, strlen (buf)))
13333 +#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_))
13334 +/* Representation of an 80-bit 'long double' as an initializer for a sequence
13335 + of 'unsigned int' words. */
13336 +# ifdef WORDS_BIGENDIAN
13337 +# define LDBL80_WORDS(exponent,manthi,mantlo) \
13338 + { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
13339 + ((unsigned int) (manthi) << 16) | (unsigned int) (mantlo) >> 16), \
13340 + (unsigned int) (mantlo) << 16 \
13343 +# define LDBL80_WORDS(exponent,manthi,mantlo) \
13344 + { mantlo, manthi, exponent }
13346 + { /* Quiet NaN. */
13347 + static union { unsigned int word[4]; long double value; } x =
13348 + { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
13349 + if (sprintf (buf, "%Lf", x.value) < 0
13350 + || !strisnan (buf, 0, strlen (buf)))
13352 + if (sprintf (buf, "%Le", x.value) < 0
13353 + || !strisnan (buf, 0, strlen (buf)))
13355 + if (sprintf (buf, "%Lg", x.value) < 0
13356 + || !strisnan (buf, 0, strlen (buf)))
13360 + /* Signalling NaN. */
13361 + static union { unsigned int word[4]; long double value; } x =
13362 + { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
13363 + if (sprintf (buf, "%Lf", x.value) < 0
13364 + || !strisnan (buf, 0, strlen (buf)))
13366 + if (sprintf (buf, "%Le", x.value) < 0
13367 + || !strisnan (buf, 0, strlen (buf)))
13369 + if (sprintf (buf, "%Lg", x.value) < 0
13370 + || !strisnan (buf, 0, strlen (buf)))
13373 + { /* Pseudo-NaN. */
13374 + static union { unsigned int word[4]; long double value; } x =
13375 + { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
13376 + if (sprintf (buf, "%Lf", x.value) < 0
13377 + || !strisnan (buf, 0, strlen (buf)))
13379 + if (sprintf (buf, "%Le", x.value) < 0
13380 + || !strisnan (buf, 0, strlen (buf)))
13382 + if (sprintf (buf, "%Lg", x.value) < 0
13383 + || !strisnan (buf, 0, strlen (buf)))
13386 + { /* Pseudo-Infinity. */
13387 + static union { unsigned int word[4]; long double value; } x =
13388 + { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
13389 + if (sprintf (buf, "%Lf", x.value) < 0
13390 + || !strisnan (buf, 0, strlen (buf)))
13392 + if (sprintf (buf, "%Le", x.value) < 0
13393 + || !strisnan (buf, 0, strlen (buf)))
13395 + if (sprintf (buf, "%Lg", x.value) < 0
13396 + || !strisnan (buf, 0, strlen (buf)))
13399 + { /* Pseudo-Zero. */
13400 + static union { unsigned int word[4]; long double value; } x =
13401 + { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
13402 + if (sprintf (buf, "%Lf", x.value) < 0
13403 + || !strisnan (buf, 0, strlen (buf)))
13405 + if (sprintf (buf, "%Le", x.value) < 0
13406 + || !strisnan (buf, 0, strlen (buf)))
13408 + if (sprintf (buf, "%Lg", x.value) < 0
13409 + || !strisnan (buf, 0, strlen (buf)))
13412 + { /* Unnormalized number. */
13413 + static union { unsigned int word[4]; long double value; } x =
13414 + { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
13415 + if (sprintf (buf, "%Lf", x.value) < 0
13416 + || !strisnan (buf, 0, strlen (buf)))
13418 + if (sprintf (buf, "%Le", x.value) < 0
13419 + || !strisnan (buf, 0, strlen (buf)))
13421 + if (sprintf (buf, "%Lg", x.value) < 0
13422 + || !strisnan (buf, 0, strlen (buf)))
13425 + { /* Pseudo-Denormal. */
13426 + static union { unsigned int word[4]; long double value; } x =
13427 + { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
13428 + if (sprintf (buf, "%Lf", x.value) < 0
13429 + || !strisnan (buf, 0, strlen (buf)))
13431 + if (sprintf (buf, "%Le", x.value) < 0
13432 + || !strisnan (buf, 0, strlen (buf)))
13434 + if (sprintf (buf, "%Lg", x.value) < 0
13435 + || !strisnan (buf, 0, strlen (buf)))
13441 + [gl_cv_func_printf_infinite_long_double=yes],
13442 + [gl_cv_func_printf_infinite_long_double=no],
13445 + case "$host_cpu" in
13446 + # Guess no on ia64, x86_64, i386.
13447 + ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
13449 + case "$host_os" in
13450 + # Guess yes on glibc systems.
13451 + *-gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13452 + # Guess yes on FreeBSD >= 6.
13453 + freebsd[1-5]*) gl_cv_func_printf_infinite_long_double="guessing no";;
13454 + freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13455 + # Guess yes on MacOS X >= 10.3.
13456 + darwin[1-6].*) gl_cv_func_printf_infinite_long_double="guessing no";;
13457 + darwin*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13458 + # Guess yes on HP-UX >= 11.
13459 + hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
13460 + hpux*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13461 + # Guess yes on NetBSD >= 3.
13462 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
13463 + gl_cv_func_printf_infinite_long_double="guessing no";;
13464 + netbsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
13465 + # If we don't know, assume the worst.
13466 + *) gl_cv_func_printf_infinite_long_double="guessing no";;
13470 +changequote([,])dnl
13475 + gl_cv_func_printf_infinite_long_double="irrelevant"
13480 +dnl Test whether the *printf family of functions supports the 'a' and 'A'
13481 +dnl conversion specifier for hexadecimal output of floating-point numbers.
13482 +dnl (ISO C99, POSIX:2001)
13483 +dnl Result is gl_cv_func_printf_directive_a.
13485 +AC_DEFUN([gl_PRINTF_DIRECTIVE_A],
13487 + AC_REQUIRE([AC_PROG_CC])
13488 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13489 + AC_CACHE_CHECK([whether printf supports the 'a' and 'A' directives],
13490 + [gl_cv_func_printf_directive_a],
13493 +#include <stdio.h>
13494 +#include <string.h>
13495 +static char buf[100];
13498 + if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
13499 + || (strcmp (buf, "0x1.922p+1 33") != 0
13500 + && strcmp (buf, "0x3.244p+0 33") != 0
13501 + && strcmp (buf, "0x6.488p-1 33") != 0
13502 + && strcmp (buf, "0xc.91p-2 33") != 0))
13504 + if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
13505 + || (strcmp (buf, "-0X1.922P+1 33") != 0
13506 + && strcmp (buf, "-0X3.244P+0 33") != 0
13507 + && strcmp (buf, "-0X6.488P-1 33") != 0
13508 + && strcmp (buf, "-0XC.91P-2 33") != 0))
13510 + /* This catches a FreeBSD 6.1 bug: it doesn't round. */
13511 + if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
13512 + || (strcmp (buf, "0x1.83p+0 33") != 0
13513 + && strcmp (buf, "0x3.05p-1 33") != 0
13514 + && strcmp (buf, "0x6.0ap-2 33") != 0
13515 + && strcmp (buf, "0xc.14p-3 33") != 0))
13517 + /* This catches a FreeBSD 6.1 bug. See
13518 + <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
13519 + if (sprintf (buf, "%010a %d", 1.0 / 0.0, 33, 44, 55) < 0
13520 + || buf[0] == '0')
13522 + /* This catches a MacOS X 10.3.9 (Darwin 7.9) bug. */
13523 + if (sprintf (buf, "%.1a", 1.999) < 0
13524 + || (strcmp (buf, "0x1.0p+1") != 0
13525 + && strcmp (buf, "0x2.0p+0") != 0
13526 + && strcmp (buf, "0x4.0p-1") != 0
13527 + && strcmp (buf, "0x8.0p-2") != 0))
13529 + /* This catches the same MacOS X 10.3.9 (Darwin 7.9) bug and also a
13530 + glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>. */
13531 + if (sprintf (buf, "%.1La", 1.999L) < 0
13532 + || (strcmp (buf, "0x1.0p+1") != 0
13533 + && strcmp (buf, "0x2.0p+0") != 0
13534 + && strcmp (buf, "0x4.0p-1") != 0
13535 + && strcmp (buf, "0x8.0p-2") != 0))
13538 +}], [gl_cv_func_printf_directive_a=yes], [gl_cv_func_printf_directive_a=no],
13540 + case "$host_os" in
13541 + # Guess yes on glibc >= 2.5 systems.
13543 + AC_EGREP_CPP([BZ2908], [
13544 + #include <features.h>
13545 + #ifdef __GNU_LIBRARY__
13546 + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)
13551 + [gl_cv_func_printf_directive_a="guessing yes"],
13552 + [gl_cv_func_printf_directive_a="guessing no"])
13554 + # If we don't know, assume the worst.
13555 + *) gl_cv_func_printf_directive_a="guessing no";;
13561 +dnl Test whether the *printf family of functions supports the %F format
13562 +dnl directive. (ISO C99, POSIX:2001)
13563 +dnl Result is gl_cv_func_printf_directive_f.
13565 +AC_DEFUN([gl_PRINTF_DIRECTIVE_F],
13567 + AC_REQUIRE([AC_PROG_CC])
13568 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13569 + AC_CACHE_CHECK([whether printf supports the 'F' directive],
13570 + [gl_cv_func_printf_directive_f],
13573 +#include <stdio.h>
13574 +#include <string.h>
13575 +static char buf[100];
13578 + if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
13579 + || strcmp (buf, "1234567.000000 33") != 0)
13581 + if (sprintf (buf, "%F", 1.0 / 0.0) < 0
13582 + || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
13584 + /* This catches a Cygwin 2007 bug. */
13585 + if (sprintf (buf, "%.F", 1234.0) < 0
13586 + || strcmp (buf, "1234") != 0)
13589 +}], [gl_cv_func_printf_directive_f=yes], [gl_cv_func_printf_directive_f=no],
13592 + case "$host_os" in
13593 + # Guess yes on glibc systems.
13594 + *-gnu*) gl_cv_func_printf_directive_f="guessing yes";;
13595 + # Guess yes on FreeBSD >= 6.
13596 + freebsd[1-5]*) gl_cv_func_printf_directive_f="guessing no";;
13597 + freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
13598 + # Guess yes on MacOS X >= 10.3.
13599 + darwin[1-6].*) gl_cv_func_printf_directive_f="guessing no";;
13600 + darwin*) gl_cv_func_printf_directive_f="guessing yes";;
13601 + # Guess yes on Solaris >= 2.10.
13602 + solaris2.[0-9]*) gl_cv_func_printf_directive_f="guessing no";;
13603 + solaris*) gl_cv_func_printf_directive_f="guessing yes";;
13604 + # If we don't know, assume the worst.
13605 + *) gl_cv_func_printf_directive_f="guessing no";;
13607 +changequote([,])dnl
13612 +dnl Test whether the *printf family of functions supports the %n format
13613 +dnl directive. (ISO C99, POSIX:2001)
13614 +dnl Result is gl_cv_func_printf_directive_n.
13616 +AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
13618 + AC_REQUIRE([AC_PROG_CC])
13619 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13620 + AC_CACHE_CHECK([whether printf supports the 'n' directive],
13621 + [gl_cv_func_printf_directive_n],
13624 +#include <stdio.h>
13625 +#include <string.h>
13626 +static char fmtstring[10];
13627 +static char buf[100];
13631 + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
13632 + support %n in format strings in read-only memory but not in writable
13634 + strcpy (fmtstring, "%d %n");
13635 + if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
13636 + || strcmp (buf, "123 ") != 0
13640 +}], [gl_cv_func_printf_directive_n=yes], [gl_cv_func_printf_directive_n=no],
13643 + case "$host_os" in
13644 + *) gl_cv_func_printf_directive_n="guessing yes";;
13646 +changequote([,])dnl
13651 +dnl Test whether the *printf family of functions supports POSIX/XSI format
13652 +dnl strings with positions. (POSIX:2001)
13653 +dnl Result is gl_cv_func_printf_positions.
13655 +AC_DEFUN([gl_PRINTF_POSITIONS],
13657 + AC_REQUIRE([AC_PROG_CC])
13658 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13659 + AC_CACHE_CHECK([whether printf supports POSIX/XSI format strings with positions],
13660 + [gl_cv_func_printf_positions],
13663 +#include <stdio.h>
13664 +#include <string.h>
13665 +/* The string "%2$d %1$d", with dollar characters protected from the shell's
13666 + dollar expansion (possibly an autoconf bug). */
13667 +static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
13668 +static char buf[100];
13671 + sprintf (buf, format, 33, 55);
13672 + return (strcmp (buf, "55 33") != 0);
13673 +}], [gl_cv_func_printf_positions=yes], [gl_cv_func_printf_positions=no],
13676 + case "$host_os" in
13677 + netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
13678 + gl_cv_func_printf_positions="guessing no";;
13679 + beos*) gl_cv_func_printf_positions="guessing no";;
13680 + mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
13681 + *) gl_cv_func_printf_positions="guessing yes";;
13683 +changequote([,])dnl
13688 +dnl Test whether the *printf family of functions supports POSIX/XSI format
13689 +dnl strings with the ' flag for grouping of decimal digits. (POSIX:2001)
13690 +dnl Result is gl_cv_func_printf_flag_grouping.
13692 +AC_DEFUN([gl_PRINTF_FLAG_GROUPING],
13694 + AC_REQUIRE([AC_PROG_CC])
13695 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13696 + AC_CACHE_CHECK([whether printf supports the grouping flag],
13697 + [gl_cv_func_printf_flag_grouping],
13700 +#include <stdio.h>
13701 +#include <string.h>
13702 +static char buf[100];
13705 + if (sprintf (buf, "%'d %d", 1234567, 99) < 0
13706 + || buf[strlen (buf) - 1] != '9')
13709 +}], [gl_cv_func_printf_flag_grouping=yes], [gl_cv_func_printf_flag_grouping=no],
13712 + case "$host_os" in
13713 + cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
13714 + netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
13715 + mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
13716 + *) gl_cv_func_printf_flag_grouping="guessing yes";;
13718 +changequote([,])dnl
13723 +dnl Test whether the *printf family of functions supports the - flag correctly.
13724 +dnl (ISO C99.) See
13725 +dnl <http://lists.gnu.org/archive/html/bug-coreutils/2008-02/msg00035.html>
13726 +dnl Result is gl_cv_func_printf_flag_leftadjust.
13728 +AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
13730 + AC_REQUIRE([AC_PROG_CC])
13731 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13732 + AC_CACHE_CHECK([whether printf supports the left-adjust flag correctly],
13733 + [gl_cv_func_printf_flag_leftadjust],
13736 +#include <stdio.h>
13737 +#include <string.h>
13738 +static char buf[100];
13741 + /* Check that a '-' flag is not annihilated by a negative width. */
13742 + if (sprintf (buf, "a%-*sc", -3, "b") < 0
13743 + || strcmp (buf, "ab c") != 0)
13747 + [gl_cv_func_printf_flag_leftadjust=yes],
13748 + [gl_cv_func_printf_flag_leftadjust=no],
13751 + case "$host_os" in
13752 + # Guess yes on HP-UX 11.
13753 + hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
13754 + # Guess no on HP-UX 10 and older.
13755 + hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
13756 + # Guess yes otherwise.
13757 + *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
13759 +changequote([,])dnl
13764 +dnl Test whether the *printf family of functions supports padding of non-finite
13765 +dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
13766 +dnl <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html>
13767 +dnl Result is gl_cv_func_printf_flag_zero.
13769 +AC_DEFUN([gl_PRINTF_FLAG_ZERO],
13771 + AC_REQUIRE([AC_PROG_CC])
13772 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13773 + AC_CACHE_CHECK([whether printf supports the zero flag correctly],
13774 + [gl_cv_func_printf_flag_zero],
13777 +#include <stdio.h>
13778 +#include <string.h>
13779 +static char buf[100];
13782 + if (sprintf (buf, "%010f", 1.0 / 0.0, 33, 44, 55) < 0
13783 + || (strcmp (buf, " inf") != 0
13784 + && strcmp (buf, " infinity") != 0))
13787 +}], [gl_cv_func_printf_flag_zero=yes], [gl_cv_func_printf_flag_zero=no],
13790 + case "$host_os" in
13791 + # Guess yes on glibc systems.
13792 + *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
13793 + # Guess yes on BeOS.
13794 + beos*) gl_cv_func_printf_flag_zero="guessing yes";;
13795 + # If we don't know, assume the worst.
13796 + *) gl_cv_func_printf_flag_zero="guessing no";;
13798 +changequote([,])dnl
13803 +dnl Test whether the *printf family of functions supports large precisions.
13804 +dnl On mingw, precisions larger than 512 are treated like 512, in integer,
13805 +dnl floating-point or pointer output. On BeOS, precisions larger than 1044
13806 +dnl crash the program.
13807 +dnl Result is gl_cv_func_printf_precision.
13809 +AC_DEFUN([gl_PRINTF_PRECISION],
13811 + AC_REQUIRE([AC_PROG_CC])
13812 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13813 + AC_CACHE_CHECK([whether printf supports large precisions],
13814 + [gl_cv_func_printf_precision],
13817 +#include <stdio.h>
13818 +#include <string.h>
13819 +static char buf[5000];
13823 + /* On BeOS, this would crash and show a dialog box. Avoid the crash. */
13826 + if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
13829 +}], [gl_cv_func_printf_precision=yes], [gl_cv_func_printf_precision=no],
13832 + case "$host_os" in
13833 + # Guess no only on native Win32 and BeOS systems.
13834 + mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
13835 + beos*) gl_cv_func_printf_precision="guessing no" ;;
13836 + *) gl_cv_func_printf_precision="guessing yes" ;;
13838 +changequote([,])dnl
13843 +dnl Test whether the *printf family of functions recovers gracefully in case
13844 +dnl of an out-of-memory condition, or whether it crashes the entire program.
13845 +dnl Result is gl_cv_func_printf_enomem.
13847 +AC_DEFUN([gl_PRINTF_ENOMEM],
13849 + AC_REQUIRE([AC_PROG_CC])
13850 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13851 + AC_CACHE_CHECK([whether printf survives out-of-memory conditions],
13852 + [gl_cv_func_printf_enomem],
13854 + if test "$cross_compiling" = no; then
13855 + AC_LANG_CONFTEST([AC_LANG_SOURCE([
13858 +#include <stdio.h>
13859 +#include <sys/types.h>
13860 +#include <sys/time.h>
13861 +#include <sys/resource.h>
13862 +#include <errno.h>
13865 + struct rlimit limit;
13868 + /* Some printf implementations allocate temporary space with malloc. */
13869 + /* On BSD systems, malloc() is limited by RLIMIT_DATA. */
13870 +#ifdef RLIMIT_DATA
13871 + if (getrlimit (RLIMIT_DATA, &limit) < 0)
13873 + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
13874 + limit.rlim_max = 5000000;
13875 + limit.rlim_cur = limit.rlim_max;
13876 + if (setrlimit (RLIMIT_DATA, &limit) < 0)
13879 + /* On Linux systems, malloc() is limited by RLIMIT_AS. */
13881 + if (getrlimit (RLIMIT_AS, &limit) < 0)
13883 + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
13884 + limit.rlim_max = 5000000;
13885 + limit.rlim_cur = limit.rlim_max;
13886 + if (setrlimit (RLIMIT_AS, &limit) < 0)
13889 + /* Some printf implementations allocate temporary space on the stack. */
13890 +#ifdef RLIMIT_STACK
13891 + if (getrlimit (RLIMIT_STACK, &limit) < 0)
13893 + if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
13894 + limit.rlim_max = 5000000;
13895 + limit.rlim_cur = limit.rlim_max;
13896 + if (setrlimit (RLIMIT_STACK, &limit) < 0)
13899 + ret = printf ("%.5000000f", 1.0);
13900 + return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
13902 +changequote([,])dnl
13904 + if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
13907 + if test $result != 0 && test $result != 77; then result=1; fi
13909 + ) >/dev/null 2>/dev/null
13911 + 0) gl_cv_func_printf_enomem="yes" ;;
13912 + 77) gl_cv_func_printf_enomem="guessing no" ;;
13913 + *) gl_cv_func_printf_enomem="no" ;;
13916 + gl_cv_func_printf_enomem="guessing no"
13921 + case "$host_os" in
13922 + # Guess yes on glibc systems.
13923 + *-gnu*) gl_cv_func_printf_enomem="guessing yes";;
13924 + # Guess yes on Solaris.
13925 + solaris*) gl_cv_func_printf_enomem="guessing yes";;
13926 + # Guess yes on AIX.
13927 + aix*) gl_cv_func_printf_enomem="guessing yes";;
13928 + # Guess yes on HP-UX/hppa.
13929 + hpux*) case "$host_cpu" in
13930 + hppa*) gl_cv_func_printf_enomem="guessing yes";;
13931 + *) gl_cv_func_printf_enomem="guessing no";;
13934 + # Guess yes on IRIX.
13935 + irix*) gl_cv_func_printf_enomem="guessing yes";;
13936 + # Guess yes on OSF/1.
13937 + osf*) gl_cv_func_printf_enomem="guessing yes";;
13938 + # Guess yes on BeOS.
13939 + beos*) gl_cv_func_printf_enomem="guessing yes";;
13940 + # If we don't know, assume the worst.
13941 + *) gl_cv_func_printf_enomem="guessing no";;
13943 +changequote([,])dnl
13948 +dnl Test whether the snprintf function exists. (ISO C99, POSIX:2001)
13949 +dnl Result is ac_cv_func_snprintf.
13951 +AC_DEFUN([gl_SNPRINTF_PRESENCE],
13953 + AC_CHECK_FUNCS_ONCE([snprintf])
13956 +dnl Test whether the string produced by the snprintf function is always NUL
13957 +dnl terminated. (ISO C99, POSIX:2001)
13958 +dnl Result is gl_cv_func_snprintf_truncation_c99.
13960 +AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
13962 + AC_REQUIRE([AC_PROG_CC])
13963 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13964 + AC_CACHE_CHECK([whether snprintf truncates the result as in C99],
13965 + [gl_cv_func_snprintf_truncation_c99],
13968 +#include <stdio.h>
13969 +#include <string.h>
13970 +static char buf[100];
13973 + strcpy (buf, "ABCDEF");
13974 + snprintf (buf, 3, "%d %d", 4567, 89);
13975 + if (memcmp (buf, "45\0DEF", 6) != 0)
13978 +}], [gl_cv_func_snprintf_truncation_c99=yes], [gl_cv_func_snprintf_truncation_c99=no],
13981 + case "$host_os" in
13982 + # Guess yes on glibc systems.
13983 + *-gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
13984 + # Guess yes on FreeBSD >= 5.
13985 + freebsd[1-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
13986 + freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
13987 + # Guess yes on MacOS X >= 10.3.
13988 + darwin[1-6].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
13989 + darwin*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
13990 + # Guess yes on OpenBSD >= 3.9.
13991 + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
13992 + gl_cv_func_snprintf_truncation_c99="guessing no";;
13993 + openbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
13994 + # Guess yes on Solaris >= 2.6.
13995 + solaris2.[0-5]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
13996 + solaris*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
13997 + # Guess yes on AIX >= 4.
13998 + aix[1-3]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
13999 + aix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14000 + # Guess yes on HP-UX >= 11.
14001 + hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
14002 + hpux*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14003 + # Guess yes on IRIX >= 6.5.
14004 + irix6.5) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14005 + # Guess yes on OSF/1 >= 5.
14006 + osf[3-4]*) gl_cv_func_snprintf_truncation_c99="guessing no";;
14007 + osf*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14008 + # Guess yes on NetBSD >= 3.
14009 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
14010 + gl_cv_func_snprintf_truncation_c99="guessing no";;
14011 + netbsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14012 + # Guess yes on BeOS.
14013 + beos*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
14014 + # If we don't know, assume the worst.
14015 + *) gl_cv_func_snprintf_truncation_c99="guessing no";;
14017 +changequote([,])dnl
14022 +dnl Test whether the return value of the snprintf function is the number
14023 +dnl of bytes (excluding the terminating NUL) that would have been produced
14024 +dnl if the buffer had been large enough. (ISO C99, POSIX:2001)
14025 +dnl For example, this test program fails on IRIX 6.5:
14026 +dnl ---------------------------------------------------------------------
14027 +dnl #include <stdio.h>
14030 +dnl static char buf[8];
14031 +dnl int retval = snprintf (buf, 3, "%d", 12345);
14032 +dnl return retval >= 0 && retval < 3;
14034 +dnl ---------------------------------------------------------------------
14035 +dnl Result is gl_cv_func_snprintf_retval_c99.
14037 +AC_DEFUN([gl_SNPRINTF_RETVAL_C99],
14039 + AC_REQUIRE([AC_PROG_CC])
14040 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
14041 + AC_CACHE_CHECK([whether snprintf returns a byte count as in C99],
14042 + [gl_cv_func_snprintf_retval_c99],
14045 +#include <stdio.h>
14046 +#include <string.h>
14047 +static char buf[100];
14050 + strcpy (buf, "ABCDEF");
14051 + if (snprintf (buf, 3, "%d %d", 4567, 89) != 7)
14054 +}], [gl_cv_func_snprintf_retval_c99=yes], [gl_cv_func_snprintf_retval_c99=no],
14057 + case "$host_os" in
14058 + # Guess yes on glibc systems.
14059 + *-gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14060 + # Guess yes on FreeBSD >= 5.
14061 + freebsd[1-4]*) gl_cv_func_snprintf_retval_c99="guessing no";;
14062 + freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14063 + # Guess yes on MacOS X >= 10.3.
14064 + darwin[1-6].*) gl_cv_func_snprintf_retval_c99="guessing no";;
14065 + darwin*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14066 + # Guess yes on OpenBSD >= 3.9.
14067 + openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
14068 + gl_cv_func_snprintf_retval_c99="guessing no";;
14069 + openbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14070 + # Guess yes on Solaris >= 2.6.
14071 + solaris2.[0-5]*) gl_cv_func_snprintf_retval_c99="guessing no";;
14072 + solaris*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14073 + # Guess yes on AIX >= 4.
14074 + aix[1-3]*) gl_cv_func_snprintf_retval_c99="guessing no";;
14075 + aix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14076 + # Guess yes on NetBSD >= 3.
14077 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
14078 + gl_cv_func_snprintf_retval_c99="guessing no";;
14079 + netbsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14080 + # Guess yes on BeOS.
14081 + beos*) gl_cv_func_snprintf_retval_c99="guessing yes";;
14082 + # If we don't know, assume the worst.
14083 + *) gl_cv_func_snprintf_retval_c99="guessing no";;
14085 +changequote([,])dnl
14090 +dnl Test whether the snprintf function supports the %n format directive
14091 +dnl also in truncated portions of the format string. (ISO C99, POSIX:2001)
14092 +dnl Result is gl_cv_func_snprintf_directive_n.
14094 +AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
14096 + AC_REQUIRE([AC_PROG_CC])
14097 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
14098 + AC_CACHE_CHECK([whether snprintf fully supports the 'n' directive],
14099 + [gl_cv_func_snprintf_directive_n],
14102 +#include <stdio.h>
14103 +#include <string.h>
14104 +static char fmtstring[10];
14105 +static char buf[100];
14109 + /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
14110 + support %n in format strings in read-only memory but not in writable
14112 + strcpy (fmtstring, "%d %n");
14113 + snprintf (buf, 4, fmtstring, 12345, &count, 33, 44, 55);
14117 +}], [gl_cv_func_snprintf_directive_n=yes], [gl_cv_func_snprintf_directive_n=no],
14120 + case "$host_os" in
14121 + # Guess yes on glibc systems.
14122 + *-gnu*) gl_cv_func_snprintf_directive_n="guessing yes";;
14123 + # Guess yes on FreeBSD >= 5.
14124 + freebsd[1-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
14125 + freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
14126 + # Guess yes on MacOS X >= 10.3.
14127 + darwin[1-6].*) gl_cv_func_snprintf_directive_n="guessing no";;
14128 + darwin*) gl_cv_func_snprintf_directive_n="guessing yes";;
14129 + # Guess yes on Solaris >= 2.6.
14130 + solaris2.[0-5]*) gl_cv_func_snprintf_directive_n="guessing no";;
14131 + solaris*) gl_cv_func_snprintf_directive_n="guessing yes";;
14132 + # Guess yes on AIX >= 4.
14133 + aix[1-3]*) gl_cv_func_snprintf_directive_n="guessing no";;
14134 + aix*) gl_cv_func_snprintf_directive_n="guessing yes";;
14135 + # Guess yes on IRIX >= 6.5.
14136 + irix6.5) gl_cv_func_snprintf_directive_n="guessing yes";;
14137 + # Guess yes on OSF/1 >= 5.
14138 + osf[3-4]*) gl_cv_func_snprintf_directive_n="guessing no";;
14139 + osf*) gl_cv_func_snprintf_directive_n="guessing yes";;
14140 + # Guess yes on NetBSD >= 3.
14141 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
14142 + gl_cv_func_snprintf_directive_n="guessing no";;
14143 + netbsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
14144 + # Guess yes on BeOS.
14145 + beos*) gl_cv_func_snprintf_directive_n="guessing yes";;
14146 + # If we don't know, assume the worst.
14147 + *) gl_cv_func_snprintf_directive_n="guessing no";;
14149 +changequote([,])dnl
14154 +dnl Test whether the snprintf function, when passed a size = 1, writes any
14155 +dnl output without bounds in this case, behaving like sprintf. This is the
14156 +dnl case on Linux libc5.
14157 +dnl Result is gl_cv_func_snprintf_size1.
14159 +AC_DEFUN([gl_SNPRINTF_SIZE1],
14161 + AC_REQUIRE([AC_PROG_CC])
14162 + AC_CACHE_CHECK([whether snprintf respects a size of 1],
14163 + [gl_cv_func_snprintf_size1],
14166 +#include <stdio.h>
14169 + static char buf[8] = "DEADBEEF";
14170 + snprintf (buf, 1, "%d", 12345);
14171 + return buf[1] != 'E';
14173 + [gl_cv_func_snprintf_size1=yes],
14174 + [gl_cv_func_snprintf_size1=no],
14175 + [gl_cv_func_snprintf_size1="guessing yes"])
14179 +dnl Test whether the vsnprintf function, when passed a zero size, produces no
14180 +dnl output. (ISO C99, POSIX:2001)
14181 +dnl For example, snprintf nevertheless writes a NUL byte in this case
14183 +dnl ---------------------------------------------------------------------
14184 +dnl #include <stdio.h>
14187 +dnl static char buf[8] = "DEADBEEF";
14188 +dnl snprintf (buf, 0, "%d", 12345);
14189 +dnl return buf[0] != 'D';
14191 +dnl ---------------------------------------------------------------------
14192 +dnl And vsnprintf writes any output without bounds in this case, behaving like
14193 +dnl vsprintf, on HP-UX 11 and OSF/1 5.1:
14194 +dnl ---------------------------------------------------------------------
14195 +dnl #include <stdarg.h>
14196 +dnl #include <stdio.h>
14197 +dnl static int my_snprintf (char *buf, int size, const char *format, ...)
14201 +dnl va_start (args, format);
14202 +dnl ret = vsnprintf (buf, size, format, args);
14203 +dnl va_end (args);
14208 +dnl static char buf[8] = "DEADBEEF";
14209 +dnl my_snprintf (buf, 0, "%d", 12345);
14210 +dnl return buf[0] != 'D';
14212 +dnl ---------------------------------------------------------------------
14213 +dnl Result is gl_cv_func_vsnprintf_zerosize_c99.
14215 +AC_DEFUN([gl_VSNPRINTF_ZEROSIZE_C99],
14217 + AC_REQUIRE([AC_PROG_CC])
14218 + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
14219 + AC_CACHE_CHECK([whether vsnprintf respects a zero size as in C99],
14220 + [gl_cv_func_vsnprintf_zerosize_c99],
14223 +#include <stdarg.h>
14224 +#include <stdio.h>
14225 +static int my_snprintf (char *buf, int size, const char *format, ...)
14229 + va_start (args, format);
14230 + ret = vsnprintf (buf, size, format, args);
14236 + static char buf[8] = "DEADBEEF";
14237 + my_snprintf (buf, 0, "%d", 12345);
14238 + return buf[0] != 'D';
14240 + [gl_cv_func_vsnprintf_zerosize_c99=yes],
14241 + [gl_cv_func_vsnprintf_zerosize_c99=no],
14244 + case "$host_os" in
14245 + # Guess yes on glibc systems.
14246 + *-gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14247 + # Guess yes on FreeBSD >= 5.
14248 + freebsd[1-4]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14249 + freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14250 + # Guess yes on MacOS X >= 10.3.
14251 + darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14252 + darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14253 + # Guess yes on Cygwin.
14254 + cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14255 + # Guess yes on Solaris >= 2.6.
14256 + solaris2.[0-5]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14257 + solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14258 + # Guess yes on AIX >= 4.
14259 + aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14260 + aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14261 + # Guess yes on IRIX >= 6.5.
14262 + irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14263 + # Guess yes on NetBSD >= 3.
14264 + netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
14265 + gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14266 + netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14267 + # Guess yes on BeOS.
14268 + beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14269 + # Guess yes on mingw.
14270 + mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
14271 + # If we don't know, assume the worst.
14272 + *) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
14274 +changequote([,])dnl
14279 +dnl The results of these tests on various platforms are:
14281 +dnl 1 = gl_PRINTF_SIZES_C99
14282 +dnl 2 = gl_PRINTF_LONG_DOUBLE
14283 +dnl 3 = gl_PRINTF_INFINITE
14284 +dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE
14285 +dnl 5 = gl_PRINTF_DIRECTIVE_A
14286 +dnl 6 = gl_PRINTF_DIRECTIVE_F
14287 +dnl 7 = gl_PRINTF_DIRECTIVE_N
14288 +dnl 8 = gl_PRINTF_POSITIONS
14289 +dnl 9 = gl_PRINTF_FLAG_GROUPING
14290 +dnl 10 = gl_PRINTF_FLAG_LEFTADJUST
14291 +dnl 11 = gl_PRINTF_FLAG_ZERO
14292 +dnl 12 = gl_PRINTF_PRECISION
14293 +dnl 13 = gl_PRINTF_ENOMEM
14294 +dnl 14 = gl_SNPRINTF_PRESENCE
14295 +dnl 15 = gl_SNPRINTF_TRUNCATION_C99
14296 +dnl 16 = gl_SNPRINTF_RETVAL_C99
14297 +dnl 17 = gl_SNPRINTF_DIRECTIVE_N
14298 +dnl 18 = gl_SNPRINTF_SIZE1
14299 +dnl 19 = gl_VSNPRINTF_ZEROSIZE_C99
14301 +dnl 1 = checking whether printf supports size specifiers as in C99...
14302 +dnl 2 = checking whether printf supports 'long double' arguments...
14303 +dnl 3 = checking whether printf supports infinite 'double' arguments...
14304 +dnl 4 = checking whether printf supports infinite 'long double' arguments...
14305 +dnl 5 = checking whether printf supports the 'a' and 'A' directives...
14306 +dnl 6 = checking whether printf supports the 'F' directive...
14307 +dnl 7 = checking whether printf supports the 'n' directive...
14308 +dnl 8 = checking whether printf supports POSIX/XSI format strings with positions...
14309 +dnl 9 = checking whether printf supports the grouping flag...
14310 +dnl 10 = checking whether printf supports the left-adjust flag correctly...
14311 +dnl 11 = checking whether printf supports the zero flag correctly...
14312 +dnl 12 = checking whether printf supports large precisions...
14313 +dnl 13 = checking whether printf survives out-of-memory conditions...
14314 +dnl 14 = checking for snprintf...
14315 +dnl 15 = checking whether snprintf truncates the result as in C99...
14316 +dnl 16 = checking whether snprintf returns a byte count as in C99...
14317 +dnl 17 = checking whether snprintf fully supports the 'n' directive...
14318 +dnl 18 = checking whether snprintf respects a size of 1...
14319 +dnl 19 = checking whether vsnprintf respects a zero size as in C99...
14321 +dnl . = yes, # = no.
14323 +dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
14324 +dnl glibc 2.5 . . . . . . . . . . . . . . . . . . .
14325 +dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . .
14326 +dnl FreeBSD 5.4, 6.1 . . . . # . . . . . # . # . . . . . .
14327 +dnl MacOS X 10.3.9 . . . . # . . . . . # . # . . . . . .
14328 +dnl OpenBSD 3.9, 4.0 . . # # # # . . # . # . # . . . . . .
14329 +dnl Cygwin 2007 (= Cygwin 1.5.24) . . . . # # . . . ? # ? ? . . . . . .
14330 +dnl Cygwin 2006 (= Cygwin 1.5.19) # . . . # # . . # ? # ? ? . . . . . .
14331 +dnl Solaris 10 . . # # # . . . . . # . . . . . . . .
14332 +dnl Solaris 2.6 ... 9 # . # # # # . . . . # . . . . . . . .
14333 +dnl Solaris 2.5.1 # . # # # # . . . . # . . # # # # # #
14334 +dnl AIX 5.2 . . # # # . . . . . # . . . . . . . .
14335 +dnl AIX 4.3.2, 5.1 # . # # # # . . . . # . . . . . . . .
14336 +dnl HP-UX 11.31 . . . . # . . . . . # . . . . # # . .
14337 +dnl HP-UX 11.{00,11,23} # . . . # # . . . . # . . . . # # . #
14338 +dnl HP-UX 10.20 # . . . # # . . . # # . . . . # # ? #
14339 +dnl IRIX 6.5 # . # # # # . . . . # . . . . # . . .
14340 +dnl OSF/1 5.1 # . # # # # . . . . # . . . . # . . #
14341 +dnl OSF/1 4.0d # . # # # # . . . . # . . # # # # # #
14342 +dnl NetBSD 4.0 . ? ? ? ? ? . . ? ? ? ? ? . . . ? ? ?
14343 +dnl NetBSD 3.0 . . . . # # . # # ? # . # . . . . . .
14344 +dnl BeOS # # . # # # . # . ? . # ? . . . . . .
14345 +dnl mingw # # # # # # . # # . # # ? . # # # . .
14346 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/size_max.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/size_max.m4
14347 --- gtk-vnc-0.3.7.mingw/gnulib/m4/size_max.m4 1970-01-01 01:00:00.000000000 +0100
14348 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/size_max.m4 2008-10-09 12:24:39.000000000 +0100
14350 +# size_max.m4 serial 6
14351 +dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
14352 +dnl This file is free software; the Free Software Foundation
14353 +dnl gives unlimited permission to copy and/or distribute it,
14354 +dnl with or without modifications, as long as this notice is preserved.
14356 +dnl From Bruno Haible.
14358 +AC_DEFUN([gl_SIZE_MAX],
14360 + AC_CHECK_HEADERS(stdint.h)
14361 + dnl First test whether the system already has SIZE_MAX.
14362 + AC_MSG_CHECKING([for SIZE_MAX])
14363 + AC_CACHE_VAL([gl_cv_size_max], [
14365 + AC_EGREP_CPP([Found it], [
14366 +#include <limits.h>
14368 +#include <stdint.h>
14373 +], gl_cv_size_max=yes)
14374 + if test -z "$gl_cv_size_max"; then
14375 + dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
14376 + dnl than the type 'unsigned long'. Try hard to find a definition that can
14377 + dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
14378 + AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
14379 + [#include <stddef.h>
14380 +#include <limits.h>], size_t_bits_minus_1=)
14381 + AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
14382 + [#include <stddef.h>], fits_in_uint=)
14383 + if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
14384 + if test $fits_in_uint = 1; then
14385 + dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
14386 + dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
14387 + AC_TRY_COMPILE([#include <stddef.h>
14388 + extern size_t foo;
14389 + extern unsigned long foo;
14390 + ], [], fits_in_uint=0)
14392 + dnl We cannot use 'expr' to simplify this expression, because 'expr'
14393 + dnl works only with 'long' integers in the host environment, while we
14394 + dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
14395 + if test $fits_in_uint = 1; then
14396 + gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
14398 + gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
14401 + dnl Shouldn't happen, but who knows...
14402 + gl_cv_size_max='((size_t)~(size_t)0)'
14406 + AC_MSG_RESULT([$gl_cv_size_max])
14407 + if test "$gl_cv_size_max" != yes; then
14408 + AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
14409 + [Define as the maximum value of type 'size_t', if the system doesn't define it.])
14413 +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
14414 +dnl Remove this when we can assume autoconf >= 2.61.
14415 +m4_ifdef([AC_COMPUTE_INT], [], [
14416 + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
14418 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/snprintf.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/snprintf.m4
14419 --- gtk-vnc-0.3.7.mingw/gnulib/m4/snprintf.m4 1970-01-01 01:00:00.000000000 +0100
14420 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/snprintf.m4 2008-10-09 12:24:39.000000000 +0100
14422 +# snprintf.m4 serial 5
14423 +dnl Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc.
14424 +dnl This file is free software; the Free Software Foundation
14425 +dnl gives unlimited permission to copy and/or distribute it,
14426 +dnl with or without modifications, as long as this notice is preserved.
14428 +AC_DEFUN([gl_FUNC_SNPRINTF],
14430 + AC_REQUIRE([gl_STDIO_H_DEFAULTS])
14431 + gl_cv_func_snprintf_usable=no
14432 + AC_CHECK_FUNCS([snprintf])
14433 + if test $ac_cv_func_snprintf = yes; then
14434 + gl_SNPRINTF_SIZE1
14435 + case "$gl_cv_func_snprintf_size1" in
14437 + gl_cv_func_snprintf_usable=yes
14441 + if test $gl_cv_func_snprintf_usable = no; then
14442 + gl_REPLACE_SNPRINTF
14444 + AC_CHECK_DECLS_ONCE([snprintf])
14445 + if test $ac_cv_have_decl_snprintf = no; then
14446 + HAVE_DECL_SNPRINTF=0
14450 +AC_DEFUN([gl_REPLACE_SNPRINTF],
14452 + AC_REQUIRE([gl_STDIO_H_DEFAULTS])
14453 + AC_LIBOBJ([snprintf])
14454 + if test $ac_cv_func_snprintf = yes; then
14455 + REPLACE_SNPRINTF=1
14457 + gl_PREREQ_SNPRINTF
14460 +# Prerequisites of lib/snprintf.c.
14461 +AC_DEFUN([gl_PREREQ_SNPRINTF], [:])
14462 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/socklen.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/socklen.m4
14463 --- gtk-vnc-0.3.7.mingw/gnulib/m4/socklen.m4 1970-01-01 01:00:00.000000000 +0100
14464 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/socklen.m4 2008-10-09 12:24:39.000000000 +0100
14466 +# socklen.m4 serial 6
14467 +dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
14468 +dnl This file is free software; the Free Software Foundation
14469 +dnl gives unlimited permission to copy and/or distribute it,
14470 +dnl with or without modifications, as long as this notice is preserved.
14472 +dnl From Albert Chin, Windows fixes from Simon Josefsson.
14474 +dnl Check for socklen_t: historically on BSD it is an int, and in
14475 +dnl POSIX 1g it is a type of its own, but some platforms use different
14476 +dnl types for the argument to getsockopt, getpeername, etc. So we
14477 +dnl have to test to find something that will work.
14479 +dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
14480 +dnl it there first. That file is included by gnulib's sys_socket.in.h, which
14481 +dnl all users of this module should include. Cygwin must not include
14483 +AC_DEFUN([gl_TYPE_SOCKLEN_T],
14484 + [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl
14485 + AC_CHECK_TYPE([socklen_t], ,
14486 + [AC_MSG_CHECKING([for socklen_t equivalent])
14487 + AC_CACHE_VAL([gl_cv_socklen_t_equiv],
14488 + [# Systems have either "struct sockaddr *" or
14489 + # "void *" as the second argument to getpeername
14490 + gl_cv_socklen_t_equiv=
14491 + for arg2 in "struct sockaddr" void; do
14492 + for t in int size_t "unsigned int" "long int" "unsigned long int"; do
14494 + [#include <sys/types.h>
14495 + #include <sys/socket.h>
14497 + int getpeername (int, $arg2 *, $t *);],
14499 + getpeername (0, 0, &len);],
14500 + [gl_cv_socklen_t_equiv="$t"])
14501 + test "$gl_cv_socklen_t_equiv" != "" && break
14503 + test "$gl_cv_socklen_t_equiv" != "" && break
14506 + if test "$gl_cv_socklen_t_equiv" = ""; then
14507 + AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
14509 + AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
14510 + AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
14511 + [type to use in place of socklen_t if not defined])],
14512 + [#include <sys/types.h>
14513 + #if HAVE_SYS_SOCKET_H
14514 + # include <sys/socket.h>
14515 + #elif HAVE_WS2TCPIP_H
14516 + # include <ws2tcpip.h>
14518 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/sockpfaf.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/sockpfaf.m4
14519 --- gtk-vnc-0.3.7.mingw/gnulib/m4/sockpfaf.m4 1970-01-01 01:00:00.000000000 +0100
14520 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/sockpfaf.m4 2008-10-09 12:24:39.000000000 +0100
14522 +# sockpfaf.m4 serial 5
14523 +dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
14524 +dnl This file is free software; the Free Software Foundation
14525 +dnl gives unlimited permission to copy and/or distribute it,
14526 +dnl with or without modifications, as long as this notice is preserved.
14528 +dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...)
14529 +dnl and some common address families (AF_INET, AF_INET6, ...).
14530 +dnl This test assumes that a system supports an address family if and only if
14531 +dnl it supports the corresponding protocol family.
14533 +dnl From Bruno Haible.
14535 +AC_DEFUN([gl_SOCKET_FAMILIES],
14537 + AC_REQUIRE([gl_HEADER_SYS_SOCKET])
14538 + AC_CHECK_HEADERS_ONCE([netinet/in.h])
14540 + AC_MSG_CHECKING(for IPv4 sockets)
14541 + AC_CACHE_VAL(gl_cv_socket_ipv4,
14542 + [AC_TRY_COMPILE([#include <sys/types.h>
14543 +#ifdef HAVE_SYS_SOCKET_H
14544 +#include <sys/socket.h>
14546 +#ifdef HAVE_NETINET_IN_H
14547 +#include <netinet/in.h>
14549 +#ifdef HAVE_WINSOCK2_H
14550 +#include <winsock2.h>
14552 +[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
14553 + if (&x && &y && &z) return 0;],
14554 + gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
14555 + AC_MSG_RESULT($gl_cv_socket_ipv4)
14556 + if test $gl_cv_socket_ipv4 = yes; then
14557 + AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if <sys/socket.h> defines AF_INET.])
14560 + AC_MSG_CHECKING(for IPv6 sockets)
14561 + AC_CACHE_VAL(gl_cv_socket_ipv6,
14562 + [AC_TRY_COMPILE([#include <sys/types.h>
14563 +#ifdef HAVE_SYS_SOCKET_H
14564 +#include <sys/socket.h>
14566 +#ifdef HAVE_NETINET_IN_H
14567 +#include <netinet/in.h>
14569 +#ifdef HAVE_WINSOCK2_H
14570 +#include <winsock2.h>
14572 +[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
14573 + if (&x && &y && &z) return 0;],
14574 + gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
14575 + AC_MSG_RESULT($gl_cv_socket_ipv6)
14576 + if test $gl_cv_socket_ipv6 = yes; then
14577 + AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if <sys/socket.h> defines AF_INET6.])
14580 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/stdbool.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdbool.m4
14581 --- gtk-vnc-0.3.7.mingw/gnulib/m4/stdbool.m4 1970-01-01 01:00:00.000000000 +0100
14582 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdbool.m4 2008-10-09 12:24:39.000000000 +0100
14584 +# Check for stdbool.h that conforms to C99.
14586 +dnl Copyright (C) 2002-2006 Free Software Foundation, Inc.
14587 +dnl This file is free software; the Free Software Foundation
14588 +dnl gives unlimited permission to copy and/or distribute it,
14589 +dnl with or without modifications, as long as this notice is preserved.
14591 +# Prepare for substituting <stdbool.h> if it is not supported.
14593 +AC_DEFUN([AM_STDBOOL_H],
14595 + AC_REQUIRE([AC_HEADER_STDBOOL])
14597 + # Define two additional variables used in the Makefile substitution.
14599 + if test "$ac_cv_header_stdbool_h" = yes; then
14602 + STDBOOL_H='stdbool.h'
14604 + AC_SUBST([STDBOOL_H])
14606 + if test "$ac_cv_type__Bool" = yes; then
14611 + AC_SUBST([HAVE__BOOL])
14614 +# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
14615 +AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
14617 +# This macro is only needed in autoconf <= 2.59. Newer versions of autoconf
14618 +# have this macro built-in.
14620 +AC_DEFUN([AC_HEADER_STDBOOL],
14621 + [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
14622 + [ac_cv_header_stdbool_h],
14625 + #include <stdbool.h>
14627 + "error: bool is not defined"
14630 + "error: false is not defined"
14633 + "error: false is not 0"
14636 + "error: true is not defined"
14639 + "error: true is not 1"
14641 + #ifndef __bool_true_false_are_defined
14642 + "error: __bool_true_false_are_defined is not defined"
14645 + struct s { _Bool s: 1; _Bool t; } s;
14647 + char a[true == 1 ? 1 : -1];
14648 + char b[false == 0 ? 1 : -1];
14649 + char c[__bool_true_false_are_defined == 1 ? 1 : -1];
14650 + char d[(bool) 0.5 == true ? 1 : -1];
14652 + char f[(_Bool) 0.0 == false ? 1 : -1];
14654 + char h[sizeof (_Bool)];
14655 + char i[sizeof s.t];
14656 + enum { j = false, k = true, l = false * true, m = true * 256 };
14658 + char o[sizeof n == m * sizeof n[0] ? 1 : -1];
14659 + char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
14660 + #if defined __xlc__ || defined __GNUC__
14661 + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
14662 + reported by James Lemley on 2005-10-05; see
14663 + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
14664 + This test is not quite right, since xlc is allowed to
14665 + reject this program, as the initializer for xlcbug is
14666 + not one of the forms that C requires support for.
14667 + However, doing the test right would require a run-time
14668 + test, and that would make cross-compilation harder.
14669 + Let us hope that IBM fixes the xlc bug, and also adds
14670 + support for this kind of constant expression. In the
14671 + meantime, this test will reject xlc, which is OK, since
14672 + our stdbool.h substitute should suffice. We also test
14673 + this with GCC, where it should work, to detect more
14674 + quickly whether someone messes up the test in the
14676 + char digs[] = "0123456789";
14677 + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
14679 + /* Catch a bug in an HP-UX C compiler. See
14680 + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
14681 + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
14689 + /* Refer to every declared value, to avoid compiler optimizations. */
14690 + return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
14691 + + !m + !n + !o + !p + !q + !pq);
14693 + [ac_cv_header_stdbool_h=yes],
14694 + [ac_cv_header_stdbool_h=no])])
14695 + AC_CHECK_TYPES([_Bool])
14696 + if test $ac_cv_header_stdbool_h = yes; then
14697 + AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
14699 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/stdint_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdint_h.m4
14700 --- gtk-vnc-0.3.7.mingw/gnulib/m4/stdint_h.m4 1970-01-01 01:00:00.000000000 +0100
14701 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdint_h.m4 2008-10-09 12:24:39.000000000 +0100
14703 +# stdint_h.m4 serial 6
14704 +dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
14705 +dnl This file is free software; the Free Software Foundation
14706 +dnl gives unlimited permission to copy and/or distribute it,
14707 +dnl with or without modifications, as long as this notice is preserved.
14709 +dnl From Paul Eggert.
14711 +# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
14712 +# doesn't clash with <sys/types.h>, and declares uintmax_t.
14714 +AC_DEFUN([gl_AC_HEADER_STDINT_H],
14716 + AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
14718 + [#include <sys/types.h>
14719 +#include <stdint.h>],
14720 + [uintmax_t i = (uintmax_t) -1; return !i;],
14721 + gl_cv_header_stdint_h=yes,
14722 + gl_cv_header_stdint_h=no)])
14723 + if test $gl_cv_header_stdint_h = yes; then
14724 + AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
14725 + [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
14726 + and declares uintmax_t. ])
14729 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/stdint.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdint.m4
14730 --- gtk-vnc-0.3.7.mingw/gnulib/m4/stdint.m4 1970-01-01 01:00:00.000000000 +0100
14731 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdint.m4 2008-10-09 12:24:39.000000000 +0100
14733 +# stdint.m4 serial 31
14734 +dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
14735 +dnl This file is free software; the Free Software Foundation
14736 +dnl gives unlimited permission to copy and/or distribute it,
14737 +dnl with or without modifications, as long as this notice is preserved.
14739 +dnl From Paul Eggert and Bruno Haible.
14740 +dnl Test whether <stdint.h> is supported or must be substituted.
14742 +AC_DEFUN([gl_STDINT_H],
14744 + AC_PREREQ(2.59)dnl
14746 + dnl Check for long long int and unsigned long long int.
14747 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
14748 + if test $ac_cv_type_long_long_int = yes; then
14749 + HAVE_LONG_LONG_INT=1
14751 + HAVE_LONG_LONG_INT=0
14753 + AC_SUBST([HAVE_LONG_LONG_INT])
14754 + AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
14755 + if test $ac_cv_type_unsigned_long_long_int = yes; then
14756 + HAVE_UNSIGNED_LONG_LONG_INT=1
14758 + HAVE_UNSIGNED_LONG_LONG_INT=0
14760 + AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
14762 + dnl Check for <inttypes.h>.
14763 + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
14764 + if test $ac_cv_header_inttypes_h = yes; then
14765 + HAVE_INTTYPES_H=1
14767 + HAVE_INTTYPES_H=0
14769 + AC_SUBST([HAVE_INTTYPES_H])
14771 + dnl Check for <sys/types.h>.
14772 + dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h.
14773 + if test $ac_cv_header_sys_types_h = yes; then
14774 + HAVE_SYS_TYPES_H=1
14776 + HAVE_SYS_TYPES_H=0
14778 + AC_SUBST([HAVE_SYS_TYPES_H])
14780 + gl_CHECK_NEXT_HEADERS([stdint.h])
14781 + if test $ac_cv_header_stdint_h = yes; then
14786 + AC_SUBST([HAVE_STDINT_H])
14788 + dnl Now see whether we need a substitute <stdint.h>.
14789 + if test $ac_cv_header_stdint_h = yes; then
14790 + AC_CACHE_CHECK([whether stdint.h conforms to C99],
14791 + [gl_cv_header_working_stdint_h],
14792 + [gl_cv_header_working_stdint_h=no
14793 + AC_COMPILE_IFELSE([
14794 + AC_LANG_PROGRAM([[
14795 +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
14796 +#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
14797 +#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
14798 +#include <stdint.h>
14799 +/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>. */
14800 +#if !(defined WCHAR_MIN && defined WCHAR_MAX)
14801 +#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
14804 +gl_STDINT_INCLUDES
14807 +int8_t a1 = INT8_MAX;
14808 +int8_t a1min = INT8_MIN;
14811 +int16_t a2 = INT16_MAX;
14812 +int16_t a2min = INT16_MIN;
14815 +int32_t a3 = INT32_MAX;
14816 +int32_t a3min = INT32_MIN;
14819 +int64_t a4 = INT64_MAX;
14820 +int64_t a4min = INT64_MIN;
14823 +uint8_t b1 = UINT8_MAX;
14825 +typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
14828 +uint16_t b2 = UINT16_MAX;
14831 +uint32_t b3 = UINT32_MAX;
14834 +uint64_t b4 = UINT64_MAX;
14836 +int_least8_t c1 = INT8_C (0x7f);
14837 +int_least8_t c1max = INT_LEAST8_MAX;
14838 +int_least8_t c1min = INT_LEAST8_MIN;
14839 +int_least16_t c2 = INT16_C (0x7fff);
14840 +int_least16_t c2max = INT_LEAST16_MAX;
14841 +int_least16_t c2min = INT_LEAST16_MIN;
14842 +int_least32_t c3 = INT32_C (0x7fffffff);
14843 +int_least32_t c3max = INT_LEAST32_MAX;
14844 +int_least32_t c3min = INT_LEAST32_MIN;
14845 +int_least64_t c4 = INT64_C (0x7fffffffffffffff);
14846 +int_least64_t c4max = INT_LEAST64_MAX;
14847 +int_least64_t c4min = INT_LEAST64_MIN;
14848 +uint_least8_t d1 = UINT8_C (0xff);
14849 +uint_least8_t d1max = UINT_LEAST8_MAX;
14850 +uint_least16_t d2 = UINT16_C (0xffff);
14851 +uint_least16_t d2max = UINT_LEAST16_MAX;
14852 +uint_least32_t d3 = UINT32_C (0xffffffff);
14853 +uint_least32_t d3max = UINT_LEAST32_MAX;
14854 +uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
14855 +uint_least64_t d4max = UINT_LEAST64_MAX;
14856 +int_fast8_t e1 = INT_FAST8_MAX;
14857 +int_fast8_t e1min = INT_FAST8_MIN;
14858 +int_fast16_t e2 = INT_FAST16_MAX;
14859 +int_fast16_t e2min = INT_FAST16_MIN;
14860 +int_fast32_t e3 = INT_FAST32_MAX;
14861 +int_fast32_t e3min = INT_FAST32_MIN;
14862 +int_fast64_t e4 = INT_FAST64_MAX;
14863 +int_fast64_t e4min = INT_FAST64_MIN;
14864 +uint_fast8_t f1 = UINT_FAST8_MAX;
14865 +uint_fast16_t f2 = UINT_FAST16_MAX;
14866 +uint_fast32_t f3 = UINT_FAST32_MAX;
14867 +uint_fast64_t f4 = UINT_FAST64_MAX;
14869 +intptr_t g = INTPTR_MAX;
14870 +intptr_t gmin = INTPTR_MIN;
14872 +#ifdef UINTPTR_MAX
14873 +uintptr_t h = UINTPTR_MAX;
14875 +intmax_t i = INTMAX_MAX;
14876 +uintmax_t j = UINTMAX_MAX;
14878 +#include <limits.h> /* for CHAR_BIT */
14879 +#define TYPE_MINIMUM(t) \
14880 + ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
14881 +#define TYPE_MAXIMUM(t) \
14882 + ((t) ((t) 0 < (t) -1 ? (t) -1 : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
14884 + int check_PTRDIFF:
14885 + PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
14886 + && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
14888 + /* Detect bug in FreeBSD 6.0 / ia64. */
14889 + int check_SIG_ATOMIC:
14890 + SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
14891 + && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
14893 + int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
14895 + WCHAR_MIN == TYPE_MINIMUM (wchar_t)
14896 + && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
14898 + /* Detect bug in mingw. */
14900 + WINT_MIN == TYPE_MINIMUM (wint_t)
14901 + && WINT_MAX == TYPE_MAXIMUM (wint_t)
14904 + /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others. */
14905 + int check_UINT8_C:
14906 + (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
14907 + int check_UINT16_C:
14908 + (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
14910 + /* Detect bugs in OpenBSD 3.9 stdint.h. */
14912 + int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
14915 + int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
14918 + int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
14921 + int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
14923 + int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
14924 + int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
14925 + int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
14926 + int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
14927 + int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
14928 + int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
14929 + int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
14930 + int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
14931 + int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
14932 + int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
14933 + int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
14936 + [gl_cv_header_working_stdint_h=yes])])
14938 + if test "$gl_cv_header_working_stdint_h" = yes; then
14941 + dnl Check for <sys/inttypes.h>, and for
14942 + dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
14943 + AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
14944 + if test $ac_cv_header_sys_inttypes_h = yes; then
14945 + HAVE_SYS_INTTYPES_H=1
14947 + HAVE_SYS_INTTYPES_H=0
14949 + AC_SUBST([HAVE_SYS_INTTYPES_H])
14950 + if test $ac_cv_header_sys_bitypes_h = yes; then
14951 + HAVE_SYS_BITYPES_H=1
14953 + HAVE_SYS_BITYPES_H=0
14955 + AC_SUBST([HAVE_SYS_BITYPES_H])
14957 + dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
14958 + dnl character support).
14959 + AC_CHECK_HEADERS_ONCE([wchar.h])
14961 + gl_STDINT_TYPE_PROPERTIES
14962 + STDINT_H=stdint.h
14964 + AC_SUBST(STDINT_H)
14967 +dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
14968 +dnl Determine the size of each of the given types in bits.
14969 +AC_DEFUN([gl_STDINT_BITSIZEOF],
14971 + dnl Use a shell loop, to avoid bloating configure, and
14972 + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
14974 + dnl - extra AC_SUBST calls, so that the right substitutions are made.
14975 + m4_foreach_w([gltype], [$1],
14976 + [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
14977 + [Define to the number of bits in type ']gltype['.])])
14978 + for gltype in $1 ; do
14979 + AC_CACHE_CHECK([for bit size of $gltype], [gl_cv_bitsizeof_${gltype}],
14980 + [AC_COMPUTE_INT([result], [sizeof ($gltype) * CHAR_BIT],
14982 +#include <limits.h>], [result=unknown])
14983 + eval gl_cv_bitsizeof_${gltype}=\$result
14985 + eval result=\$gl_cv_bitsizeof_${gltype}
14986 + if test $result = unknown; then
14987 + dnl Use a nonempty default, because some compilers, such as IRIX 5 cc,
14988 + dnl do a syntax check even on unused #if conditions and give an error
14989 + dnl on valid C code like this:
14996 + GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
14997 + AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
14998 + eval BITSIZEOF_${GLTYPE}=\$result
15000 + m4_foreach_w([gltype], [$1],
15001 + [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
15004 +dnl gl_CHECK_TYPES_SIGNED(TYPES, INCLUDES)
15005 +dnl Determine the signedness of each of the given types.
15006 +dnl Define HAVE_SIGNED_TYPE if type is signed.
15007 +AC_DEFUN([gl_CHECK_TYPES_SIGNED],
15009 + dnl Use a shell loop, to avoid bloating configure, and
15010 + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
15012 + dnl - extra AC_SUBST calls, so that the right substitutions are made.
15013 + m4_foreach_w([gltype], [$1],
15014 + [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
15015 + [Define to 1 if ']gltype[' is a signed integer type.])])
15016 + for gltype in $1 ; do
15017 + AC_CACHE_CHECK([whether $gltype is signed], [gl_cv_type_${gltype}_signed],
15018 + [AC_COMPILE_IFELSE(
15019 + [AC_LANG_PROGRAM([$2[
15020 + int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];]])],
15021 + result=yes, result=no)
15022 + eval gl_cv_type_${gltype}_signed=\$result
15024 + eval result=\$gl_cv_type_${gltype}_signed
15025 + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
15026 + if test "$result" = yes; then
15027 + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1)
15028 + eval HAVE_SIGNED_${GLTYPE}=1
15030 + eval HAVE_SIGNED_${GLTYPE}=0
15033 + m4_foreach_w([gltype], [$1],
15034 + [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
15037 +dnl gl_INTEGER_TYPE_SUFFIX(TYPES, INCLUDES)
15038 +dnl Determine the suffix to use for integer constants of the given types.
15039 +dnl Define t_SUFFIX for each such type.
15040 +AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
15042 + dnl Use a shell loop, to avoid bloating configure, and
15043 + dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
15045 + dnl - extra AC_SUBST calls, so that the right substitutions are made.
15046 + m4_foreach_w([gltype], [$1],
15047 + [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
15048 + [Define to l, ll, u, ul, ull, etc., as suitable for
15049 + constants of type ']gltype['.])])
15050 + for gltype in $1 ; do
15051 + AC_CACHE_CHECK([for $gltype integer literal suffix],
15052 + [gl_cv_type_${gltype}_suffix],
15053 + [eval gl_cv_type_${gltype}_suffix=no
15054 + eval result=\$gl_cv_type_${gltype}_signed
15055 + if test "$result" = yes; then
15060 + for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
15062 + '') gltype1='int';;
15063 + l) gltype1='long int';;
15064 + ll) gltype1='long long int';;
15065 + i64) gltype1='__int64';;
15066 + u) gltype1='unsigned int';;
15067 + ul) gltype1='unsigned long int';;
15068 + ull) gltype1='unsigned long long int';;
15069 + ui64)gltype1='unsigned __int64';;
15071 + AC_COMPILE_IFELSE(
15072 + [AC_LANG_PROGRAM([$2[
15073 + extern $gltype foo;
15074 + extern $gltype1 foo;]])],
15075 + [eval gl_cv_type_${gltype}_suffix=\$glsuf])
15076 + eval result=\$gl_cv_type_${gltype}_suffix
15077 + test "$result" != no && break
15079 + GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
15080 + eval result=\$gl_cv_type_${gltype}_suffix
15081 + test "$result" = no && result=
15082 + eval ${GLTYPE}_SUFFIX=\$result
15083 + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result)
15085 + m4_foreach_w([gltype], [$1],
15086 + [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
15089 +dnl gl_STDINT_INCLUDES
15090 +AC_DEFUN([gl_STDINT_INCLUDES],
15092 + /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
15093 + included before <wchar.h>. */
15094 + #include <stddef.h>
15095 + #include <signal.h>
15097 + # include <stdio.h>
15098 + # include <time.h>
15099 + # include <wchar.h>
15103 +dnl gl_STDINT_TYPE_PROPERTIES
15104 +dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
15105 +dnl of interest to stdint.in.h.
15106 +AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
15108 + gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
15109 + [gl_STDINT_INCLUDES])
15110 + gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
15111 + [gl_STDINT_INCLUDES])
15112 + gl_cv_type_ptrdiff_t_signed=yes
15113 + gl_cv_type_size_t_signed=no
15114 + gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
15115 + [gl_STDINT_INCLUDES])
15118 +dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
15119 +dnl Remove this when we can assume autoconf >= 2.61.
15120 +m4_ifdef([AC_COMPUTE_INT], [], [
15121 + AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
15125 +# Local Variables:
15126 +# indent-tabs-mode: nil
15128 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/stdio_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/stdio_h.m4
15129 --- gtk-vnc-0.3.7.mingw/gnulib/m4/stdio_h.m4 1970-01-01 01:00:00.000000000 +0100
15130 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/stdio_h.m4 2008-10-09 12:24:39.000000000 +0100
15132 +# stdio_h.m4 serial 13
15133 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
15134 +dnl This file is free software; the Free Software Foundation
15135 +dnl gives unlimited permission to copy and/or distribute it,
15136 +dnl with or without modifications, as long as this notice is preserved.
15138 +AC_DEFUN([gl_STDIO_H],
15140 + AC_REQUIRE([gl_STDIO_H_DEFAULTS])
15141 + gl_CHECK_NEXT_HEADERS([stdio.h])
15142 + dnl No need to create extra modules for these functions. Everyone who uses
15143 + dnl <stdio.h> likely needs them.
15146 + GNULIB_VFPRINTF=1
15154 + dnl This ifdef is just an optimization, to avoid performing a configure
15155 + dnl check whose result is not used. It does not make the test of
15156 + dnl GNULIB_STDIO_H_SIGPIPE or GNULIB_SIGPIPE redundant.
15157 + m4_ifdef([gl_SIGNAL_SIGPIPE], [
15158 + gl_SIGNAL_SIGPIPE
15159 + if test $gl_cv_header_signal_h_SIGPIPE != yes; then
15160 + REPLACE_STDIO_WRITE_FUNCS=1
15161 + AC_LIBOBJ([stdio-write])
15166 +AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
15168 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
15169 + AC_REQUIRE([gl_STDIO_H_DEFAULTS])
15170 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
15173 +AC_DEFUN([gl_STDIO_H_DEFAULTS],
15175 + GNULIB_FPRINTF=0; AC_SUBST([GNULIB_FPRINTF])
15176 + GNULIB_FPRINTF_POSIX=0; AC_SUBST([GNULIB_FPRINTF_POSIX])
15177 + GNULIB_PRINTF=0; AC_SUBST([GNULIB_PRINTF])
15178 + GNULIB_PRINTF_POSIX=0; AC_SUBST([GNULIB_PRINTF_POSIX])
15179 + GNULIB_SNPRINTF=0; AC_SUBST([GNULIB_SNPRINTF])
15180 + GNULIB_SPRINTF_POSIX=0; AC_SUBST([GNULIB_SPRINTF_POSIX])
15181 + GNULIB_VFPRINTF=0; AC_SUBST([GNULIB_VFPRINTF])
15182 + GNULIB_VFPRINTF_POSIX=0; AC_SUBST([GNULIB_VFPRINTF_POSIX])
15183 + GNULIB_VPRINTF=0; AC_SUBST([GNULIB_VPRINTF])
15184 + GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX])
15185 + GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF])
15186 + GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX])
15187 + GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF])
15188 + GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF])
15189 + GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
15190 + GNULIB_FOPEN=0; AC_SUBST([GNULIB_FOPEN])
15191 + GNULIB_FREOPEN=0; AC_SUBST([GNULIB_FREOPEN])
15192 + GNULIB_FSEEK=0; AC_SUBST([GNULIB_FSEEK])
15193 + GNULIB_FSEEKO=0; AC_SUBST([GNULIB_FSEEKO])
15194 + GNULIB_FTELL=0; AC_SUBST([GNULIB_FTELL])
15195 + GNULIB_FTELLO=0; AC_SUBST([GNULIB_FTELLO])
15196 + GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
15197 + GNULIB_FPUTC=0; AC_SUBST([GNULIB_FPUTC])
15198 + GNULIB_PUTC=0; AC_SUBST([GNULIB_PUTC])
15199 + GNULIB_PUTCHAR=0; AC_SUBST([GNULIB_PUTCHAR])
15200 + GNULIB_FPUTS=0; AC_SUBST([GNULIB_FPUTS])
15201 + GNULIB_PUTS=0; AC_SUBST([GNULIB_PUTS])
15202 + GNULIB_FWRITE=0; AC_SUBST([GNULIB_FWRITE])
15203 + GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
15204 + GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
15205 + GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
15206 + GNULIB_STDIO_H_SIGPIPE=0; AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
15207 + dnl Assume proper GNU behavior unless another module says otherwise.
15208 + REPLACE_STDIO_WRITE_FUNCS=0; AC_SUBST([REPLACE_STDIO_WRITE_FUNCS])
15209 + REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
15210 + REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
15211 + REPLACE_PRINTF=0; AC_SUBST([REPLACE_PRINTF])
15212 + REPLACE_VPRINTF=0; AC_SUBST([REPLACE_VPRINTF])
15213 + REPLACE_SNPRINTF=0; AC_SUBST([REPLACE_SNPRINTF])
15214 + HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
15215 + REPLACE_VSNPRINTF=0; AC_SUBST([REPLACE_VSNPRINTF])
15216 + HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
15217 + REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF])
15218 + REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF])
15219 + HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF])
15220 + REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF])
15221 + HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
15222 + REPLACE_OBSTACK_PRINTF=0; AC_SUBST([REPLACE_OBSTACK_PRINTF])
15223 + REPLACE_FOPEN=0; AC_SUBST([REPLACE_FOPEN])
15224 + REPLACE_FREOPEN=0; AC_SUBST([REPLACE_FREOPEN])
15225 + HAVE_FSEEKO=1; AC_SUBST([HAVE_FSEEKO])
15226 + REPLACE_FSEEKO=0; AC_SUBST([REPLACE_FSEEKO])
15227 + REPLACE_FSEEK=0; AC_SUBST([REPLACE_FSEEK])
15228 + HAVE_FTELLO=1; AC_SUBST([HAVE_FTELLO])
15229 + REPLACE_FTELLO=0; AC_SUBST([REPLACE_FTELLO])
15230 + REPLACE_FTELL=0; AC_SUBST([REPLACE_FTELL])
15231 + REPLACE_FFLUSH=0; AC_SUBST([REPLACE_FFLUSH])
15232 + HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
15233 + HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
15234 + REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
15235 + REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
15238 +dnl Code shared by fseeko and ftello. Determine if large files are supported,
15239 +dnl but stdin does not start as a large file by default.
15240 +AC_DEFUN([gl_STDIN_LARGE_OFFSET],
15242 + AC_CACHE_CHECK([whether stdin defaults to large file offsets],
15243 + [gl_cv_var_stdin_large_offset],
15244 + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]],
15245 +[[#if defined __SL64 && defined __SCLE /* cygwin */
15246 + /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
15247 + fseeko/ftello needlessly fail. This bug was fixed in 1.5.25, and
15248 + it is easier to do a version check than building a runtime test. */
15249 +# include <cygwin/version.h>
15250 +# if CYGWIN_VERSION_DLL_COMBINED < CYGWIN_VERSION_DLL_MAKE_COMBINED (1005, 25)
15254 + [gl_cv_var_stdin_large_offset=yes],
15255 + [gl_cv_var_stdin_large_offset=no])])
15257 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/sys_socket_h.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/sys_socket_h.m4
15258 --- gtk-vnc-0.3.7.mingw/gnulib/m4/sys_socket_h.m4 1970-01-01 01:00:00.000000000 +0100
15259 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/sys_socket_h.m4 2008-10-09 12:24:39.000000000 +0100
15261 +# sys_socket_h.m4 serial 8
15262 +dnl Copyright (C) 2005-2008 Free Software Foundation, Inc.
15263 +dnl This file is free software; the Free Software Foundation
15264 +dnl gives unlimited permission to copy and/or distribute it,
15265 +dnl with or without modifications, as long as this notice is preserved.
15267 +dnl From Simon Josefsson.
15269 +AC_DEFUN([gl_HEADER_SYS_SOCKET],
15271 + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
15272 + AC_REQUIRE([AC_C_INLINE])
15274 + AC_CACHE_CHECK([whether <sys/socket.h> is self-contained],
15275 + [gl_cv_header_sys_socket_h_selfcontained],
15277 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]], [[]])],
15278 + [gl_cv_header_sys_socket_h_selfcontained=yes],
15279 + [gl_cv_header_sys_socket_h_selfcontained=no])
15281 + if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
15283 + dnl If the shutdown function exists, <sys/socket.h> should define
15284 + dnl SHUT_RD, SHUT_WR, SHUT_RDWR.
15285 + AC_CHECK_FUNCS([shutdown])
15286 + if test $ac_cv_func_shutdown = yes; then
15287 + AC_CACHE_CHECK([whether <sys/socket.h> defines the SHUT_* macros],
15288 + [gl_cv_header_sys_socket_h_shut],
15290 + AC_COMPILE_IFELSE(
15291 + [AC_LANG_PROGRAM([[#include <sys/socket.h>]],
15292 + [[int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };]])],
15293 + [gl_cv_header_sys_socket_h_shut=yes],
15294 + [gl_cv_header_sys_socket_h_shut=no])
15296 + if test $gl_cv_header_sys_socket_h_shut = no; then
15297 + SYS_SOCKET_H='sys/socket.h'
15301 + SYS_SOCKET_H='sys/socket.h'
15303 + if test -n "$SYS_SOCKET_H"; then
15304 + dnl Check prerequisites of the <sys/socket.h> replacement.
15305 + gl_CHECK_NEXT_HEADERS([sys/socket.h])
15306 + if test $ac_cv_header_sys_socket_h = yes; then
15307 + HAVE_SYS_SOCKET_H=1
15308 + HAVE_WS2TCPIP_H=0
15310 + HAVE_SYS_SOCKET_H=0
15311 + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
15312 + dnl the check for those headers unconditional; yet cygwin reports
15313 + dnl that the headers are present but cannot be compiled (since on
15314 + dnl cygwin, all socket information should come from sys/socket.h).
15315 + AC_CHECK_HEADERS([ws2tcpip.h])
15316 + if test $ac_cv_header_ws2tcpip_h = yes; then
15317 + HAVE_WS2TCPIP_H=1
15319 + HAVE_WS2TCPIP_H=0
15322 + gl_PREREQ_SYS_H_WINSOCK2
15323 + AC_SUBST([HAVE_SYS_SOCKET_H])
15324 + AC_SUBST([HAVE_WS2TCPIP_H])
15326 + AC_SUBST([SYS_SOCKET_H])
15329 +# Common prerequisites of of the <sys/socket.h> replacement and of the
15330 +# <sys/select.h> replacement.
15331 +# Sets and substitutes HAVE_WINSOCK2_H.
15332 +AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
15334 + AC_CHECK_HEADERS_ONCE([sys/socket.h])
15335 + if test $ac_cv_header_sys_socket_h != yes; then
15336 + dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
15337 + dnl the check for those headers unconditional; yet cygwin reports
15338 + dnl that the headers are present but cannot be compiled (since on
15339 + dnl cygwin, all socket information should come from sys/socket.h).
15340 + AC_CHECK_HEADERS([winsock2.h])
15342 + if test "$ac_cv_header_winsock2_h" = yes; then
15343 + HAVE_WINSOCK2_H=1
15345 + HAVE_WINSOCK2_H=0
15347 + AC_SUBST([HAVE_WINSOCK2_H])
15350 +AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
15352 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
15353 + AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
15354 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
15355 + gl_MODULE_INDICATOR([$1])
15358 +AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
15360 + GNULIB_SOCKET=0; AC_SUBST([GNULIB_SOCKET])
15361 + GNULIB_CONNECT=0; AC_SUBST([GNULIB_CONNECT])
15362 + GNULIB_ACCEPT=0; AC_SUBST([GNULIB_ACCEPT])
15363 + GNULIB_BIND=0; AC_SUBST([GNULIB_BIND])
15364 + GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
15365 + GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
15366 + GNULIB_GETSOCKOPT=0; AC_SUBST([GNULIB_GETSOCKOPT])
15367 + GNULIB_LISTEN=0; AC_SUBST([GNULIB_LISTEN])
15368 + GNULIB_RECV=0; AC_SUBST([GNULIB_RECV])
15369 + GNULIB_SEND=0; AC_SUBST([GNULIB_SEND])
15370 + GNULIB_RECVFROM=0; AC_SUBST([GNULIB_RECVFROM])
15371 + GNULIB_SENDTO=0; AC_SUBST([GNULIB_SENDTO])
15372 + GNULIB_SETSOCKOPT=0; AC_SUBST([GNULIB_SETSOCKOPT])
15374 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/vasnprintf.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/vasnprintf.m4
15375 --- gtk-vnc-0.3.7.mingw/gnulib/m4/vasnprintf.m4 1970-01-01 01:00:00.000000000 +0100
15376 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/vasnprintf.m4 2008-10-09 12:24:39.000000000 +0100
15378 +# vasnprintf.m4 serial 25
15379 +dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc.
15380 +dnl This file is free software; the Free Software Foundation
15381 +dnl gives unlimited permission to copy and/or distribute it,
15382 +dnl with or without modifications, as long as this notice is preserved.
15384 +AC_DEFUN([gl_FUNC_VASNPRINTF],
15386 + AC_CHECK_FUNCS_ONCE([vasnprintf])
15387 + if test $ac_cv_func_vasnprintf = no; then
15388 + gl_REPLACE_VASNPRINTF
15392 +AC_DEFUN([gl_REPLACE_VASNPRINTF],
15394 + AC_CHECK_FUNCS_ONCE([vasnprintf])
15395 + AC_LIBOBJ([vasnprintf])
15396 + AC_LIBOBJ([printf-args])
15397 + AC_LIBOBJ([printf-parse])
15398 + AC_LIBOBJ([asnprintf])
15399 + if test $ac_cv_func_vasnprintf = yes; then
15400 + AC_DEFINE([REPLACE_VASNPRINTF], 1,
15401 + [Define if vasnprintf exists but is overridden by gnulib.])
15403 + gl_PREREQ_PRINTF_ARGS
15404 + gl_PREREQ_PRINTF_PARSE
15405 + gl_PREREQ_VASNPRINTF
15406 + gl_PREREQ_ASNPRINTF
15409 +# Prequisites of lib/printf-args.h, lib/printf-args.c.
15410 +AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
15412 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
15413 + AC_REQUIRE([gt_TYPE_WCHAR_T])
15414 + AC_REQUIRE([gt_TYPE_WINT_T])
15417 +# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
15418 +AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
15420 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
15421 + AC_REQUIRE([gt_TYPE_WCHAR_T])
15422 + AC_REQUIRE([gt_TYPE_WINT_T])
15423 + AC_REQUIRE([AC_TYPE_SIZE_T])
15424 + AC_CHECK_TYPE([ptrdiff_t], ,
15425 + [AC_DEFINE([ptrdiff_t], [long],
15426 + [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
15428 + AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
15431 +# Prerequisites of lib/vasnprintf.c.
15432 +AC_DEFUN([gl_PREREQ_VASNPRINTF],
15434 + AC_REQUIRE([AC_FUNC_ALLOCA])
15435 + AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
15436 + AC_REQUIRE([gt_TYPE_WCHAR_T])
15437 + AC_REQUIRE([gt_TYPE_WINT_T])
15438 + AC_CHECK_FUNCS(snprintf wcslen)
15439 + dnl Use the _snprintf function only if it is declared (because on NetBSD it
15440 + dnl is defined as a weak alias of snprintf; we prefer to use the latter).
15441 + AC_CHECK_DECLS([_snprintf], , , [#include <stdio.h>])
15444 +# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
15446 +AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE],
15448 + AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
15449 + case "$gl_cv_func_printf_long_double" in
15453 + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
15454 + [Define if the vasnprintf implementation needs special code for
15455 + 'long double' arguments.])
15460 +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'double'
15462 +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE],
15464 + AC_REQUIRE([gl_PRINTF_INFINITE])
15465 + case "$gl_cv_func_printf_infinite" in
15469 + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1,
15470 + [Define if the vasnprintf implementation needs special code for
15471 + infinite 'double' arguments.])
15476 +# Extra prerequisites of lib/vasnprintf.c for supporting infinite 'long double'
15478 +AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE],
15480 + AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
15481 + dnl There is no need to set NEED_PRINTF_INFINITE_LONG_DOUBLE if
15482 + dnl NEED_PRINTF_LONG_DOUBLE is already set.
15483 + AC_REQUIRE([gl_PREREQ_VASNPRINTF_LONG_DOUBLE])
15484 + case "$gl_cv_func_printf_long_double" in
15486 + case "$gl_cv_func_printf_infinite_long_double" in
15490 + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1,
15491 + [Define if the vasnprintf implementation needs special code for
15492 + infinite 'long double' arguments.])
15499 +# Extra prerequisites of lib/vasnprintf.c for supporting the 'a' directive.
15500 +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
15502 + AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
15503 + case "$gl_cv_func_printf_directive_a" in
15507 + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1,
15508 + [Define if the vasnprintf implementation needs special code for
15509 + the 'a' and 'A' directives.])
15510 + AC_CHECK_FUNCS([nl_langinfo])
15515 +# Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive.
15516 +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F],
15518 + AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
15519 + case "$gl_cv_func_printf_directive_f" in
15523 + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1,
15524 + [Define if the vasnprintf implementation needs special code for
15525 + the 'F' directive.])
15530 +# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
15531 +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
15533 + AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
15534 + case "$gl_cv_func_printf_flag_grouping" in
15538 + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1,
15539 + [Define if the vasnprintf implementation needs special code for the
15545 +# Extra prerequisites of lib/vasnprintf.c for supporting the '-' flag.
15546 +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST],
15548 + AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
15549 + case "$gl_cv_func_printf_flag_leftadjust" in
15553 + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1,
15554 + [Define if the vasnprintf implementation needs special code for the
15560 +# Extra prerequisites of lib/vasnprintf.c for supporting the 0 flag.
15561 +AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
15563 + AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
15564 + case "$gl_cv_func_printf_flag_zero" in
15568 + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1,
15569 + [Define if the vasnprintf implementation needs special code for the
15575 +# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
15576 +AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
15578 + AC_REQUIRE([gl_PRINTF_PRECISION])
15579 + case "$gl_cv_func_printf_precision" in
15583 + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1,
15584 + [Define if the vasnprintf implementation needs special code for
15585 + supporting large precisions without arbitrary bounds.])
15586 + AC_DEFINE([NEED_PRINTF_DOUBLE], 1,
15587 + [Define if the vasnprintf implementation needs special code for
15588 + 'double' arguments.])
15589 + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
15590 + [Define if the vasnprintf implementation needs special code for
15591 + 'long double' arguments.])
15596 +# Extra prerequisites of lib/vasnprintf.c for surviving out-of-memory
15598 +AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
15600 + AC_REQUIRE([gl_PRINTF_ENOMEM])
15601 + case "$gl_cv_func_printf_enomem" in
15605 + AC_DEFINE([NEED_PRINTF_ENOMEM], 1,
15606 + [Define if the vasnprintf implementation needs special code for
15607 + surviving out-of-memory conditions.])
15608 + AC_DEFINE([NEED_PRINTF_DOUBLE], 1,
15609 + [Define if the vasnprintf implementation needs special code for
15610 + 'double' arguments.])
15611 + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1,
15612 + [Define if the vasnprintf implementation needs special code for
15613 + 'long double' arguments.])
15618 +# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
15619 +AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS],
15621 + AC_REQUIRE([gl_PREREQ_VASNPRINTF])
15622 + gl_PREREQ_VASNPRINTF_LONG_DOUBLE
15623 + gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
15624 + gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
15625 + gl_PREREQ_VASNPRINTF_DIRECTIVE_A
15626 + gl_PREREQ_VASNPRINTF_DIRECTIVE_F
15627 + gl_PREREQ_VASNPRINTF_FLAG_GROUPING
15628 + gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
15629 + gl_PREREQ_VASNPRINTF_FLAG_ZERO
15630 + gl_PREREQ_VASNPRINTF_PRECISION
15631 + gl_PREREQ_VASNPRINTF_ENOMEM
15634 +# Prerequisites of lib/asnprintf.c.
15635 +AC_DEFUN([gl_PREREQ_ASNPRINTF],
15638 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/wchar.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/wchar.m4
15639 --- gtk-vnc-0.3.7.mingw/gnulib/m4/wchar.m4 1970-01-01 01:00:00.000000000 +0100
15640 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/wchar.m4 2008-10-09 12:24:39.000000000 +0100
15642 +dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
15644 +dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
15645 +dnl This file is free software; the Free Software Foundation
15646 +dnl gives unlimited permission to copy and/or distribute it,
15647 +dnl with or without modifications, as long as this notice is preserved.
15649 +dnl Written by Eric Blake.
15651 +# wchar.m4 serial 6
15653 +AC_DEFUN([gl_WCHAR_H],
15655 + AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
15656 + AC_CACHE_CHECK([whether <wchar.h> is standalone],
15657 + [gl_cv_header_wchar_h_standalone],
15658 + [AC_COMPILE_IFELSE([[#include <wchar.h>
15660 + [gl_cv_header_wchar_h_standalone=yes],
15661 + [gl_cv_header_wchar_h_standalone=no])])
15663 + AC_REQUIRE([gt_TYPE_WINT_T])
15664 + if test $gt_cv_c_wint_t = yes; then
15669 + AC_SUBST([HAVE_WINT_T])
15671 + if test $gl_cv_header_wchar_h_standalone != yes || test $gt_cv_c_wint_t != yes; then
15675 + dnl Prepare for creating substitute <wchar.h>.
15676 + dnl Do it always: WCHAR_H may be empty here but can be set later.
15677 + dnl Check for <wchar.h> (missing in Linux uClibc when built without wide
15678 + dnl character support).
15679 + AC_CHECK_HEADERS_ONCE([wchar.h])
15680 + if test $ac_cv_header_wchar_h = yes; then
15685 + AC_SUBST([HAVE_WCHAR_H])
15686 + gl_CHECK_NEXT_HEADERS([wchar.h])
15689 +dnl Unconditionally enables the replacement of <wchar.h>.
15690 +AC_DEFUN([gl_REPLACE_WCHAR_H],
15692 + AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
15696 +AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
15698 + dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
15699 + AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
15700 + GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
15703 +AC_DEFUN([gl_WCHAR_H_DEFAULTS],
15705 + GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH])
15706 + dnl Assume proper GNU behavior unless another module says otherwise.
15707 + HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH])
15708 + REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
15709 + WCHAR_H=''; AC_SUBST([WCHAR_H])
15711 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/wchar_t.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/wchar_t.m4
15712 --- gtk-vnc-0.3.7.mingw/gnulib/m4/wchar_t.m4 1970-01-01 01:00:00.000000000 +0100
15713 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/wchar_t.m4 2008-10-09 12:24:39.000000000 +0100
15715 +# wchar_t.m4 serial 1 (gettext-0.12)
15716 +dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
15717 +dnl This file is free software; the Free Software Foundation
15718 +dnl gives unlimited permission to copy and/or distribute it,
15719 +dnl with or without modifications, as long as this notice is preserved.
15721 +dnl From Bruno Haible.
15722 +dnl Test whether <stddef.h> has the 'wchar_t' type.
15723 +dnl Prerequisite: AC_PROG_CC
15725 +AC_DEFUN([gt_TYPE_WCHAR_T],
15727 + AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
15728 + [AC_TRY_COMPILE([#include <stddef.h>
15729 + wchar_t foo = (wchar_t)'\0';], ,
15730 + gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
15731 + if test $gt_cv_c_wchar_t = yes; then
15732 + AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
15735 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/wint_t.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/wint_t.m4
15736 --- gtk-vnc-0.3.7.mingw/gnulib/m4/wint_t.m4 1970-01-01 01:00:00.000000000 +0100
15737 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/wint_t.m4 2008-10-09 12:24:39.000000000 +0100
15739 +# wint_t.m4 serial 2 (gettext-0.17)
15740 +dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
15741 +dnl This file is free software; the Free Software Foundation
15742 +dnl gives unlimited permission to copy and/or distribute it,
15743 +dnl with or without modifications, as long as this notice is preserved.
15745 +dnl From Bruno Haible.
15746 +dnl Test whether <wchar.h> has the 'wint_t' type.
15747 +dnl Prerequisite: AC_PROG_CC
15749 +AC_DEFUN([gt_TYPE_WINT_T],
15751 + AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
15752 + [AC_TRY_COMPILE([
15753 +/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
15755 + BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
15756 + before <wchar.h>. */
15757 +#include <stddef.h>
15758 +#include <stdio.h>
15760 +#include <wchar.h>
15761 + wint_t foo = (wchar_t)'\0';], ,
15762 + gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
15763 + if test $gt_cv_c_wint_t = yes; then
15764 + AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
15767 diff -urN gtk-vnc-0.3.7.mingw/gnulib/m4/xsize.m4 gtk-vnc-0.3.7.gnulib/gnulib/m4/xsize.m4
15768 --- gtk-vnc-0.3.7.mingw/gnulib/m4/xsize.m4 1970-01-01 01:00:00.000000000 +0100
15769 +++ gtk-vnc-0.3.7.gnulib/gnulib/m4/xsize.m4 2008-10-09 12:24:39.000000000 +0100
15771 +# xsize.m4 serial 3
15772 +dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
15773 +dnl This file is free software; the Free Software Foundation
15774 +dnl gives unlimited permission to copy and/or distribute it,
15775 +dnl with or without modifications, as long as this notice is preserved.
15777 +AC_DEFUN([gl_XSIZE],
15779 + dnl Prerequisites of lib/xsize.h.
15780 + AC_REQUIRE([gl_SIZE_MAX])
15781 + AC_REQUIRE([AC_C_INLINE])
15782 + AC_CHECK_HEADERS(stdint.h)
15784 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/dummy.c gtk-vnc-0.3.7.gnulib/gnulib/tests/dummy.c
15785 --- gtk-vnc-0.3.7.mingw/gnulib/tests/dummy.c 1970-01-01 01:00:00.000000000 +0100
15786 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/dummy.c 2008-10-09 12:24:39.000000000 +0100
15788 +/* A dummy file, to prevent empty libraries from breaking builds.
15789 + Copyright (C) 2004, 2007 Free Software Foundation, Inc.
15791 + This program is free software: you can redistribute it and/or modify
15792 + it under the terms of the GNU General Public License as published by
15793 + the Free Software Foundation; either version 3 of the License, or
15794 + (at your option) any later version.
15796 + This program is distributed in the hope that it will be useful,
15797 + but WITHOUT ANY WARRANTY; without even the implied warranty of
15798 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15799 + GNU General Public License for more details.
15801 + You should have received a copy of the GNU General Public License
15802 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
15804 +/* Some systems, reportedly OpenBSD and Mac OS X, refuse to create
15805 + libraries without any object files. You might get an error like:
15807 + > ar cru .libs/libgl.a
15808 + > ar: no archive members specified
15810 + Compiling this file, and adding its object file to the library, will
15811 + prevent the library from being empty. */
15813 +/* Some systems, such as Solaris with cc 5.0, refuse to work with libraries
15814 + that don't export any symbol. You might get an error like:
15816 + > cc ... libgnu.a
15817 + > ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a
15819 + Compiling this file, and adding its object file to the library, will
15820 + prevent the library from exporting no symbols. */
15823 +/* This declaration ensures that the library will export at least 1 symbol. */
15824 +int gl_dummy_symbol;
15826 +/* This declaration is solely to ensure that after preprocessing
15827 + this file is never empty. */
15828 +typedef int dummy;
15830 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/intprops.h gtk-vnc-0.3.7.gnulib/gnulib/tests/intprops.h
15831 --- gtk-vnc-0.3.7.mingw/gnulib/tests/intprops.h 1970-01-01 01:00:00.000000000 +0100
15832 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/intprops.h 2008-10-09 12:24:39.000000000 +0100
15834 +/* intprops.h -- properties of integer types
15836 + Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
15838 + This program is free software: you can redistribute it and/or modify
15839 + it under the terms of the GNU General Public License as published by
15840 + the Free Software Foundation; either version 3 of the License, or
15841 + (at your option) any later version.
15843 + This program is distributed in the hope that it will be useful,
15844 + but WITHOUT ANY WARRANTY; without even the implied warranty of
15845 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15846 + GNU General Public License for more details.
15848 + You should have received a copy of the GNU General Public License
15849 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
15851 +/* Written by Paul Eggert. */
15853 +#include <limits.h>
15855 +/* The extra casts in the following macros work around compiler bugs,
15856 + e.g., in Cray C 5.0.3.0. */
15858 +/* True if the arithmetic type T is an integer type. bool counts as
15860 +#define TYPE_IS_INTEGER(t) ((t) 1.5 == 1)
15862 +/* True if negative values of the signed integer type T use two's
15863 + complement, ones' complement, or signed magnitude representation,
15864 + respectively. Much GNU code assumes two's complement, but some
15865 + people like to be portable to all possible C hosts. */
15866 +#define TYPE_TWOS_COMPLEMENT(t) ((t) ~ (t) 0 == (t) -1)
15867 +#define TYPE_ONES_COMPLEMENT(t) ((t) ~ (t) 0 == 0)
15868 +#define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1)
15870 +/* True if the arithmetic type T is signed. */
15871 +#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
15873 +/* The maximum and minimum values for the integer type T. These
15874 + macros have undefined behavior if T is signed and has padding bits.
15875 + If this is a problem for you, please let us know how to fix it for
15877 +#define TYPE_MINIMUM(t) \
15878 + ((t) (! TYPE_SIGNED (t) \
15880 + : TYPE_SIGNED_MAGNITUDE (t) \
15882 + : ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1)))
15883 +#define TYPE_MAXIMUM(t) \
15884 + ((t) (! TYPE_SIGNED (t) \
15886 + : ~ (~ (t) 0 << (sizeof (t) * CHAR_BIT - 1))))
15888 +/* Return zero if T can be determined to be an unsigned type.
15889 + Otherwise, return 1.
15890 + When compiling with GCC, INT_STRLEN_BOUND uses this macro to obtain a
15891 + tighter bound. Otherwise, it overestimates the true bound by one byte
15892 + when applied to unsigned types of size 2, 4, 16, ... bytes.
15893 + The symbol signed_type_or_expr__ is private to this header file. */
15895 +# define signed_type_or_expr__(t) TYPE_SIGNED (__typeof__ (t))
15897 +# define signed_type_or_expr__(t) 1
15900 +/* Bound on length of the string representing an integer type or expression T.
15901 + Subtract 1 for the sign bit if T is signed; log10 (2.0) < 146/485;
15902 + add 1 for integer division truncation; add 1 more for a minus sign
15904 +#define INT_STRLEN_BOUND(t) \
15905 + ((sizeof (t) * CHAR_BIT - signed_type_or_expr__ (t)) * 146 / 485 \
15906 + + signed_type_or_expr__ (t) + 1)
15908 +/* Bound on buffer size needed to represent an integer type or expression T,
15909 + including the terminating null. */
15910 +#define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
15911 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/Makefile.am gtk-vnc-0.3.7.gnulib/gnulib/tests/Makefile.am
15912 --- gtk-vnc-0.3.7.mingw/gnulib/tests/Makefile.am 1970-01-01 01:00:00.000000000 +0100
15913 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/Makefile.am 2008-10-09 12:24:40.000000000 +0100
15915 +## DO NOT EDIT! GENERATED AUTOMATICALLY!
15916 +## Process this file with automake to produce Makefile.in.
15917 +# Copyright (C) 2002-2008 Free Software Foundation, Inc.
15919 +# This file is free software, distributed under the terms of the GNU
15920 +# General Public License. As a special exception to the GNU General
15921 +# Public License, this file may be distributed as part of a program
15922 +# that contains a configuration script generated by Autoconf, under
15923 +# the same distribution terms as the rest of that program.
15925 +# Generated by gnulib-tool.
15927 +AUTOMAKE_OPTIONS = 1.5 foreign
15931 +TESTS_ENVIRONMENT =
15935 +noinst_LIBRARIES =
15936 +check_LIBRARIES = libtests.a
15940 +MOSTLYCLEANFILES = core *.stackdump
15944 +MAINTAINERCLEANFILES =
15947 + -I. -I$(srcdir) \
15948 + -I../.. -I$(srcdir)/../.. \
15949 + -I../../gnulib/lib -I$(srcdir)/../../gnulib/lib
15951 +LDADD = libtests.a ../../gnulib/lib/libgnu.la libtests.a $(LIBTESTS_LIBDEPS)
15953 +libtests_a_SOURCES =
15954 +libtests_a_LIBADD = $(gltests_LIBOBJS)
15955 +libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
15956 +EXTRA_libtests_a_SOURCES =
15957 +AM_LIBTOOLFLAGS = --preserve-dup-deps
15959 +## begin gnulib module alloca-opt-tests
15961 +TESTS += test-alloca-opt
15962 +check_PROGRAMS += test-alloca-opt
15964 +EXTRA_DIST += test-alloca-opt.c
15966 +## end gnulib module alloca-opt-tests
15968 +## begin gnulib module arpa_inet-tests
15970 +TESTS += test-arpa_inet
15971 +check_PROGRAMS += test-arpa_inet
15973 +EXTRA_DIST += test-arpa_inet.c
15975 +## end gnulib module arpa_inet-tests
15977 +## begin gnulib module errno-tests
15979 +TESTS += test-errno
15980 +check_PROGRAMS += test-errno
15982 +EXTRA_DIST += test-errno.c
15984 +## end gnulib module errno-tests
15986 +## begin gnulib module getaddrinfo-tests
15988 +TESTS += test-getaddrinfo
15989 +check_PROGRAMS += test-getaddrinfo
15990 +test_getaddrinfo_LDADD = $(LDADD) @LIBINTL@
15992 +EXTRA_DIST += test-getaddrinfo.c
15994 +## end gnulib module getaddrinfo-tests
15996 +## begin gnulib module intprops
15999 +EXTRA_DIST += intprops.h
16001 +## end gnulib module intprops
16003 +## begin gnulib module netinet_in-tests
16005 +TESTS += test-netinet_in
16006 +check_PROGRAMS += test-netinet_in
16008 +EXTRA_DIST += test-netinet_in.c
16010 +## end gnulib module netinet_in-tests
16012 +## begin gnulib module snprintf-tests
16014 +TESTS += test-snprintf
16015 +check_PROGRAMS += test-snprintf
16017 +EXTRA_DIST += test-snprintf.c
16019 +## end gnulib module snprintf-tests
16021 +## begin gnulib module stdbool-tests
16023 +TESTS += test-stdbool
16024 +check_PROGRAMS += test-stdbool
16026 +EXTRA_DIST += test-stdbool.c
16028 +## end gnulib module stdbool-tests
16030 +## begin gnulib module stdint-tests
16032 +TESTS += test-stdint
16033 +check_PROGRAMS += test-stdint
16035 +EXTRA_DIST += test-stdint.c
16037 +## end gnulib module stdint-tests
16039 +## begin gnulib module stdio-tests
16041 +TESTS += test-stdio
16042 +check_PROGRAMS += test-stdio
16044 +EXTRA_DIST += test-stdio.c
16046 +## end gnulib module stdio-tests
16048 +## begin gnulib module sys_socket-tests
16050 +TESTS += test-sys_socket
16051 +check_PROGRAMS += test-sys_socket
16053 +EXTRA_DIST += test-sys_socket.c
16055 +## end gnulib module sys_socket-tests
16057 +## begin gnulib module vasnprintf-tests
16059 +TESTS += test-vasnprintf
16060 +check_PROGRAMS += test-vasnprintf
16062 +EXTRA_DIST += test-vasnprintf.c
16064 +## end gnulib module vasnprintf-tests
16066 +## begin gnulib module vc-list-files-tests
16068 +TESTS += test-vc-list-files-git.sh
16069 +TESTS += test-vc-list-files-cvs.sh
16070 +TESTS_ENVIRONMENT += PATH='$(abs_aux_dir)':"$$PATH"
16071 +EXTRA_DIST += test-vc-list-files-git.sh test-vc-list-files-cvs.sh
16073 +## end gnulib module vc-list-files-tests
16075 +## begin gnulib module verify
16077 +libtests_a_SOURCES += verify.h
16079 +## end gnulib module verify
16081 +## begin gnulib module wchar-tests
16083 +TESTS += test-wchar
16084 +check_PROGRAMS += test-wchar
16086 +EXTRA_DIST += test-wchar.c
16088 +## end gnulib module wchar-tests
16090 +## begin gnulib module dummy
16092 +libtests_a_SOURCES += dummy.c
16094 +## end gnulib module dummy
16096 +# Clean up after Solaris cc.
16098 + rm -rf SunWS_cache
16100 +mostlyclean-local: mostlyclean-generic
16101 + @for dir in '' $(MOSTLYCLEANDIRS); do \
16102 + if test -n "$$dir" && test -d $$dir; then \
16103 + echo "rmdir $$dir"; rmdir $$dir; \
16107 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-alloca-opt.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-alloca-opt.c
16108 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-alloca-opt.c 1970-01-01 01:00:00.000000000 +0100
16109 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-alloca-opt.c 2008-10-09 12:24:39.000000000 +0100
16111 +/* Test of optional automatic memory allocation.
16112 + Copyright (C) 2005, 2007 Free Software Foundation, Inc.
16114 + This program is free software: you can redistribute it and/or modify
16115 + it under the terms of the GNU General Public License as published by
16116 + the Free Software Foundation; either version 3 of the License, or
16117 + (at your option) any later version.
16119 + This program is distributed in the hope that it will be useful,
16120 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16121 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16122 + GNU General Public License for more details.
16124 + You should have received a copy of the GNU General Public License
16125 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16127 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16129 +#include <config.h>
16131 +#include <alloca.h>
16136 +do_allocation (int n)
16138 + void *ptr = alloca (n);
16142 +void (*func) (int) = do_allocation;
16152 + /* Repeat a lot of times, to make sure there's no memory leak. */
16153 + for (i = 0; i < 100000; i++)
16155 + /* Try various values.
16156 + n = 0 gave a crash on Alpha with gcc-2.5.8.
16157 + Some versions of MacOS X have a stack size limit of 512 KB. */
16173 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-arpa_inet.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-arpa_inet.c
16174 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-arpa_inet.c 1970-01-01 01:00:00.000000000 +0100
16175 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-arpa_inet.c 2008-10-09 12:24:39.000000000 +0100
16177 +/* Test of <arpa/inet.h> substitute.
16178 + Copyright (C) 2007 Free Software Foundation, Inc.
16180 + This program is free software: you can redistribute it and/or modify
16181 + it under the terms of the GNU General Public License as published by
16182 + the Free Software Foundation; either version 3 of the License, or
16183 + (at your option) any later version.
16185 + This program is distributed in the hope that it will be useful,
16186 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16187 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16188 + GNU General Public License for more details.
16190 + You should have received a copy of the GNU General Public License
16191 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16193 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16195 +#include <config.h>
16197 +#include <arpa/inet.h>
16204 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-errno.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-errno.c
16205 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-errno.c 1970-01-01 01:00:00.000000000 +0100
16206 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-errno.c 2008-10-09 12:24:39.000000000 +0100
16208 +/* Test of <errno.h> substitute.
16209 + Copyright (C) 2008 Free Software Foundation, Inc.
16211 + This program is free software: you can redistribute it and/or modify
16212 + it under the terms of the GNU General Public License as published by
16213 + the Free Software Foundation; either version 3 of the License, or
16214 + (at your option) any later version.
16216 + This program is distributed in the hope that it will be useful,
16217 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16218 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16219 + GNU General Public License for more details.
16221 + You should have received a copy of the GNU General Public License
16222 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16224 +/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
16226 +#include <config.h>
16228 +#include <errno.h>
16230 +/* Verify that the POSIX mandated errno values exist and can be used as
16231 + initializers outside of a function.
16232 + The variable names happen to match the Linux/x86 error numbers. */
16244 +int e11a = EWOULDBLOCK;
16252 +int e20 = ENOTDIR;
16258 +int e26 = ETXTBSY;
16267 +int e35 = EDEADLK;
16268 +int e36 = ENAMETOOLONG;
16271 +int e39 = ENOTEMPTY;
16275 +int e67 = ENOLINK;
16277 +int e72 = EMULTIHOP;
16278 +int e74 = EBADMSG;
16279 +int e75 = EOVERFLOW;
16281 +int e88 = ENOTSOCK;
16282 +int e89 = EDESTADDRREQ;
16283 +int e90 = EMSGSIZE;
16284 +int e91 = EPROTOTYPE;
16285 +int e92 = ENOPROTOOPT;
16286 +int e93 = EPROTONOSUPPORT;
16287 +int e95 = EOPNOTSUPP;
16288 +int e95a = ENOTSUP;
16289 +int e97 = EAFNOSUPPORT;
16290 +int e98 = EADDRINUSE;
16291 +int e99 = EADDRNOTAVAIL;
16292 +int e100 = ENETDOWN;
16293 +int e101 = ENETUNREACH;
16294 +int e102 = ENETRESET;
16295 +int e103 = ECONNABORTED;
16296 +int e104 = ECONNRESET;
16297 +int e105 = ENOBUFS;
16298 +int e106 = EISCONN;
16299 +int e107 = ENOTCONN;
16300 +int e110 = ETIMEDOUT;
16301 +int e111 = ECONNREFUSED;
16302 +int e113 = EHOSTUNREACH;
16303 +int e114 = EALREADY;
16304 +int e115 = EINPROGRESS;
16305 +int e116 = ESTALE;
16306 +int e122 = EDQUOT;
16307 +int e125 = ECANCELED;
16309 +/* Don't verify that these errno values are all different, except for possibly
16310 + EWOULDBLOCK == EAGAIN. Even Linux/x86 does not pass this check: it has
16311 + ENOTSUP == EOPNOTSUPP. */
16316 + /* Verify that errno can be assigned. */
16317 + errno = EOVERFLOW;
16319 + /* snprintf() callers want to distinguish EINVAL and EOVERFLOW. */
16320 + if (errno == EINVAL)
16325 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-getaddrinfo.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-getaddrinfo.c
16326 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-getaddrinfo.c 1970-01-01 01:00:00.000000000 +0100
16327 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-getaddrinfo.c 2008-10-09 12:24:39.000000000 +0100
16329 +/* Test the getaddrinfo module.
16331 + Copyright (C) 2006-2008 Free Software Foundation, Inc.
16333 + This program is free software: you can redistribute it and/or modify
16334 + it under the terms of the GNU General Public License as published by
16335 + the Free Software Foundation; either version 3 of the License, or
16336 + (at your option) any later version.
16338 + This program is distributed in the hope that it will be useful,
16339 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16340 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16341 + GNU General Public License for more details.
16343 + You should have received a copy of the GNU General Public License
16344 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16346 +/* Written by Simon Josefsson. */
16348 +#include <config.h>
16349 +#include "getaddrinfo.h"
16350 +#include <arpa/inet.h>
16351 +#include <netinet/in.h>
16352 +#include <stdio.h>
16353 +#include <string.h>
16355 +/* Whether to print debugging messages. */
16356 +#define ENABLE_DEBUGGING 0
16358 +#if ENABLE_DEBUGGING
16359 +# define dbgprintf printf
16361 +# define dbgprintf if (0) printf
16364 +/* BeOS does not have AF_UNSPEC. */
16366 +# define AF_UNSPEC 0
16369 +#ifndef EAI_SERVICE
16370 +# define EAI_SERVICE 0
16373 +int simple (char *host, char *service)
16375 + char buf[BUFSIZ];
16376 + struct addrinfo hints;
16377 + struct addrinfo *ai0, *ai;
16380 + dbgprintf ("Finding %s service %s...\n", host, service);
16382 + /* This initializes "hints" but does not use it. Is there a reason
16383 + for this? If so, please fix this comment. */
16384 + memset (&hints, 0, sizeof (hints));
16385 + hints.ai_flags = AI_CANONNAME;
16386 + hints.ai_family = AF_UNSPEC;
16387 + hints.ai_socktype = SOCK_STREAM;
16389 + res = getaddrinfo (host, service, 0, &ai0);
16391 + dbgprintf ("res %d: %s\n", res, gai_strerror (res));
16395 + /* IRIX reports EAI_NONAME for "https". Don't fail the test
16396 + merely because of this. */
16397 + if (res == EAI_NONAME)
16399 + /* Solaris reports EAI_SERVICE for "http" and "https". Don't
16400 + fail the test merely because of this. */
16401 + if (res == EAI_SERVICE)
16403 + /* AIX reports EAI_NODATA for "https". Don't fail the test
16404 + merely because of this. */
16405 + if (res == EAI_NODATA)
16411 + for (ai = ai0; ai; ai = ai->ai_next)
16413 + dbgprintf ("\tflags %x\n", ai->ai_flags);
16414 + dbgprintf ("\tfamily %x\n", ai->ai_family);
16415 + dbgprintf ("\tsocktype %x\n", ai->ai_socktype);
16416 + dbgprintf ("\tprotocol %x\n", ai->ai_protocol);
16417 + dbgprintf ("\taddrlen %ld: ", (unsigned long) ai->ai_addrlen);
16418 + dbgprintf ("\tFound %s\n",
16419 + inet_ntop (ai->ai_family,
16420 + &((struct sockaddr_in *)
16421 + ai->ai_addr)->sin_addr,
16422 + buf, sizeof (buf) - 1));
16423 + if (ai->ai_canonname)
16424 + dbgprintf ("\tFound %s...\n", ai->ai_canonname);
16427 + char ipbuf[BUFSIZ];
16428 + char portbuf[BUFSIZ];
16430 + res = getnameinfo (ai->ai_addr, ai->ai_addrlen,
16431 + ipbuf, sizeof (ipbuf) - 1,
16432 + portbuf, sizeof (portbuf) - 1,
16433 + NI_NUMERICHOST|NI_NUMERICSERV);
16434 + dbgprintf ("\t\tgetnameinfo %d: %s\n", res, gai_strerror (res));
16437 + dbgprintf ("\t\tip %s\n", ipbuf);
16438 + dbgprintf ("\t\tport %s\n", portbuf);
16444 + freeaddrinfo (ai0);
16449 +#define HOST1 "www.gnu.org"
16450 +#define SERV1 "http"
16451 +#define HOST2 "www.ibm.com"
16452 +#define SERV2 "https"
16453 +#define HOST3 "microsoft.com"
16454 +#define SERV3 "http"
16455 +#define HOST4 "google.org"
16456 +#define SERV4 "ldap"
16466 + requested = MAKEWORD (1, 1);
16467 + err = WSAStartup (requested, &data);
16471 + if (data.wVersion < requested)
16479 + return simple (HOST1, SERV1)
16480 + + simple (HOST2, SERV2)
16481 + + simple (HOST3, SERV3)
16482 + + simple (HOST4, SERV4);
16484 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-netinet_in.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-netinet_in.c
16485 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-netinet_in.c 1970-01-01 01:00:00.000000000 +0100
16486 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-netinet_in.c 2008-10-09 12:24:39.000000000 +0100
16488 +/* Test of <netinet/in.h> substitute.
16489 + Copyright (C) 2007 Free Software Foundation, Inc.
16491 + This program is free software: you can redistribute it and/or modify
16492 + it under the terms of the GNU General Public License as published by
16493 + the Free Software Foundation; either version 3 of the License, or
16494 + (at your option) any later version.
16496 + This program is distributed in the hope that it will be useful,
16497 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16498 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16499 + GNU General Public License for more details.
16501 + You should have received a copy of the GNU General Public License
16502 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16504 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16506 +#include <config.h>
16508 +#include <netinet/in.h>
16515 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-snprintf.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-snprintf.c
16516 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-snprintf.c 1970-01-01 01:00:00.000000000 +0100
16517 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-snprintf.c 2008-10-09 12:24:39.000000000 +0100
16519 +/* Test of snprintf() function.
16520 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
16522 + This program is free software: you can redistribute it and/or modify
16523 + it under the terms of the GNU General Public License as published by
16524 + the Free Software Foundation; either version 3 of the License, or
16525 + (at your option) any later version.
16527 + This program is distributed in the hope that it will be useful,
16528 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16529 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16530 + GNU General Public License for more details.
16532 + You should have received a copy of the GNU General Public License
16533 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16535 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16537 +#include <config.h>
16539 +#include <stdio.h>
16541 +#include <stdlib.h>
16542 +#include <string.h>
16544 +#define ASSERT(expr) \
16549 + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
16550 + fflush (stderr); \
16557 +main (int argc, char *argv[])
16563 + for (size = 0; size <= 8; size++)
16565 + memcpy (buf, "DEADBEEF", 8);
16566 + retval = snprintf (buf, size, "%d", 12345);
16569 +#if CHECK_SNPRINTF_POSIX
16570 + ASSERT (retval < 0 || retval >= size);
16574 + ASSERT (memcmp (buf, "12345", size - 1) == 0);
16575 + ASSERT (buf[size - 1] == '\0' || buf[size - 1] == '0' + size);
16577 +#if !CHECK_SNPRINTF_POSIX
16580 + ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
16584 + ASSERT (retval == 5);
16585 + ASSERT (memcmp (buf, "12345\0EF", 8) == 0);
16591 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-stdbool.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdbool.c
16592 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-stdbool.c 1970-01-01 01:00:00.000000000 +0100
16593 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdbool.c 2008-10-09 12:24:39.000000000 +0100
16595 +/* Test of <stdbool.h> substitute.
16596 + Copyright (C) 2002-2007 Free Software Foundation, Inc.
16598 + This program is free software: you can redistribute it and/or modify
16599 + it under the terms of the GNU General Public License as published by
16600 + the Free Software Foundation; either version 3 of the License, or
16601 + (at your option) any later version.
16603 + This program is distributed in the hope that it will be useful,
16604 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16605 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16606 + GNU General Public License for more details.
16608 + You should have received a copy of the GNU General Public License
16609 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16611 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
16613 +#include <config.h>
16615 +#include <stdbool.h>
16618 + "error: bool is not defined"
16621 + "error: false is not defined"
16624 + "error: false is not 0"
16627 + "error: true is not defined"
16630 + "error: true is not 1"
16632 +#ifndef __bool_true_false_are_defined
16633 + "error: __bool_true_false_are_defined is not defined"
16636 +#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>. */
16637 +struct s { _Bool s: 1; _Bool t; } s;
16640 +char a[true == 1 ? 1 : -1];
16641 +char b[false == 0 ? 1 : -1];
16642 +char c[__bool_true_false_are_defined == 1 ? 1 : -1];
16643 +#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>. */
16644 +char d[(bool) 0.5 == true ? 1 : -1];
16647 +char f[(_Bool) 0.0 == false ? 1 : -1];
16649 +char h[sizeof (_Bool)];
16650 +#if 0 /* See above. */
16651 +char i[sizeof s.t];
16653 +enum { j = false, k = true, l = false * true, m = true * 256 };
16655 +char o[sizeof n == m * sizeof n[0] ? 1 : -1];
16656 +char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
16657 +#if 0 /* Cannot be guaranteed with gnulib's <stdbool.h>. */
16658 +#if defined __xlc__ || defined __GNUC__
16659 + /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
16660 + reported by James Lemley on 2005-10-05; see
16661 + http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
16662 + This test is not quite right, since xlc is allowed to
16663 + reject this program, as the initializer for xlcbug is
16664 + not one of the forms that C requires support for.
16665 + However, doing the test right would require a run-time
16666 + test, and that would make cross-compilation harder.
16667 + Let us hope that IBM fixes the xlc bug, and also adds
16668 + support for this kind of constant expression. In the
16669 + meantime, this test will reject xlc, which is OK, since
16670 + our stdbool.h substitute should suffice. We also test
16671 + this with GCC, where it should work, to detect more
16672 + quickly whether someone messes up the test in the
16674 + char digs[] = "0123456789";
16675 + int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
16678 +/* Catch a bug in an HP-UX C compiler. See
16679 + http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
16680 + http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
16690 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-stdint.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdint.c
16691 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-stdint.c 1970-01-01 01:00:00.000000000 +0100
16692 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdint.c 2008-10-09 12:24:39.000000000 +0100
16694 +/* Test of <stdint.h> substitute.
16695 + Copyright (C) 2006-2008 Free Software Foundation, Inc.
16697 + This program is free software: you can redistribute it and/or modify
16698 + it under the terms of the GNU General Public License as published by
16699 + the Free Software Foundation; either version 3 of the License, or
16700 + (at your option) any later version.
16702 + This program is distributed in the hope that it will be useful,
16703 + but WITHOUT ANY WARRANTY; without even the implied warranty of
16704 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16705 + GNU General Public License for more details.
16707 + You should have received a copy of the GNU General Public License
16708 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
16710 +/* Written by Bruno Haible <bruno@clisp.org>, 2006. */
16712 +#include <config.h>
16714 +/* Whether to enable pedantic checks. */
16715 +#define DO_PEDANTIC 0
16717 +#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
16718 +#include <stdint.h>
16720 +#include "verify.h"
16721 +#include "intprops.h"
16723 +#if __GNUC__ >= 2 && DO_PEDANTIC
16724 +# define verify_same_types(expr1,expr2) \
16725 + extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \
16726 + extern void _verify_func(__LINE__) (__typeof__ (expr2) *);
16727 +# define _verify_func(line) _verify_func2(line)
16728 +# define _verify_func2(line) verify_func_ ## line
16730 +# define verify_same_types(expr1,expr2) extern void verify_func (int)
16733 +/* 7.18.1.1. Exact-width integer types */
16734 +/* 7.18.2.1. Limits of exact-width integer types */
16736 +int8_t a1[3] = { INT8_C (17), INT8_MIN, INT8_MAX };
16737 +verify (TYPE_MINIMUM (int8_t) == INT8_MIN);
16738 +verify (TYPE_MAXIMUM (int8_t) == INT8_MAX);
16739 +verify_same_types (INT8_MIN, (int8_t) 0 + 0);
16740 +verify_same_types (INT8_MAX, (int8_t) 0 + 0);
16742 +int16_t a2[3] = { INT16_C (17), INT16_MIN, INT16_MAX };
16743 +verify (TYPE_MINIMUM (int16_t) == INT16_MIN);
16744 +verify (TYPE_MAXIMUM (int16_t) == INT16_MAX);
16745 +verify_same_types (INT16_MIN, (int16_t) 0 + 0);
16746 +verify_same_types (INT16_MAX, (int16_t) 0 + 0);
16748 +int32_t a3[3] = { INT32_C (17), INT32_MIN, INT32_MAX };
16749 +verify (TYPE_MINIMUM (int32_t) == INT32_MIN);
16750 +verify (TYPE_MAXIMUM (int32_t) == INT32_MAX);
16751 +verify_same_types (INT32_MIN, (int32_t) 0 + 0);
16752 +verify_same_types (INT32_MAX, (int32_t) 0 + 0);
16755 +int64_t a4[3] = { INT64_C (17), INT64_MIN, INT64_MAX };
16756 +verify (TYPE_MINIMUM (int64_t) == INT64_MIN);
16757 +verify (TYPE_MAXIMUM (int64_t) == INT64_MAX);
16758 +verify_same_types (INT64_MIN, (int64_t) 0 + 0);
16759 +verify_same_types (INT64_MAX, (int64_t) 0 + 0);
16762 +uint8_t b1[2] = { UINT8_C (17), UINT8_MAX };
16763 +verify (TYPE_MAXIMUM (uint8_t) == UINT8_MAX);
16764 +verify_same_types (UINT8_MAX, (uint8_t) 0 + 0);
16766 +uint16_t b2[2] = { UINT16_C (17), UINT16_MAX };
16767 +verify (TYPE_MAXIMUM (uint16_t) == UINT16_MAX);
16768 +verify_same_types (UINT16_MAX, (uint16_t) 0 + 0);
16770 +uint32_t b3[2] = { UINT32_C (17), UINT32_MAX };
16771 +verify (TYPE_MAXIMUM (uint32_t) == UINT32_MAX);
16772 +verify_same_types (UINT32_MAX, (uint32_t) 0 + 0);
16775 +uint64_t b4[2] = { UINT64_C (17), UINT64_MAX };
16776 +verify (TYPE_MAXIMUM (uint64_t) == UINT64_MAX);
16777 +verify_same_types (UINT64_MAX, (uint64_t) 0 + 0);
16780 +#if INT8_MIN && INT8_MAX && INT16_MIN && INT16_MAX && INT32_MIN && INT32_MAX
16786 +#if UINT8_MAX && UINT16_MAX && UINT32_MAX
16792 +/* 7.18.1.2. Minimum-width integer types */
16793 +/* 7.18.2.2. Limits of minimum-width integer types */
16795 +int_least8_t c1[3] = { 17, INT_LEAST8_MIN, INT_LEAST8_MAX };
16796 +verify (TYPE_MINIMUM (int_least8_t) == INT_LEAST8_MIN);
16797 +verify (TYPE_MAXIMUM (int_least8_t) == INT_LEAST8_MAX);
16798 +verify_same_types (INT_LEAST8_MIN, (int_least8_t) 0 + 0);
16799 +verify_same_types (INT_LEAST8_MAX, (int_least8_t) 0 + 0);
16801 +int_least16_t c2[3] = { 17, INT_LEAST16_MIN, INT_LEAST16_MAX };
16802 +verify (TYPE_MINIMUM (int_least16_t) == INT_LEAST16_MIN);
16803 +verify (TYPE_MAXIMUM (int_least16_t) == INT_LEAST16_MAX);
16804 +verify_same_types (INT_LEAST16_MIN, (int_least16_t) 0 + 0);
16805 +verify_same_types (INT_LEAST16_MAX, (int_least16_t) 0 + 0);
16807 +int_least32_t c3[3] = { 17, INT_LEAST32_MIN, INT_LEAST32_MAX };
16808 +verify (TYPE_MINIMUM (int_least32_t) == INT_LEAST32_MIN);
16809 +verify (TYPE_MAXIMUM (int_least32_t) == INT_LEAST32_MAX);
16810 +verify_same_types (INT_LEAST32_MIN, (int_least32_t) 0 + 0);
16811 +verify_same_types (INT_LEAST32_MAX, (int_least32_t) 0 + 0);
16813 +#ifdef INT_LEAST64_MAX
16814 +int_least64_t c4[3] = { 17, INT_LEAST64_MIN, INT_LEAST64_MAX };
16815 +verify (TYPE_MINIMUM (int_least64_t) == INT_LEAST64_MIN);
16816 +verify (TYPE_MAXIMUM (int_least64_t) == INT_LEAST64_MAX);
16817 +verify_same_types (INT_LEAST64_MIN, (int_least64_t) 0 + 0);
16818 +verify_same_types (INT_LEAST64_MAX, (int_least64_t) 0 + 0);
16821 +uint_least8_t d1[2] = { 17, UINT_LEAST8_MAX };
16822 +verify (TYPE_MAXIMUM (uint_least8_t) == UINT_LEAST8_MAX);
16823 +verify_same_types (UINT_LEAST8_MAX, (uint_least8_t) 0 + 0);
16825 +uint_least16_t d2[2] = { 17, UINT_LEAST16_MAX };
16826 +verify (TYPE_MAXIMUM (uint_least16_t) == UINT_LEAST16_MAX);
16827 +verify_same_types (UINT_LEAST16_MAX, (uint_least16_t) 0 + 0);
16829 +uint_least32_t d3[2] = { 17, UINT_LEAST32_MAX };
16830 +verify (TYPE_MAXIMUM (uint_least32_t) == UINT_LEAST32_MAX);
16831 +verify_same_types (UINT_LEAST32_MAX, (uint_least32_t) 0 + 0);
16833 +#ifdef UINT_LEAST64_MAX
16834 +uint_least64_t d4[2] = { 17, UINT_LEAST64_MAX };
16835 +verify (TYPE_MAXIMUM (uint_least64_t) == UINT_LEAST64_MAX);
16836 +verify_same_types (UINT_LEAST64_MAX, (uint_least64_t) 0 + 0);
16839 +#if INT_LEAST8_MIN && INT_LEAST8_MAX && INT_LEAST16_MIN && INT_LEAST16_MAX && INT_LEAST32_MIN && INT_LEAST32_MAX
16845 +#if UINT_LEAST8_MAX && UINT_LEAST16_MAX && UINT_LEAST32_MAX
16851 +/* 7.18.1.3. Fastest minimum-width integer types */
16852 +/* 7.18.2.3. Limits of fastest minimum-width integer types */
16854 +int_fast8_t e1[3] = { 17, INT_FAST8_MIN, INT_FAST8_MAX };
16855 +verify (TYPE_MINIMUM (int_fast8_t) == INT_FAST8_MIN);
16856 +verify (TYPE_MAXIMUM (int_fast8_t) == INT_FAST8_MAX);
16857 +verify_same_types (INT_FAST8_MIN, (int_fast8_t) 0 + 0);
16858 +verify_same_types (INT_FAST8_MAX, (int_fast8_t) 0 + 0);
16860 +int_fast16_t e2[3] = { 17, INT_FAST16_MIN, INT_FAST16_MAX };
16861 +verify (TYPE_MINIMUM (int_fast16_t) == INT_FAST16_MIN);
16862 +verify (TYPE_MAXIMUM (int_fast16_t) == INT_FAST16_MAX);
16863 +verify_same_types (INT_FAST16_MIN, (int_fast16_t) 0 + 0);
16864 +verify_same_types (INT_FAST16_MAX, (int_fast16_t) 0 + 0);
16866 +int_fast32_t e3[3] = { 17, INT_FAST32_MIN, INT_FAST32_MAX };
16867 +verify (TYPE_MINIMUM (int_fast32_t) == INT_FAST32_MIN);
16868 +verify (TYPE_MAXIMUM (int_fast32_t) == INT_FAST32_MAX);
16869 +verify_same_types (INT_FAST32_MIN, (int_fast32_t) 0 + 0);
16870 +verify_same_types (INT_FAST32_MAX, (int_fast32_t) 0 + 0);
16872 +#ifdef INT_FAST64_MAX
16873 +int_fast64_t e4[3] = { 17, INT_FAST64_MIN, INT_FAST64_MAX };
16874 +verify (TYPE_MINIMUM (int_fast64_t) == INT_FAST64_MIN);
16875 +verify (TYPE_MAXIMUM (int_fast64_t) == INT_FAST64_MAX);
16876 +verify_same_types (INT_FAST64_MIN, (int_fast64_t) 0 + 0);
16877 +verify_same_types (INT_FAST64_MAX, (int_fast64_t) 0 + 0);
16880 +uint_fast8_t f1[2] = { 17, UINT_FAST8_MAX };
16881 +verify (TYPE_MAXIMUM (uint_fast8_t) == UINT_FAST8_MAX);
16882 +verify_same_types (UINT_FAST8_MAX, (uint_fast8_t) 0 + 0);
16884 +uint_fast16_t f2[2] = { 17, UINT_FAST16_MAX };
16885 +verify (TYPE_MAXIMUM (uint_fast16_t) == UINT_FAST16_MAX);
16886 +verify_same_types (UINT_FAST16_MAX, (uint_fast16_t) 0 + 0);
16888 +uint_fast32_t f3[2] = { 17, UINT_FAST32_MAX };
16889 +verify (TYPE_MAXIMUM (uint_fast32_t) == UINT_FAST32_MAX);
16890 +verify_same_types (UINT_FAST32_MAX, (uint_fast32_t) 0 + 0);
16892 +#ifdef UINT_FAST64_MAX
16893 +uint_fast64_t f4[2] = { 17, UINT_FAST64_MAX };
16894 +verify (TYPE_MAXIMUM (uint_fast64_t) == UINT_FAST64_MAX);
16895 +verify_same_types (UINT_FAST64_MAX, (uint_fast64_t) 0 + 0);
16898 +#if INT_FAST8_MIN && INT_FAST8_MAX && INT_FAST16_MIN && INT_FAST16_MAX && INT_FAST32_MIN && INT_FAST32_MAX
16904 +#if UINT_FAST8_MAX && UINT_FAST16_MAX && UINT_FAST32_MAX
16910 +/* 7.18.1.4. Integer types capable of holding object pointers */
16911 +/* 7.18.2.4. Limits of integer types capable of holding object pointers */
16913 +intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX };
16914 +verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN);
16915 +verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX);
16916 +verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0);
16917 +verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0);
16919 +uintptr_t h[2] = { 17, UINTPTR_MAX };
16920 +verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX);
16921 +verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0);
16923 +#if INTPTR_MIN && INTPTR_MAX && UINTPTR_MAX
16929 +/* 7.18.1.5. Greatest-width integer types */
16930 +/* 7.18.2.5. Limits of greatest-width integer types */
16932 +intmax_t i[3] = { INTMAX_C (17), INTMAX_MIN, INTMAX_MAX };
16933 +verify (TYPE_MINIMUM (intmax_t) == INTMAX_MIN);
16934 +verify (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX);
16935 +verify_same_types (INTMAX_MIN, (intmax_t) 0 + 0);
16936 +verify_same_types (INTMAX_MAX, (intmax_t) 0 + 0);
16938 +uintmax_t j[2] = { UINTMAX_C (17), UINTMAX_MAX };
16939 +verify (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX);
16940 +verify_same_types (UINTMAX_MAX, (uintmax_t) 0 + 0);
16942 +/* As of 2007, Sun C and HP-UX 10.20 cc don't support 'long long' constants in
16943 + the preprocessor. */
16944 +#if !(defined __SUNPRO_C || (defined __hpux && !defined __GNUC__))
16945 +#if INTMAX_MIN && INTMAX_MAX && UINTMAX_MAX
16952 +/* 7.18.3. Limits of other integer types */
16954 +#include <stddef.h>
16956 +verify (TYPE_MINIMUM (ptrdiff_t) == PTRDIFF_MIN);
16957 +verify (TYPE_MAXIMUM (ptrdiff_t) == PTRDIFF_MAX);
16958 +verify_same_types (PTRDIFF_MIN, (ptrdiff_t) 0 + 0);
16959 +verify_same_types (PTRDIFF_MAX, (ptrdiff_t) 0 + 0);
16961 +#if PTRDIFF_MIN && PTRDIFF_MAX
16967 +#include <signal.h>
16969 +verify (TYPE_MINIMUM (sig_atomic_t) == SIG_ATOMIC_MIN);
16970 +verify (TYPE_MAXIMUM (sig_atomic_t) == SIG_ATOMIC_MAX);
16971 +verify_same_types (SIG_ATOMIC_MIN, (sig_atomic_t) 0 + 0);
16972 +verify_same_types (SIG_ATOMIC_MAX, (sig_atomic_t) 0 + 0);
16974 +#if SIG_ATOMIC_MIN != 17 && SIG_ATOMIC_MAX
16980 +verify (TYPE_MAXIMUM (size_t) == SIZE_MAX);
16981 +verify_same_types (SIZE_MAX, (size_t) 0 + 0);
16990 +verify (TYPE_MINIMUM (wchar_t) == WCHAR_MIN);
16991 +verify (TYPE_MAXIMUM (wchar_t) == WCHAR_MAX);
16992 +verify_same_types (WCHAR_MIN, (wchar_t) 0 + 0);
16993 +verify_same_types (WCHAR_MAX, (wchar_t) 0 + 0);
16995 +# if WCHAR_MIN != 17 && WCHAR_MAX
17003 +# include <wchar.h>
17005 +verify (TYPE_MINIMUM (wint_t) == WINT_MIN);
17006 +verify (TYPE_MAXIMUM (wint_t) == WINT_MAX);
17007 +verify_same_types (WINT_MIN, (wint_t) 0 + 0);
17008 +verify_same_types (WINT_MAX, (wint_t) 0 + 0);
17010 +# if WINT_MIN != 17 && WINT_MAX
17017 +/* 7.18.4. Macros for integer constants */
17019 +verify (INT8_C (17) == 17);
17020 +verify_same_types (INT8_C (17), (int_least8_t)0 + 0);
17021 +verify (UINT8_C (17) == 17);
17022 +verify_same_types (UINT8_C (17), (uint_least8_t)0 + 0);
17024 +verify (INT16_C (17) == 17);
17025 +verify_same_types (INT16_C (17), (int_least16_t)0 + 0);
17026 +verify (UINT16_C (17) == 17);
17027 +verify_same_types (UINT16_C (17), (uint_least16_t)0 + 0);
17029 +verify (INT32_C (17) == 17);
17030 +verify_same_types (INT32_C (17), (int_least32_t)0 + 0);
17031 +verify (UINT32_C (17) == 17);
17032 +verify_same_types (UINT32_C (17), (uint_least32_t)0 + 0);
17035 +verify (INT64_C (17) == 17);
17036 +verify_same_types (INT64_C (17), (int_least64_t)0 + 0);
17039 +verify (UINT64_C (17) == 17);
17040 +verify_same_types (UINT64_C (17), (uint_least64_t)0 + 0);
17043 +verify (INTMAX_C (17) == 17);
17044 +verify_same_types (INTMAX_C (17), (intmax_t)0 + 0);
17045 +verify (UINTMAX_C (17) == 17);
17046 +verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
17054 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-stdio.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdio.c
17055 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-stdio.c 1970-01-01 01:00:00.000000000 +0100
17056 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-stdio.c 2008-10-09 12:24:39.000000000 +0100
17058 +/* Test of <stdio.h> substitute.
17059 + Copyright (C) 2007 Free Software Foundation, Inc.
17061 + This program is free software: you can redistribute it and/or modify
17062 + it under the terms of the GNU General Public License as published by
17063 + the Free Software Foundation; either version 3 of the License, or
17064 + (at your option) any later version.
17066 + This program is distributed in the hope that it will be useful,
17067 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17068 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17069 + GNU General Public License for more details.
17071 + You should have received a copy of the GNU General Public License
17072 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17074 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17076 +#include <config.h>
17078 +#include <stdio.h>
17080 +/* Check that the various SEEK_* macros are defined. */
17081 +int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
17088 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-sys_socket.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-sys_socket.c
17089 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-sys_socket.c 1970-01-01 01:00:00.000000000 +0100
17090 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-sys_socket.c 2008-10-09 12:24:39.000000000 +0100
17092 +/* Test of <sys/socket.h> substitute.
17093 + Copyright (C) 2007 Free Software Foundation, Inc.
17095 + This program is free software: you can redistribute it and/or modify
17096 + it under the terms of the GNU General Public License as published by
17097 + the Free Software Foundation; either version 3 of the License, or
17098 + (at your option) any later version.
17100 + This program is distributed in the hope that it will be useful,
17101 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17102 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17103 + GNU General Public License for more details.
17105 + You should have received a copy of the GNU General Public License
17106 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17108 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17110 +#include <config.h>
17112 +#include <sys/socket.h>
17114 +#include <errno.h>
17117 +/* Check some integer constant expressions. */
17118 +int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
17124 + /* Check some errno values. */
17130 + case ECONNABORTED:
17139 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-vasnprintf.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vasnprintf.c
17140 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-vasnprintf.c 1970-01-01 01:00:00.000000000 +0100
17141 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vasnprintf.c 2008-10-09 12:24:39.000000000 +0100
17143 +/* Test of vasnprintf() and asnprintf() functions.
17144 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
17146 + This program is free software: you can redistribute it and/or modify
17147 + it under the terms of the GNU General Public License as published by
17148 + the Free Software Foundation; either version 3 of the License, or
17149 + (at your option) any later version.
17151 + This program is distributed in the hope that it will be useful,
17152 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17153 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17154 + GNU General Public License for more details.
17156 + You should have received a copy of the GNU General Public License
17157 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17159 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17161 +#include <config.h>
17163 +#include "vasnprintf.h"
17165 +#include <stdarg.h>
17166 +#include <stdio.h>
17167 +#include <stdlib.h>
17168 +#include <string.h>
17170 +#define ASSERT(expr) \
17175 + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
17176 + fflush (stderr); \
17183 +my_asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
17188 + va_start (args, format);
17189 + ret = vasnprintf (resultbuf, lengthp, format, args);
17195 +test_vasnprintf ()
17200 + for (size = 0; size <= 8; size++)
17202 + size_t length = size;
17203 + char *result = my_asnprintf (NULL, &length, "%d", 12345);
17204 + ASSERT (result != NULL);
17205 + ASSERT (strcmp (result, "12345") == 0);
17206 + ASSERT (length == 5);
17210 + for (size = 0; size <= 8; size++)
17215 + memcpy (buf, "DEADBEEF", 8);
17217 + result = my_asnprintf (buf, &length, "%d", 12345);
17218 + ASSERT (result != NULL);
17219 + ASSERT (strcmp (result, "12345") == 0);
17220 + ASSERT (length == 5);
17222 + ASSERT (result != buf);
17223 + ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
17224 + if (result != buf)
17235 + for (size = 0; size <= 8; size++)
17237 + size_t length = size;
17238 + char *result = asnprintf (NULL, &length, "%d", 12345);
17239 + ASSERT (result != NULL);
17240 + ASSERT (strcmp (result, "12345") == 0);
17241 + ASSERT (length == 5);
17245 + for (size = 0; size <= 8; size++)
17250 + memcpy (buf, "DEADBEEF", 8);
17252 + result = asnprintf (buf, &length, "%d", 12345);
17253 + ASSERT (result != NULL);
17254 + ASSERT (strcmp (result, "12345") == 0);
17255 + ASSERT (length == 5);
17257 + ASSERT (result != buf);
17258 + ASSERT (memcmp (buf + size, "DEADBEEF" + size, 8 - size) == 0);
17259 + if (result != buf)
17265 +main (int argc, char *argv[])
17267 + test_vasnprintf ();
17268 + test_asnprintf ();
17271 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-vc-list-files-cvs.sh gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vc-list-files-cvs.sh
17272 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-vc-list-files-cvs.sh 1970-01-01 01:00:00.000000000 +0100
17273 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vc-list-files-cvs.sh 2008-10-09 12:24:39.000000000 +0100
17276 +# Unit tests for vc-list-files
17277 +# Copyright (C) 2008 Free Software Foundation, Inc.
17278 +# This file is part of the GNUlib Library.
17280 +# This program is free software: you can redistribute it and/or modify
17281 +# it under the terms of the GNU General Public License as published by
17282 +# the Free Software Foundation; either version 3 of the License, or
17283 +# (at your option) any later version.
17285 +# This program is distributed in the hope that it will be useful,
17286 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
17287 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17288 +# GNU General Public License for more details.
17290 +# You should have received a copy of the GNU General Public License
17291 +# along with this program. If not, see <http://www.gnu.org/licenses/>. */
17294 +trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
17295 +trap '(exit $?); exit $?' 1 2 13 15
17297 +if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
17298 + compare() { diff -u "$@"; }
17299 +elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
17300 + compare() { cmp -s "$@"; }
17302 + compare() { cmp "$@"; }
17305 +repo=`pwd`/$tmpdir/repo
17308 +for i in with-cvsu without; do
17309 + # On the first iteration, test using cvsu, if it's in your path.
17310 + # On the second iteration, ensure that cvsu fails, so we'll
17311 + # exercise the awk-using code.
17312 + if test $i = without; then
17313 + printf '%s\n' '#!/bin/sh' 'exit 1' > cvsu
17319 + mkdir $tmpdir && cd $tmpdir &&
17320 + # without cvs, skip the test
17321 + # The double use of 'exit' is needed for the reference to $? inside the trap.
17322 + { ( cvs -Q -d "$repo" init ) > /dev/null 2>&1 \
17323 + || { echo "Skipping test: cvs not found in PATH"; (exit 77); exit 77; }; } &&
17324 + mkdir w && cd w &&
17327 + cvs -Q -d "$repo" import -m imp m M M0 &&
17328 + cvs -Q -d "$repo" co m && cd m &&
17329 + printf '%s\n' b c d/a > expected &&
17330 + vc-list-files | sort > actual &&
17331 + compare expected actual &&
17333 + test $ok = 0 && fail=1
17336 +(exit $fail); exit $fail
17337 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-vc-list-files-git.sh gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vc-list-files-git.sh
17338 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-vc-list-files-git.sh 1970-01-01 01:00:00.000000000 +0100
17339 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-vc-list-files-git.sh 2008-10-09 12:24:39.000000000 +0100
17342 +# Unit tests for vc-list-files
17343 +# Copyright (C) 2008 Free Software Foundation, Inc.
17344 +# This file is part of the GNUlib Library.
17346 +# This program is free software: you can redistribute it and/or modify
17347 +# it under the terms of the GNU General Public License as published by
17348 +# the Free Software Foundation; either version 3 of the License, or
17349 +# (at your option) any later version.
17351 +# This program is distributed in the hope that it will be useful,
17352 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
17353 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17354 +# GNU General Public License for more details.
17356 +# You should have received a copy of the GNU General Public License
17357 +# along with this program. If not, see <http://www.gnu.org/licenses/>. */
17359 +if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
17360 + compare() { diff -u "$@"; }
17361 +elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then
17362 + compare() { cmp -s "$@"; }
17364 + compare() { cmp "$@"; }
17368 +trap 'st=$?; cd '"`pwd`"' && rm -rf $tmpdir; exit $st' 0
17369 +trap '(exit $?); exit $?' 1 2 13 15
17372 +mkdir $tmpdir && cd $tmpdir &&
17373 + # without git, skip the test
17374 + # The double use of 'exit' is needed for the reference to $? inside the trap.
17375 + { ( git init -q ) > /dev/null 2>&1 \
17376 + || { echo "Skipping test: git not found in PATH"; (exit 77); exit 77; }; } &&
17379 + git add . > /dev/null &&
17380 + git commit -q -a -m log &&
17381 + printf '%s\n' b c d/a > expected &&
17382 + vc-list-files > actual &&
17383 + compare expected actual &&
17386 +(exit $fail); exit $fail
17387 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/test-wchar.c gtk-vnc-0.3.7.gnulib/gnulib/tests/test-wchar.c
17388 --- gtk-vnc-0.3.7.mingw/gnulib/tests/test-wchar.c 1970-01-01 01:00:00.000000000 +0100
17389 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/test-wchar.c 2008-10-09 12:24:39.000000000 +0100
17391 +/* Test of <wchar.h> substitute.
17392 + Copyright (C) 2007-2008 Free Software Foundation, Inc.
17394 + This program is free software: you can redistribute it and/or modify
17395 + it under the terms of the GNU General Public License as published by
17396 + the Free Software Foundation; either version 3 of the License, or
17397 + (at your option) any later version.
17399 + This program is distributed in the hope that it will be useful,
17400 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17401 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17402 + GNU General Public License for more details.
17404 + You should have received a copy of the GNU General Public License
17405 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17407 +/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
17409 +#include <config.h>
17411 +#include <wchar.h>
17413 +/* Check that the types wchar_t and wint_t are defined. */
17422 diff -urN gtk-vnc-0.3.7.mingw/gnulib/tests/verify.h gtk-vnc-0.3.7.gnulib/gnulib/tests/verify.h
17423 --- gtk-vnc-0.3.7.mingw/gnulib/tests/verify.h 1970-01-01 01:00:00.000000000 +0100
17424 +++ gtk-vnc-0.3.7.gnulib/gnulib/tests/verify.h 2008-10-09 12:24:39.000000000 +0100
17426 +/* Compile-time assert-like macros.
17428 + Copyright (C) 2005, 2006 Free Software Foundation, Inc.
17430 + This program is free software: you can redistribute it and/or modify
17431 + it under the terms of the GNU General Public License as published by
17432 + the Free Software Foundation; either version 3 of the License, or
17433 + (at your option) any later version.
17435 + This program is distributed in the hope that it will be useful,
17436 + but WITHOUT ANY WARRANTY; without even the implied warranty of
17437 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17438 + GNU General Public License for more details.
17440 + You should have received a copy of the GNU General Public License
17441 + along with this program. If not, see <http://www.gnu.org/licenses/>. */
17443 +/* Written by Paul Eggert, Bruno Haible, and Jim Meyering. */
17446 +# define VERIFY_H 1
17448 +/* Each of these macros verifies that its argument R is nonzero. To
17449 + be portable, R should be an integer constant expression. Unlike
17450 + assert (R), there is no run-time overhead.
17452 + There are two macros, since no single macro can be used in all
17453 + contexts in C. verify_true (R) is for scalar contexts, including
17454 + integer constant expression contexts. verify (R) is for declaration
17455 + contexts, e.g., the top level.
17457 + Symbols ending in "__" are private to this header.
17459 + The code below uses several ideas.
17461 + * The first step is ((R) ? 1 : -1). Given an expression R, of
17462 + integral or boolean or floating-point type, this yields an
17463 + expression of integral type, whose value is later verified to be
17464 + constant and nonnegative.
17466 + * Next this expression W is wrapped in a type
17467 + struct verify_type__ { unsigned int verify_error_if_negative_size__: W; }.
17468 + If W is negative, this yields a compile-time error. No compiler can
17469 + deal with a bit-field of negative size.
17471 + One might think that an array size check would have the same
17472 + effect, that is, that the type struct { unsigned int dummy[W]; }
17473 + would work as well. However, inside a function, some compilers
17474 + (such as C++ compilers and GNU C) allow local parameters and
17475 + variables inside array size expressions. With these compilers,
17476 + an array size check would not properly diagnose this misuse of
17477 + the verify macro:
17479 + void function (int n) { verify (n < 0); }
17481 + * For the verify macro, the struct verify_type__ will need to
17482 + somehow be embedded into a declaration. To be portable, this
17483 + declaration must declare an object, a constant, a function, or a
17484 + typedef name. If the declared entity uses the type directly,
17487 + struct dummy {...};
17488 + typedef struct {...} dummy;
17489 + extern struct {...} *dummy;
17490 + extern void dummy (struct {...} *);
17491 + extern struct {...} *dummy (void);
17493 + two uses of the verify macro would yield colliding declarations
17494 + if the entity names are not disambiguated. A workaround is to
17495 + attach the current line number to the entity name:
17497 + #define GL_CONCAT0(x, y) x##y
17498 + #define GL_CONCAT(x, y) GL_CONCAT0 (x, y)
17499 + extern struct {...} * GL_CONCAT(dummy,__LINE__);
17501 + But this has the problem that two invocations of verify from
17502 + within the same macro would collide, since the __LINE__ value
17503 + would be the same for both invocations.
17505 + A solution is to use the sizeof operator. It yields a number,
17506 + getting rid of the identity of the type. Declarations like
17508 + extern int dummy [sizeof (struct {...})];
17509 + extern void dummy (int [sizeof (struct {...})]);
17510 + extern int (*dummy (void)) [sizeof (struct {...})];
17514 + * Should the implementation use a named struct or an unnamed struct?
17515 + Which of the following alternatives can be used?
17517 + extern int dummy [sizeof (struct {...})];
17518 + extern int dummy [sizeof (struct verify_type__ {...})];
17519 + extern void dummy (int [sizeof (struct {...})]);
17520 + extern void dummy (int [sizeof (struct verify_type__ {...})]);
17521 + extern int (*dummy (void)) [sizeof (struct {...})];
17522 + extern int (*dummy (void)) [sizeof (struct verify_type__ {...})];
17524 + In the second and sixth case, the struct type is exported to the
17525 + outer scope; two such declarations therefore collide. GCC warns
17526 + about the first, third, and fourth cases. So the only remaining
17527 + possibility is the fifth case:
17529 + extern int (*dummy (void)) [sizeof (struct {...})];
17531 + * This implementation exploits the fact that GCC does not warn about
17532 + the last declaration mentioned above. If a future version of GCC
17533 + introduces a warning for this, the problem could be worked around
17534 + by using code specialized to GCC, e.g.,:
17536 + #if 4 <= __GNUC__
17537 + # define verify(R) \
17538 + extern int (* verify_function__ (void)) \
17539 + [__builtin_constant_p (R) && (R) ? 1 : -1]
17542 + * In C++, any struct definition inside sizeof is invalid.
17543 + Use a template type to work around the problem. */
17546 +/* Verify requirement R at compile-time, as an integer constant expression.
17549 +# ifdef __cplusplus
17551 + struct verify_type__ { unsigned int verify_error_if_negative_size__: w; };
17552 +# define verify_true(R) \
17553 + (!!sizeof (verify_type__<(R) ? 1 : -1>))
17555 +# define verify_true(R) \
17557 + (struct { unsigned int verify_error_if_negative_size__: (R) ? 1 : -1; }))
17560 +/* Verify requirement R at compile-time, as a declaration without a
17563 +# define verify(R) extern int (* verify_function__ (void)) [verify_true (R)]
17566 diff -urN gtk-vnc-0.3.7.mingw/link-warning.h gtk-vnc-0.3.7.gnulib/link-warning.h
17567 --- gtk-vnc-0.3.7.mingw/link-warning.h 1970-01-01 01:00:00.000000000 +0100
17568 +++ gtk-vnc-0.3.7.gnulib/link-warning.h 2008-10-09 12:24:39.000000000 +0100
17570 +/* GL_LINK_WARNING("literal string") arranges to emit the literal string as
17571 + a linker warning on most glibc systems.
17572 + We use a linker warning rather than a preprocessor warning, because
17573 + #warning cannot be used inside macros. */
17574 +#ifndef GL_LINK_WARNING
17575 + /* This works on platforms with GNU ld and ELF object format.
17576 + Testing __GLIBC__ is sufficient for asserting that GNU ld is in use.
17577 + Testing __ELF__ guarantees the ELF object format.
17578 + Testing __GNUC__ is necessary for the compound expression syntax. */
17579 +# if defined __GLIBC__ && defined __ELF__ && defined __GNUC__
17580 +# define GL_LINK_WARNING(message) \
17581 + GL_LINK_WARNING1 (__FILE__, __LINE__, message)
17582 +# define GL_LINK_WARNING1(file, line, message) \
17583 + GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */
17584 +# define GL_LINK_WARNING2(file, line, message) \
17585 + GL_LINK_WARNING3 (file ":" #line ": warning: " message)
17586 +# define GL_LINK_WARNING3(message) \
17587 + ({ static const char warning[sizeof (message)] \
17588 + __attribute__ ((__unused__, \
17589 + __section__ (".gnu.warning"), \
17590 + __aligned__ (1))) \
17591 + = message "\n"; \
17595 +# define GL_LINK_WARNING(message) ((void) 0)