Skip to content

Commit

Permalink
Make it possible to turn off each of the Windows oldnames workarounds.
Browse files Browse the repository at this point in the history
* lib/fcntl.in.h (creat, open):  Conditionalize each of the Windows
oldnames workarounds through a GNULIB_MDA_<func> symbol.
* lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise.
* lib/search.in.h (lfind, lsearch): Likewise.
* lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam):
Likewise.
* lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise.
* lib/string.in.h (memccpy, strdup): Likewise.
* lib/sys_stat.in.h (chmod, umask): Likewise.
* lib/time.in.h (tzset): Likewise.
* lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle,
execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek,
read, rmdir, swab, unlink, write): Likewise.
* lib/utime.in.h (utime): Likewise.
* lib/wchar.in.h (wcsdup): Likewise.
* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize these
GNULIB_MDA_<func> symbols.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise.
* m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise.
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise.
* m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise.
* modules/fcntl-h (Makefile.am): Substitute these GNULIB_MDA_<func>
symbols.
* modules/math (Makefile.am): Likewise.
* modules/search (Makefile.am): Likewise.
* modules/stdio (Makefile.am): Likewise.
* modules/stdlib (Makefile.am): Likewise.
* modules/string (Makefile.am): Likewise.
* modules/sys_stat (Makefile.am): Likewise.
* modules/time (Makefile.am): Likewise.
* modules/unistd (Makefile.am): Likewise.
* modules/utime-h (Makefile.am): Likewise.
* modules/wchar (Makefile.am): Likewise.
  • Loading branch information
bhaible committed Dec 25, 2020
1 parent d411aa6 commit 52c7413
Show file tree
Hide file tree
Showing 34 changed files with 456 additions and 246 deletions.
43 changes: 43 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
2020-12-25 Bruno Haible <[email protected]>

Make it possible to turn off each of the Windows oldnames workarounds.
* lib/fcntl.in.h (creat, open): Conditionalize each of the Windows
oldnames workarounds through a GNULIB_MDA_<func> symbol.
* lib/math.in.h (j0, j1, jn, y0, y1, yn): Likewise.
* lib/search.in.h (lfind, lsearch): Likewise.
* lib/stdio.in.h (fcloseall, fdopen, fileno, getw, putw, tempnam):
Likewise.
* lib/stdlib.in.h (ecvt, fcvt, gcvt, mktemp, putenv): Likewise.
* lib/string.in.h (memccpy, strdup): Likewise.
* lib/sys_stat.in.h (chmod, umask): Likewise.
* lib/time.in.h (tzset): Likewise.
* lib/unistd.in.h (access, chdir, close, dup, dup2, execl, execle,
execlp, execv, execve, execvp, execvpe, getcwd, getpid, isatty, lseek,
read, rmdir, swab, unlink, write): Likewise.
* lib/utime.in.h (utime): Likewise.
* lib/wchar.in.h (wcsdup): Likewise.
* m4/fcntl_h.m4 (gl_FCNTL_H_DEFAULTS): Initialize these
GNULIB_MDA_<func> symbols.
* m4/math_h.m4 (gl_MATH_H_DEFAULTS): Likewise.
* m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Likewise.
* m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Likewise.
* m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Likewise.
* m4/string_h.m4 (gl_HEADER_STRING_H_DEFAULTS): Likewise.
* m4/sys_stat_h.m4 (gl_SYS_STAT_H_DEFAULTS): Likewise.
* m4/time_h.m4 (gl_HEADER_TIME_H_DEFAULTS): Likewise.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Likewise.
* m4/utime_h.m4 (gl_UTIME_H_DEFAULTS): Likewise.
* m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Likewise.
* modules/fcntl-h (Makefile.am): Substitute these GNULIB_MDA_<func>
symbols.
* modules/math (Makefile.am): Likewise.
* modules/search (Makefile.am): Likewise.
* modules/stdio (Makefile.am): Likewise.
* modules/stdlib (Makefile.am): Likewise.
* modules/string (Makefile.am): Likewise.
* modules/sys_stat (Makefile.am): Likewise.
* modules/time (Makefile.am): Likewise.
* modules/unistd (Makefile.am): Likewise.
* modules/utime-h (Makefile.am): Likewise.
* modules/wchar (Makefile.am): Likewise.

2020-12-24 Paul Eggert <[email protected]>

canonicalize, canonicalize-lgpl: remove lint
Expand Down
4 changes: 2 additions & 2 deletions lib/fcntl.in.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ _GL_CXXALIASWARN (creat);
/* Assume creat is always declared. */
_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
"use gnulib module creat for portability");
#else
#elif @GNULIB_MDA_CREAT@
/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::creat always. */
Expand Down Expand Up @@ -186,7 +186,7 @@ _GL_CXXALIASWARN (open);
/* Assume open is always declared. */
_GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
"use gnulib module open for portability");
#else
#elif @GNULIB_MDA_OPEN@
/* On native Windows, map 'open' to '_open', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::open always. */
Expand Down
96 changes: 54 additions & 42 deletions lib/math.in.h
Original file line number Diff line number Diff line change
Expand Up @@ -1336,47 +1336,53 @@ _GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
#endif


#if @GNULIB_MDA_J0@
/* On native Windows, map 'j0' to '_j0', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::j0 always. */
#if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef j0
# define j0 _j0
# endif
# if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef j0
# define j0 _j0
# endif
_GL_CXXALIAS_MDA (j0, double, (double x));
#else
# else
_GL_CXXALIAS_SYS (j0, double, (double x));
#endif
# endif
_GL_CXXALIASWARN (j0);
#endif

#if @GNULIB_MDA_J1@
/* On native Windows, map 'j1' to '_j1', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::j1 always. */
#if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef j1
# define j1 _j1
# endif
# if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef j1
# define j1 _j1
# endif
_GL_CXXALIAS_MDA (j1, double, (double x));
#else
# else
_GL_CXXALIAS_SYS (j1, double, (double x));
#endif
# endif
_GL_CXXALIASWARN (j1);
#endif

#if @GNULIB_MDA_JN@
/* On native Windows, map 'jn' to '_jn', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::jn always. */
#if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef jn
# define jn _jn
# endif
# if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef jn
# define jn _jn
# endif
_GL_CXXALIAS_MDA (jn, double, (int n, double x));
#else
# else
_GL_CXXALIAS_SYS (jn, double, (int n, double x));
#endif
# endif
_GL_CXXALIASWARN (jn);
#endif


/* Return x * 2^exp. */
Expand Down Expand Up @@ -2343,47 +2349,53 @@ _GL_WARN_ON_USE (truncl, "truncl is unportable - "
#endif


#if @GNULIB_MDA_Y0@
/* On native Windows, map 'y0' to '_y0', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::y0 always. */
#if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef y0
# define y0 _y0
# endif
# if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef y0
# define y0 _y0
# endif
_GL_CXXALIAS_MDA (y0, double, (double x));
#else
# else
_GL_CXXALIAS_SYS (y0, double, (double x));
#endif
# endif
_GL_CXXALIASWARN (y0);
#endif

#if @GNULIB_MDA_Y1@
/* On native Windows, map 'y1' to '_y1', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::y1 always. */
#if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef y1
# define y1 _y1
# endif
# if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef y1
# define y1 _y1
# endif
_GL_CXXALIAS_MDA (y1, double, (double x));
#else
# else
_GL_CXXALIAS_SYS (y1, double, (double x));
#endif
# endif
_GL_CXXALIASWARN (y1);
#endif

#if @GNULIB_MDA_YN@
/* On native Windows, map 'yn' to '_yn', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::yn always. */
#if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef yn
# define yn _yn
# endif
# if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef yn
# define yn _yn
# endif
_GL_CXXALIAS_MDA (yn, double, (int n, double x));
#else
# else
_GL_CXXALIAS_SYS (yn, double, (int n, double x));
#endif
# endif
_GL_CXXALIASWARN (yn);
#endif


/* Definitions of function-like macros come here, after the function
Expand Down
32 changes: 18 additions & 14 deletions lib/search.in.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,45 +38,49 @@
/* The definition of _GL_WARN_ON_USE is copied here. */


#if @GNULIB_MDA_LFIND@
/* On native Windows, map 'lfind' to '_lfind', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::lfind always. */
#if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef lfind
# define lfind _lfind
# endif
# if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef lfind
# define lfind _lfind
# endif
_GL_CXXALIAS_MDA (lfind, void *,
(const void *key, const void *base, unsigned int *nmemb,
unsigned int size,
int (*compar) (const void *, const void *)));
#else
# else
_GL_CXXALIAS_SYS (lfind, void *,
(const void *key, const void *base, size_t *nmemb,
size_t size,
int (*compar) (const void *, const void *)));
#endif
# endif
_GL_CXXALIASWARN (lfind);
#endif

#if @GNULIB_MDA_LSEARCH@
/* On native Windows, map 'lsearch' to '_lsearch', so that -loldnames is not
required. In C++ with GNULIB_NAMESPACE, avoid differences between
platforms by defining GNULIB_NAMESPACE::lsearch always. */
#if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef lsearch
# define lsearch _lsearch
# endif
# if defined _WIN32 && !defined __CYGWIN__
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# undef lsearch
# define lsearch _lsearch
# endif
_GL_CXXALIAS_MDA (lsearch, void *,
(const void *key, void *base, unsigned int *nmemb,
unsigned int size,
int (*compar) (const void *, const void *)));
#else
# else
_GL_CXXALIAS_SYS (lsearch, void *,
(const void *key, void *base, size_t *nmemb,
size_t size,
int (*compar) (const void *, const void *)));
#endif
# endif
_GL_CXXALIASWARN (lsearch);
#endif


#if @GNULIB_TSEARCH@
Expand Down
Loading

0 comments on commit 52c7413

Please sign in to comment.