+2003-08-24 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.am (config.h.msvc): Define HAVE__SNPRINTF, HAVE__SNWPRINTF.
+
+2003-08-24 Bruno Haible <bruno@clisp.org>
+
+ * configure.ac: Define DLL_VARIABLE in config.h through AH_BOTTOM.
+
2003-08-23 Bruno Haible <bruno@clisp.org>
* Makefile.am (config.h_vms): Define HAVE_READLINK and HAVE_WCSLEN.
-e 's/#undef HAVE_WCSLEN$$/#define HAVE_WCSLEN 1/' \
-e 's/#undef HAVE_WINT_T$$/#define HAVE_WINT_T 1/' \
-e 's/#undef HAVE_WPRINTF$$/#define HAVE_WPRINTF 1/' \
+ -e 's/#undef HAVE__SNPRINTF$$/#define HAVE__SNPRINTF 1/' \
+ -e 's/#undef HAVE__SNWPRINTF$$/#define HAVE__SNWPRINTF 1/' \
-e 's/#undef ICONV_CONST$$/#define ICONV_CONST const/' \
-e 's/#undef STACK_DIRECTION$$/#define STACK_DIRECTION -1/' \
-e 's/#undef STDC_HEADERS$$/#define STDC_HEADERS 1/' \
+2003-08-24 Bruno Haible <bruno@clisp.org>
+
+ * vasnprintf.c (local_wcslen): Protect against multiple definition.
+ (USE_SNPRINTF): Define also if only _snprintf() is available.
+ (SNPRINTF): Possibly define as _snprintf or _snwprintf.
+
2003-08-24 Bruno Haible <bruno@clisp.org>
* libgnuintl.h.in: Use <stdarg.h> when compiling with MSVC, even though
# define local_wcslen wcslen
# else
/* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
- a dependency towards this library, here is a local substitute. */
+ a dependency towards this library, here is a local substitute.
+ Define this substitute only once, even if this file is included
+ twice in the same compilation unit. */
+# ifndef local_wcslen_defined
+# define local_wcslen_defined 1
static size_t
local_wcslen (const wchar_t *s)
{
;
return ptr - s;
}
+# endif
# endif
#endif
# define DIRECTIVES wchar_t_directives
# define PRINTF_PARSE wprintf_parse
# define USE_SNPRINTF 1
-# define SNPRINTF swprintf
+# if HAVE__SNWPRINTF
+ /* On Windows, the function swprintf() has a different signature than
+ on Unix; we use the _snwprintf() function instead. */
+# define SNPRINTF _snwprintf
+# else
+ /* Unix. */
+# define SNPRINTF swprintf
+# endif
#else
# define VASNPRINTF vasnprintf
# define CHAR_T char
# define DIRECTIVE char_directive
# define DIRECTIVES char_directives
# define PRINTF_PARSE printf_parse
-# define USE_SNPRINTF HAVE_SNPRINTF
-# define SNPRINTF snprintf
+# define USE_SNPRINTF (HAVE__SNPRINTF || HAVE_SNPRINTF)
+# if HAVE__SNPRINTF
+ /* Windows. */
+# define SNPRINTF _snprintf
+# else
+ /* Unix. */
+# define SNPRINTF snprintf
+# endif
#endif
CHAR_T *
+2003-08-24 Bruno Haible <bruno@clisp.org>
+
+ * vasnprintf.c (local_wcslen): Protect against multiple definition.
+ (USE_SNPRINTF): Define also if only _snprintf() is available.
+ (SNPRINTF): Possibly define as _snprintf or _snwprintf.
+ * configure.ac: Also check for _snprintf.
+
2003-08-11 Bruno Haible <bruno@clisp.org>
* vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
ALLOCA_H=)
AC_SUBST([ALLOCA_H])
-AC_CHECK_FUNCS([snprintf vasprintf wcslen])
+AC_CHECK_FUNCS([snprintf vasprintf wcslen _snprintf])
gt_PRINTF_POSIX
dnl Check for tools needed for formatting the documentation.
# define local_wcslen wcslen
# else
/* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
- a dependency towards this library, here is a local substitute. */
+ a dependency towards this library, here is a local substitute.
+ Define this substitute only once, even if this file is included
+ twice in the same compilation unit. */
+# ifndef local_wcslen_defined
+# define local_wcslen_defined 1
static size_t
local_wcslen (const wchar_t *s)
{
;
return ptr - s;
}
+# endif
# endif
#endif
# define DIRECTIVES wchar_t_directives
# define PRINTF_PARSE wprintf_parse
# define USE_SNPRINTF 1
-# define SNPRINTF swprintf
+# if HAVE__SNWPRINTF
+ /* On Windows, the function swprintf() has a different signature than
+ on Unix; we use the _snwprintf() function instead. */
+# define SNPRINTF _snwprintf
+# else
+ /* Unix. */
+# define SNPRINTF swprintf
+# endif
#else
# define VASNPRINTF vasnprintf
# define CHAR_T char
# define DIRECTIVE char_directive
# define DIRECTIVES char_directives
# define PRINTF_PARSE printf_parse
-# define USE_SNPRINTF HAVE_SNPRINTF
-# define SNPRINTF snprintf
+# define USE_SNPRINTF (HAVE__SNPRINTF || HAVE_SNPRINTF)
+# if HAVE__SNPRINTF
+ /* Windows. */
+# define SNPRINTF _snprintf
+# else
+ /* Unix. */
+# define SNPRINTF snprintf
+# endif
#endif
CHAR_T *
+2003-08-24 Bruno Haible <bruno@clisp.org>
+
+ * gettext.m4 (AM_INTL_SUBDIR): Also check for _snprintf, _snwprintf.
+
2003-08-11 Bruno Haible <bruno@clisp.org>
* gettext.m4 (AM_INTL_SUBDIR): Also check for wcslen.
-# gettext.m4 serial 23 (gettext-0.12.2)
+# gettext.m4 serial 24 (gettext-0.12.2)
dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
stdlib.h string.h unistd.h sys/param.h])
AC_CHECK_FUNCS([asprintf getcwd getegid geteuid getgid getuid mempcpy \
munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup strtoul \
-tsearch wcslen wprintf __argz_count __argz_stringify __argz_next \
-__fsetlocking])
+tsearch wcslen wprintf _snprintf _snwprintf __argz_count __argz_stringify \
+__argz_next __fsetlocking])
dnl Use the *_unlocked functions only if they are declared.
dnl (because some of them were defined without being declared in Solaris
+2003-08-24 Bruno Haible <bruno@clisp.org>
+
+ * Makefile.am (config.h.msvc): Define HAVE__SNPRINTF, HAVE__SNWPRINTF.
+
+2003-08-24 Bruno Haible <bruno@clisp.org>
+
+ * configure.ac: Define DLL_VARIABLE in config.h through AH_BOTTOM.
+
2003-08-24 Bruno Haible <bruno@clisp.org>
* windows/gettextsrc.def: Add formatstring_gcc_internal,
-e 's/#undef HAVE_WCSLEN$$/#define HAVE_WCSLEN 1/' \
-e 's/#undef HAVE_WINT_T$$/#define HAVE_WINT_T 1/' \
-e 's/#undef HAVE_WPRINTF$$/#define HAVE_WPRINTF 1/' \
+ -e 's/#undef HAVE__SNPRINTF$$/#define HAVE__SNPRINTF 1/' \
+ -e 's/#undef HAVE__SNWPRINTF$$/#define HAVE__SNWPRINTF 1/' \
-e 's/#undef ICONV_CONST$$/#define ICONV_CONST const/' \
-e 's/#undef SETLOCALE_CONST$$/#define SETLOCALE_CONST const/' \
-e 's/#undef STACK_DIRECTION$$/#define STACK_DIRECTION -1/' \