Re: fix inadequate Windows implementation of tmpfile
Paul Eggert wrote: > I think gnulib is for porting GNU applications, and if GNU > applications assume glibc behavior for a function then it's OK to > replace a vendor's function that behaves differrently. OK. So I'm adding Ben's module, with the following modifications: * tmpfile.c: - Don't use _O_TEMPORARY on Windows 95/98/ME. - Provide an 'errno' in the case of the first 'goto done'. - Restructure the code so as to avoid 'goto'. - Allocate 'dir' and 'xtemplate' on the stack, since their size is bounded by PATH_MAX (<= 4096 or so). - Change range check to allow paths of length PATH_MAX - 1. * tmpfile.m4: - Change the configure message. (If the message says "for tmpfile that only uses the root directory", it should also test for this behaviour.) - Use AC_EGREP_CPP instead of AC_COMPILE_IFELSE, since it's faster. - Actually invoke gl_PREREQ_TMPFILE. * modules/tmpfile: - Don't mention "Windows" in the module description. The module description should be abstract enough that it doesn't need to change if problems appear on other platforms. - Mention as header file to be included. * MODULES.html.sh: Put new section about before , not between and . Please proofread again. Did I miss something? 2007-02-17 Ben Pfaff <[EMAIL PROTECTED]> Bruno Haible <[EMAIL PROTECTED]> * modules/tmpfile: New file. * lib/tmpfile.c: New file. * m4/tmpfile.m4: New file. * MODULES.html.sh (func_all_modules): New section "Input/output". modules/tmpfile = Description: tmpfile() function: create a temporary file. Files: lib/tmpfile.c m4/tmpfile.m4 Depends-on: pathmax tempname tmpdir configure.ac: gl_TMPFILE Makefile.am: Include: #include License: GPL Maintainer: Ben Pfaff = lib/tmpfile.c == /* Create a temporary file. Copyright (C) 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* Written by Ben Pfaff. */ #include /* Specification. */ #include /* This replacement is used only on native Windows platforms. */ #include #include #include #include #include #define WIN32_LEAN_AND_MEAN /* avoid including junk */ #include #include "pathmax.h" #include "tempname.h" #include "tmpdir.h" /* On Windows, opening a file with _O_TEMPORARY has the effect of passing the FILE_FLAG_DELETE_ON_CLOSE flag to CreateFile(), which has the effect of deleting the file when it is closed - even when the program crashes. But (according to the Cygwin sources) it works only on Windows NT or newer. So we cache the info whether we are running on Windows NT or newer. */ static bool supports_delete_on_close () { static int known; /* 1 = yes, -1 = no, 0 = unknown */ if (!known) { OSVERSIONINFO v; if (GetVersionEx (&v)) known = (v.dwPlatformId == VER_PLATFORM_WIN32_NT ? 1 : -1); else known = -1; } return (known > 0); } FILE * tmpfile (void) { char dir[PATH_MAX]; DWORD retval; /* Find Windows temporary file directory. We provide this as the directory argument to path_search because Windows defines P_tmpdir to "\\" and will therefore try to put all temporary files in the root directory (unless $TMPDIR is set). */ retval = GetTempPath (PATH_MAX, dir); if (retval > 0 && retval < PATH_MAX) { char xtemplate[PATH_MAX]; if (path_search (xtemplate, PATH_MAX, dir, NULL, true) >= 0) { size_t len = strlen (xtemplate); int o_temporary = (supports_delete_on_close () ? _O_TEMPORARY : 0); int fd; do { memcpy (&xtemplate[len - 6], "XX", 6); if (gen_tempname (xtemplate, GT_NOCREATE) < 0) { fd = -1; break; } fd = _open (xtemplate, _O_CREAT | _O_EXCL | o_temporary | _O_RDWR | _O_BINARY, _S_IREAD | _S_IWRITE); } while (fd < 0 && errno == EEXIST); if (fd >= 0) { FILE *fp = _fdopen (fd, "w+b"); if (fp != NULL)
Re: fix inadequate Windows implementation of tmpfile
Bruno Haible <[EMAIL PROTECTED]> writes: > Paul Eggert wrote: >> I think gnulib is for porting GNU applications, and if GNU >> applications assume glibc behavior for a function then it's OK to >> replace a vendor's function that behaves differrently. > > OK. So I'm adding Ben's module, with the following modifications: Thank you Bruno. The changes look good to me, and they test out correctly in PSPP. I have not yet signed papers for gnulib contributions. Should I? -- Ben Pfaff [EMAIL PROTECTED] http://benpfaff.org
string_.h: break lines
This introduces some line breaking in the source, for the GL_LINK_WARNING arguments. Functionally a nop. 2007-02-17 Bruno Haible <[EMAIL PROTECTED]> * lib/string_.h (memmem, mempcpy, memrchr, stpcpy, stpncpy, strcasecmp, strncasecmp, strchr, strchrnul, strdup, strndup, strnlen, strcspn, strpbrk, strspn, strrchr, strsep, strstr, strcasestr, strtok_r): Break long lines. --- lib/string_.h 15 Feb 2007 03:07:04 - 1.24 +++ lib/string_.h 17 Feb 2007 19:38:04 - @@ -65,7 +65,8 @@ #elif defined GNULIB_POSIXCHECK # undef memmem # define memmem(a,al,b,bl) \ -(GL_LINK_WARNING ("memmem is unportable - use gnulib module memmem for portability"), \ +(GL_LINK_WARNING ("memmem is unportable - "\ + "use gnulib module memmem for portability"), \ memmem (a, al, b, bl)) #endif @@ -79,7 +80,8 @@ #elif defined GNULIB_POSIXCHECK # undef mempcpy # define mempcpy(a,b,n) \ -(GL_LINK_WARNING ("mempcpy is unportable - use gnulib module mempcpy for portability"), \ +(GL_LINK_WARNING ("mempcpy is unportable - "\ + "use gnulib module mempcpy for portability"), \ mempcpy (a, b, n)) #endif @@ -91,7 +93,8 @@ #elif defined GNULIB_POSIXCHECK # undef memrchr # define memrchr(a,b,c) \ -(GL_LINK_WARNING ("memrchr is unportable - use gnulib module memrchr for portability"), \ +(GL_LINK_WARNING ("memrchr is unportable - "\ + "use gnulib module memrchr for portability"), \ memrchr (a, b, c)) #endif @@ -103,7 +106,8 @@ #elif defined GNULIB_POSIXCHECK # undef stpcpy # define stpcpy(a,b) \ -(GL_LINK_WARNING ("stpcpy is unportable - use gnulib module stpcpy for portability"), \ +(GL_LINK_WARNING ("stpcpy is unportable - "\ + "use gnulib module stpcpy for portability"), \ stpcpy (a, b)) #endif @@ -118,7 +122,8 @@ #elif defined GNULIB_POSIXCHECK # undef stpncpy # define stpncpy(a,b,n) \ -(GL_LINK_WARNING ("stpncpy is unportable - use gnulib module stpncpy for portability"), \ +(GL_LINK_WARNING ("stpncpy is unportable - "\ + "use gnulib module stpncpy for portability"), \ stpncpy (a, b, n)) #endif @@ -135,7 +140,12 @@ as a sequence of bytes, not of characters. */ # undef strcasecmp # define strcasecmp(a,b) \ -(GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings in multibyte locales - use mbscasecmp if you care about internationalization, or use c_strcasecmp (from gnulib module c-strcase) if you want a locale independent function"), \ +(GL_LINK_WARNING ("strcasecmp cannot work correctly on character strings " \ + "in multibyte locales - "\ + "use mbscasecmp if you care about " \ + "internationalization, or use c_strcasecmp (from " \ + "gnulib module c-strcase) if you want a locale " \ + "independent function"), \ strcasecmp (a, b)) #endif @@ -152,7 +162,12 @@ as a sequence of bytes, not of characters. */ # undef strncasecmp # define strncasecmp(a,b,n) \ -(GL_LINK_WARNING ("strncasecmp cannot work correctly on character strings in multibyte locales - use mbsncasecmp or mbspcasecmp if you care about internationalization, or use c_strncasecmp (from gnulib module c-strcase) if you want a locale independent function"), \ +(GL_LINK_WARNING ("strncasecmp cannot work correctly on character " \ + "strings in multibyte locales - "\ + "use mbsncasecmp or mbspcasecmp if you care about " \ + "internationalization, or use c_strncasecmp (from " \ + "gnulib module c-strcase) if you want a locale " \ + "independent function"), \ strncasecmp (a, b, n)) #endif @@ -161,7 +176,9 @@ GB18030 and the character to be searched is a digit. */ # undef strchr # define strchr(s,c) \ -(GL_LINK_WARNING ("strchr cannot work correctly on character strings in some multibyte locales - use mbschr if you care about internationalization"), \ +(GL_LINK_WARNING ("strchr cannot work correctly on character strings " \ + "in some multibyte locales - "\ + "use mbschr if you care about internationalization"), \ strchr (s, c)) #endif @@ -173,7 +190,8 @@ #elif defined GNULIB_POSIXCHECK # undef strchrnul # define strchrnul(a,b) \ -(GL_LINK_WARNING ("strchrnul is unportable - use gnulib module strchrnul for portability"), \ +(GL_LINK_WARNING ("strchrnul is unportable - "\ + "use gnulib module strchrnul for portability"), \ strchrnul (a, b)) #endif @@ -185,7 +203,8 @@ #elif defined GNULIB_POSIXCHECK # undef strdup # define strdup(a) \ -(GL_LINK_WARNING ("strdup is unportable - use gnulib module strdup for portability"), \ +(GL_LINK_WARNING (
Re: portability checks, errors and warnings
Paul Eggert wrote on 2007-02-05: > > he will get a link error about function 'rpl_strstr', and will likely > > report it as a bug in gnulib. > > I don't think this will be much of a problem in practice. We can > assume maintainers will read the gnulib documentation so that they > know what rpl_ is for. Briefly, defining strstr to rpl_strstr means > "Do not use any library implementation of strstr, regardless of > whether the library implements strstr." A linker warning with a one or two line text is better than a link error because - We can enable a link warning even for cases where 90% of the uses of the functions are ok, such as dlopen() If the file name argument is not absolute, the file is searched for. The search algorithm is system specific. glob() Some systems may store additional flags in the @code{gl_flags} field. - A link errors aborts the "make" process, a link warning doesn't. - The documentation (functions.texi) is not yet in the autoconf manual. - The documentation (functions.texi) does not say which gnulib module solves the portability warning; the rpl_* symbol doesn't say either. But the link warning says it. Bruno
new module 'link-warning'
The GL_LINK_WARNING macro will also be needed in all other header file overrides like . In order not to duplicate the code, I'm putting it into a separate module 'link-warning'. The file link-warning.h would go into lib/ if our generated could simply #include it. But we want the generated to be self-contained. So it goes into build-aux/ and is copied into string.h when string.h is created. (A separate file would not be needed if we could assume AC_SUBST to handle multiline replacements correctly. But the minimum required autoconf version for gnulib is still 2.59.) 2007-02-17 Bruno Haible <[EMAIL PROTECTED]> * modules/link-warning: New file. * build-aux/link-warning.h: New file, extracted from lib/string_.h. * lib/string_.h (GL_LINK_WARNING): Remove definition. * modules/string (Depends-on): Add link-warning. (Makefile.am): Copy the contents of build-aux/link-warning.h into string.h. = modules/link-warning Description: A C macro for emitting link time warnings. Files: build-aux/link-warning.h Depends-on: configure.ac: Makefile.am: LINK_WARNING_H=$(top_srcdir)/build-aux/link-warning.h Include: License: LGPL Maintainer: Bruno Haible === build-aux/link-warning.h == /* GL_LINK_WARNING("literal string") arranges to emit the literal string as a linker warning on most glibc systems. We use a linker warning rather than a preprocessor warning, because #warning cannot be used inside macros. */ #ifndef GL_LINK_WARNING /* This works on platforms with GNU ld and ELF object format. Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. Testing __ELF__ guarantees the ELF object format. Testing __GNUC__ is necessary for the compound expression syntax. */ # if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ # define GL_LINK_WARNING(message) \ GL_LINK_WARNING1 (__FILE__, __LINE__, message) # define GL_LINK_WARNING1(file, line, message) \ GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ # define GL_LINK_WARNING2(file, line, message) \ GL_LINK_WARNING3 (file ":" #line ": warning: " message) # define GL_LINK_WARNING3(message) \ ({ static const char warning[sizeof (message)] \ __attribute__ ((__unused__, \ __section__ (".gnu.warning"), \ __aligned__ (1))) \ = message "\n"; \ (void)0;\ }) # else # define GL_LINK_WARNING(message) ((void) 0) # endif #endif === *** lib/string_.h 17 Feb 2007 19:43:30 - 1.25 --- lib/string_.h 17 Feb 2007 22:19:41 - *** *** 22,55 #include @ABSOLUTE_STRING_H@ ! /* GL_LINK_WARNING("literal string") arranges to emit the literal string as !a linker warning on most glibc systems. !We use a linker warning rather than a preprocessor warning, because !#warning cannot be used inside macros. */ ! #ifndef GL_LINK_WARNING ! /* This works on platforms with GNU ld and ELF object format. ! Testing __GLIBC__ is sufficient for asserting that GNU ld is in use. ! Testing __ELF__ guarantees the ELF object format. ! Testing __GNUC__ is necessary for the compound expression syntax. */ ! # if defined __GLIBC__ && defined __ELF__ && defined __GNUC__ ! # define GL_LINK_WARNING(message) \ ! GL_LINK_WARNING1 (__FILE__, __LINE__, message) ! # define GL_LINK_WARNING1(file, line, message) \ ! GL_LINK_WARNING2 (file, line, message) /* macroexpand file and line */ ! # define GL_LINK_WARNING2(file, line, message) \ ! GL_LINK_WARNING3 (file ":" #line ": warning: " message) ! # define GL_LINK_WARNING3(message) \ ! ({ static const char warning[sizeof (message)] \ ! __attribute__ ((__unused__, \ ! __section__ (".gnu.warning"), \ ! __aligned__ (1))) \ ! = message "\n"; \ ! (void)0; \ ! }) ! # else ! # define GL_LINK_WARNING(message) ((void) 0) ! # endif ! #endif #ifdef __cplusplus --- 22,28 #include @ABSOLUTE_STRING_H@ ! /* The definition of GL_LINK_WARNING is copied here. */ #ifdef __cplusplus *** modules/string 15 Feb 2007 03:07:04 - 1.19 --- modules/string 17 Feb 2007 22:19:41 - *** *** 8,13 --- 8,14 Depends-on: absolute-header extensions + link-warning configure.ac: gl_HEADER_STRING_H *** *** 63,68 --- 64,70 -e
string_h.m4 simplification
This patch merges gl_HEADER_STRING_H_DEFAULTS and gl_STRING_MODULE_INDICATOR_DEFAULTS into a single macro. Since both initialize a part of the variables needed to create string.h, and the other part is needed as well for the same purpose, it's hard to imagine a situation where one of the two is needed but not the other one. And even if so, the added "cost" is only a dozen of lines in configure.ac. 2007-02-17 Bruno Haible <[EMAIL PROTECTED]> * m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Include the contents of gl_STRING_MODULE_INDICATOR_DEFAULTS. (gl_STRING_MODULE_INDICATOR_DEFAULTS): Remove macro. (gl_HEADER_STRING_H_BODY, gl_STRING_MODULE_INDICATOR): Update. *** m4/string_h.m4 15 Feb 2007 03:07:04 - 1.20 --- m4/string_h.m4 18 Feb 2007 00:13:23 - *** *** 18,58 [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_REQUIRE([gl_STRING_MODULE_INDICATOR_DEFAULTS]) gl_ABSOLUTE_HEADER([string.h]) ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\" AC_SUBST([ABSOLUTE_STRING_H]) ]) - AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], - [ - dnl Assume proper GNU behavior unless another module says otherwise. - HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) - HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) - HAVE_DECL_MEMRCHR=1;AC_SUBST([HAVE_DECL_MEMRCHR]) - HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) - HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) - HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) - HAVE_DECL_STRNCASECMP=1;AC_SUBST([HAVE_DECL_STRNCASECMP]) - HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) - HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) - HAVE_STRNDUP=1; AC_SUBST([HAVE_STRNDUP]) - HAVE_DECL_STRNDUP=1;AC_SUBST([HAVE_DECL_STRNDUP]) - HAVE_DECL_STRNLEN=1;AC_SUBST([HAVE_DECL_STRNLEN]) - HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) - HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) - HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) - HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) - ]) - AC_DEFUN([gl_STRING_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. ! AC_REQUIRE([gl_STRING_MODULE_INDICATOR_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 ]) ! AC_DEFUN([gl_STRING_MODULE_INDICATOR_DEFAULTS], [ GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) --- 18,36 [ AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) gl_ABSOLUTE_HEADER([string.h]) ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\" AC_SUBST([ABSOLUTE_STRING_H]) ]) AC_DEFUN([gl_STRING_MODULE_INDICATOR], [ dnl Use AC_REQUIRE here, so that the default settings are expanded once only. ! AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1 ]) ! AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS], [ GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM]) GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY]) *** *** 80,83 --- 58,78 GNULIB_MBSSPN=0; AC_SUBST([GNULIB_MBSSPN]) GNULIB_MBSSEP=0; AC_SUBST([GNULIB_MBSSEP]) GNULIB_MBSTOK_R=0;AC_SUBST([GNULIB_MBSTOK_R]) + dnl Assume proper GNU behavior unless another module says otherwise. + HAVE_DECL_MEMMEM=1; AC_SUBST([HAVE_DECL_MEMMEM]) + HAVE_MEMPCPY=1; AC_SUBST([HAVE_MEMPCPY]) + HAVE_DECL_MEMRCHR=1;AC_SUBST([HAVE_DECL_MEMRCHR]) + HAVE_STPCPY=1; AC_SUBST([HAVE_STPCPY]) + HAVE_STPNCPY=1; AC_SUBST([HAVE_STPNCPY]) + HAVE_STRCASECMP=1; AC_SUBST([HAVE_STRCASECMP]) + HAVE_DECL_STRNCASECMP=1;AC_SUBST([HAVE_DECL_STRNCASECMP]) + HAVE_STRCHRNUL=1; AC_SUBST([HAVE_STRCHRNUL]) + HAVE_DECL_STRDUP=1; AC_SUBST([HAVE_DECL_STRDUP]) + HAVE_STRNDUP=1; AC_SUBST([HAVE_STRNDUP]) + HAVE_DECL_STRNDUP=1;AC_SUBST([HAVE_DECL_STRNDUP]) + HAVE_DECL_STRNLEN=1;AC_SUBST([HAVE_DECL_STRNLEN]) + HAVE_STRPBRK=1; AC_SUBST([HAVE_STRPBRK]) + HAVE_STRSEP=1; AC_SUBST([HAVE_STRSEP]) + HAVE_STRCASESTR=1; AC_SUBST([HAVE_STRCASESTR]) + HAVE_DECL_STRTOK_R=1; AC_SUBST([HAVE_DECL_STRTOK_R]) ])
add link warnings to inttypes.h
This patch adds link warnings (conditional, only if GNULIB_POSIXCHECK is defined) to inttypes.h. A side effect is that the 'inttypes' module will create inttypes.h always - like the 'string' module creates string.h always. 2007-02-17 Bruno Haible <[EMAIL PROTECTED]> * lib/inttypes_.h: Add definition for GL_LINK_WARNING. (imaxabs, imaxdiv, strtoimax, strtoumax): Don't declare the function if the corresponding module is not enabled. Emit link warnings if the function is used nevertheless. * m4/inttypes_.h (gl_INTTYPES_H): Never use the existing . Don't AC_SUBST HAVE_DECL_IMAXABS, HAVE_DECL_IMAXDIV, HAVE_DECL_STRTOIMAX, HAVE_DECL_STRTOUMAX. (gl_INTTYPES_MODULE_INDICATOR, gl_INTTYPES_H_DEFAULTS): New macros. * modules/inttypes (Depends-on): Add link-warning. (Makefile.am): Copy the contents of build-aux/link-warning.h into inttypes.h. * modules/imaxabs (configure.ac): Invoke gl_INTTYPES_MODULE_INDICATOR. * modules/imaxdiv (configure.ac): Likewise. * modules/strtoimax (configure.ac): Likewise. * modules/strtoumax (configure.ac): Likewise. *** lib/inttypes_.h 12 Oct 2006 12:55:07 - 1.6 --- lib/inttypes_.h 17 Feb 2007 23:35:51 - *** *** 1,4 ! /* Copyright (C) 2006 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. --- 1,4 ! /* Copyright (C) 2006-2007 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Derek Price. This file is part of gnulib. *** *** 42,47 --- 42,49 # error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to ." #endif + /* The definition of GL_LINK_WARNING is copied here. */ + /* 7.8.1 Macros for format specifiers */ #if ! defined __cplusplus || defined __STDC_FORMAT_MACROS *** *** 1034,1053 extern "C" { #endif ! #if [EMAIL PROTECTED]@ extern intmax_t imaxabs (intmax_t); #endif ! #if [EMAIL PROTECTED]@ typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; extern imaxdiv_t imaxdiv (intmax_t, intmax_t); #endif ! #if [EMAIL PROTECTED]@ extern intmax_t strtoimax (const char *, char **, int); #endif ! #if [EMAIL PROTECTED]@ extern uintmax_t strtoumax (const char *, char **, int); #endif /* Don't bother defining or declaring wcstoimax and wcstoumax, since --- 1036,1088 extern "C" { #endif ! #if @GNULIB_IMAXABS@ ! # if [EMAIL PROTECTED]@ extern intmax_t imaxabs (intmax_t); + # endif + #elif defined GNULIB_POSIXCHECK + # undef imaxabs + # define imaxabs(a) \ + (GL_LINK_WARNING ("imaxabs is unportable - "\ + "use gnulib module imaxabs for portability"), \ + imaxabs (a)) #endif ! #if @GNULIB_IMAXDIV@ ! # if [EMAIL PROTECTED]@ typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t; extern imaxdiv_t imaxdiv (intmax_t, intmax_t); + # endif + #elif defined GNULIB_POSIXCHECK + # undef imaxdiv + # define imaxdiv(a,b) \ + (GL_LINK_WARNING ("imaxdiv is unportable - "\ + "use gnulib module imaxdiv for portability"), \ + imaxdiv (a, b)) #endif ! #if @GNULIB_STRTOIMAX@ ! # if [EMAIL PROTECTED]@ extern intmax_t strtoimax (const char *, char **, int); + # endif + #elif defined GNULIB_POSIXCHECK + # undef strtoimax + # define strtoimax(p,e,b) \ + (GL_LINK_WARNING ("strtoimax is unportable - "\ + "use gnulib module strtoimax for portability"), \ + strtoimax (p, e, b)) #endif ! ! #if @GNULIB_STRTOUMAX@ ! # if [EMAIL PROTECTED]@ extern uintmax_t strtoumax (const char *, char **, int); + # endif + #elif defined GNULIB_POSIXCHECK + # undef strtoumax + # define strtoumax(p,e,b) \ + (GL_LINK_WARNING ("strtoumax is unportable - "\ + "use gnulib module strtoumax for portability"), \ + strtoumax (p, e, b)) #endif /* Don't bother defining or declaring wcstoimax and wcstoumax, since *** m4/inttypes.m4 14 Nov 2006 22:27:06 - 1.17 --- m4/inttypes.m4 17 Feb 2007 23:35:51 - *** *** 1,5 ! # inttypes.m4 serial 7 ! dnl Copyright (C) 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. --- 1,5 ! # inttypes.m4 serial 8 ! dnl Copyright (C) 2006-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. *** *** 133,143 ])], [gl_cv_header_working_inttypes_h=yes]) fi]) ! if test $gl_cv_header_working_inttypes_h = yes; then
new test modules
Hi, I added minimal tests for the modules arpa_inet byteswap fcntl inttypes netinet_in stdbool string sys_select sys_socket sys_stat sys_time sysexits time unistd wchar wctype Just to check that the include file that it defines can really be included. Feel free to add more checks to these tests when you have time. Bruno
conflicts between pathname.h and dirname.h
pathname.h and dirname.h define macros with the same names, but conflicting definitions. Should they be merged? -- Ben Pfaff [EMAIL PROTECTED] http://benpfaff.org