Collin Funk wrote:
> Doing a separate for each seems excessive.

I agree. If a package needs one of these functions, the odds are high that
it needs some of the other three functions as well.

The second patch, with the tests, is fine.

However, the first patch is not sufficient:

1) The portability problem that it solves is that the functions are missing
   on HP-UX 11 and on old Android. HP-UX is dead, but old Android is relevant
   for Emacs.

   On all other POSIX-like platforms, REPLACE_HTONL is never set to 1, because
   the test 'if arpa/inet.h defines htonl, htons, ntohl, ntohs' always succeeds.
   All platforms that I could test have these functions, and inspection of the
   header files shows that the functions are defined as functions everywhere,
   except that some platforms define them as macros when they are the identity
   function (i.e. on big-endian platforms):

       $ grep 'define[  ]htonl' */usr/include/arpa/inet.h
       aix-4.3.2/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       aix-5.1.0/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       aix-5.2.0/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       aix-5.3.0a/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       aix-5.3.0/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       aix-6.1.0/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       aix-7.1.0/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       aix-7.2.0/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       aix-7.3.1/usr/include/arpa/inet.h:#define htonl(hostlong)  (hostlong)
       freebsd-11.0/usr/include/arpa/inet.h:#define    htonl(x)        
__htonl(x)
       freebsd-12.0/usr/include/arpa/inet.h:#define    htonl(x)        
__htonl(x)
       freebsd-13.0/usr/include/arpa/inet.h:#define    htonl(x)        
__htonl(x)
       freebsd-14.0/usr/include/arpa/inet.h:#define    htonl(x)        
__htonl(x)
       freebsd-5.2.1/usr/include/arpa/inet.h:#define   htonl(x)        
__htonl(x)
       freebsd-6.0/usr/include/arpa/inet.h:#define     htonl(x)        
__htonl(x)
       freebsd-6.4/usr/include/arpa/inet.h:#define     htonl(x)        
__htonl(x)
       hpux-10.20/usr/include/arpa/inet.h:#define htonl(x)        (x)
       hpux-11.00/usr/include/arpa/inet.h:#define htonl(x)        (x)
       hpux-11.11/usr/include/arpa/inet.h:#define htonl(x)        (x)
       hpux-11.23-ia64/usr/include/arpa/inet.h:#define htonl(x)        (x)
       hpux-11.23/usr/include/arpa/inet.h:#define htonl(x)        (x)
       hpux-11.31/usr/include/arpa/inet.h:#define htonl(x)        (x)
       openbsd-6.0/usr/include/arpa/inet.h:#define htonl(x)    __htobe32(x)
       openbsd-6.7/usr/include/arpa/inet.h:#define htonl(x)    __htobe32(x)
       openbsd-7.5/usr/include/arpa/inet.h:#define htonl(x)    __htobe32(x)

   For a function, the float-argument test and the evaluates-arg-only-once
   test naturally succeed.

   I believe the situation is good here because these 4 functions have been
   heavily used over the last 30 years, and problems like evaluates-arg-
   several-times would have been noticed and fixed many years ago already.

2) It does not solve the portability problem that it advertises to solve
   in the documentation.

   The doc change claims to solve the problem on native Windows. But a testdir
   of module 'htonl' produces a link error there. (See attached log1, log2, 
log3.)
   The error message indicates that the declarations in <winsock2.h> were in
   effect (that declare the functions, with a dllimport; via <sys/socket.h>),
   but the test program was not linked with -lws2_32. Cf.
   
<https://learn.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-htonl>

In order to fix the native Windows problem, the module description should
have a 'Link:' section that references a variable (named $(HTONL_LIB) by
convention) that expands to -lws2_32 on native Windows systems.

Bruno
configure: creating cache config.cache
checking for a BSD-compatible install... /usr/bin/install -c
checking whether sleep supports fractional seconds... yes
checking filesystem timestamp resolution... 0.01
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... x86_64-w64-mingw32-strip
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking xargs -n works... yes
checking for x86_64-w64-mingw32-gcc... x86_64-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether x86_64-w64-mingw32-gcc accepts -g... yes
checking for x86_64-w64-mingw32-gcc option to enable C11 features... none needed
checking whether x86_64-w64-mingw32-gcc understands -c and -o together... yes
checking whether the compiler is clang... no
checking for compiler option needed when checking for declarations... none
checking whether make supports the include directive... yes (GNU style)
checking dependency style of x86_64-w64-mingw32-gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-pc-cygwin
checking host system type... x86_64-w64-mingw32
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for wchar.h... yes
checking for minix/config.h... no
checking for arpa/inet.h... no
checking for features.h... no
checking for sys/socket.h... no
checking for byteswap.h... no
checking for endian.h... no
checking for limits.h... yes
checking for stdbool.h... yes
checking for sys/uio.h... no
checking for netinet/in.h... no
checking for sys/un.h... no
checking for crtdefs.h... yes
checking whether it is safe to define __EXTENSIONS__... yes
checking whether _XOPEN_SOURCE should be defined... no
checking how to run the C preprocessor... x86_64-w64-mingw32-gcc -E
checking for egrep -e... /usr/bin/grep -E
checking for Minix Amsterdam compiler... no
checking for x86_64-w64-mingw32-ar... x86_64-w64-mingw32-ar
checking for x86_64-w64-mingw32-ranlib... x86_64-w64-mingw32-ranlib
checking whether the preprocessor supports include_next... yes
checking whether source code line length is unlimited... yes
checking for ws2tcpip.h... yes
checking whether byte ordering is bigendian... no
checking for complete errno.h... no
checking for EMULTIHOP value... no
checking for ENOLINK value... yes
checking for EOVERFLOW value... yes
checking whether ctype.h defines __header_inline... no
checking whether limits.h has WORD_BIT, BOOL_WIDTH etc.... no
checking whether the compiler produces multi-arch binaries... no
checking for wint_t... yes
checking whether wint_t is large enough... no
checking whether stdint.h conforms to C99... yes
checking whether stdint.h works without ISO C predefines... yes
checking whether stdint.h has UINTMAX_WIDTH etc.... no
checking for C/C++ restrict keyword... __restrict__
checking whether <sys/socket.h> is self-contained... no
checking for struct sockaddr_storage... yes
checking for sa_family_t... no
checking for struct sockaddr_storage.ss_family... yes
checking for winsock2.h... yes
checking for pid_t... yes
checking for mode_t... yes
checking for off64_t... yes
checking for C compiler option to allow warnings... -Wno-error
checking for C++ compiler option to allow warnings... -Wno-error
checking whether INT32_MAX < INTMAX_MAX... yes
checking whether INT64_MAX == LONG_MAX... no
checking whether UINT32_MAX < UINTMAX_MAX... yes
checking whether UINT64_MAX == ULONG_MAX... no
checking for good max_align_t... yes
checking whether NULL can be used in arbitrary expressions... yes
checking for unreachable... no
checking whether nullptr_t needs <stddef.h>... yes
checking for clean definition of __STDC_VERSION_STDDEF_H__... yes
checking for nl_langinfo and CODESET... no
checking for a french Unicode locale... none
checking for x86_64-w64-mingw32-gcc options needed to detect all undeclared 
functions... none needed
checking whether ecvt is declared... yes
checking whether fcvt is declared... yes
checking whether gcvt is declared... yes
checking whether MB_CUR_MAX is correct... guessing yes
checking for shutdown... no
checking whether execvpe is declared... yes
checking whether <wchar.h> uses 'inline' correctly... yes
checking whether wcsdup is declared... yes
checking for alignas and alignof... yes, <stdalign.h> macros
checking for socklen_t... yes
checking for ssize_t... yes
checking for bool, true, false... no
checking for static_assert... yes, an <assert.h> macro
checking for IPv4 sockets... yes
checking for IPv6 sockets... yes
checking for afunix.h... yes
checking for UNIX domain sockets... yes
configure: updating cache config.cache
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating gllib/Makefile
config.status: creating glm4/Makefile
config.status: creating gltests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
make  all-recursive
make[1]: Entering directory '/home/bruno/testdir2/build-mingw64'
Making all in gllib
make[2]: Entering directory '/home/bruno/testdir2/build-mingw64/gllib'
/usr/bin/mkdir -p 'arpa'
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''HAVE_FEATURES_H''@|0|g' \
      -e 's|@''NEXT_ARPA_INET_H''@|<arpa/inet.h>|g' \
      -e 's|@''HAVE_ARPA_INET_H''@|0|g' \
      -e 's/@''GNULIB_INET_NTOP''@/0/g' \
      -e 's/@''GNULIB_INET_PTON''@/0/g' \
      -e 's|@''HAVE_WS2TCPIP_H''@|1|g' \
      -e 's|@''HAVE_DECL_INET_NTOP''@|1|g' \
      -e 's|@''HAVE_DECL_INET_PTON''@|1|g' \
      -e 's|@''REPLACE_HTONL''@|0|g' \
      -e 's|@''REPLACE_INET_NTOP''@|0|g' \
      -e 's|@''REPLACE_INET_PTON''@|0|g' \
      -e '/definitions of _GL_FUNCDECL_RPL/r ../../gllib/c++defs.h' \
      -e '/definition of _GL_ARG_NONNULL/r ../../gllib/arg-nonnull.h' \
      -e '/definition of _GL_WARN_ON_USE/r ../../gllib/warn-on-use.h' \
      ../../gllib/arpa_inet.in.h > arpa/inet.h-t
mv arpa/inet.h-t arpa/inet.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G -n -e 
'w byteswap.h-t' ../../gllib/byteswap.in.h
mv byteswap.h-t byteswap.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''HAVE_ENDIAN_H''@|0|g' \
      -e 's|@''NEXT_ENDIAN_H''@|<endian.h>|g' \
      -e 's|@''ENDIAN_H_JUST_MISSING_STDINT''@|0|g' \
../../gllib/endian.in.h > endian.h-t
mv endian.h-t endian.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_ERRNO_H''@|<errno.h>|g' \
      -e 's|@''EMULTIHOP_HIDDEN''@|0|g' \
      -e 's|@''EMULTIHOP_VALUE''@||g' \
      -e 's|@''ENOLINK_HIDDEN''@|0|g' \
      -e 's|@''ENOLINK_VALUE''@||g' \
      -e 's|@''EOVERFLOW_HIDDEN''@|0|g' \
      -e 's|@''EOVERFLOW_VALUE''@||g' \
      ../../gllib/errno.in.h > errno.h-t
mv errno.h-t errno.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_LIMITS_H''@|<limits.h>|g' \
      ../../gllib/limits.in.h > limits.h-t
mv limits.h-t limits.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's/@''HAVE_STDINT_H''@/1/g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_STDINT_H''@|<stdint.h>|g' \
      -e 's/@''HAVE_C99_STDINT_H''@/1/g' \
      -e 's/@''HAVE_SYS_TYPES_H''@/1/g' \
      -e 's/@''HAVE_INTTYPES_H''@/1/g' \
      -e 's/@''HAVE_SYS_INTTYPES_H''@/0/g' \
      -e 's/@''HAVE_SYS_BITYPES_H''@/0/g' \
      -e 's/@''HAVE_WCHAR_H''@/1/g' \
      -e 's/@''APPLE_UNIVERSAL_BUILD''@/0/g' \
      -e 's/@''BITSIZEOF_PTRDIFF_T''@//g' \
      -e 's/@''PTRDIFF_T_SUFFIX''@//g' \
      -e 's/@''BITSIZEOF_SIG_ATOMIC_T''@//g' \
      -e 's/@''HAVE_SIGNED_SIG_ATOMIC_T''@//g' \
      -e 's/@''SIG_ATOMIC_T_SUFFIX''@//g' \
      -e 's/@''BITSIZEOF_SIZE_T''@//g' \
      -e 's/@''SIZE_T_SUFFIX''@//g' \
      -e 's/@''BITSIZEOF_WCHAR_T''@//g' \
      -e 's/@''HAVE_SIGNED_WCHAR_T''@//g' \
      -e 's/@''WCHAR_T_SUFFIX''@//g' \
      -e 's/@''BITSIZEOF_WINT_T''@//g' \
      -e 's/@''HAVE_SIGNED_WINT_T''@//g' \
      -e 's/@''WINT_T_SUFFIX''@//g' \
      -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/1/g' \
      ../../gllib/stdint.in.h > stdint.h-t
mv stdint.h-t stdint.h
/usr/bin/mkdir -p 'sys'
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_SYS_SOCKET_H''@|<sys/socket.h>|g' \
      -e 's|@''HAVE_SYS_SOCKET_H''@|0|g' \
      -e 's/@''GNULIB_CLOSE''@/0/g' \
      -e 's/@''GNULIB_SOCKET''@/0/g' \
      -e 's/@''GNULIB_CONNECT''@/0/g' \
      -e 's/@''GNULIB_ACCEPT''@/0/g' \
      -e 's/@''GNULIB_BIND''@/0/g' \
      -e 's/@''GNULIB_GETPEERNAME''@/0/g' \
      -e 's/@''GNULIB_GETSOCKNAME''@/0/g' \
      -e 's/@''GNULIB_GETSOCKOPT''@/0/g' \
      -e 's/@''GNULIB_LISTEN''@/0/g' \
      -e 's/@''GNULIB_RECV''@/0/g' \
      -e 's/@''GNULIB_SEND''@/0/g' \
      -e 's/@''GNULIB_RECVFROM''@/0/g' \
      -e 's/@''GNULIB_SENDTO''@/0/g' \
      -e 's/@''GNULIB_SETSOCKOPT''@/0/g' \
      -e 's/@''GNULIB_SHUTDOWN''@/0/g' \
      -e 's/@''GNULIB_ACCEPT4''@/0/g' \
      -e 's|@''HAVE_WINSOCK2_H''@|1|g' \
      -e 's|@''HAVE_WS2TCPIP_H''@|1|g' \
      -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|1|g' \
      -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|1|g' \
      -e 's|@''HAVE_SA_FAMILY_T''@|0|g' \
      -e 's|@''HAVE_ACCEPT4''@|1|g' \
      -e '/definitions of _GL_FUNCDECL_RPL/r ../../gllib/c++defs.h' \
      -e '/definition of _GL_ARG_NONNULL/r ../../gllib/arg-nonnull.h' \
      -e '/definition of _GL_WARN_ON_USE/r ../../gllib/warn-on-use.h' \
      ../../gllib/sys_socket.in.h > sys/socket.h-t
mv sys/socket.h-t sys/socket.h
/usr/bin/mkdir -p 'sys'
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_SYS_TYPES_H''@|<sys/types.h>|g' \
      -e 's|@''WINDOWS_64_BIT_OFF_T''@|0|g' \
      -e 's|@''HAVE_OFF64_T''@|1|g' \
      -e 's|@''WINDOWS_STAT_INODES''@|0|g' \
      ../../gllib/sys_types.in.h > sys/types.h-t
mv sys/types.h-t sys/types.h
/usr/bin/mkdir -p 'sys'
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_SYS_UIO_H''@|<sys/uio.h>|g' \
      -e 's|@''HAVE_SYS_UIO_H''@|0|g' \
      ../../gllib/sys_uio.in.h > sys/uio.h-t
mv sys/uio.h-t sys/uio.h
make  all-recursive
make[3]: Entering directory '/home/bruno/testdir2/build-mingw64/gllib'
make[4]: Entering directory '/home/bruno/testdir2/build-mingw64/gllib'
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gllib -I..  
-DGNULIB_STRICT_CHECKING=1 -D_WIN32_WINNT=_WIN32_WINNT_WINXP 
-I/usr/local/mingw64/include -Wall  -g -O2 -MT arpa_inet.o -MD -MP -MF 
.deps/arpa_inet.Tpo -c -o arpa_inet.o ../../gllib/arpa_inet.c
mv -f .deps/arpa_inet.Tpo .deps/arpa_inet.Po
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gllib -I..  
-DGNULIB_STRICT_CHECKING=1 -D_WIN32_WINNT=_WIN32_WINNT_WINXP 
-I/usr/local/mingw64/include -Wall  -g -O2 -MT byteswap.o -MD -MP -MF 
.deps/byteswap.Tpo -c -o byteswap.o ../../gllib/byteswap.c
mv -f .deps/byteswap.Tpo .deps/byteswap.Po
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gllib -I..  
-DGNULIB_STRICT_CHECKING=1 -D_WIN32_WINNT=_WIN32_WINNT_WINXP 
-I/usr/local/mingw64/include -Wall  -g -O2 -MT endian.o -MD -MP -MF 
.deps/endian.Tpo -c -o endian.o ../../gllib/endian.c
mv -f .deps/endian.Tpo .deps/endian.Po
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gllib -I..  
-DGNULIB_STRICT_CHECKING=1 -D_WIN32_WINNT=_WIN32_WINNT_WINXP 
-I/usr/local/mingw64/include -Wall  -g -O2 -MT sys_socket.o -MD -MP -MF 
.deps/sys_socket.Tpo -c -o sys_socket.o ../../gllib/sys_socket.c
mv -f .deps/sys_socket.Tpo .deps/sys_socket.Po
rm -f libgnu.a
x86_64-w64-mingw32-ar cr libgnu.a arpa_inet.o byteswap.o endian.o sys_socket.o 
x86_64-w64-mingw32-ranlib libgnu.a
make[4]: Leaving directory '/home/bruno/testdir2/build-mingw64/gllib'
make[3]: Leaving directory '/home/bruno/testdir2/build-mingw64/gllib'
make[2]: Leaving directory '/home/bruno/testdir2/build-mingw64/gllib'
Making all in glm4
make[2]: Entering directory '/home/bruno/testdir2/build-mingw64/glm4'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/bruno/testdir2/build-mingw64/glm4'
Making all in gltests
make[2]: Entering directory '/home/bruno/testdir2/build-mingw64/gltests'
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's/@''HAVE_INTTYPES_H''@/1/g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_INTTYPES_H''@|<inttypes.h>|g' \
      -e 's/@''APPLE_UNIVERSAL_BUILD''@/0/g' \
      -e 's/@''PRIPTR_PREFIX''@/"ll"/g' \
      -e 's/@''GNULIB_IMAXABS''@/0/g' \
      -e 's/@''GNULIB_IMAXDIV''@/0/g' \
      -e 's/@''GNULIB_STRTOIMAX''@/0/g' \
      -e 's/@''GNULIB_STRTOUMAX''@/0/g' \
      -e 's/@''HAVE_DECL_IMAXABS''@/1/g' \
      -e 's/@''HAVE_DECL_IMAXDIV''@/1/g' \
      -e 's/@''HAVE_DECL_STRTOIMAX''@/1/g' \
      -e 's/@''HAVE_DECL_STRTOUMAX''@/1/g' \
      -e 's/@''HAVE_IMAXDIV_T''@/1/g' \
      -e 's/@''REPLACE_IMAXABS''@/0/g' \
      -e 's/@''REPLACE_IMAXDIV''@/0/g' \
      -e 's/@''REPLACE_STRTOIMAX''@/0/g' \
      -e 's/@''REPLACE_STRTOUMAX''@/0/g' \
      -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/1/g' \
      -e 's/@''INT64_MAX_EQ_LONG_MAX''@/0/g' \
      -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/1/g' \
      -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/0/g' \
      -e '/definitions of _GL_FUNCDECL_RPL/r ../../gltests/c++defs.h' \
      -e '/definition of _GL_ARG_NONNULL/r ../../gltests/arg-nonnull.h' \
      -e '/definition of _GL_WARN_ON_USE/r ../../gltests/warn-on-use.h' \
      ../../gltests/inttypes.in.h > inttypes.h-t
mv inttypes.h-t inttypes.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_STDDEF_H''@|<stddef.h>|g' \
      -e 's|@''NULLPTR_T_NEEDS_STDDEF''@|1|g' \
      -e 's|@''STDDEF_NOT_IDEMPOTENT''@|0|g' \
      -e 's|@''REPLACE_NULL''@|0|g' \
      -e 's|@''HAVE_MAX_ALIGN_T''@|1|g' \
      ../../gltests/stddef.in.h > stddef.h-t
mv stddef.h-t stddef.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_STDLIB_H''@|<stdlib.h>|g' \
      -e 's/@''GNULIB__EXIT''@/0/g' \
      -e 's/@''GNULIB_ABORT_DEBUG''@/0/g' \
      -e 's/@''GNULIB_ALIGNED_ALLOC''@/0/g' \
      -e 's/@''GNULIB_ATOLL''@/0/g' \
      -e 's/@''GNULIB_CALLOC_GNU''@/0/g' \
      -e 's/@''GNULIB_CALLOC_POSIX''@/0/g' \
      -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/0/g' \
      -e 's/@''GNULIB_FREE_POSIX''@/0/g' \
      -e 's/@''GNULIB_GETLOADAVG''@/0/g' \
      -e 's/@''GNULIB_GETPROGNAME''@/0/g' \
      -e 's/@''GNULIB_GETSUBOPT''@/0/g' \
      -e 's/@''GNULIB_GRANTPT''@/0/g' \
      -e 's/@''GNULIB_MALLOC_GNU''@/0/g' \
      -e 's/@''GNULIB_MALLOC_POSIX''@/0/g' \
      -e 's/@''GNULIB_MBSTOWCS''@/0/g' \
      -e 's/@''GNULIB_MBTOWC''@/0/g' \
      -e 's/@''GNULIB_MKDTEMP''@/0/g' \
      -e 's/@''GNULIB_MKOSTEMP''@/0/g' \
      -e 's/@''GNULIB_MKOSTEMPS''@/0/g' \
      -e 's/@''GNULIB_MKSTEMP''@/0/g' \
      -e 's/@''GNULIB_MKSTEMPS''@/0/g' \
      -e 's/@''GNULIB_POSIX_MEMALIGN''@/0/g' \
      -e 's/@''GNULIB_POSIX_OPENPT''@/0/g' \
      -e 's/@''GNULIB_PTSNAME''@/0/g' \
      -e 's/@''GNULIB_PTSNAME_R''@/0/g' \
      -e 's/@''GNULIB_PUTENV''@/0/g' \
      -e 's/@''GNULIB_QSORT_R''@/0/g' \
      -e 's/@''GNULIB_RAND''@/0/g' \
      -e 's/@''GNULIB_RANDOM''@/0/g' \
      -e 's/@''GNULIB_RANDOM_R''@/0/g' \
      -e 's/@''GNULIB_REALLOC_GNU''@/0/g' \
      -e 's/@''GNULIB_REALLOC_POSIX''@/0/g' \
      -e 's/@''GNULIB_REALLOCARRAY''@/0/g' \
      -e 's/@''GNULIB_REALPATH''@/0/g' \
      -e 's/@''GNULIB_RPMATCH''@/0/g' \
      -e 's/@''GNULIB_SECURE_GETENV''@/0/g' \
      -e 's/@''GNULIB_SETENV''@/0/g' \
      -e 's/@''GNULIB_STACK_TRACE''@/0/g' \
      -e 's/@''GNULIB_STRTOD''@/0/g' \
      -e 's/@''GNULIB_STRTOF''@/0/g' \
      -e 's/@''GNULIB_STRTOL''@/0/g' \
      -e 's/@''GNULIB_STRTOLD''@/0/g' \
      -e 's/@''GNULIB_STRTOLL''@/0/g' \
      -e 's/@''GNULIB_STRTOUL''@/0/g' \
      -e 's/@''GNULIB_STRTOULL''@/0/g' \
      -e 's/@''GNULIB_SYSTEM_POSIX''@/0/g' \
      -e 's/@''GNULIB_UNLOCKPT''@/0/g' \
      -e 's/@''GNULIB_UNSETENV''@/0/g' \
      -e 's/@''GNULIB_WCTOMB''@/0/g' \
      -e 's/@''GNULIB_MDA_ECVT''@/1/g' \
      -e 's/@''GNULIB_MDA_FCVT''@/1/g' \
      -e 's/@''GNULIB_MDA_GCVT''@/1/g' \
      -e 's/@''GNULIB_MDA_MKTEMP''@/1/g' \
      -e 's/@''GNULIB_MDA_PUTENV''@/1/g' \
      < ../../gltests/stdlib.in.h > stdlib.h-t1
sed \
      -e 's|@''HAVE__EXIT''@|1|g' \
      -e 's|@''HAVE_ALIGNED_ALLOC''@|1|g' \
      -e 's|@''HAVE_ATOLL''@|1|g' \
      -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|1|g' \
      -e 's|@''HAVE_DECL_ECVT''@|1|g' \
      -e 's|@''HAVE_DECL_FCVT''@|1|g' \
      -e 's|@''HAVE_DECL_GCVT''@|1|g' \
      -e 's|@''HAVE_DECL_GETLOADAVG''@|1|g' \
      -e 's|@''HAVE_DECL_PROGRAM_INVOCATION_NAME''@|1|g' \
      -e 's|@''HAVE_GETPROGNAME''@|1|g' \
      -e 's|@''HAVE_GETSUBOPT''@|1|g' \
      -e 's|@''HAVE_GRANTPT''@|1|g' \
      -e 's|@''HAVE_INITSTATE''@|1|g' \
      -e 's|@''HAVE_DECL_INITSTATE''@|1|g' \
      -e 's|@''HAVE_MBTOWC''@|1|g' \
      -e 's|@''HAVE_MKDTEMP''@|1|g' \
      -e 's|@''HAVE_MKOSTEMP''@|1|g' \
      -e 's|@''HAVE_MKOSTEMPS''@|1|g' \
      -e 's|@''HAVE_MKSTEMP''@|1|g' \
      -e 's|@''HAVE_MKSTEMPS''@|1|g' \
      -e 's|@''HAVE_POSIX_MEMALIGN''@|1|g' \
      -e 's|@''HAVE_POSIX_OPENPT''@|1|g' \
      -e 's|@''HAVE_PTSNAME''@|1|g' \
      -e 's|@''HAVE_PTSNAME_R''@|1|g' \
      -e 's|@''HAVE_QSORT_R''@|1|g' \
      -e 's|@''HAVE_RANDOM''@|1|g' \
      -e 's|@''HAVE_RANDOM_H''@|1|g' \
      -e 's|@''HAVE_RANDOM_R''@|1|g' \
      -e 's|@''HAVE_REALLOCARRAY''@|1|g' \
      -e 's|@''HAVE_REALPATH''@|1|g' \
      -e 's|@''HAVE_RPMATCH''@|1|g' \
      -e 's|@''HAVE_SECURE_GETENV''@|1|g' \
      -e 's|@''HAVE_DECL_SETENV''@|1|g' \
      -e 's|@''HAVE_SETSTATE''@|1|g' \
      -e 's|@''HAVE_DECL_SETSTATE''@|1|g' \
      -e 's|@''HAVE_STRTOD''@|1|g' \
      -e 's|@''HAVE_STRTOF''@|1|g' \
      -e 's|@''HAVE_STRTOL''@|1|g' \
      -e 's|@''HAVE_STRTOLD''@|1|g' \
      -e 's|@''HAVE_STRTOLL''@|1|g' \
      -e 's|@''HAVE_STRTOUL''@|1|g' \
      -e 's|@''HAVE_STRTOULL''@|1|g' \
      -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|1|g' \
      -e 's|@''HAVE_SYS_LOADAVG_H''@|0|g' \
      -e 's|@''HAVE_UNLOCKPT''@|1|g' \
      -e 's|@''HAVE_DECL_UNSETENV''@|1|g' \
      < stdlib.h-t1 > stdlib.h-t2
sed \
      -e 's|@''REPLACE__EXIT''@|0|g' \
      -e 's|@''REPLACE_ABORT''@|0|g' \
      -e 's|@''REPLACE_ALIGNED_ALLOC''@|0|g' \
      -e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|0|g' \
      -e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|0|g' \
      -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|0|g' \
      -e 's|@''REPLACE_FREE''@|0|g' \
      -e 's|@''REPLACE_GETLOADAVG''@|0|g' \
      -e 's|@''REPLACE_GETPROGNAME''@|0|g' \
      -e 's|@''REPLACE_GETSUBOPT''@|0|g' \
      -e 's|@''REPLACE_INITSTATE''@|0|g' \
      -e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|0|g' \
      -e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|0|g' \
      -e 's|@''REPLACE_MB_CUR_MAX''@|0|g' \
      -e 's|@''REPLACE_MBSTOWCS''@|0|g' \
      -e 's|@''REPLACE_MBTOWC''@|0|g' \
      -e 's|@''REPLACE_MKOSTEMP''@|0|g' \
      -e 's|@''REPLACE_MKOSTEMPS''@|0|g' \
      -e 's|@''REPLACE_MKSTEMP''@|0|g' \
      -e 's|@''REPLACE_POSIX_MEMALIGN''@|0|g' \
      -e 's|@''REPLACE_POSIX_OPENPT''@|0|g' \
      -e 's|@''REPLACE_PTSNAME''@|0|g' \
      -e 's|@''REPLACE_PTSNAME_R''@|0|g' \
      -e 's|@''REPLACE_PUTENV''@|0|g' \
      -e 's|@''REPLACE_QSORT_R''@|0|g' \
      -e 's|@''REPLACE_RAND''@|0|g' \
      -e 's|@''REPLACE_RANDOM''@|0|g' \
      -e 's|@''REPLACE_RANDOM_R''@|0|g' \
      -e 's|@''REPLACE_REALLOC_FOR_REALLOC_GNU''@|0|g' \
      -e 's|@''REPLACE_REALLOC_FOR_REALLOC_POSIX''@|0|g' \
      -e 's|@''REPLACE_REALLOCARRAY''@|0|g' \
      -e 's|@''REPLACE_REALPATH''@|0|g' \
      -e 's|@''REPLACE_SETENV''@|0|g' \
      -e 's|@''REPLACE_SETSTATE''@|0|g' \
      -e 's|@''REPLACE_STRTOD''@|0|g' \
      -e 's|@''REPLACE_STRTOF''@|0|g' \
      -e 's|@''REPLACE_STRTOL''@|0|g' \
      -e 's|@''REPLACE_STRTOLD''@|0|g' \
      -e 's|@''REPLACE_STRTOLL''@|0|g' \
      -e 's|@''REPLACE_STRTOUL''@|0|g' \
      -e 's|@''REPLACE_STRTOULL''@|0|g' \
      -e 's|@''REPLACE_UNSETENV''@|0|g' \
      -e 's|@''REPLACE_WCTOMB''@|0|g' \
      -e 's|@''CAN_PRINT_STACK_TRACE''@|0|g' \
      -e '/definitions of _GL_FUNCDECL_RPL/r ../../gltests/c++defs.h' \
      -e '/definition of _Noreturn/r ../../gltests/_Noreturn.h' \
      -e '/definition of _GL_ARG_NONNULL/r ../../gltests/arg-nonnull.h' \
      -e '/definition of _GL_WARN_ON_USE/r ../../gltests/warn-on-use.h' \
      < stdlib.h-t2 > stdlib.h-t3
rm -f stdlib.h-t1 stdlib.h-t2
mv stdlib.h-t3 stdlib.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''HAVE_UNISTD_H''@|1|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''NEXT_UNISTD_H''@|<unistd.h>|g' \
      -e 's|@''WINDOWS_64_BIT_OFF_T''@|0|g' \
      -e 's/@''GNULIB_ACCESS''@/0/g' \
      -e 's/@''GNULIB_CHDIR''@/0/g' \
      -e 's/@''GNULIB_CHOWN''@/0/g' \
      -e 's/@''GNULIB_CLOSE''@/0/g' \
      -e 's/@''GNULIB_COPY_FILE_RANGE''@/0/g' \
      -e 's/@''GNULIB_DUP''@/0/g' \
      -e 's/@''GNULIB_DUP2''@/0/g' \
      -e 's/@''GNULIB_DUP3''@/0/g' \
      -e 's/@''GNULIB_ENVIRON''@/0/g' \
      -e 's/@''GNULIB_EUIDACCESS''@/0/g' \
      -e 's/@''GNULIB_EXECL''@/0/g' \
      -e 's/@''GNULIB_EXECLE''@/0/g' \
      -e 's/@''GNULIB_EXECLP''@/0/g' \
      -e 's/@''GNULIB_EXECV''@/0/g' \
      -e 's/@''GNULIB_EXECVE''@/0/g' \
      -e 's/@''GNULIB_EXECVP''@/0/g' \
      -e 's/@''GNULIB_EXECVPE''@/0/g' \
      -e 's/@''GNULIB_FACCESSAT''@/0/g' \
      -e 's/@''GNULIB_FCHDIR''@/0/g' \
      -e 's/@''GNULIB_FCHOWNAT''@/0/g' \
      -e 's/@''GNULIB_FDATASYNC''@/0/g' \
      -e 's/@''GNULIB_FSYNC''@/0/g' \
      -e 's/@''GNULIB_FTRUNCATE''@/0/g' \
      < ../../gltests/unistd.in.h > unistd.h-t1
sed \
      -e 's/@''GNULIB_GETCWD''@/0/g' \
      -e 's/@''GNULIB_GETDOMAINNAME''@/0/g' \
      -e 's/@''GNULIB_GETDTABLESIZE''@/0/g' \
      -e 's/@''GNULIB_GETENTROPY''@/0/g' \
      -e 's/@''GNULIB_GETGROUPS''@/0/g' \
      -e 's/@''GNULIB_GETHOSTNAME''@/0/g' \
      -e 's/@''GNULIB_GETLOGIN''@/0/g' \
      -e 's/@''GNULIB_GETLOGIN_R''@/0/g' \
      -e 's/@''GNULIB_GETOPT_POSIX''@/0/g' \
      -e 's/@''GNULIB_GETPAGESIZE''@/0/g' \
      -e 's/@''GNULIB_GETPASS''@/0/g' \
      -e 's/@''GNULIB_GETPASS_GNU''@/0/g' \
      -e 's/@''GNULIB_GETUSERSHELL''@/0/g' \
      -e 's/@''GNULIB_GROUP_MEMBER''@/0/g' \
      -e 's/@''GNULIB_ISATTY''@/0/g' \
      -e 's/@''GNULIB_LCHOWN''@/0/g' \
      -e 's/@''GNULIB_LINK''@/0/g' \
      -e 's/@''GNULIB_LINKAT''@/0/g' \
      -e 's/@''GNULIB_LSEEK''@/0/g' \
      -e 's/@''GNULIB_PIPE''@/0/g' \
      -e 's/@''GNULIB_PIPE2''@/0/g' \
      -e 's/@''GNULIB_PREAD''@/0/g' \
      -e 's/@''GNULIB_PWRITE''@/0/g' \
      -e 's/@''GNULIB_READ''@/0/g' \
      -e 's/@''GNULIB_READLINK''@/0/g' \
      -e 's/@''GNULIB_READLINKAT''@/0/g' \
      -e 's/@''GNULIB_RMDIR''@/0/g' \
      -e 's/@''GNULIB_SETHOSTNAME''@/0/g' \
      -e 's/@''GNULIB_SLEEP''@/0/g' \
      -e 's/@''GNULIB_SYMLINK''@/0/g' \
      -e 's/@''GNULIB_SYMLINKAT''@/0/g' \
      -e 's/@''GNULIB_TRUNCATE''@/0/g' \
      -e 's/@''GNULIB_TTYNAME_R''@/0/g' \
      -e 's/@''GNULIB_UNISTD_H_GETOPT''@/00/g' \
      -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/0/g' \
      -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/0/g' \
      -e 's/@''GNULIB_UNLINK''@/0/g' \
      -e 's/@''GNULIB_UNLINKAT''@/0/g' \
      -e 's/@''GNULIB_USLEEP''@/0/g' \
      -e 's/@''GNULIB_WRITE''@/0/g' \
      -e 's/@''GNULIB_MDA_ACCESS''@/1/g' \
      -e 's/@''GNULIB_MDA_CHDIR''@/1/g' \
      -e 's/@''GNULIB_MDA_CLOSE''@/1/g' \
      -e 's/@''GNULIB_MDA_DUP''@/1/g' \
      -e 's/@''GNULIB_MDA_DUP2''@/1/g' \
      -e 's/@''GNULIB_MDA_EXECL''@/1/g' \
      -e 's/@''GNULIB_MDA_EXECLE''@/1/g' \
      -e 's/@''GNULIB_MDA_EXECLP''@/1/g' \
      -e 's/@''GNULIB_MDA_EXECV''@/1/g' \
      -e 's/@''GNULIB_MDA_EXECVE''@/1/g' \
      -e 's/@''GNULIB_MDA_EXECVP''@/1/g' \
      -e 's/@''GNULIB_MDA_EXECVPE''@/1/g' \
      -e 's/@''GNULIB_MDA_GETCWD''@/1/g' \
      -e 's/@''GNULIB_MDA_GETPID''@/1/g' \
      -e 's/@''GNULIB_MDA_ISATTY''@/1/g' \
      -e 's/@''GNULIB_MDA_LSEEK''@/1/g' \
      -e 's/@''GNULIB_MDA_READ''@/1/g' \
      -e 's/@''GNULIB_MDA_RMDIR''@/1/g' \
      -e 's/@''GNULIB_MDA_SWAB''@/1/g' \
      -e 's/@''GNULIB_MDA_UNLINK''@/1/g' \
      -e 's/@''GNULIB_MDA_WRITE''@/1/g' \
      < unistd.h-t1 > unistd.h-t2
sed \
      -e 's|@''HAVE_CHOWN''@|1|g' \
      -e 's|@''HAVE_COPY_FILE_RANGE''@|1|g' \
      -e 's|@''HAVE_DUP3''@|1|g' \
      -e 's|@''HAVE_EUIDACCESS''@|1|g' \
      -e 's|@''HAVE_EXECVPE''@|1|g' \
      -e 's|@''HAVE_FACCESSAT''@|1|g' \
      -e 's|@''HAVE_FCHDIR''@|1|g' \
      -e 's|@''HAVE_FCHOWNAT''@|1|g' \
      -e 's|@''HAVE_FDATASYNC''@|1|g' \
      -e 's|@''HAVE_FSYNC''@|1|g' \
      -e 's|@''HAVE_FTRUNCATE''@|1|g' \
      -e 's|@''HAVE_GETDTABLESIZE''@|1|g' \
      -e 's|@''HAVE_GETENTROPY''@|1|g' \
      -e 's|@''HAVE_GETGROUPS''@|1|g' \
      -e 's|@''HAVE_GETHOSTNAME''@|1|g' \
      -e 's|@''HAVE_GETPAGESIZE''@|1|g' \
      -e 's|@''HAVE_GETPASS''@|1|g' \
      -e 's|@''HAVE_GROUP_MEMBER''@|1|g' \
      -e 's|@''HAVE_LCHOWN''@|1|g' \
      -e 's|@''HAVE_LINK''@|1|g' \
      -e 's|@''HAVE_LINKAT''@|1|g' \
      -e 's|@''HAVE_PIPE''@|1|g' \
      -e 's|@''HAVE_PIPE2''@|1|g' \
      -e 's|@''HAVE_PREAD''@|1|g' \
      -e 's|@''HAVE_PWRITE''@|1|g' \
      -e 's|@''HAVE_READLINK''@|1|g' \
      -e 's|@''HAVE_READLINKAT''@|1|g' \
      -e 's|@''HAVE_SETHOSTNAME''@|1|g' \
      -e 's|@''HAVE_SLEEP''@|1|g' \
      -e 's|@''HAVE_SYMLINK''@|1|g' \
      -e 's|@''HAVE_SYMLINKAT''@|1|g' \
      -e 's|@''HAVE_UNLINKAT''@|1|g' \
      -e 's|@''HAVE_USLEEP''@|1|g' \
      -e 's|@''HAVE_DECL_ENVIRON''@|1|g' \
      -e 's|@''HAVE_DECL_EXECVPE''@|1|g' \
      -e 's|@''HAVE_DECL_FCHDIR''@|1|g' \
      -e 's|@''HAVE_DECL_FDATASYNC''@|1|g' \
      -e 's|@''HAVE_DECL_GETDOMAINNAME''@|1|g' \
      -e 's|@''HAVE_DECL_GETLOGIN''@|1|g' \
      -e 's|@''HAVE_DECL_GETLOGIN_R''@|1|g' \
      -e 's|@''HAVE_DECL_GETPAGESIZE''@|1|g' \
      -e 's|@''HAVE_DECL_GETUSERSHELL''@|1|g' \
      -e 's|@''HAVE_DECL_SETHOSTNAME''@|1|g' \
      -e 's|@''HAVE_DECL_TRUNCATE''@|1|g' \
      -e 's|@''HAVE_DECL_TTYNAME_R''@|1|g' \
      -e 's|@''HAVE_OS_H''@|0|g' \
      -e 's|@''HAVE_SYS_PARAM_H''@|0|g' \
      < unistd.h-t2 > unistd.h-t3
sed \
      -e 's|@''REPLACE_ACCESS''@|0|g' \
      -e 's|@''REPLACE_CHOWN''@|0|g' \
      -e 's|@''REPLACE_CLOSE''@|0|g' \
      -e 's|@''REPLACE_COPY_FILE_RANGE''@|0|g' \
      -e 's|@''REPLACE_DUP''@|0|g' \
      -e 's|@''REPLACE_DUP2''@|0|g' \
      -e 's|@''REPLACE_DUP3''@|0|g' \
      -e 's|@''REPLACE_EXECL''@|0|g' \
      -e 's|@''REPLACE_EXECLE''@|0|g' \
      -e 's|@''REPLACE_EXECLP''@|0|g' \
      -e 's|@''REPLACE_EXECV''@|0|g' \
      -e 's|@''REPLACE_EXECVE''@|0|g' \
      -e 's|@''REPLACE_EXECVP''@|0|g' \
      -e 's|@''REPLACE_EXECVPE''@|0|g' \
      -e 's|@''REPLACE_FACCESSAT''@|0|g' \
      -e 's|@''REPLACE_FCHDIR''@|0|g' \
      -e 's|@''REPLACE_FCHOWNAT''@|0|g' \
      -e 's|@''REPLACE_FDATASYNC''@|0|g' \
      -e 's|@''REPLACE_FTRUNCATE''@|0|g' \
      -e 's|@''REPLACE_GETCWD''@|0|g' \
      -e 's|@''REPLACE_GETDOMAINNAME''@|0|g' \
      -e 's|@''REPLACE_GETDTABLESIZE''@|0|g' \
      -e 's|@''REPLACE_GETENTROPY''@|0|g' \
      -e 's|@''REPLACE_GETLOGIN_R''@|0|g' \
      -e 's|@''REPLACE_GETGROUPS''@|0|g' \
      -e 's|@''REPLACE_GETPAGESIZE''@|0|g' \
      -e 's|@''REPLACE_GETPASS''@|0|g' \
      -e 's|@''REPLACE_GETPASS_FOR_GETPASS_GNU''@|0|g' \
      -e 's|@''REPLACE_GETUSERSHELL''@|0|g' \
      -e 's|@''REPLACE_ISATTY''@|0|g' \
      -e 's|@''REPLACE_LCHOWN''@|0|g' \
      -e 's|@''REPLACE_LINK''@|0|g' \
      -e 's|@''REPLACE_LINKAT''@|0|g' \
      -e 's|@''REPLACE_LSEEK''@|0|g' \
      -e 's|@''REPLACE_PIPE2''@|0|g' \
      -e 's|@''REPLACE_PREAD''@|0|g' \
      -e 's|@''REPLACE_PWRITE''@|0|g' \
      -e 's|@''REPLACE_READ''@|0|g' \
      -e 's|@''REPLACE_READLINK''@|0|g' \
      -e 's|@''REPLACE_READLINKAT''@|0|g' \
      -e 's|@''REPLACE_RMDIR''@|0|g' \
      -e 's|@''REPLACE_SETHOSTNAME''@|0|g' \
      -e 's|@''REPLACE_SLEEP''@|0|g' \
      -e 's|@''REPLACE_SYMLINK''@|0|g' \
      -e 's|@''REPLACE_SYMLINKAT''@|0|g' \
      -e 's|@''REPLACE_TRUNCATE''@|0|g' \
      -e 's|@''REPLACE_TTYNAME_R''@|0|g' \
      -e 's|@''REPLACE_UNLINK''@|0|g' \
      -e 's|@''REPLACE_UNLINKAT''@|0|g' \
      -e 's|@''REPLACE_USLEEP''@|0|g' \
      -e 's|@''REPLACE_WRITE''@|0|g' \
      -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|0|g' \
      -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|1|g' \
      -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|0|g' \
      -e '/definitions of _GL_FUNCDECL_RPL/r ../../gltests/c++defs.h' \
      -e '/definition of _GL_ARG_NONNULL/r ../../gltests/arg-nonnull.h' \
      -e '/definition of _GL_WARN_ON_USE/r ../../gltests/warn-on-use.h' \
      < unistd.h-t3 > unistd.h-t4
rm -f unistd.h-t1 unistd.h-t2 unistd.h-t3
mv unistd.h-t4 unistd.h
sed -e 1h -e '1s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,' -e 1G \
      -e 's|@''GUARD_PREFIX''@|GL|g' \
      -e 's|@''INCLUDE_NEXT''@|include_next|g' \
      -e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
      -e 's|@''PRAGMA_COLUMNS''@||g' \
      -e 's|@''HAVE_FEATURES_H''@|0|g' \
      -e 's|@''NEXT_WCHAR_H''@|<wchar.h>|g' \
      -e 's|@''HAVE_WCHAR_H''@|1|g' \
      -e 's/@''HAVE_CRTDEFS_H''@/1/g' \
      -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/1/g' \
      -e 's/@''GNULIB_BTOWC''@/0/g' \
      -e 's/@''GNULIB_WCTOB''@/0/g' \
      -e 's/@''GNULIB_MBSINIT''@/0/g' \
      -e 's/@''GNULIB_MBSZERO''@/0/g' \
      -e 's/@''GNULIB_MBRTOWC''@/0/g' \
      -e 's/@''GNULIB_MBRLEN''@/0/g' \
      -e 's/@''GNULIB_MBSRTOWCS''@/0/g' \
      -e 's/@''GNULIB_MBSNRTOWCS''@/0/g' \
      -e 's/@''GNULIB_WCRTOMB''@/0/g' \
      -e 's/@''GNULIB_WCSRTOMBS''@/0/g' \
      -e 's/@''GNULIB_WCSNRTOMBS''@/0/g' \
      -e 's/@''GNULIB_WCWIDTH''@/0/g' \
      -e 's/@''GNULIB_WMEMCHR''@/0/g' \
      -e 's/@''GNULIB_WMEMCMP''@/0/g' \
      -e 's/@''GNULIB_WMEMCPY''@/0/g' \
      -e 's/@''GNULIB_WMEMMOVE''@/0/g' \
      -e 's/@''GNULIB_WMEMPCPY''@/0/g' \
      -e 's/@''GNULIB_WMEMSET''@/0/g' \
      -e 's/@''GNULIB_WCSLEN''@/0/g' \
      -e 's/@''GNULIB_WCSNLEN''@/0/g' \
      -e 's/@''GNULIB_WCSCPY''@/0/g' \
      -e 's/@''GNULIB_WCPCPY''@/0/g' \
      -e 's/@''GNULIB_WCSNCPY''@/0/g' \
      -e 's/@''GNULIB_WCPNCPY''@/0/g' \
      -e 's/@''GNULIB_WCSCAT''@/0/g' \
      -e 's/@''GNULIB_WCSNCAT''@/0/g' \
      -e 's/@''GNULIB_WCSCMP''@/0/g' \
      -e 's/@''GNULIB_WCSNCMP''@/0/g' \
      -e 's/@''GNULIB_WCSCASECMP''@/0/g' \
      -e 's/@''GNULIB_WCSNCASECMP''@/0/g' \
      -e 's/@''GNULIB_WCSCOLL''@/0/g' \
      -e 's/@''GNULIB_WCSXFRM''@/0/g' \
      -e 's/@''GNULIB_WCSDUP''@/0/g' \
      -e 's/@''GNULIB_WCSCHR''@/0/g' \
      -e 's/@''GNULIB_WCSRCHR''@/0/g' \
      -e 's/@''GNULIB_WCSCSPN''@/0/g' \
      -e 's/@''GNULIB_WCSSPN''@/0/g' \
      -e 's/@''GNULIB_WCSPBRK''@/0/g' \
      -e 's/@''GNULIB_WCSSTR''@/0/g' \
      -e 's/@''GNULIB_WCSTOK''@/0/g' \
      -e 's/@''GNULIB_WCSWIDTH''@/0/g' \
      -e 's/@''GNULIB_WCSFTIME''@/0/g' \
      -e 's/@''GNULIB_WGETCWD''@/0/g' \
      -e 's/@''GNULIB_MDA_WCSDUP''@/1/g' \
      -e 's/@''GNULIB_FREE_POSIX''@/0/g' \
      < ../../gltests/wchar.in.h > wchar.h-t1
sed \
      -e 's|@''HAVE_WINT_T''@|1|g' \
      -e 's|@''HAVE_BTOWC''@|1|g' \
      -e 's|@''HAVE_MBSINIT''@|1|g' \
      -e 's|@''HAVE_MBRTOWC''@|1|g' \
      -e 's|@''HAVE_MBRLEN''@|1|g' \
      -e 's|@''HAVE_MBSRTOWCS''@|1|g' \
      -e 's|@''HAVE_MBSNRTOWCS''@|1|g' \
      -e 's|@''HAVE_WCRTOMB''@|1|g' \
      -e 's|@''HAVE_WCSRTOMBS''@|1|g' \
      -e 's|@''HAVE_WCSNRTOMBS''@|1|g' \
      -e 's|@''HAVE_WMEMCHR''@|1|g' \
      -e 's|@''HAVE_WMEMCMP''@|1|g' \
      -e 's|@''HAVE_WMEMCPY''@|1|g' \
      -e 's|@''HAVE_WMEMMOVE''@|1|g' \
      -e 's|@''HAVE_WMEMPCPY''@|1|g' \
      -e 's|@''HAVE_WMEMSET''@|1|g' \
      -e 's|@''HAVE_WCSLEN''@|1|g' \
      -e 's|@''HAVE_WCSNLEN''@|1|g' \
      -e 's|@''HAVE_WCSCPY''@|1|g' \
      -e 's|@''HAVE_WCPCPY''@|1|g' \
      -e 's|@''HAVE_WCSNCPY''@|1|g' \
      -e 's|@''HAVE_WCPNCPY''@|1|g' \
      -e 's|@''HAVE_WCSCAT''@|1|g' \
      -e 's|@''HAVE_WCSNCAT''@|1|g' \
      -e 's|@''HAVE_WCSCMP''@|1|g' \
      -e 's|@''HAVE_WCSNCMP''@|1|g' \
      -e 's|@''HAVE_WCSCASECMP''@|1|g' \
      -e 's|@''HAVE_WCSNCASECMP''@|1|g' \
      -e 's|@''HAVE_WCSCOLL''@|1|g' \
      -e 's|@''HAVE_WCSXFRM''@|1|g' \
      -e 's|@''HAVE_WCSDUP''@|1|g' \
      -e 's|@''HAVE_WCSCHR''@|1|g' \
      -e 's|@''HAVE_WCSRCHR''@|1|g' \
      -e 's|@''HAVE_WCSCSPN''@|1|g' \
      -e 's|@''HAVE_WCSSPN''@|1|g' \
      -e 's|@''HAVE_WCSPBRK''@|1|g' \
      -e 's|@''HAVE_WCSSTR''@|1|g' \
      -e 's|@''HAVE_WCSTOK''@|1|g' \
      -e 's|@''HAVE_WCSWIDTH''@|1|g' \
      -e 's|@''HAVE_WCSFTIME''@|1|g' \
      -e 's|@''HAVE_DECL_WCTOB''@|1|g' \
      -e 's|@''HAVE_DECL_WCSDUP''@|1|g' \
      -e 's|@''HAVE_DECL_WCWIDTH''@|1|g' \
      < wchar.h-t1 > wchar.h-t2
sed \
      -e 's|@''REPLACE_MBSTATE_T''@|0|g' \
      -e 's|@''REPLACE_BTOWC''@|0|g' \
      -e 's|@''REPLACE_WCTOB''@|0|g' \
      -e 's|@''REPLACE_FREE''@|0|g' \
      -e 's|@''REPLACE_MBSINIT''@|0|g' \
      -e 's|@''REPLACE_MBRTOWC''@|0|g' \
      -e 's|@''REPLACE_MBRLEN''@|0|g' \
      -e 's|@''REPLACE_MBSRTOWCS''@|0|g' \
      -e 's|@''REPLACE_MBSNRTOWCS''@|0|g' \
      -e 's|@''REPLACE_WCRTOMB''@|0|g' \
      -e 's|@''REPLACE_WCSRTOMBS''@|0|g' \
      -e 's|@''REPLACE_WCSNRTOMBS''@|0|g' \
      -e 's|@''REPLACE_WCWIDTH''@|0|g' \
      -e 's|@''REPLACE_WCSWIDTH''@|0|g' \
      -e 's|@''REPLACE_WCSFTIME''@|0|g' \
      -e 's|@''REPLACE_WCSCMP''@|0|g' \
      -e 's|@''REPLACE_WCSNCMP''@|0|g' \
      -e 's|@''REPLACE_WCSSTR''@|0|g' \
      -e 's|@''REPLACE_WCSTOK''@|0|g' \
      -e 's|@''REPLACE_WMEMCMP''@|0|g' \
      -e 's|@''REPLACE_WMEMPCPY''@|0|g' \
      -e '/definitions of _GL_FUNCDECL_RPL/r ../../gltests/c++defs.h' \
      -e '/definition of _GL_ARG_NONNULL/r ../../gltests/arg-nonnull.h' \
      -e '/definition of _GL_WARN_ON_USE/r ../../gltests/warn-on-use.h' \
      < wchar.h-t2 > wchar.h-t3
rm -f wchar.h-t1 wchar.h-t2
mv wchar.h-t3 wchar.h
## ---------------------------------------------------- ##
## ------------------- Gnulib tests ------------------- ##
## You can ignore compiler warnings in this directory.  ##
## ---------------------------------------------------- ##
make  all-recursive
make[3]: Entering directory '/home/bruno/testdir2/build-mingw64/gltests'
Making all in .
make[4]: Entering directory '/home/bruno/testdir2/build-mingw64/gltests'
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT test-alignasof.o -MD -MP -MF .deps/test-alignasof.Tpo -c 
-o test-alignasof.o ../../gltests/test-alignasof.c
mv -f .deps/test-alignasof.Tpo .deps/test-alignasof.Po
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT unistd.o -MD -MP -MF .deps/unistd.Tpo -c -o unistd.o 
../../gltests/unistd.c
mv -f .deps/unistd.Tpo .deps/unistd.Po
rm -f libtests.a
x86_64-w64-mingw32-ar cr libtests.a unistd.o 
x86_64-w64-mingw32-ranlib libtests.a
x86_64-w64-mingw32-gcc  -Wno-error -g -O2  -L/usr/local/mingw64/lib -o 
test-alignasof.exe test-alignasof.o libtests.a ../gllib/libgnu.a libtests.a 
../gllib/libgnu.a libtests.a  
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT test-arpa_inet.o -MD -MP -MF .deps/test-arpa_inet.Tpo -c 
-o test-arpa_inet.o ../../gltests/test-arpa_inet.c
mv -f .deps/test-arpa_inet.Tpo .deps/test-arpa_inet.Po
x86_64-w64-mingw32-gcc  -Wno-error -g -O2  -L/usr/local/mingw64/lib -o 
test-arpa_inet.exe test-arpa_inet.o libtests.a ../gllib/libgnu.a libtests.a 
../gllib/libgnu.a libtests.a  
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT test-assert.o -MD -MP -MF .deps/test-assert.Tpo -c -o 
test-assert.o ../../gltests/test-assert.c
mv -f .deps/test-assert.Tpo .deps/test-assert.Po
x86_64-w64-mingw32-gcc  -Wno-error -g -O2  -L/usr/local/mingw64/lib -o 
test-assert.exe test-assert.o libtests.a ../gllib/libgnu.a libtests.a 
../gllib/libgnu.a libtests.a  
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT test-byteswap.o -MD -MP -MF .deps/test-byteswap.Tpo -c -o 
test-byteswap.o ../../gltests/test-byteswap.c
mv -f .deps/test-byteswap.Tpo .deps/test-byteswap.Po
x86_64-w64-mingw32-gcc  -Wno-error -g -O2  -L/usr/local/mingw64/lib -o 
test-byteswap.exe test-byteswap.o libtests.a ../gllib/libgnu.a libtests.a 
../gllib/libgnu.a libtests.a  
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT test-endian.o -MD -MP -MF .deps/test-endian.Tpo -c -o 
test-endian.o ../../gltests/test-endian.c
mv -f .deps/test-endian.Tpo .deps/test-endian.Po
x86_64-w64-mingw32-gcc  -Wno-error -g -O2  -L/usr/local/mingw64/lib -o 
test-endian.exe test-endian.o libtests.a ../gllib/libgnu.a libtests.a 
../gllib/libgnu.a libtests.a  
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT test-errno.o -MD -MP -MF .deps/test-errno.Tpo -c -o 
test-errno.o ../../gltests/test-errno.c
mv -f .deps/test-errno.Tpo .deps/test-errno.Po
x86_64-w64-mingw32-gcc  -Wno-error -g -O2  -L/usr/local/mingw64/lib -o 
test-errno.exe test-errno.o libtests.a ../gllib/libgnu.a libtests.a 
../gllib/libgnu.a libtests.a  
x86_64-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I../../gltests -I..  
-DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. 
-I../../gltests/.. -I../gllib -I../../gltests/../gllib 
-D_WIN32_WINNT=_WIN32_WINNT_WINXP -I/usr/local/mingw64/include -Wall  
-Wno-error -g -O2 -MT test-htonl.o -MD -MP -MF .deps/test-htonl.Tpo -c -o 
test-htonl.o ../../gltests/test-htonl.c
mv -f .deps/test-htonl.Tpo .deps/test-htonl.Po
x86_64-w64-mingw32-gcc  -Wno-error -g -O2  -L/usr/local/mingw64/lib -o 
test-htonl.exe test-htonl.o libtests.a ../gllib/libgnu.a libtests.a 
../gllib/libgnu.a libtests.a  
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: 
test-htonl.o: in function `test_convert_constant':
/home/bruno/testdir2/build-mingw64/gltests/../../gltests/test-htonl.c:43:(.text.startup+0x10):
 undefined reference to `__imp_htons'
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: 
/home/bruno/testdir2/build-mingw64/gltests/../../gltests/test-htonl.c:44:(.text.startup+0x28):
 undefined reference to `__imp_ntohs'
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: 
/home/bruno/testdir2/build-mingw64/gltests/../../gltests/test-htonl.c:47:(.text.startup+0x40):
 undefined reference to `__imp_htonl'
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: 
/home/bruno/testdir2/build-mingw64/gltests/../../gltests/test-htonl.c:48:(.text.startup+0x59):
 undefined reference to `__imp_ntohl'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:1466: test-htonl.exe] Error 1
make[4]: Leaving directory '/home/bruno/testdir2/build-mingw64/gltests'
make[3]: *** [Makefile:1601: all-recursive] Error 1
make[3]: Leaving directory '/home/bruno/testdir2/build-mingw64/gltests'
make[2]: *** [Makefile:1395: all] Error 2
make[2]: Leaving directory '/home/bruno/testdir2/build-mingw64/gltests'
make[1]: *** [Makefile:986: all-recursive] Error 1
make[1]: Leaving directory '/home/bruno/testdir2/build-mingw64'
make: *** [Makefile:927: all] Error 2
Making check in gllib
make[1]: Entering directory '/home/bruno/testdir2/build-mingw64/gllib'
make  check-recursive
make[2]: Entering directory '/home/bruno/testdir2/build-mingw64/gllib'
make[3]: Entering directory '/home/bruno/testdir2/build-mingw64/gllib'
make[3]: Nothing to be done for 'check-am'.
make[3]: Leaving directory '/home/bruno/testdir2/build-mingw64/gllib'
make[2]: Leaving directory '/home/bruno/testdir2/build-mingw64/gllib'
make[1]: Leaving directory '/home/bruno/testdir2/build-mingw64/gllib'
Making check in glm4
make[1]: Entering directory '/home/bruno/testdir2/build-mingw64/glm4'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/bruno/testdir2/build-mingw64/glm4'
Making check in gltests
make[1]: Entering directory '/home/bruno/testdir2/build-mingw64/gltests'
make  check-recursive
make[2]: Entering directory '/home/bruno/testdir2/build-mingw64/gltests'
Making check in .
make[3]: Entering directory '/home/bruno/testdir2/build-mingw64/gltests'
x86_64-w64-mingw32-gcc  -Wno-error -g -O2  -L/usr/local/mingw64/lib -o 
test-htonl.exe test-htonl.o libtests.a ../gllib/libgnu.a libtests.a 
../gllib/libgnu.a libtests.a  
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: 
test-htonl.o: in function `test_convert_constant':
/home/bruno/testdir2/build-mingw64/gltests/../../gltests/test-htonl.c:43:(.text.startup+0x10):
 undefined reference to `__imp_htons'
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: 
/home/bruno/testdir2/build-mingw64/gltests/../../gltests/test-htonl.c:44:(.text.startup+0x28):
 undefined reference to `__imp_ntohs'
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: 
/home/bruno/testdir2/build-mingw64/gltests/../../gltests/test-htonl.c:47:(.text.startup+0x40):
 undefined reference to `__imp_htonl'
/usr/lib/gcc/x86_64-w64-mingw32/11/../../../../x86_64-w64-mingw32/bin/ld: 
/home/bruno/testdir2/build-mingw64/gltests/../../gltests/test-htonl.c:48:(.text.startup+0x59):
 undefined reference to `__imp_ntohl'
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:1466: test-htonl.exe] Error 1
make[3]: Leaving directory '/home/bruno/testdir2/build-mingw64/gltests'
make[2]: *** [Makefile:1601: check-recursive] Error 1
make[2]: Leaving directory '/home/bruno/testdir2/build-mingw64/gltests'
make[1]: *** [Makefile:2088: check] Error 2
make[1]: Leaving directory '/home/bruno/testdir2/build-mingw64/gltests'
make: *** [Makefile:986: check-recursive] Error 1

Reply via email to