Update Gnulib to the latest git version
This patch allows us to remove a workaround in common-defs.h due to the gnulib fix in: https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00024.html All of GDB's local Gnulib patches were already fixed upstream per their descriptions, so this patch removes them all. The problem listed here: https://sourceware.org/ml/gdb-patches/2019-08/msg00553.html was probably partially fixed by moving gnulib to the toplevel; for the remainder, I am setting MAKEOVERRIDES to empty in gnulib/Makefile.am. See also the comment there (it fixes an issue with compilers that don't use C99/C11 by default such as GCC 4.8.5, the default on Centos 7). gdb/ChangeLog: 2019-12-16 Christian Biesinger <cbiesinger@google.com> * gdbsupport/common-defs.h: Remove workaround for a gnulib bug (we no longer need to include time.h before pathmax.h) gnulib/ChangeLog: 2019-12-16 Christian Biesinger <cbiesinger@google.com> * Makefile.am: Set MAKEOVERRIDES. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. * config.in: Regenerate. * configure: Regenerate. * import/Makefile.am: Update. * import/Makefile.in: Regenerate. * import/_Noreturn.h: New file. * import/alloca.c (i00afunc): Update. * import/alloca.in.h (if): Update. * import/arg-nonnull.h: Rename from import/extra/snippet/arg-nonnull.h. * import/arpa_inet.in.h (if): Update. * import/assure.h: Update. * import/at-func.c: Update. * import/basename-lgpl.c: Update. * import/canonicalize-lgpl.c (if): Update. * import/c++defs.h: Rename from import/extra/snippet/c++defs.h. * import/cdefs.h: New file. * import/chdir-long.c: Update. * import/chdir-long.h: Update. * import/cloexec.c: Update. * import/cloexec.h: Update. * import/close.c: Update. * import/closedir.c: Update. * import/config.charset: Remove. * import/dirent-private.h: Update. * import/dirent.in.h: Update. * import/dirfd.c: Update. * import/dirname-lgpl.c: Update. * import/dirname.h (base_name): Update. * import/dosname.h (if): Update. * import/dup-safer-flag.c: New file. * import/dup-safer.c: Update. * import/dup.c: Update. * import/dup2.c (if): Update. (dup2_nothrow): Update. (ms_windows_dup2): Update. * import/errno.in.h (if): Update. (elif): Update. * import/error.c (if): Update. (strerror_r): Update. (program_name): Update. (error): Update. (error_at_line): Update. * import/error.h: Update. * import/exitfail.c: Update. * import/exitfail.h: Update. * import/extra/config.rpath: Update. * import/extra/snippet/_Noreturn.h: Remove. * import/extra/update-copyright: Update. * import/fchdir.c: Update. * import/fcntl.c (rpl_fcntl): Update. (INCL_DOS): Update. (if): Update. (rpl_fcntl_DUPFD): Update. (rpl_fcntl_DUPFD_CLOEXEC): Update. (klibc_fcntl): Update. (fcntl): Update. (have_dupfd_cloexec): Update. * import/fcntl.in.h (if): Update. (creat): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. (O_CLOEXEC): Update. (GNULIB_defined_O_CLOEXEC): Update. * import/fd-hook.c: Update. * import/fd-hook.h: Update. * import/fd-safer-flag.c: New file. * import/fd-safer.c: Update. * import/fdopendir.c: Update. * import/filename.h: Update. * import/filenamecat-lgpl.c (longest_relative_suffix): Update. (mfile_name_concat): Update. * import/filenamecat.h: Update. * import/flexmember.h: Update. * import/float+.h: Update. * import/float.c: Update. * import/float.in.h (LDBL_MIN): Update. * import/fnmatch.c (__builtin_expect): Update. (FALLTHROUGH): Update. * import/fnmatch.in.h (_FNMATCH_H): Update. (_): Update. (fnmatch): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. * import/fnmatch_loop.c (FCT): Update. (EXT): Update. * import/fpucw.h (GET_FPUCW): Update. (SET_FPUCW): Update. * import/frexp.c: Update. * import/frexpl.c: Update. * import/fstat.c (stat): Update. (fstat): Update. (WINDOWS_NATIVE): Update. (fstat_nothrow): Update. (WIN32_LEAN_AND_MEAN): Update. * import/fstatat.c (normal_fstatat): Update. (rpl_fstatat): Update. * import/getcwd-lgpl.c (rpl_getcwd): Update. * import/getcwd.c (getcwd_nothrow): Update. (getcwd_system): Update. (__getcwd): Update. * import/getdtablesize.c (if): Update. (_setmaxstdio): Update. (_setmaxstdio_nothrow): Update. (getdtablesize): Update. * import/getlogin_r.c (if): Update. (getlogin_r): Update. * import/getprogname.c (getprogname): Update. * import/getprogname.h: Update. * import/gettext.h (if): Update. * import/gettimeofday.c (WINDOWS_NATIVE): Update. (localtime): Update. (GetProcAddress): Update. (gmtime): Update. (void): Update. (struct tm): Update. (rpl_localtime): Update. (initialize): Update. (rpl_gmtime): Update. (tzset): Update. (rpl_tzset): Update. * import/glob-libc.h (_Restrict_): Update. (__size_t): Update. (__need_size_t): Update. (glob): Update. (globfree): Update. (__REDIRECT_NTH): Update. (glob64): Update. (globfree64): Update. (glob_pattern_p): Update. * import/glob.c (POSIX): Update. (if): Update. (__set_errno): Update. (getpwnam_r): Update. (__lstat64): Update. (FLEXIBLE_ARRAY_MEMBER): Update. (__glob_pattern_p): Update. (GETPW_R_SIZE_MAX): Update. (GET_LOGIN_NAME_MAX): Update. (DT_UNKNOWN): Update. (DT_DIR): Update. (DT_LNK): Update. (D_TYPE_TO_RESULT): Update. (readdir_result_might_be_symlink): Update. (readdir_result_might_be_dir): Update. (readdir_result_type): Update. (D_INO_TO_RESULT): Update. (READDIR_RESULT_INITIALIZER): Update. (attribute_hidden): Update. (__attribute_noinline__): Update. (__builtin_expect): Update. (__glibc_unlikely): Update. (__has_builtin): Update. (__glob_pattern_type): Update. (is_dir): Update. (glob): Update. (globfree): Update. (libc_hidden_def): Update. (DIRSEP_CHAR): Update. (prefix_array): Update. (weak_alias): Update. (link_exists2_p): Update. (link_exists_p): Update. (glob_in_dir): Update. (GLOBNAMES_MEMBERS): Update. * import/glob.in.h (_GL_GLOB_H): Update. (_): Update. (__BEGIN_DECLS): Update. (__END_DECLS): Update. (_Restrict_): Update. (__THROW): Update. (__THROWNL): Update. (__size_t): Update. (__USE_GNU): Update. (glob): Update. (globfree): Update. (glob_pattern_p): Update. (__glob_pattern_p): Update. (__GLOB_GNULIB): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_WARN_ON_USE): Update. * import/glob_internal.h: New file. * import/glob_pattern_p.c: New file. * import/globfree.c: New file. * import/glthread/lock.c (glthread_rwlock_init_for_glibc): Update. (glthread_rwlock_rdlock_multithreaded): Update. (glthread_once_call): Update. (glthread_once_multithreaded): Update. (glthread_once_singlethreaded): Update. (glthread_recursive_lock_init_multithreaded): Update. (glthread_recursive_lock_lock_multithreaded): Update. (glthread_recursive_lock_unlock_multithreaded): Update. (glthread_recursive_lock_destroy_multithreaded): Update. (glthread_lock_init_func): Update. (glthread_lock_lock_func): Update. (glthread_lock_unlock_func): Update. (glthread_lock_destroy_func): Update. (gl_waitqueue_t): Update. (gl_waitqueue_init): Update. (gl_waitqueue_add): Update. (gl_waitqueue_notify_first): Update. (gl_waitqueue_notify_all): Update. (glthread_rwlock_init_func): Update. (glthread_rwlock_rdlock_func): Update. (glthread_rwlock_wrlock_func): Update. (glthread_rwlock_unlock_func): Update. (glthread_rwlock_destroy_func): Update. (glthread_recursive_lock_init_func): Update. (glthread_recursive_lock_lock_func): Update. (glthread_recursive_lock_unlock_func): Update. (glthread_recursive_lock_destroy_func): Update. (glthread_once_func): Update. * import/glthread/lock.h (c11_threads_in_use): Update. (pthread_in_use): Update. (gl_rwlock_initializer): Update. (glthread_rwlock_init): Update. (glthread_rwlock_init_for_glibc): Update. (pth_in_use): Update. (gl_lock_define): Update. (gl_lock_define_initialized): Update. (gl_lock_initializer): Update. (glthread_lock_init): Update. (glthread_lock_lock): Update. (glthread_lock_unlock): Update. (glthread_lock_destroy): Update. (gl_rwlock_define): Update. (gl_rwlock_define_initialized): Update. (glthread_rwlock_rdlock): Update. (glthread_rwlock_wrlock): Update. (glthread_rwlock_unlock): Update. (glthread_rwlock_destroy): Update. (gl_recursive_lock_define): Update. (gl_recursive_lock_define_initialized): Update. (gl_recursive_lock_initializer): Update. (glthread_recursive_lock_init): Update. (glthread_recursive_lock_lock): Update. (glthread_recursive_lock_unlock): Update. (glthread_recursive_lock_destroy): Update. (gl_once_define): Update. (glthread_once): Update. (glthread_once_multithreaded): Update. (glthread_once_singlethreaded): Update. (thread_in_use): Update. (glthread_recursive_lock_init_multithreaded): Update. (glthread_recursive_lock_lock_multithreaded): Update. (glthread_recursive_lock_unlock_multithreaded): Update. (glthread_recursive_lock_destroy_multithreaded): Update. (glthread_lock_init_func): Update. (glthread_lock_lock_func): Update. (glthread_lock_unlock_func): Update. (glthread_lock_destroy_func): Update. (glthread_rwlock_init_func): Update. (glthread_rwlock_rdlock_func): Update. (glthread_rwlock_wrlock_func): Update. (glthread_rwlock_unlock_func): Update. (glthread_rwlock_destroy_func): Update. (glthread_recursive_lock_init_func): Update. (glthread_recursive_lock_lock_func): Update. (glthread_recursive_lock_unlock_func): Update. (glthread_recursive_lock_destroy_func): Update. (glthread_once_func): Update. * import/glthread/threadlib.c: Update. * import/hard-locale.c: Update. * import/hard-locale.h: Update. * import/inet_ntop.c: Update. * import/intprops.h (__has_builtin): Update. (_GL_INT_CONVERT): Update. (_GL_INT_NEGATE_CONVERT): Update. (verify): Update. (_GL_HAS_BUILTIN_OVERFLOW): Update. (_GL_HAS_BUILTIN_ADD_OVERFLOW): Update. (_GL_HAS_BUILTIN_OVERFLOW_P): Update. (_GL_HAS_BUILTIN_MUL_OVERFLOW): Update. (_GL_BINARY_OP_OVERFLOW): Update. (INT_ADD_WRAPV): Update. (INT_SUBTRACT_WRAPV): Update. (INT_MULTIPLY_WRAPV): Update. (_GL_INT_OP_WRAPV): Update. (_GL_INT_OP_WRAPV_SMALLISH): Update. (_GL_INT_OP_WRAPV_LONGISH): Update. (_GL_INT_OP_CALC): Update. (_GL_INT_OP_CALC1): Update. (_GL_INT_OP_WRAPV_VIA_UNSIGNED): Update. (_GL_INT_ADD_RANGE_OVERFLOW): Update. (_GL_INT_SUBTRACT_RANGE_OVERFLOW): Update. (_GL_INT_MULTIPLY_RANGE_OVERFLOW): Update. * import/inttypes.in.h (if): Update. * import/isnan.c: Update. * import/isnand-nolibm.h: Update. * import/isnand.c: Update. * import/isnanl-nolibm.h: Update. * import/isnanl.c: Update. * import/itold.c: Update. * import/libc-config.h: New file. * import/limits.in.h (LLONG_MIN): Update. (LLONG_MAX): Update. (ULLONG_MAX): Update. (WORD_BIT): Update. (LONG_BIT): Update. * import/localcharset.c (setlocale): Update. (relocate): Update. (O_NOFOLLOW): Update. (ISSLASH): Update. (DIRECTORY_SEPARATOR): Update. (getc): Update. (volatile): Update. (get_charset_aliases): Update. (struct table_entry): Update. (alias_table_defined): Update. (locale_table_defined): Update. (locale_charset): Update. (if): Update. * import/localcharset.h: Update. * import/localtime-buffer.c: New file. * import/localtime-buffer.h: New file. * import/lstat.c (rpl_lstat): Update. * import/m4/00gnulib.m4: Update. * import/m4/__inline.m4: New file. * import/m4/absolute-header.m4: Update. * import/m4/alloca.m4: Update. * import/m4/arpa_inet_h.m4: Update. * import/m4/builtin-expect.m4: New file. * import/m4/canonicalize.m4: Update. * import/m4/chdir-long.m4: Update. * import/m4/close.m4: Update. * import/m4/closedir.m4: Update. * import/m4/codeset.m4: Update. * import/m4/configmake.m4: Remove. * import/m4/d-ino.m4: Update. * import/m4/d-type.m4: Update. * import/m4/dirent_h.m4: Update. * import/m4/dirfd.m4: Update. * import/m4/dirname.m4: Update. * import/m4/double-slash-root.m4: Update. * import/m4/dup.m4: Update. * import/m4/dup2.m4: Update. * import/m4/eealloc.m4: Update. * import/m4/environ.m4: Update. * import/m4/errno_h.m4: Update. * import/m4/error.m4: Update. * import/m4/exponentd.m4: Update. * import/m4/exponentl.m4: Update. * import/m4/extensions.m4: Update. * import/m4/extern-inline.m4: Update. * import/m4/fchdir.m4: Update. * import/m4/fcntl-o.m4: Update. * import/m4/fcntl.m4: Update. * import/m4/fcntl_h.m4: Update. * import/m4/fdopendir.m4: Update. * import/m4/filenamecat.m4: Update. * import/m4/flexmember.m4: Update. * import/m4/float_h.m4: Update. * import/m4/fnmatch.m4: Update. * import/m4/fnmatch_h.m4: New file. * import/m4/fpieee.m4: Update. * import/m4/frexp.m4: Update. * import/m4/frexpl.m4: Update. * import/m4/fstat.m4: Update. * import/m4/fstatat.m4: Update. * import/m4/getcwd-abort-bug.m4: Update. * import/m4/getcwd-path-max.m4: Update. * import/m4/getcwd.m4: Update. * import/m4/getdtablesize.m4: Update. * import/m4/getlogin.m4: New file. * import/m4/getlogin_r.m4: Update. * import/m4/getpagesize.m4: New file. * import/m4/getprogname.m4: Update. * import/m4/gettimeofday.m4: Update. * import/m4/glibc21.m4: Remove. * import/m4/glob.m4: Update. * import/m4/glob_h.m4: New file. * import/m4/gnulib-cache.m4: Update. * import/m4/gnulib-common.m4: Update. * import/m4/gnulib-comp.m4: Update. * import/m4/gnulib-tool.m4: Update. * import/m4/hard-locale.m4: Remove. * import/m4/host-cpu-c-abi.m4: New file. * import/m4/include_next.m4: Update. * import/m4/inet_ntop.m4: Update. * import/m4/inttypes-pri.m4: Update. * import/m4/inttypes.m4: Update. * import/m4/isnand.m4: Update. * import/m4/isnanl.m4: Update. * import/m4/largefile.m4: Update. * import/m4/lib-ld.m4: Update. * import/m4/lib-link.m4: Update. * import/m4/lib-prefix.m4: Update. * import/m4/limits-h.m4: Update. * import/m4/localcharset.m4: Update. * import/m4/locale-fr.m4: Update. * import/m4/locale-ja.m4: Update. * import/m4/locale-zh.m4: Update. * import/m4/localtime-buffer.m4: New file. * import/m4/lock.m4: Update. * import/m4/longlong.m4: Update. * import/m4/lstat.m4: Update. * import/m4/malloc.m4: Update. * import/m4/malloca.m4: Update. * import/m4/math_h.m4: Update. * import/m4/mbrtowc.m4: Update. * import/m4/mbsinit.m4: Update. * import/m4/mbsrtowcs.m4: Update. * import/m4/mbstate_t.m4: Update. * import/m4/memchr.m4: Update. * import/m4/memmem.m4: Update. * import/m4/mempcpy.m4: Update. * import/m4/memrchr.m4: Update. * import/m4/mkdir.m4: Update. * import/m4/mkdtemp.m4: Update. * import/m4/mkostemp.m4: Update. * import/m4/mmap-anon.m4: Update. * import/m4/mode_t.m4: Update. * import/m4/msvc-inval.m4: Update. * import/m4/msvc-nothrow.m4: Update. * import/m4/multiarch.m4: Update. * import/m4/netinet_in_h.m4: Update. * import/m4/nocrash.m4: Update. * import/m4/off_t.m4: Update. * import/m4/onceonly.m4: Remove. * import/m4/open-cloexec.m4: New file. * import/m4/open-slash.m4: New file. * import/m4/open.m4: Update. * import/m4/openat.m4: Update. * import/m4/opendir.m4: Update. * import/m4/pathmax.m4: Update. * import/m4/pthread_rwlock_rdlock.m4: New file. * import/m4/rawmemchr.m4: Update. * import/m4/readdir.m4: Update. * import/m4/readlink.m4: Update. * import/m4/realloc.m4: Update. * import/m4/rename.m4: Update. * import/m4/rewinddir.m4: Update. * import/m4/rmdir.m4: Update. * import/m4/save-cwd.m4: Update. * import/m4/secure_getenv.m4: Remove. * import/m4/setenv.m4: Update. * import/m4/signal_h.m4: Update. * import/m4/socklen.m4: Update. * import/m4/sockpfaf.m4: Update. * import/m4/ssize_t.m4: Update. * import/m4/stat-time.m4: New file. * import/m4/stat.m4: Update. * import/m4/std-gnu11.m4: New file. * import/m4/stdalign.m4: Update. * import/m4/stdbool.m4: Update. * import/m4/stddef_h.m4: Update. * import/m4/stdint.m4: Update. * import/m4/stdio_h.m4: Update. * import/m4/stdlib_h.m4: Update. * import/m4/strchrnul.m4: Update. * import/m4/strdup.m4: Update. * import/m4/strerror.m4: Update. * import/m4/strerror_r.m4: Update. * import/m4/string_h.m4: Update. * import/m4/strstr.m4: Update. * import/m4/strtok_r.m4: Update. * import/m4/sys_socket_h.m4: Update. * import/m4/sys_stat_h.m4: Update. * import/m4/sys_time_h.m4: Update. * import/m4/sys_types_h.m4: Update. * import/m4/sys_uio_h.m4: Update. * import/m4/tempname.m4: Update. * import/m4/threadlib.m4: Update. * import/m4/time_h.m4: Update. * import/m4/time_r.m4: Update. * import/m4/unistd-safer.m4: Update. * import/m4/unistd_h.m4: Update. * import/m4/warn-on-use.m4: Update. * import/m4/wchar_h.m4: Update. * import/m4/wchar_t.m4: Update. * import/m4/wctype_h.m4: Update. * import/m4/wint_t.m4: Update. * import/malloc.c: Update. * import/malloc/scratch_buffer.h: New file. * import/malloc/scratch_buffer_grow.c: New file. * import/malloc/scratch_buffer_grow_preserve.c: New file. * import/malloc/scratch_buffer_set_array_size.c: New file. * import/malloca.c (MAGIC_NUMBER): Update. (MAGIC_SIZE): Update. (struct preliminary_header): Update. (HEADER_SIZE): Update. (union header): Update. (verify): Update. (HASH_TABLE_SIZE): Update. (freea): Update. * import/malloca.h (malloca): Update. (nmalloca): Update. * import/malloca.valgrind: Remove. * import/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Update. (func): Update. (rpl_func): Update. (f): Update. (d): Update. (l): Update. (_GL_WARN_ON_USE): Update. (_GL_WARN_ON_USE_ATTRIBUTE): Update. (FP_ILOGB0): Update. (FP_ILOGBNAN): Update. (acosf): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (asinf): Update. (atanf): Update. (atan2f): Update. (cosf): Update. (coshf): Update. (expf): Update. (expl): Update. (expm1l): Update. (ilogbl): Update. (rintl): Update. (sinf): Update. (sinhf): Update. (sqrtf): Update. (tanf): Update. (tanhf): Update. (isfinite): Update. (isinf): Update. (isnan): Update. (GNULIB_defined_signbit): Update. (signbit): Update. * import/mbrtowc.c (FALLTHROUGH): Update. (locale_enc): Update. (locale_enc_cached): Update. (gl_lock_define_initialized): Update. (mbrtowc): Update. * import/mbsinit.c (if): Update. (mbsinit): Update. * import/mbsrtowcs-impl.h: Update. * import/mbsrtowcs-state.c: Update. * import/mbsrtowcs.c: Update. * import/memchr.c: Update. * import/memchr.valgrind: Update. * import/memmem.c (__builtin_expect): Update. * import/mempcpy.c: Update. * import/memrchr.c (__memrchr): Update. * import/mkdir.c (if): Update. * import/mkdtemp.c: Update. * import/mkostemp.c: Update. * import/msvc-inval.c: Update. * import/msvc-inval.h: Update. * import/msvc-nothrow.c: Update. * import/msvc-nothrow.h (if): Update. * import/netinet_in.in.h: Update. * import/open.c (open): Update. (if): Update. * import/openat-die.c: Update. * import/openat-priv.h: Update. * import/openat-proc.c: Update. * import/openat.c (rpl_openat): Update. * import/openat.h: Update. * import/opendir.c: Update. * import/pathmax.h (if): Update. * import/pipe-safer.c: Update. * import/rawmemchr.c: Update. * import/rawmemchr.valgrind: Update. * import/readdir.c (readdir): Update. * import/readlink.c: Update. * import/realloc.c: Update. * import/ref-add.sin: Remove. * import/ref-del.sin: Remove. * import/rename.c (if): Update. * import/rewinddir.c: Update. * import/rmdir.c: Update. * import/same-inode.h (SAME_INODE): Update. * import/save-cwd.c (save_cwd): Update. * import/save-cwd.h: Update. * import/scratch_buffer.h: New file. * import/secure_getenv.c: Remove. * import/setenv.c: Update. * import/signal.in.h: Update. * import/stat-time.c: New file. * import/stat-time.h: New file. * import/stat-w32.c: New file. * import/stat-w32.h: New file. * import/stat.c (if): Update. (stat): Update. (REPLACE_FUNC_STAT_DIR): Update. (WINDOWS_NATIVE): Update. (WIN32_LEAN_AND_MEAN): Update. (is_unc_root): Update. (rpl_stat): Update. * import/stdalign.in.h (elif): Update. * import/stdbool.in.h: Update. * import/stddef.in.h (_GL_STDDEF_ALIGNAS): Update. (max_align_t): Update. (GNULIB_defined_max_align_t): Update. * import/stdint.in.h (WINT_MIN): Update. (WINT_MAX): Update. (_STDINT_MIN): Update. (_STDINT_UNSIGNED_MIN): Update. (_STDINT_SIGNED_MIN): Update. (PTRDIFF_MIN): Update. (SIG_ATOMIC_MIN): Update. (WCHAR_MIN): Update. * import/stdio.in.h (if): Update. * import/stdlib.in.h (if): Update. (_GL_WARN_ON_USE): Update. (_GL_FUNCDECL_SYS): Update. (random): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (srandom): Update. (initstate): Update. (setstate): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (GNULIB_defined_strtod_function): Update. (strtold): Update. (GNULIB_defined_strtold_function): Update. * import/str-two-way.h: Update. * import/strchrnul.c: Update. * import/strchrnul.valgrind: Update. * import/strdup.c: Update. * import/streq.h: Update. * import/strerror-override.c: Update. * import/strerror-override.h: Update. * import/strerror.c (strerror): Update. * import/strerror_r.c (safe_copy): Update. * import/string.in.h (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. * import/stripslash.c: Update. * import/strnlen1.c: Update. * import/strnlen1.h: Update. * import/strstr.c (__builtin_expect): Update. * import/strtok_r.c: Update. * import/sys_socket.in.h (CMSG_SPACE): Update. (CMSG_LEN): Update. (struct sockaddr_storage): Update. (SO_REUSEPORT): Update. (_GL_WARN_ON_USE): Update. * import/sys_stat.in.h (if): Update. (stat): Update. (struct stat): Update. (st_atime): Update. (st_mtime): Update. (st_ctime): Update. (_GL_WINDOWS_STAT_TIMESPEC): Update. (GNULIB_defined_struct_stat): Update. (_S_IFBLK): Update. (_S_IFLNK): Update. (_S_IFSOCK): Update. (fstat): Update. (fstatat): Update. (lstat): Update. (stat64): Update. (_stat64): Update. (_stat32i64): Update. (_stati64): Update. (_stat32): Update. (_stat64i32): Update. * import/sys_time.in.h: Update. * import/sys_types.in.h (dev_t): Update. (GNULIB_defined_dev_t): Update. (ino_t): Update. (GNULIB_defined_ino_t): Update. (_GL_WINDOWS_STAT_INODES): Update. (if): Update. * import/sys_uio.in.h: Update. * import/tempname.c (__secure_getenv): Update. (try_nocreate): Update. * import/tempname.h: Update. * import/time.in.h (tzset): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (ctime): Update. (strftime): Update. * import/time_r.c: Update. * import/unistd--.h: Update. * import/unistd-safer.h: Update. * import/unistd.in.h (if): Update. (elif): Update. (__need_getopt): Update. (access): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. (_GL_FUNCDECL_SYS): Update. (__declspec): Update. (_GL_WARN_ON_USE_ATTRIBUTE): Update. (faccessat): Update. (getpass): Update. (truncate): Update. * import/unsetenv.c: Update. * import/verify.h (if): Update. (_GL_HAVE__STATIC_ASSERT): Update. (_GL_HAVE_STATIC_ASSERT): Update. (_GL_HAVE__STATIC_ASSERT1): Update. (_GL_HAVE_STATIC_ASSERT1): Update. (_GL_VERIFY): Update. (_Static_assert): Update. (_GL_HAS_BUILTIN_TRAP): Update. (_GL_HAS_BUILTIN_UNREACHABLE): Update. (verify_true): Update. (verify): Update. (__has_builtin): Update. (elif): Update. (assume): Update. * import/warn-on-use.h: Rename from import/extra/snippet/warn-on-use.h. * import/wchar.in.h (if): Update. (wcsftime): Update. (_GL_FUNCDECL_RPL): Update. (_GL_CXXALIAS_RPL): Update. (_GL_FUNCDECL_SYS): Update. (_GL_CXXALIAS_SYS): Update. (_GL_CXXALIASWARN): Update. (_GL_WARN_ON_USE): Update. * import/wctype.in.h (rpl_iswalnum): Update. (rpl_iswalpha): Update. (rpl_iswblank): Update. (rpl_iswcntrl): Update. (rpl_iswdigit): Update. (rpl_iswgraph): Update. (rpl_iswlower): Update. (rpl_iswprint): Update. (rpl_iswpunct): Update. (rpl_iswspace): Update. (rpl_iswupper): Update. (rpl_iswxdigit): Update. (rpl_towlower): Update. (rpl_towupper): Update. (iswalnum): Update. (iswalpha): Update. (iswblank): Update. (iswcntrl): Update. (iswdigit): Update. (iswgraph): Update. (iswlower): Update. (iswprint): Update. (iswpunct): Update. (iswspace): Update. (iswupper): Update. (iswxdigit): Update. (towlower): Update. (towupper): Update. * import/windows-initguard.h: New file. * import/windows-mutex.c: New file. * import/windows-mutex.h: New file. * import/windows-once.c: New file. * import/windows-once.h: New file. * import/windows-recmutex.c: New file. * import/windows-recmutex.h: New file. * import/windows-rwlock.c: New file. * import/windows-rwlock.h: New file. * import/xalloc-oversized.h: New file. * patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch: Remove. * patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch: Remove. * patches/0003-Fix-glob-c-Coverity-issues.patch: Remove. * update-gnulib.sh: Update to latest gnulib and don't apply patches anymore. Also updates the patch -p flag to the current directory structure in case patches are needed again in the future. Change-Id: I9c2b07a3046baecfb664e21b2644353ea888dbfa
This commit is contained in:
parent
f81e7e2db6
commit
c0c3707ff4
@ -1,3 +1,8 @@
|
||||
2019-12-16 Christian Biesinger <cbiesinger@google.com>
|
||||
|
||||
* gdbsupport/common-defs.h: Remove workaround for a gnulib bug
|
||||
(we no longer need to include time.h before pathmax.h)
|
||||
|
||||
2019-12-15 Christian Biesinger <cbiesinger@google.com>
|
||||
|
||||
* ada-exp.y (write_ambiguous_var): Update.
|
||||
|
||||
@ -97,11 +97,6 @@
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <alloca.h>
|
||||
/* Must be included before pathmax.h to avoid build errors about localtime_r
|
||||
and gmtime_r in gnulib on MinGW. This is a gnulib bug:
|
||||
https://lists.gnu.org/archive/html/bug-gnulib/2019-11/msg00022.html */
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#include "ansidecl.h"
|
||||
/* This is defined by ansidecl.h, but we prefer gnulib's version. On
|
||||
|
||||
772
gnulib/ChangeLog
772
gnulib/ChangeLog
@ -1,3 +1,775 @@
|
||||
2019-12-16 Christian Biesinger <cbiesinger@google.com>
|
||||
|
||||
* Makefile.am: Set MAKEOVERRIDES.
|
||||
* Makefile.in: Regenerate.
|
||||
* aclocal.m4: Regenerate.
|
||||
* config.in: Regenerate.
|
||||
* configure: Regenerate.
|
||||
* import/Makefile.am: Update.
|
||||
* import/Makefile.in: Regenerate.
|
||||
* import/_Noreturn.h: New file.
|
||||
* import/alloca.c (i00afunc): Update.
|
||||
* import/alloca.in.h (if): Update.
|
||||
* import/arg-nonnull.h: Rename from import/extra/snippet/arg-nonnull.h.
|
||||
* import/arpa_inet.in.h (if): Update.
|
||||
* import/assure.h: Update.
|
||||
* import/at-func.c: Update.
|
||||
* import/basename-lgpl.c: Update.
|
||||
* import/canonicalize-lgpl.c (if): Update.
|
||||
* import/c++defs.h: Rename from import/extra/snippet/c++defs.h.
|
||||
* import/cdefs.h: New file.
|
||||
* import/chdir-long.c: Update.
|
||||
* import/chdir-long.h: Update.
|
||||
* import/cloexec.c: Update.
|
||||
* import/cloexec.h: Update.
|
||||
* import/close.c: Update.
|
||||
* import/closedir.c: Update.
|
||||
* import/config.charset: Remove.
|
||||
* import/dirent-private.h: Update.
|
||||
* import/dirent.in.h: Update.
|
||||
* import/dirfd.c: Update.
|
||||
* import/dirname-lgpl.c: Update.
|
||||
* import/dirname.h (base_name): Update.
|
||||
* import/dosname.h (if): Update.
|
||||
* import/dup-safer-flag.c: New file.
|
||||
* import/dup-safer.c: Update.
|
||||
* import/dup.c: Update.
|
||||
* import/dup2.c (if): Update.
|
||||
(dup2_nothrow): Update.
|
||||
(ms_windows_dup2): Update.
|
||||
* import/errno.in.h (if): Update.
|
||||
(elif): Update.
|
||||
* import/error.c (if): Update.
|
||||
(strerror_r): Update.
|
||||
(program_name): Update.
|
||||
(error): Update.
|
||||
(error_at_line): Update.
|
||||
* import/error.h: Update.
|
||||
* import/exitfail.c: Update.
|
||||
* import/exitfail.h: Update.
|
||||
* import/extra/config.rpath: Update.
|
||||
* import/extra/snippet/_Noreturn.h: Remove.
|
||||
* import/extra/update-copyright: Update.
|
||||
* import/fchdir.c: Update.
|
||||
* import/fcntl.c (rpl_fcntl): Update.
|
||||
(INCL_DOS): Update.
|
||||
(if): Update.
|
||||
(rpl_fcntl_DUPFD): Update.
|
||||
(rpl_fcntl_DUPFD_CLOEXEC): Update.
|
||||
(klibc_fcntl): Update.
|
||||
(fcntl): Update.
|
||||
(have_dupfd_cloexec): Update.
|
||||
* import/fcntl.in.h (if): Update.
|
||||
(creat): Update.
|
||||
(_GL_FUNCDECL_RPL): Update.
|
||||
(_GL_CXXALIAS_RPL): Update.
|
||||
(_GL_CXXALIAS_SYS): Update.
|
||||
(_GL_CXXALIASWARN): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
(O_CLOEXEC): Update.
|
||||
(GNULIB_defined_O_CLOEXEC): Update.
|
||||
* import/fd-hook.c: Update.
|
||||
* import/fd-hook.h: Update.
|
||||
* import/fd-safer-flag.c: New file.
|
||||
* import/fd-safer.c: Update.
|
||||
* import/fdopendir.c: Update.
|
||||
* import/filename.h: Update.
|
||||
* import/filenamecat-lgpl.c (longest_relative_suffix): Update.
|
||||
(mfile_name_concat): Update.
|
||||
* import/filenamecat.h: Update.
|
||||
* import/flexmember.h: Update.
|
||||
* import/float+.h: Update.
|
||||
* import/float.c: Update.
|
||||
* import/float.in.h (LDBL_MIN): Update.
|
||||
* import/fnmatch.c (__builtin_expect): Update.
|
||||
(FALLTHROUGH): Update.
|
||||
* import/fnmatch.in.h (_FNMATCH_H): Update.
|
||||
(_): Update.
|
||||
(fnmatch): Update.
|
||||
(_GL_FUNCDECL_RPL): Update.
|
||||
(_GL_CXXALIAS_RPL): Update.
|
||||
(_GL_FUNCDECL_SYS): Update.
|
||||
(_GL_CXXALIAS_SYS): Update.
|
||||
(_GL_CXXALIASWARN): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
* import/fnmatch_loop.c (FCT): Update.
|
||||
(EXT): Update.
|
||||
* import/fpucw.h (GET_FPUCW): Update.
|
||||
(SET_FPUCW): Update.
|
||||
* import/frexp.c: Update.
|
||||
* import/frexpl.c: Update.
|
||||
* import/fstat.c (stat): Update.
|
||||
(fstat): Update.
|
||||
(WINDOWS_NATIVE): Update.
|
||||
(fstat_nothrow): Update.
|
||||
(WIN32_LEAN_AND_MEAN): Update.
|
||||
* import/fstatat.c (normal_fstatat): Update.
|
||||
(rpl_fstatat): Update.
|
||||
* import/getcwd-lgpl.c (rpl_getcwd): Update.
|
||||
* import/getcwd.c (getcwd_nothrow): Update.
|
||||
(getcwd_system): Update.
|
||||
(__getcwd): Update.
|
||||
* import/getdtablesize.c (if): Update.
|
||||
(_setmaxstdio): Update.
|
||||
(_setmaxstdio_nothrow): Update.
|
||||
(getdtablesize): Update.
|
||||
* import/getlogin_r.c (if): Update.
|
||||
(getlogin_r): Update.
|
||||
* import/getprogname.c (getprogname): Update.
|
||||
* import/getprogname.h: Update.
|
||||
* import/gettext.h (if): Update.
|
||||
* import/gettimeofday.c (WINDOWS_NATIVE): Update.
|
||||
(localtime): Update.
|
||||
(GetProcAddress): Update.
|
||||
(gmtime): Update.
|
||||
(void): Update.
|
||||
(struct tm): Update.
|
||||
(rpl_localtime): Update.
|
||||
(initialize): Update.
|
||||
(rpl_gmtime): Update.
|
||||
(tzset): Update.
|
||||
(rpl_tzset): Update.
|
||||
* import/glob-libc.h (_Restrict_): Update.
|
||||
(__size_t): Update.
|
||||
(__need_size_t): Update.
|
||||
(glob): Update.
|
||||
(globfree): Update.
|
||||
(__REDIRECT_NTH): Update.
|
||||
(glob64): Update.
|
||||
(globfree64): Update.
|
||||
(glob_pattern_p): Update.
|
||||
* import/glob.c (POSIX): Update.
|
||||
(if): Update.
|
||||
(__set_errno): Update.
|
||||
(getpwnam_r): Update.
|
||||
(__lstat64): Update.
|
||||
(FLEXIBLE_ARRAY_MEMBER): Update.
|
||||
(__glob_pattern_p): Update.
|
||||
(GETPW_R_SIZE_MAX): Update.
|
||||
(GET_LOGIN_NAME_MAX): Update.
|
||||
(DT_UNKNOWN): Update.
|
||||
(DT_DIR): Update.
|
||||
(DT_LNK): Update.
|
||||
(D_TYPE_TO_RESULT): Update.
|
||||
(readdir_result_might_be_symlink): Update.
|
||||
(readdir_result_might_be_dir): Update.
|
||||
(readdir_result_type): Update.
|
||||
(D_INO_TO_RESULT): Update.
|
||||
(READDIR_RESULT_INITIALIZER): Update.
|
||||
(attribute_hidden): Update.
|
||||
(__attribute_noinline__): Update.
|
||||
(__builtin_expect): Update.
|
||||
(__glibc_unlikely): Update.
|
||||
(__has_builtin): Update.
|
||||
(__glob_pattern_type): Update.
|
||||
(is_dir): Update.
|
||||
(glob): Update.
|
||||
(globfree): Update.
|
||||
(libc_hidden_def): Update.
|
||||
(DIRSEP_CHAR): Update.
|
||||
(prefix_array): Update.
|
||||
(weak_alias): Update.
|
||||
(link_exists2_p): Update.
|
||||
(link_exists_p): Update.
|
||||
(glob_in_dir): Update.
|
||||
(GLOBNAMES_MEMBERS): Update.
|
||||
* import/glob.in.h (_GL_GLOB_H): Update.
|
||||
(_): Update.
|
||||
(__BEGIN_DECLS): Update.
|
||||
(__END_DECLS): Update.
|
||||
(_Restrict_): Update.
|
||||
(__THROW): Update.
|
||||
(__THROWNL): Update.
|
||||
(__size_t): Update.
|
||||
(__USE_GNU): Update.
|
||||
(glob): Update.
|
||||
(globfree): Update.
|
||||
(glob_pattern_p): Update.
|
||||
(__glob_pattern_p): Update.
|
||||
(__GLOB_GNULIB): Update.
|
||||
(_GL_FUNCDECL_RPL): Update.
|
||||
(_GL_CXXALIAS_RPL): Update.
|
||||
(_GL_FUNCDECL_SYS): Update.
|
||||
(_GL_CXXALIAS_SYS): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
* import/glob_internal.h: New file.
|
||||
* import/glob_pattern_p.c: New file.
|
||||
* import/globfree.c: New file.
|
||||
* import/glthread/lock.c (glthread_rwlock_init_for_glibc): Update.
|
||||
(glthread_rwlock_rdlock_multithreaded): Update.
|
||||
(glthread_once_call): Update.
|
||||
(glthread_once_multithreaded): Update.
|
||||
(glthread_once_singlethreaded): Update.
|
||||
(glthread_recursive_lock_init_multithreaded): Update.
|
||||
(glthread_recursive_lock_lock_multithreaded): Update.
|
||||
(glthread_recursive_lock_unlock_multithreaded): Update.
|
||||
(glthread_recursive_lock_destroy_multithreaded): Update.
|
||||
(glthread_lock_init_func): Update.
|
||||
(glthread_lock_lock_func): Update.
|
||||
(glthread_lock_unlock_func): Update.
|
||||
(glthread_lock_destroy_func): Update.
|
||||
(gl_waitqueue_t): Update.
|
||||
(gl_waitqueue_init): Update.
|
||||
(gl_waitqueue_add): Update.
|
||||
(gl_waitqueue_notify_first): Update.
|
||||
(gl_waitqueue_notify_all): Update.
|
||||
(glthread_rwlock_init_func): Update.
|
||||
(glthread_rwlock_rdlock_func): Update.
|
||||
(glthread_rwlock_wrlock_func): Update.
|
||||
(glthread_rwlock_unlock_func): Update.
|
||||
(glthread_rwlock_destroy_func): Update.
|
||||
(glthread_recursive_lock_init_func): Update.
|
||||
(glthread_recursive_lock_lock_func): Update.
|
||||
(glthread_recursive_lock_unlock_func): Update.
|
||||
(glthread_recursive_lock_destroy_func): Update.
|
||||
(glthread_once_func): Update.
|
||||
* import/glthread/lock.h (c11_threads_in_use): Update.
|
||||
(pthread_in_use): Update.
|
||||
(gl_rwlock_initializer): Update.
|
||||
(glthread_rwlock_init): Update.
|
||||
(glthread_rwlock_init_for_glibc): Update.
|
||||
(pth_in_use): Update.
|
||||
(gl_lock_define): Update.
|
||||
(gl_lock_define_initialized): Update.
|
||||
(gl_lock_initializer): Update.
|
||||
(glthread_lock_init): Update.
|
||||
(glthread_lock_lock): Update.
|
||||
(glthread_lock_unlock): Update.
|
||||
(glthread_lock_destroy): Update.
|
||||
(gl_rwlock_define): Update.
|
||||
(gl_rwlock_define_initialized): Update.
|
||||
(glthread_rwlock_rdlock): Update.
|
||||
(glthread_rwlock_wrlock): Update.
|
||||
(glthread_rwlock_unlock): Update.
|
||||
(glthread_rwlock_destroy): Update.
|
||||
(gl_recursive_lock_define): Update.
|
||||
(gl_recursive_lock_define_initialized): Update.
|
||||
(gl_recursive_lock_initializer): Update.
|
||||
(glthread_recursive_lock_init): Update.
|
||||
(glthread_recursive_lock_lock): Update.
|
||||
(glthread_recursive_lock_unlock): Update.
|
||||
(glthread_recursive_lock_destroy): Update.
|
||||
(gl_once_define): Update.
|
||||
(glthread_once): Update.
|
||||
(glthread_once_multithreaded): Update.
|
||||
(glthread_once_singlethreaded): Update.
|
||||
(thread_in_use): Update.
|
||||
(glthread_recursive_lock_init_multithreaded): Update.
|
||||
(glthread_recursive_lock_lock_multithreaded): Update.
|
||||
(glthread_recursive_lock_unlock_multithreaded): Update.
|
||||
(glthread_recursive_lock_destroy_multithreaded): Update.
|
||||
(glthread_lock_init_func): Update.
|
||||
(glthread_lock_lock_func): Update.
|
||||
(glthread_lock_unlock_func): Update.
|
||||
(glthread_lock_destroy_func): Update.
|
||||
(glthread_rwlock_init_func): Update.
|
||||
(glthread_rwlock_rdlock_func): Update.
|
||||
(glthread_rwlock_wrlock_func): Update.
|
||||
(glthread_rwlock_unlock_func): Update.
|
||||
(glthread_rwlock_destroy_func): Update.
|
||||
(glthread_recursive_lock_init_func): Update.
|
||||
(glthread_recursive_lock_lock_func): Update.
|
||||
(glthread_recursive_lock_unlock_func): Update.
|
||||
(glthread_recursive_lock_destroy_func): Update.
|
||||
(glthread_once_func): Update.
|
||||
* import/glthread/threadlib.c: Update.
|
||||
* import/hard-locale.c: Update.
|
||||
* import/hard-locale.h: Update.
|
||||
* import/inet_ntop.c: Update.
|
||||
* import/intprops.h (__has_builtin): Update.
|
||||
(_GL_INT_CONVERT): Update.
|
||||
(_GL_INT_NEGATE_CONVERT): Update.
|
||||
(verify): Update.
|
||||
(_GL_HAS_BUILTIN_OVERFLOW): Update.
|
||||
(_GL_HAS_BUILTIN_ADD_OVERFLOW): Update.
|
||||
(_GL_HAS_BUILTIN_OVERFLOW_P): Update.
|
||||
(_GL_HAS_BUILTIN_MUL_OVERFLOW): Update.
|
||||
(_GL_BINARY_OP_OVERFLOW): Update.
|
||||
(INT_ADD_WRAPV): Update.
|
||||
(INT_SUBTRACT_WRAPV): Update.
|
||||
(INT_MULTIPLY_WRAPV): Update.
|
||||
(_GL_INT_OP_WRAPV): Update.
|
||||
(_GL_INT_OP_WRAPV_SMALLISH): Update.
|
||||
(_GL_INT_OP_WRAPV_LONGISH): Update.
|
||||
(_GL_INT_OP_CALC): Update.
|
||||
(_GL_INT_OP_CALC1): Update.
|
||||
(_GL_INT_OP_WRAPV_VIA_UNSIGNED): Update.
|
||||
(_GL_INT_ADD_RANGE_OVERFLOW): Update.
|
||||
(_GL_INT_SUBTRACT_RANGE_OVERFLOW): Update.
|
||||
(_GL_INT_MULTIPLY_RANGE_OVERFLOW): Update.
|
||||
* import/inttypes.in.h (if): Update.
|
||||
* import/isnan.c: Update.
|
||||
* import/isnand-nolibm.h: Update.
|
||||
* import/isnand.c: Update.
|
||||
* import/isnanl-nolibm.h: Update.
|
||||
* import/isnanl.c: Update.
|
||||
* import/itold.c: Update.
|
||||
* import/libc-config.h: New file.
|
||||
* import/limits.in.h (LLONG_MIN): Update.
|
||||
(LLONG_MAX): Update.
|
||||
(ULLONG_MAX): Update.
|
||||
(WORD_BIT): Update.
|
||||
(LONG_BIT): Update.
|
||||
* import/localcharset.c (setlocale): Update.
|
||||
(relocate): Update.
|
||||
(O_NOFOLLOW): Update.
|
||||
(ISSLASH): Update.
|
||||
(DIRECTORY_SEPARATOR): Update.
|
||||
(getc): Update.
|
||||
(volatile): Update.
|
||||
(get_charset_aliases): Update.
|
||||
(struct table_entry): Update.
|
||||
(alias_table_defined): Update.
|
||||
(locale_table_defined): Update.
|
||||
(locale_charset): Update.
|
||||
(if): Update.
|
||||
* import/localcharset.h: Update.
|
||||
* import/localtime-buffer.c: New file.
|
||||
* import/localtime-buffer.h: New file.
|
||||
* import/lstat.c (rpl_lstat): Update.
|
||||
* import/m4/00gnulib.m4: Update.
|
||||
* import/m4/__inline.m4: New file.
|
||||
* import/m4/absolute-header.m4: Update.
|
||||
* import/m4/alloca.m4: Update.
|
||||
* import/m4/arpa_inet_h.m4: Update.
|
||||
* import/m4/builtin-expect.m4: New file.
|
||||
* import/m4/canonicalize.m4: Update.
|
||||
* import/m4/chdir-long.m4: Update.
|
||||
* import/m4/close.m4: Update.
|
||||
* import/m4/closedir.m4: Update.
|
||||
* import/m4/codeset.m4: Update.
|
||||
* import/m4/configmake.m4: Remove.
|
||||
* import/m4/d-ino.m4: Update.
|
||||
* import/m4/d-type.m4: Update.
|
||||
* import/m4/dirent_h.m4: Update.
|
||||
* import/m4/dirfd.m4: Update.
|
||||
* import/m4/dirname.m4: Update.
|
||||
* import/m4/double-slash-root.m4: Update.
|
||||
* import/m4/dup.m4: Update.
|
||||
* import/m4/dup2.m4: Update.
|
||||
* import/m4/eealloc.m4: Update.
|
||||
* import/m4/environ.m4: Update.
|
||||
* import/m4/errno_h.m4: Update.
|
||||
* import/m4/error.m4: Update.
|
||||
* import/m4/exponentd.m4: Update.
|
||||
* import/m4/exponentl.m4: Update.
|
||||
* import/m4/extensions.m4: Update.
|
||||
* import/m4/extern-inline.m4: Update.
|
||||
* import/m4/fchdir.m4: Update.
|
||||
* import/m4/fcntl-o.m4: Update.
|
||||
* import/m4/fcntl.m4: Update.
|
||||
* import/m4/fcntl_h.m4: Update.
|
||||
* import/m4/fdopendir.m4: Update.
|
||||
* import/m4/filenamecat.m4: Update.
|
||||
* import/m4/flexmember.m4: Update.
|
||||
* import/m4/float_h.m4: Update.
|
||||
* import/m4/fnmatch.m4: Update.
|
||||
* import/m4/fnmatch_h.m4: New file.
|
||||
* import/m4/fpieee.m4: Update.
|
||||
* import/m4/frexp.m4: Update.
|
||||
* import/m4/frexpl.m4: Update.
|
||||
* import/m4/fstat.m4: Update.
|
||||
* import/m4/fstatat.m4: Update.
|
||||
* import/m4/getcwd-abort-bug.m4: Update.
|
||||
* import/m4/getcwd-path-max.m4: Update.
|
||||
* import/m4/getcwd.m4: Update.
|
||||
* import/m4/getdtablesize.m4: Update.
|
||||
* import/m4/getlogin.m4: New file.
|
||||
* import/m4/getlogin_r.m4: Update.
|
||||
* import/m4/getpagesize.m4: New file.
|
||||
* import/m4/getprogname.m4: Update.
|
||||
* import/m4/gettimeofday.m4: Update.
|
||||
* import/m4/glibc21.m4: Remove.
|
||||
* import/m4/glob.m4: Update.
|
||||
* import/m4/glob_h.m4: New file.
|
||||
* import/m4/gnulib-cache.m4: Update.
|
||||
* import/m4/gnulib-common.m4: Update.
|
||||
* import/m4/gnulib-comp.m4: Update.
|
||||
* import/m4/gnulib-tool.m4: Update.
|
||||
* import/m4/hard-locale.m4: Remove.
|
||||
* import/m4/host-cpu-c-abi.m4: New file.
|
||||
* import/m4/include_next.m4: Update.
|
||||
* import/m4/inet_ntop.m4: Update.
|
||||
* import/m4/inttypes-pri.m4: Update.
|
||||
* import/m4/inttypes.m4: Update.
|
||||
* import/m4/isnand.m4: Update.
|
||||
* import/m4/isnanl.m4: Update.
|
||||
* import/m4/largefile.m4: Update.
|
||||
* import/m4/lib-ld.m4: Update.
|
||||
* import/m4/lib-link.m4: Update.
|
||||
* import/m4/lib-prefix.m4: Update.
|
||||
* import/m4/limits-h.m4: Update.
|
||||
* import/m4/localcharset.m4: Update.
|
||||
* import/m4/locale-fr.m4: Update.
|
||||
* import/m4/locale-ja.m4: Update.
|
||||
* import/m4/locale-zh.m4: Update.
|
||||
* import/m4/localtime-buffer.m4: New file.
|
||||
* import/m4/lock.m4: Update.
|
||||
* import/m4/longlong.m4: Update.
|
||||
* import/m4/lstat.m4: Update.
|
||||
* import/m4/malloc.m4: Update.
|
||||
* import/m4/malloca.m4: Update.
|
||||
* import/m4/math_h.m4: Update.
|
||||
* import/m4/mbrtowc.m4: Update.
|
||||
* import/m4/mbsinit.m4: Update.
|
||||
* import/m4/mbsrtowcs.m4: Update.
|
||||
* import/m4/mbstate_t.m4: Update.
|
||||
* import/m4/memchr.m4: Update.
|
||||
* import/m4/memmem.m4: Update.
|
||||
* import/m4/mempcpy.m4: Update.
|
||||
* import/m4/memrchr.m4: Update.
|
||||
* import/m4/mkdir.m4: Update.
|
||||
* import/m4/mkdtemp.m4: Update.
|
||||
* import/m4/mkostemp.m4: Update.
|
||||
* import/m4/mmap-anon.m4: Update.
|
||||
* import/m4/mode_t.m4: Update.
|
||||
* import/m4/msvc-inval.m4: Update.
|
||||
* import/m4/msvc-nothrow.m4: Update.
|
||||
* import/m4/multiarch.m4: Update.
|
||||
* import/m4/netinet_in_h.m4: Update.
|
||||
* import/m4/nocrash.m4: Update.
|
||||
* import/m4/off_t.m4: Update.
|
||||
* import/m4/onceonly.m4: Remove.
|
||||
* import/m4/open-cloexec.m4: New file.
|
||||
* import/m4/open-slash.m4: New file.
|
||||
* import/m4/open.m4: Update.
|
||||
* import/m4/openat.m4: Update.
|
||||
* import/m4/opendir.m4: Update.
|
||||
* import/m4/pathmax.m4: Update.
|
||||
* import/m4/pthread_rwlock_rdlock.m4: New file.
|
||||
* import/m4/rawmemchr.m4: Update.
|
||||
* import/m4/readdir.m4: Update.
|
||||
* import/m4/readlink.m4: Update.
|
||||
* import/m4/realloc.m4: Update.
|
||||
* import/m4/rename.m4: Update.
|
||||
* import/m4/rewinddir.m4: Update.
|
||||
* import/m4/rmdir.m4: Update.
|
||||
* import/m4/save-cwd.m4: Update.
|
||||
* import/m4/secure_getenv.m4: Remove.
|
||||
* import/m4/setenv.m4: Update.
|
||||
* import/m4/signal_h.m4: Update.
|
||||
* import/m4/socklen.m4: Update.
|
||||
* import/m4/sockpfaf.m4: Update.
|
||||
* import/m4/ssize_t.m4: Update.
|
||||
* import/m4/stat-time.m4: New file.
|
||||
* import/m4/stat.m4: Update.
|
||||
* import/m4/std-gnu11.m4: New file.
|
||||
* import/m4/stdalign.m4: Update.
|
||||
* import/m4/stdbool.m4: Update.
|
||||
* import/m4/stddef_h.m4: Update.
|
||||
* import/m4/stdint.m4: Update.
|
||||
* import/m4/stdio_h.m4: Update.
|
||||
* import/m4/stdlib_h.m4: Update.
|
||||
* import/m4/strchrnul.m4: Update.
|
||||
* import/m4/strdup.m4: Update.
|
||||
* import/m4/strerror.m4: Update.
|
||||
* import/m4/strerror_r.m4: Update.
|
||||
* import/m4/string_h.m4: Update.
|
||||
* import/m4/strstr.m4: Update.
|
||||
* import/m4/strtok_r.m4: Update.
|
||||
* import/m4/sys_socket_h.m4: Update.
|
||||
* import/m4/sys_stat_h.m4: Update.
|
||||
* import/m4/sys_time_h.m4: Update.
|
||||
* import/m4/sys_types_h.m4: Update.
|
||||
* import/m4/sys_uio_h.m4: Update.
|
||||
* import/m4/tempname.m4: Update.
|
||||
* import/m4/threadlib.m4: Update.
|
||||
* import/m4/time_h.m4: Update.
|
||||
* import/m4/time_r.m4: Update.
|
||||
* import/m4/unistd-safer.m4: Update.
|
||||
* import/m4/unistd_h.m4: Update.
|
||||
* import/m4/warn-on-use.m4: Update.
|
||||
* import/m4/wchar_h.m4: Update.
|
||||
* import/m4/wchar_t.m4: Update.
|
||||
* import/m4/wctype_h.m4: Update.
|
||||
* import/m4/wint_t.m4: Update.
|
||||
* import/malloc.c: Update.
|
||||
* import/malloc/scratch_buffer.h: New file.
|
||||
* import/malloc/scratch_buffer_grow.c: New file.
|
||||
* import/malloc/scratch_buffer_grow_preserve.c: New file.
|
||||
* import/malloc/scratch_buffer_set_array_size.c: New file.
|
||||
* import/malloca.c (MAGIC_NUMBER): Update.
|
||||
(MAGIC_SIZE): Update.
|
||||
(struct preliminary_header): Update.
|
||||
(HEADER_SIZE): Update.
|
||||
(union header): Update.
|
||||
(verify): Update.
|
||||
(HASH_TABLE_SIZE): Update.
|
||||
(freea): Update.
|
||||
* import/malloca.h (malloca): Update.
|
||||
(nmalloca): Update.
|
||||
* import/malloca.valgrind: Remove.
|
||||
* import/math.in.h (_GL_MATH_CXX_REAL_FLOATING_DECL_2): Update.
|
||||
(func): Update.
|
||||
(rpl_func): Update.
|
||||
(f): Update.
|
||||
(d): Update.
|
||||
(l): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
(_GL_WARN_ON_USE_ATTRIBUTE): Update.
|
||||
(FP_ILOGB0): Update.
|
||||
(FP_ILOGBNAN): Update.
|
||||
(acosf): Update.
|
||||
(_GL_FUNCDECL_RPL): Update.
|
||||
(_GL_CXXALIAS_RPL): Update.
|
||||
(asinf): Update.
|
||||
(atanf): Update.
|
||||
(atan2f): Update.
|
||||
(cosf): Update.
|
||||
(coshf): Update.
|
||||
(expf): Update.
|
||||
(expl): Update.
|
||||
(expm1l): Update.
|
||||
(ilogbl): Update.
|
||||
(rintl): Update.
|
||||
(sinf): Update.
|
||||
(sinhf): Update.
|
||||
(sqrtf): Update.
|
||||
(tanf): Update.
|
||||
(tanhf): Update.
|
||||
(isfinite): Update.
|
||||
(isinf): Update.
|
||||
(isnan): Update.
|
||||
(GNULIB_defined_signbit): Update.
|
||||
(signbit): Update.
|
||||
* import/mbrtowc.c (FALLTHROUGH): Update.
|
||||
(locale_enc): Update.
|
||||
(locale_enc_cached): Update.
|
||||
(gl_lock_define_initialized): Update.
|
||||
(mbrtowc): Update.
|
||||
* import/mbsinit.c (if): Update.
|
||||
(mbsinit): Update.
|
||||
* import/mbsrtowcs-impl.h: Update.
|
||||
* import/mbsrtowcs-state.c: Update.
|
||||
* import/mbsrtowcs.c: Update.
|
||||
* import/memchr.c: Update.
|
||||
* import/memchr.valgrind: Update.
|
||||
* import/memmem.c (__builtin_expect): Update.
|
||||
* import/mempcpy.c: Update.
|
||||
* import/memrchr.c (__memrchr): Update.
|
||||
* import/mkdir.c (if): Update.
|
||||
* import/mkdtemp.c: Update.
|
||||
* import/mkostemp.c: Update.
|
||||
* import/msvc-inval.c: Update.
|
||||
* import/msvc-inval.h: Update.
|
||||
* import/msvc-nothrow.c: Update.
|
||||
* import/msvc-nothrow.h (if): Update.
|
||||
* import/netinet_in.in.h: Update.
|
||||
* import/open.c (open): Update.
|
||||
(if): Update.
|
||||
* import/openat-die.c: Update.
|
||||
* import/openat-priv.h: Update.
|
||||
* import/openat-proc.c: Update.
|
||||
* import/openat.c (rpl_openat): Update.
|
||||
* import/openat.h: Update.
|
||||
* import/opendir.c: Update.
|
||||
* import/pathmax.h (if): Update.
|
||||
* import/pipe-safer.c: Update.
|
||||
* import/rawmemchr.c: Update.
|
||||
* import/rawmemchr.valgrind: Update.
|
||||
* import/readdir.c (readdir): Update.
|
||||
* import/readlink.c: Update.
|
||||
* import/realloc.c: Update.
|
||||
* import/ref-add.sin: Remove.
|
||||
* import/ref-del.sin: Remove.
|
||||
* import/rename.c (if): Update.
|
||||
* import/rewinddir.c: Update.
|
||||
* import/rmdir.c: Update.
|
||||
* import/same-inode.h (SAME_INODE): Update.
|
||||
* import/save-cwd.c (save_cwd): Update.
|
||||
* import/save-cwd.h: Update.
|
||||
* import/scratch_buffer.h: New file.
|
||||
* import/secure_getenv.c: Remove.
|
||||
* import/setenv.c: Update.
|
||||
* import/signal.in.h: Update.
|
||||
* import/stat-time.c: New file.
|
||||
* import/stat-time.h: New file.
|
||||
* import/stat-w32.c: New file.
|
||||
* import/stat-w32.h: New file.
|
||||
* import/stat.c (if): Update.
|
||||
(stat): Update.
|
||||
(REPLACE_FUNC_STAT_DIR): Update.
|
||||
(WINDOWS_NATIVE): Update.
|
||||
(WIN32_LEAN_AND_MEAN): Update.
|
||||
(is_unc_root): Update.
|
||||
(rpl_stat): Update.
|
||||
* import/stdalign.in.h (elif): Update.
|
||||
* import/stdbool.in.h: Update.
|
||||
* import/stddef.in.h (_GL_STDDEF_ALIGNAS): Update.
|
||||
(max_align_t): Update.
|
||||
(GNULIB_defined_max_align_t): Update.
|
||||
* import/stdint.in.h (WINT_MIN): Update.
|
||||
(WINT_MAX): Update.
|
||||
(_STDINT_MIN): Update.
|
||||
(_STDINT_UNSIGNED_MIN): Update.
|
||||
(_STDINT_SIGNED_MIN): Update.
|
||||
(PTRDIFF_MIN): Update.
|
||||
(SIG_ATOMIC_MIN): Update.
|
||||
(WCHAR_MIN): Update.
|
||||
* import/stdio.in.h (if): Update.
|
||||
* import/stdlib.in.h (if): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
(_GL_FUNCDECL_SYS): Update.
|
||||
(random): Update.
|
||||
(_GL_FUNCDECL_RPL): Update.
|
||||
(_GL_CXXALIAS_RPL): Update.
|
||||
(srandom): Update.
|
||||
(initstate): Update.
|
||||
(setstate): Update.
|
||||
(_GL_CXXALIAS_SYS): Update.
|
||||
(_GL_CXXALIASWARN): Update.
|
||||
(GNULIB_defined_strtod_function): Update.
|
||||
(strtold): Update.
|
||||
(GNULIB_defined_strtold_function): Update.
|
||||
* import/str-two-way.h: Update.
|
||||
* import/strchrnul.c: Update.
|
||||
* import/strchrnul.valgrind: Update.
|
||||
* import/strdup.c: Update.
|
||||
* import/streq.h: Update.
|
||||
* import/strerror-override.c: Update.
|
||||
* import/strerror-override.h: Update.
|
||||
* import/strerror.c (strerror): Update.
|
||||
* import/strerror_r.c (safe_copy): Update.
|
||||
* import/string.in.h (_GL_FUNCDECL_SYS): Update.
|
||||
(_GL_CXXALIAS_SYS): Update.
|
||||
(_GL_CXXALIASWARN): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
* import/stripslash.c: Update.
|
||||
* import/strnlen1.c: Update.
|
||||
* import/strnlen1.h: Update.
|
||||
* import/strstr.c (__builtin_expect): Update.
|
||||
* import/strtok_r.c: Update.
|
||||
* import/sys_socket.in.h (CMSG_SPACE): Update.
|
||||
(CMSG_LEN): Update.
|
||||
(struct sockaddr_storage): Update.
|
||||
(SO_REUSEPORT): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
* import/sys_stat.in.h (if): Update.
|
||||
(stat): Update.
|
||||
(struct stat): Update.
|
||||
(st_atime): Update.
|
||||
(st_mtime): Update.
|
||||
(st_ctime): Update.
|
||||
(_GL_WINDOWS_STAT_TIMESPEC): Update.
|
||||
(GNULIB_defined_struct_stat): Update.
|
||||
(_S_IFBLK): Update.
|
||||
(_S_IFLNK): Update.
|
||||
(_S_IFSOCK): Update.
|
||||
(fstat): Update.
|
||||
(fstatat): Update.
|
||||
(lstat): Update.
|
||||
(stat64): Update.
|
||||
(_stat64): Update.
|
||||
(_stat32i64): Update.
|
||||
(_stati64): Update.
|
||||
(_stat32): Update.
|
||||
(_stat64i32): Update.
|
||||
* import/sys_time.in.h: Update.
|
||||
* import/sys_types.in.h (dev_t): Update.
|
||||
(GNULIB_defined_dev_t): Update.
|
||||
(ino_t): Update.
|
||||
(GNULIB_defined_ino_t): Update.
|
||||
(_GL_WINDOWS_STAT_INODES): Update.
|
||||
(if): Update.
|
||||
* import/sys_uio.in.h: Update.
|
||||
* import/tempname.c (__secure_getenv): Update.
|
||||
(try_nocreate): Update.
|
||||
* import/tempname.h: Update.
|
||||
* import/time.in.h (tzset): Update.
|
||||
(_GL_FUNCDECL_RPL): Update.
|
||||
(_GL_CXXALIAS_RPL): Update.
|
||||
(_GL_FUNCDECL_SYS): Update.
|
||||
(_GL_CXXALIAS_SYS): Update.
|
||||
(_GL_CXXALIASWARN): Update.
|
||||
(ctime): Update.
|
||||
(strftime): Update.
|
||||
* import/time_r.c: Update.
|
||||
* import/unistd--.h: Update.
|
||||
* import/unistd-safer.h: Update.
|
||||
* import/unistd.in.h (if): Update.
|
||||
(elif): Update.
|
||||
(__need_getopt): Update.
|
||||
(access): Update.
|
||||
(_GL_FUNCDECL_RPL): Update.
|
||||
(_GL_CXXALIAS_RPL): Update.
|
||||
(_GL_CXXALIAS_SYS): Update.
|
||||
(_GL_CXXALIASWARN): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
(_GL_FUNCDECL_SYS): Update.
|
||||
(__declspec): Update.
|
||||
(_GL_WARN_ON_USE_ATTRIBUTE): Update.
|
||||
(faccessat): Update.
|
||||
(getpass): Update.
|
||||
(truncate): Update.
|
||||
* import/unsetenv.c: Update.
|
||||
* import/verify.h (if): Update.
|
||||
(_GL_HAVE__STATIC_ASSERT): Update.
|
||||
(_GL_HAVE_STATIC_ASSERT): Update.
|
||||
(_GL_HAVE__STATIC_ASSERT1): Update.
|
||||
(_GL_HAVE_STATIC_ASSERT1): Update.
|
||||
(_GL_VERIFY): Update.
|
||||
(_Static_assert): Update.
|
||||
(_GL_HAS_BUILTIN_TRAP): Update.
|
||||
(_GL_HAS_BUILTIN_UNREACHABLE): Update.
|
||||
(verify_true): Update.
|
||||
(verify): Update.
|
||||
(__has_builtin): Update.
|
||||
(elif): Update.
|
||||
(assume): Update.
|
||||
* import/warn-on-use.h: Rename from import/extra/snippet/warn-on-use.h.
|
||||
* import/wchar.in.h (if): Update.
|
||||
(wcsftime): Update.
|
||||
(_GL_FUNCDECL_RPL): Update.
|
||||
(_GL_CXXALIAS_RPL): Update.
|
||||
(_GL_FUNCDECL_SYS): Update.
|
||||
(_GL_CXXALIAS_SYS): Update.
|
||||
(_GL_CXXALIASWARN): Update.
|
||||
(_GL_WARN_ON_USE): Update.
|
||||
* import/wctype.in.h (rpl_iswalnum): Update.
|
||||
(rpl_iswalpha): Update.
|
||||
(rpl_iswblank): Update.
|
||||
(rpl_iswcntrl): Update.
|
||||
(rpl_iswdigit): Update.
|
||||
(rpl_iswgraph): Update.
|
||||
(rpl_iswlower): Update.
|
||||
(rpl_iswprint): Update.
|
||||
(rpl_iswpunct): Update.
|
||||
(rpl_iswspace): Update.
|
||||
(rpl_iswupper): Update.
|
||||
(rpl_iswxdigit): Update.
|
||||
(rpl_towlower): Update.
|
||||
(rpl_towupper): Update.
|
||||
(iswalnum): Update.
|
||||
(iswalpha): Update.
|
||||
(iswblank): Update.
|
||||
(iswcntrl): Update.
|
||||
(iswdigit): Update.
|
||||
(iswgraph): Update.
|
||||
(iswlower): Update.
|
||||
(iswprint): Update.
|
||||
(iswpunct): Update.
|
||||
(iswspace): Update.
|
||||
(iswupper): Update.
|
||||
(iswxdigit): Update.
|
||||
(towlower): Update.
|
||||
(towupper): Update.
|
||||
* import/windows-initguard.h: New file.
|
||||
* import/windows-mutex.c: New file.
|
||||
* import/windows-mutex.h: New file.
|
||||
* import/windows-once.c: New file.
|
||||
* import/windows-once.h: New file.
|
||||
* import/windows-recmutex.c: New file.
|
||||
* import/windows-recmutex.h: New file.
|
||||
* import/windows-rwlock.c: New file.
|
||||
* import/windows-rwlock.h: New file.
|
||||
* import/xalloc-oversized.h: New file.
|
||||
* patches/0001-Fix-PR-gdb-23558-Use-system-s-getcwd-when-cross-comp.patch: Remove.
|
||||
* patches/0002-mkostemp-mkostemps-Fix-compilation-error-in-C-mode-o.patch: Remove.
|
||||
* patches/0003-Fix-glob-c-Coverity-issues.patch: Remove.
|
||||
* update-gnulib.sh: Update to latest gnulib and don't apply patches
|
||||
anymore. Also updates the patch -p flag to the current directory structure in
|
||||
case patches are needed again in the future.
|
||||
|
||||
2019-11-15 Tom Tromey <tromey@adacore.com>
|
||||
|
||||
* aclocal.m4, configure, Makefile.in, import/Makefile.in:
|
||||
|
||||
@ -15,4 +15,14 @@
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# The toplevel makefile overrides $(CC) (in EXTRA_HOST_FLAGS) by setting
|
||||
# it to whatever CC was in the toplevel configure. This breaks in Gnulib with
|
||||
# older GCCs, because Gnulib's configure uses this variable to store the
|
||||
# standard-setting switch (e.g. -std=gnu99/-std=gnu11). To fix this, we just
|
||||
# set MAKEOVERRIDES to empty here so that import/ uses the right $(CC).
|
||||
#
|
||||
# This problem is visible with compilers that don't use C99 by default, such
|
||||
# as GCC 4.8.5 (Centos 7).
|
||||
MAKEOVERRIDES =
|
||||
|
||||
SUBDIRS = import
|
||||
|
||||
@ -89,6 +89,7 @@ am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
@ -112,15 +113,16 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../config/plugins.m4 \
|
||||
$(top_srcdir)/import/m4/00gnulib.m4 \
|
||||
$(top_srcdir)/import/m4/__inline.m4 \
|
||||
$(top_srcdir)/import/m4/absolute-header.m4 \
|
||||
$(top_srcdir)/import/m4/alloca.m4 \
|
||||
$(top_srcdir)/import/m4/arpa_inet_h.m4 \
|
||||
$(top_srcdir)/import/m4/builtin-expect.m4 \
|
||||
$(top_srcdir)/import/m4/canonicalize.m4 \
|
||||
$(top_srcdir)/import/m4/chdir-long.m4 \
|
||||
$(top_srcdir)/import/m4/close.m4 \
|
||||
$(top_srcdir)/import/m4/closedir.m4 \
|
||||
$(top_srcdir)/import/m4/codeset.m4 \
|
||||
$(top_srcdir)/import/m4/configmake.m4 \
|
||||
$(top_srcdir)/import/m4/d-ino.m4 \
|
||||
$(top_srcdir)/import/m4/d-type.m4 \
|
||||
$(top_srcdir)/import/m4/dirent_h.m4 \
|
||||
@ -145,6 +147,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/import/m4/flexmember.m4 \
|
||||
$(top_srcdir)/import/m4/float_h.m4 \
|
||||
$(top_srcdir)/import/m4/fnmatch.m4 \
|
||||
$(top_srcdir)/import/m4/fnmatch_h.m4 \
|
||||
$(top_srcdir)/import/m4/fpieee.m4 \
|
||||
$(top_srcdir)/import/m4/frexp.m4 \
|
||||
$(top_srcdir)/import/m4/frexpl.m4 \
|
||||
@ -154,14 +157,15 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/import/m4/getcwd-path-max.m4 \
|
||||
$(top_srcdir)/import/m4/getcwd.m4 \
|
||||
$(top_srcdir)/import/m4/getdtablesize.m4 \
|
||||
$(top_srcdir)/import/m4/getlogin.m4 \
|
||||
$(top_srcdir)/import/m4/getlogin_r.m4 \
|
||||
$(top_srcdir)/import/m4/getpagesize.m4 \
|
||||
$(top_srcdir)/import/m4/getprogname.m4 \
|
||||
$(top_srcdir)/import/m4/gettimeofday.m4 \
|
||||
$(top_srcdir)/import/m4/glibc21.m4 \
|
||||
$(top_srcdir)/import/m4/glob.m4 \
|
||||
$(top_srcdir)/import/m4/glob_h.m4 \
|
||||
$(top_srcdir)/import/m4/gnulib-common.m4 \
|
||||
$(top_srcdir)/import/m4/gnulib-comp.m4 \
|
||||
$(top_srcdir)/import/m4/hard-locale.m4 \
|
||||
$(top_srcdir)/import/m4/include_next.m4 \
|
||||
$(top_srcdir)/import/m4/inet_ntop.m4 \
|
||||
$(top_srcdir)/import/m4/inttypes-pri.m4 \
|
||||
@ -169,14 +173,12 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/import/m4/isnand.m4 \
|
||||
$(top_srcdir)/import/m4/isnanl.m4 \
|
||||
$(top_srcdir)/import/m4/largefile.m4 \
|
||||
$(top_srcdir)/import/m4/lib-ld.m4 \
|
||||
$(top_srcdir)/import/m4/lib-link.m4 \
|
||||
$(top_srcdir)/import/m4/lib-prefix.m4 \
|
||||
$(top_srcdir)/import/m4/limits-h.m4 \
|
||||
$(top_srcdir)/import/m4/localcharset.m4 \
|
||||
$(top_srcdir)/import/m4/locale-fr.m4 \
|
||||
$(top_srcdir)/import/m4/locale-ja.m4 \
|
||||
$(top_srcdir)/import/m4/locale-zh.m4 \
|
||||
$(top_srcdir)/import/m4/localtime-buffer.m4 \
|
||||
$(top_srcdir)/import/m4/lock.m4 \
|
||||
$(top_srcdir)/import/m4/longlong.m4 \
|
||||
$(top_srcdir)/import/m4/lstat.m4 \
|
||||
@ -202,11 +204,13 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/import/m4/netinet_in_h.m4 \
|
||||
$(top_srcdir)/import/m4/nocrash.m4 \
|
||||
$(top_srcdir)/import/m4/off_t.m4 \
|
||||
$(top_srcdir)/import/m4/onceonly.m4 \
|
||||
$(top_srcdir)/import/m4/open-cloexec.m4 \
|
||||
$(top_srcdir)/import/m4/open-slash.m4 \
|
||||
$(top_srcdir)/import/m4/open.m4 \
|
||||
$(top_srcdir)/import/m4/openat.m4 \
|
||||
$(top_srcdir)/import/m4/opendir.m4 \
|
||||
$(top_srcdir)/import/m4/pathmax.m4 \
|
||||
$(top_srcdir)/import/m4/pthread_rwlock_rdlock.m4 \
|
||||
$(top_srcdir)/import/m4/rawmemchr.m4 \
|
||||
$(top_srcdir)/import/m4/readdir.m4 \
|
||||
$(top_srcdir)/import/m4/readlink.m4 \
|
||||
@ -215,13 +219,14 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
|
||||
$(top_srcdir)/import/m4/rewinddir.m4 \
|
||||
$(top_srcdir)/import/m4/rmdir.m4 \
|
||||
$(top_srcdir)/import/m4/save-cwd.m4 \
|
||||
$(top_srcdir)/import/m4/secure_getenv.m4 \
|
||||
$(top_srcdir)/import/m4/setenv.m4 \
|
||||
$(top_srcdir)/import/m4/signal_h.m4 \
|
||||
$(top_srcdir)/import/m4/socklen.m4 \
|
||||
$(top_srcdir)/import/m4/sockpfaf.m4 \
|
||||
$(top_srcdir)/import/m4/ssize_t.m4 \
|
||||
$(top_srcdir)/import/m4/stat-time.m4 \
|
||||
$(top_srcdir)/import/m4/stat.m4 \
|
||||
$(top_srcdir)/import/m4/std-gnu11.m4 \
|
||||
$(top_srcdir)/import/m4/stdalign.m4 \
|
||||
$(top_srcdir)/import/m4/stdbool.m4 \
|
||||
$(top_srcdir)/import/m4/stddef_h.m4 \
|
||||
@ -317,7 +322,6 @@ ETAGS = etags
|
||||
CTAGS = ctags
|
||||
CSCOPE = cscope
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
pkglibexecdir = @pkglibexecdir@
|
||||
ACLOCAL = @ACLOCAL@
|
||||
ALLOCA = @ALLOCA@
|
||||
ALLOCA_H = @ALLOCA_H@
|
||||
@ -359,10 +363,10 @@ FLOAT_H = @FLOAT_H@
|
||||
FNMATCH_H = @FNMATCH_H@
|
||||
FREXPL_LIBM = @FREXPL_LIBM@
|
||||
FREXP_LIBM = @FREXP_LIBM@
|
||||
GLIBC21 = @GLIBC21@
|
||||
GLOB_H = @GLOB_H@
|
||||
GNULIB_ACCEPT = @GNULIB_ACCEPT@
|
||||
GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
|
||||
GNULIB_ACCESS = @GNULIB_ACCESS@
|
||||
GNULIB_ACOSF = @GNULIB_ACOSF@
|
||||
GNULIB_ACOSL = @GNULIB_ACOSL@
|
||||
GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
|
||||
@ -390,9 +394,12 @@ GNULIB_CONNECT = @GNULIB_CONNECT@
|
||||
GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
|
||||
GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
|
||||
GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
|
||||
GNULIB_COPY_FILE_RANGE = @GNULIB_COPY_FILE_RANGE@
|
||||
GNULIB_COSF = @GNULIB_COSF@
|
||||
GNULIB_COSHF = @GNULIB_COSHF@
|
||||
GNULIB_COSL = @GNULIB_COSL@
|
||||
GNULIB_CREAT = @GNULIB_CREAT@
|
||||
GNULIB_CTIME = @GNULIB_CTIME@
|
||||
GNULIB_DIRFD = @GNULIB_DIRFD@
|
||||
GNULIB_DPRINTF = @GNULIB_DPRINTF@
|
||||
GNULIB_DUP = @GNULIB_DUP@
|
||||
@ -405,6 +412,7 @@ GNULIB_EXP2F = @GNULIB_EXP2F@
|
||||
GNULIB_EXP2L = @GNULIB_EXP2L@
|
||||
GNULIB_EXPF = @GNULIB_EXPF@
|
||||
GNULIB_EXPL = @GNULIB_EXPL@
|
||||
GNULIB_EXPLICIT_BZERO = @GNULIB_EXPLICIT_BZERO@
|
||||
GNULIB_EXPM1 = @GNULIB_EXPM1@
|
||||
GNULIB_EXPM1F = @GNULIB_EXPM1F@
|
||||
GNULIB_EXPM1L = @GNULIB_EXPM1L@
|
||||
@ -433,6 +441,7 @@ GNULIB_FMAL = @GNULIB_FMAL@
|
||||
GNULIB_FMOD = @GNULIB_FMOD@
|
||||
GNULIB_FMODF = @GNULIB_FMODF@
|
||||
GNULIB_FMODL = @GNULIB_FMODL@
|
||||
GNULIB_FNMATCH = @GNULIB_FNMATCH@
|
||||
GNULIB_FOPEN = @GNULIB_FOPEN@
|
||||
GNULIB_FPRINTF = @GNULIB_FPRINTF@
|
||||
GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
|
||||
@ -468,12 +477,14 @@ GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
|
||||
GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
|
||||
GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
|
||||
GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
|
||||
GNULIB_GETPASS = @GNULIB_GETPASS@
|
||||
GNULIB_GETPEERNAME = @GNULIB_GETPEERNAME@
|
||||
GNULIB_GETSOCKNAME = @GNULIB_GETSOCKNAME@
|
||||
GNULIB_GETSOCKOPT = @GNULIB_GETSOCKOPT@
|
||||
GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
|
||||
GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
|
||||
GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
|
||||
GNULIB_GLOB = @GNULIB_GLOB@
|
||||
GNULIB_GRANTPT = @GNULIB_GRANTPT@
|
||||
GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
|
||||
GNULIB_HYPOT = @GNULIB_HYPOT@
|
||||
@ -502,6 +513,7 @@ GNULIB_LDEXPL = @GNULIB_LDEXPL@
|
||||
GNULIB_LINK = @GNULIB_LINK@
|
||||
GNULIB_LINKAT = @GNULIB_LINKAT@
|
||||
GNULIB_LISTEN = @GNULIB_LISTEN@
|
||||
GNULIB_LOCALTIME = @GNULIB_LOCALTIME@
|
||||
GNULIB_LOG = @GNULIB_LOG@
|
||||
GNULIB_LOG10 = @GNULIB_LOG10@
|
||||
GNULIB_LOG10F = @GNULIB_LOG10F@
|
||||
@ -565,6 +577,8 @@ GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
|
||||
GNULIB_OPEN = @GNULIB_OPEN@
|
||||
GNULIB_OPENAT = @GNULIB_OPENAT@
|
||||
GNULIB_OPENDIR = @GNULIB_OPENDIR@
|
||||
GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@
|
||||
GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
|
||||
GNULIB_PCLOSE = @GNULIB_PCLOSE@
|
||||
GNULIB_PERROR = @GNULIB_PERROR@
|
||||
GNULIB_PIPE = @GNULIB_PIPE@
|
||||
@ -592,6 +606,7 @@ GNULIB_READ = @GNULIB_READ@
|
||||
GNULIB_READDIR = @GNULIB_READDIR@
|
||||
GNULIB_READLINK = @GNULIB_READLINK@
|
||||
GNULIB_READLINKAT = @GNULIB_READLINKAT@
|
||||
GNULIB_REALLOCARRAY = @GNULIB_REALLOCARRAY@
|
||||
GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
|
||||
GNULIB_REALPATH = @GNULIB_REALPATH@
|
||||
GNULIB_RECV = @GNULIB_RECV@
|
||||
@ -643,6 +658,7 @@ GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
|
||||
GNULIB_STRDUP = @GNULIB_STRDUP@
|
||||
GNULIB_STRERROR = @GNULIB_STRERROR@
|
||||
GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
|
||||
GNULIB_STRFTIME = @GNULIB_STRFTIME@
|
||||
GNULIB_STRNCAT = @GNULIB_STRNCAT@
|
||||
GNULIB_STRNDUP = @GNULIB_STRNDUP@
|
||||
GNULIB_STRNLEN = @GNULIB_STRNLEN@
|
||||
@ -654,6 +670,7 @@ GNULIB_STRSTR = @GNULIB_STRSTR@
|
||||
GNULIB_STRTOD = @GNULIB_STRTOD@
|
||||
GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
|
||||
GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
|
||||
GNULIB_STRTOLD = @GNULIB_STRTOLD@
|
||||
GNULIB_STRTOLL = @GNULIB_STRTOLL@
|
||||
GNULIB_STRTOULL = @GNULIB_STRTOULL@
|
||||
GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
|
||||
@ -670,9 +687,11 @@ GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
|
||||
GNULIB_TMPFILE = @GNULIB_TMPFILE@
|
||||
GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
|
||||
GNULIB_TRUNC = @GNULIB_TRUNC@
|
||||
GNULIB_TRUNCATE = @GNULIB_TRUNCATE@
|
||||
GNULIB_TRUNCF = @GNULIB_TRUNCF@
|
||||
GNULIB_TRUNCL = @GNULIB_TRUNCL@
|
||||
GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
|
||||
GNULIB_TZSET = @GNULIB_TZSET@
|
||||
GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
|
||||
GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
|
||||
GNULIB_UNLINK = @GNULIB_UNLINK@
|
||||
@ -702,6 +721,7 @@ GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
|
||||
GNULIB_WCSCPY = @GNULIB_WCSCPY@
|
||||
GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
|
||||
GNULIB_WCSDUP = @GNULIB_WCSDUP@
|
||||
GNULIB_WCSFTIME = @GNULIB_WCSFTIME@
|
||||
GNULIB_WCSLEN = @GNULIB_WCSLEN@
|
||||
GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
|
||||
GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
|
||||
@ -733,6 +753,7 @@ GREP = @GREP@
|
||||
HAVE_ACCEPT4 = @HAVE_ACCEPT4@
|
||||
HAVE_ACOSF = @HAVE_ACOSF@
|
||||
HAVE_ACOSL = @HAVE_ACOSL@
|
||||
HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
|
||||
HAVE_ALPHASORT = @HAVE_ALPHASORT@
|
||||
HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
|
||||
HAVE_ASINF = @HAVE_ASINF@
|
||||
@ -751,9 +772,11 @@ HAVE_CHOWN = @HAVE_CHOWN@
|
||||
HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
|
||||
HAVE_COPYSIGN = @HAVE_COPYSIGN@
|
||||
HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
|
||||
HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
|
||||
HAVE_COSF = @HAVE_COSF@
|
||||
HAVE_COSHF = @HAVE_COSHF@
|
||||
HAVE_COSL = @HAVE_COSL@
|
||||
HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
|
||||
HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
|
||||
HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
|
||||
HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
|
||||
@ -783,6 +806,7 @@ HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
|
||||
HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
|
||||
HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
|
||||
HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
|
||||
HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
|
||||
HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
|
||||
HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
|
||||
HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
|
||||
@ -790,6 +814,7 @@ HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
|
||||
HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
|
||||
HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
|
||||
HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
|
||||
HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
|
||||
HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
|
||||
HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
|
||||
HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
|
||||
@ -809,6 +834,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
|
||||
HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
|
||||
HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
|
||||
HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
|
||||
HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
|
||||
HAVE_DECL_SINL = @HAVE_DECL_SINL@
|
||||
HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
|
||||
HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
|
||||
@ -822,6 +848,7 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
|
||||
HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
|
||||
HAVE_DECL_TANL = @HAVE_DECL_TANL@
|
||||
HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
|
||||
HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
|
||||
HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
|
||||
HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
|
||||
HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
|
||||
@ -836,6 +863,7 @@ HAVE_DUP3 = @HAVE_DUP3@
|
||||
HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
|
||||
HAVE_EXPF = @HAVE_EXPF@
|
||||
HAVE_EXPL = @HAVE_EXPL@
|
||||
HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
|
||||
HAVE_EXPM1 = @HAVE_EXPM1@
|
||||
HAVE_EXPM1F = @HAVE_EXPM1F@
|
||||
HAVE_FABSF = @HAVE_FABSF@
|
||||
@ -855,6 +883,8 @@ HAVE_FMAF = @HAVE_FMAF@
|
||||
HAVE_FMAL = @HAVE_FMAL@
|
||||
HAVE_FMODF = @HAVE_FMODF@
|
||||
HAVE_FMODL = @HAVE_FMODL@
|
||||
HAVE_FNMATCH = @HAVE_FNMATCH@
|
||||
HAVE_FNMATCH_H = @HAVE_FNMATCH_H@
|
||||
HAVE_FREXPF = @HAVE_FREXPF@
|
||||
HAVE_FSEEKO = @HAVE_FSEEKO@
|
||||
HAVE_FSTATAT = @HAVE_FSTATAT@
|
||||
@ -867,8 +897,12 @@ HAVE_GETGROUPS = @HAVE_GETGROUPS@
|
||||
HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
|
||||
HAVE_GETLOGIN = @HAVE_GETLOGIN@
|
||||
HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
|
||||
HAVE_GETPASS = @HAVE_GETPASS@
|
||||
HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
|
||||
HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
|
||||
HAVE_GLOB = @HAVE_GLOB@
|
||||
HAVE_GLOB_H = @HAVE_GLOB_H@
|
||||
HAVE_GLOB_PATTERN_P = @HAVE_GLOB_PATTERN_P@
|
||||
HAVE_GRANTPT = @HAVE_GRANTPT@
|
||||
HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
|
||||
HAVE_HYPOTF = @HAVE_HYPOTF@
|
||||
@ -876,6 +910,8 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
|
||||
HAVE_ILOGB = @HAVE_ILOGB@
|
||||
HAVE_ILOGBF = @HAVE_ILOGBF@
|
||||
HAVE_ILOGBL = @HAVE_ILOGBL@
|
||||
HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
|
||||
HAVE_INITSTATE = @HAVE_INITSTATE@
|
||||
HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
|
||||
HAVE_ISNAND = @HAVE_ISNAND@
|
||||
HAVE_ISNANF = @HAVE_ISNANF@
|
||||
@ -905,6 +941,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
|
||||
HAVE_MBSLEN = @HAVE_MBSLEN@
|
||||
HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
|
||||
HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
|
||||
HAVE_MBTOWC = @HAVE_MBTOWC@
|
||||
HAVE_MEMCHR = @HAVE_MEMCHR@
|
||||
HAVE_MEMPCPY = @HAVE_MEMPCPY@
|
||||
HAVE_MKDIRAT = @HAVE_MKDIRAT@
|
||||
@ -946,6 +983,7 @@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
|
||||
HAVE_READDIR = @HAVE_READDIR@
|
||||
HAVE_READLINK = @HAVE_READLINK@
|
||||
HAVE_READLINKAT = @HAVE_READLINKAT@
|
||||
HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
|
||||
HAVE_REALPATH = @HAVE_REALPATH@
|
||||
HAVE_REMAINDER = @HAVE_REMAINDER@
|
||||
HAVE_REMAINDERF = @HAVE_REMAINDERF@
|
||||
@ -960,6 +998,7 @@ HAVE_SCANDIR = @HAVE_SCANDIR@
|
||||
HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
|
||||
HAVE_SETENV = @HAVE_SETENV@
|
||||
HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
|
||||
HAVE_SETSTATE = @HAVE_SETSTATE@
|
||||
HAVE_SIGACTION = @HAVE_SIGACTION@
|
||||
HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
|
||||
HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
|
||||
@ -982,6 +1021,7 @@ HAVE_STRPBRK = @HAVE_STRPBRK@
|
||||
HAVE_STRPTIME = @HAVE_STRPTIME@
|
||||
HAVE_STRSEP = @HAVE_STRSEP@
|
||||
HAVE_STRTOD = @HAVE_STRTOD@
|
||||
HAVE_STRTOLD = @HAVE_STRTOLD@
|
||||
HAVE_STRTOLL = @HAVE_STRTOLL@
|
||||
HAVE_STRTOULL = @HAVE_STRTOULL@
|
||||
HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
|
||||
@ -993,7 +1033,6 @@ HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
|
||||
HAVE_SYMLINK = @HAVE_SYMLINK@
|
||||
HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
|
||||
HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
|
||||
HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
|
||||
HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
|
||||
HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
|
||||
HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
|
||||
@ -1007,6 +1046,7 @@ HAVE_TANL = @HAVE_TANL@
|
||||
HAVE_TIMEGM = @HAVE_TIMEGM@
|
||||
HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
|
||||
HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
|
||||
HAVE_TZSET = @HAVE_TZSET@
|
||||
HAVE_UNISTD_H = @HAVE_UNISTD_H@
|
||||
HAVE_UNLINKAT = @HAVE_UNLINKAT@
|
||||
HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
|
||||
@ -1028,6 +1068,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@
|
||||
HAVE_WCSCPY = @HAVE_WCSCPY@
|
||||
HAVE_WCSCSPN = @HAVE_WCSCSPN@
|
||||
HAVE_WCSDUP = @HAVE_WCSDUP@
|
||||
HAVE_WCSFTIME = @HAVE_WCSFTIME@
|
||||
HAVE_WCSLEN = @HAVE_WCSLEN@
|
||||
HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
|
||||
HAVE_WCSNCAT = @HAVE_WCSNCAT@
|
||||
@ -1072,10 +1113,11 @@ LIBGNU_LTLIBDEPS = @LIBGNU_LTLIBDEPS@
|
||||
LIBINTL = @LIBINTL@
|
||||
LIBMULTITHREAD = @LIBMULTITHREAD@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBPTH = @LIBPTH@
|
||||
LIBPTH_PREFIX = @LIBPTH_PREFIX@
|
||||
LIBPMULTITHREAD = @LIBPMULTITHREAD@
|
||||
LIBPTHREAD = @LIBPTHREAD@
|
||||
LIBS = @LIBS@
|
||||
LIBTHREAD = @LIBTHREAD@
|
||||
LIB_GETLOGIN = @LIB_GETLOGIN@
|
||||
LIMITS_H = @LIMITS_H@
|
||||
LN_S = @LN_S@
|
||||
LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
|
||||
@ -1086,7 +1128,6 @@ LOCALE_ZH_CN = @LOCALE_ZH_CN@
|
||||
LTLIBINTL = @LTLIBINTL@
|
||||
LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
LTLIBPTH = @LTLIBPTH@
|
||||
LTLIBTHREAD = @LTLIBTHREAD@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
@ -1098,6 +1139,8 @@ NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H = @NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_GLOB_H = @NEXT_AS_FIRST_DIRECTIVE_GLOB_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
|
||||
NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
|
||||
@ -1121,6 +1164,8 @@ NEXT_DIRENT_H = @NEXT_DIRENT_H@
|
||||
NEXT_ERRNO_H = @NEXT_ERRNO_H@
|
||||
NEXT_FCNTL_H = @NEXT_FCNTL_H@
|
||||
NEXT_FLOAT_H = @NEXT_FLOAT_H@
|
||||
NEXT_FNMATCH_H = @NEXT_FNMATCH_H@
|
||||
NEXT_GLOB_H = @NEXT_GLOB_H@
|
||||
NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
|
||||
NEXT_LIMITS_H = @NEXT_LIMITS_H@
|
||||
NEXT_MATH_H = @NEXT_MATH_H@
|
||||
@ -1156,6 +1201,11 @@ PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
|
||||
PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
|
||||
PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
|
||||
RANLIB = @RANLIB@
|
||||
REPLACE_ACCESS = @REPLACE_ACCESS@
|
||||
REPLACE_ACOSF = @REPLACE_ACOSF@
|
||||
REPLACE_ASINF = @REPLACE_ASINF@
|
||||
REPLACE_ATAN2F = @REPLACE_ATAN2F@
|
||||
REPLACE_ATANF = @REPLACE_ATANF@
|
||||
REPLACE_BTOWC = @REPLACE_BTOWC@
|
||||
REPLACE_CALLOC = @REPLACE_CALLOC@
|
||||
REPLACE_CANONICALIZE_FILE_NAME = @REPLACE_CANONICALIZE_FILE_NAME@
|
||||
@ -1167,15 +1217,23 @@ REPLACE_CEILL = @REPLACE_CEILL@
|
||||
REPLACE_CHOWN = @REPLACE_CHOWN@
|
||||
REPLACE_CLOSE = @REPLACE_CLOSE@
|
||||
REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
|
||||
REPLACE_COSF = @REPLACE_COSF@
|
||||
REPLACE_COSHF = @REPLACE_COSHF@
|
||||
REPLACE_CREAT = @REPLACE_CREAT@
|
||||
REPLACE_CTIME = @REPLACE_CTIME@
|
||||
REPLACE_DIRFD = @REPLACE_DIRFD@
|
||||
REPLACE_DPRINTF = @REPLACE_DPRINTF@
|
||||
REPLACE_DUP = @REPLACE_DUP@
|
||||
REPLACE_DUP2 = @REPLACE_DUP2@
|
||||
REPLACE_EXP2 = @REPLACE_EXP2@
|
||||
REPLACE_EXP2L = @REPLACE_EXP2L@
|
||||
REPLACE_EXPF = @REPLACE_EXPF@
|
||||
REPLACE_EXPL = @REPLACE_EXPL@
|
||||
REPLACE_EXPM1 = @REPLACE_EXPM1@
|
||||
REPLACE_EXPM1F = @REPLACE_EXPM1F@
|
||||
REPLACE_EXPM1L = @REPLACE_EXPM1L@
|
||||
REPLACE_FABSL = @REPLACE_FABSL@
|
||||
REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
|
||||
REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
|
||||
REPLACE_FCLOSE = @REPLACE_FCLOSE@
|
||||
REPLACE_FCNTL = @REPLACE_FCNTL@
|
||||
@ -1191,6 +1249,7 @@ REPLACE_FMAL = @REPLACE_FMAL@
|
||||
REPLACE_FMOD = @REPLACE_FMOD@
|
||||
REPLACE_FMODF = @REPLACE_FMODF@
|
||||
REPLACE_FMODL = @REPLACE_FMODL@
|
||||
REPLACE_FNMATCH = @REPLACE_FNMATCH@
|
||||
REPLACE_FOPEN = @REPLACE_FOPEN@
|
||||
REPLACE_FPRINTF = @REPLACE_FPRINTF@
|
||||
REPLACE_FPURGE = @REPLACE_FPURGE@
|
||||
@ -1214,7 +1273,10 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
|
||||
REPLACE_GETLINE = @REPLACE_GETLINE@
|
||||
REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
|
||||
REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
|
||||
REPLACE_GETPASS = @REPLACE_GETPASS@
|
||||
REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
|
||||
REPLACE_GLOB = @REPLACE_GLOB@
|
||||
REPLACE_GLOB_PATTERN_P = @REPLACE_GLOB_PATTERN_P@
|
||||
REPLACE_GMTIME = @REPLACE_GMTIME@
|
||||
REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
|
||||
REPLACE_HYPOT = @REPLACE_HYPOT@
|
||||
@ -1222,8 +1284,10 @@ REPLACE_HYPOTF = @REPLACE_HYPOTF@
|
||||
REPLACE_HYPOTL = @REPLACE_HYPOTL@
|
||||
REPLACE_ILOGB = @REPLACE_ILOGB@
|
||||
REPLACE_ILOGBF = @REPLACE_ILOGBF@
|
||||
REPLACE_ILOGBL = @REPLACE_ILOGBL@
|
||||
REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
|
||||
REPLACE_INET_PTON = @REPLACE_INET_PTON@
|
||||
REPLACE_INITSTATE = @REPLACE_INITSTATE@
|
||||
REPLACE_ISATTY = @REPLACE_ISATTY@
|
||||
REPLACE_ISFINITE = @REPLACE_ISFINITE@
|
||||
REPLACE_ISINF = @REPLACE_ISINF@
|
||||
@ -1290,6 +1354,7 @@ REPLACE_PUTENV = @REPLACE_PUTENV@
|
||||
REPLACE_PWRITE = @REPLACE_PWRITE@
|
||||
REPLACE_QSORT_R = @REPLACE_QSORT_R@
|
||||
REPLACE_RAISE = @REPLACE_RAISE@
|
||||
REPLACE_RANDOM = @REPLACE_RANDOM@
|
||||
REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
|
||||
REPLACE_READ = @REPLACE_READ@
|
||||
REPLACE_READLINK = @REPLACE_READLINK@
|
||||
@ -1302,16 +1367,21 @@ REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
|
||||
REPLACE_REMOVE = @REPLACE_REMOVE@
|
||||
REPLACE_RENAME = @REPLACE_RENAME@
|
||||
REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
|
||||
REPLACE_RINTL = @REPLACE_RINTL@
|
||||
REPLACE_RMDIR = @REPLACE_RMDIR@
|
||||
REPLACE_ROUND = @REPLACE_ROUND@
|
||||
REPLACE_ROUNDF = @REPLACE_ROUNDF@
|
||||
REPLACE_ROUNDL = @REPLACE_ROUNDL@
|
||||
REPLACE_SETENV = @REPLACE_SETENV@
|
||||
REPLACE_SETSTATE = @REPLACE_SETSTATE@
|
||||
REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
|
||||
REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
|
||||
REPLACE_SINF = @REPLACE_SINF@
|
||||
REPLACE_SINHF = @REPLACE_SINHF@
|
||||
REPLACE_SLEEP = @REPLACE_SLEEP@
|
||||
REPLACE_SNPRINTF = @REPLACE_SNPRINTF@
|
||||
REPLACE_SPRINTF = @REPLACE_SPRINTF@
|
||||
REPLACE_SQRTF = @REPLACE_SQRTF@
|
||||
REPLACE_SQRTL = @REPLACE_SQRTL@
|
||||
REPLACE_STAT = @REPLACE_STAT@
|
||||
REPLACE_STDIO_READ_FUNCS = @REPLACE_STDIO_READ_FUNCS@
|
||||
@ -1322,6 +1392,7 @@ REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
|
||||
REPLACE_STRDUP = @REPLACE_STRDUP@
|
||||
REPLACE_STRERROR = @REPLACE_STRERROR@
|
||||
REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
|
||||
REPLACE_STRFTIME = @REPLACE_STRFTIME@
|
||||
REPLACE_STRNCAT = @REPLACE_STRNCAT@
|
||||
REPLACE_STRNDUP = @REPLACE_STRNDUP@
|
||||
REPLACE_STRNLEN = @REPLACE_STRNLEN@
|
||||
@ -1330,17 +1401,22 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
|
||||
REPLACE_STRTOD = @REPLACE_STRTOD@
|
||||
REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
|
||||
REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
|
||||
REPLACE_STRTOLD = @REPLACE_STRTOLD@
|
||||
REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
|
||||
REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
|
||||
REPLACE_SYMLINK = @REPLACE_SYMLINK@
|
||||
REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
|
||||
REPLACE_TANF = @REPLACE_TANF@
|
||||
REPLACE_TANHF = @REPLACE_TANHF@
|
||||
REPLACE_TIMEGM = @REPLACE_TIMEGM@
|
||||
REPLACE_TMPFILE = @REPLACE_TMPFILE@
|
||||
REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
|
||||
REPLACE_TRUNC = @REPLACE_TRUNC@
|
||||
REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
|
||||
REPLACE_TRUNCF = @REPLACE_TRUNCF@
|
||||
REPLACE_TRUNCL = @REPLACE_TRUNCL@
|
||||
REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
|
||||
REPLACE_TZSET = @REPLACE_TZSET@
|
||||
REPLACE_UNLINK = @REPLACE_UNLINK@
|
||||
REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
|
||||
REPLACE_UNSETENV = @REPLACE_UNSETENV@
|
||||
@ -1353,8 +1429,10 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
|
||||
REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
|
||||
REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
|
||||
REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
|
||||
REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
|
||||
REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
|
||||
REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
|
||||
REPLACE_WCSTOK = @REPLACE_WCSTOK@
|
||||
REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
|
||||
REPLACE_WCTOB = @REPLACE_WCTOB@
|
||||
REPLACE_WCTOMB = @REPLACE_WCTOMB@
|
||||
@ -1381,12 +1459,13 @@ VERSION = @VERSION@
|
||||
WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
|
||||
WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
|
||||
WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
|
||||
WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
|
||||
WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
|
||||
WINT_T_SUFFIX = @WINT_T_SUFFIX@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
@ -1421,7 +1500,6 @@ infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
lispdir = @lispdir@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
@ -1431,7 +1509,6 @@ pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
@ -1444,6 +1521,16 @@ target_vendor = @target_vendor@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
# The toplevel makefile overrides $(CC) (in EXTRA_HOST_FLAGS) by setting
|
||||
# it to whatever CC was in the toplevel configure. This breaks in Gnulib with
|
||||
# older GCCs, because Gnulib's configure uses this variable to store the
|
||||
# standard-setting switch (e.g. -std=gnu99/-std=gnu11). To fix this, we just
|
||||
# set MAKEOVERRIDES to empty here so that import/ uses the right $(CC).
|
||||
#
|
||||
# This problem is visible with compilers that don't use C99 by default, such
|
||||
# as GCC 4.8.5 (Centos 7).
|
||||
MAKEOVERRIDES =
|
||||
SUBDIRS = import
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
97
gnulib/aclocal.m4
vendored
97
gnulib/aclocal.m4
vendored
@ -56,66 +56,6 @@ m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
||||
|
||||
# Copyright (C) 2011-2017 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_AR([ACT-IF-FAIL])
|
||||
# -------------------------
|
||||
# Try to determine the archiver interface, and trigger the ar-lib wrapper
|
||||
# if it is needed. If the detection of archiver interface fails, run
|
||||
# ACT-IF-FAIL (default is to abort configure with a proper error message).
|
||||
AC_DEFUN([AM_PROG_AR],
|
||||
[AC_BEFORE([$0], [LT_INIT])dnl
|
||||
AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
|
||||
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([ar-lib])dnl
|
||||
AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
|
||||
: ${AR=ar}
|
||||
|
||||
AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
|
||||
[AC_LANG_PUSH([C])
|
||||
am_cv_ar_interface=ar
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
|
||||
[am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
|
||||
AC_TRY_EVAL([am_ar_try])
|
||||
if test "$ac_status" -eq 0; then
|
||||
am_cv_ar_interface=ar
|
||||
else
|
||||
am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
|
||||
AC_TRY_EVAL([am_ar_try])
|
||||
if test "$ac_status" -eq 0; then
|
||||
am_cv_ar_interface=lib
|
||||
else
|
||||
am_cv_ar_interface=unknown
|
||||
fi
|
||||
fi
|
||||
rm -f conftest.lib libconftest.a
|
||||
])
|
||||
AC_LANG_POP([C])])
|
||||
|
||||
case $am_cv_ar_interface in
|
||||
ar)
|
||||
;;
|
||||
lib)
|
||||
# Microsoft lib, so override with the ar-lib wrapper script.
|
||||
# FIXME: It is wrong to rewrite AR.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__AR in this case,
|
||||
# and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
|
||||
# similar.
|
||||
AR="$am_aux_dir/ar-lib $AR"
|
||||
;;
|
||||
unknown)
|
||||
m4_default([$1],
|
||||
[AC_MSG_ERROR([could not determine $AR interface])])
|
||||
;;
|
||||
esac
|
||||
AC_SUBST([AR])dnl
|
||||
])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
@ -918,23 +858,6 @@ AC_LANG_POP([C])])
|
||||
# For backward compatibility.
|
||||
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_RUN_LOG(COMMAND)
|
||||
# -------------------
|
||||
# Run COMMAND, save the exit status in ac_status, and log it.
|
||||
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
|
||||
AC_DEFUN([AM_RUN_LOG],
|
||||
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
|
||||
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
|
||||
ac_status=$?
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
|
||||
(exit $ac_status); }])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||
@ -1262,15 +1185,16 @@ m4_include([../config/lead-dot.m4])
|
||||
m4_include([../config/override.m4])
|
||||
m4_include([../config/plugins.m4])
|
||||
m4_include([import/m4/00gnulib.m4])
|
||||
m4_include([import/m4/__inline.m4])
|
||||
m4_include([import/m4/absolute-header.m4])
|
||||
m4_include([import/m4/alloca.m4])
|
||||
m4_include([import/m4/arpa_inet_h.m4])
|
||||
m4_include([import/m4/builtin-expect.m4])
|
||||
m4_include([import/m4/canonicalize.m4])
|
||||
m4_include([import/m4/chdir-long.m4])
|
||||
m4_include([import/m4/close.m4])
|
||||
m4_include([import/m4/closedir.m4])
|
||||
m4_include([import/m4/codeset.m4])
|
||||
m4_include([import/m4/configmake.m4])
|
||||
m4_include([import/m4/d-ino.m4])
|
||||
m4_include([import/m4/d-type.m4])
|
||||
m4_include([import/m4/dirent_h.m4])
|
||||
@ -1296,6 +1220,7 @@ m4_include([import/m4/filenamecat.m4])
|
||||
m4_include([import/m4/flexmember.m4])
|
||||
m4_include([import/m4/float_h.m4])
|
||||
m4_include([import/m4/fnmatch.m4])
|
||||
m4_include([import/m4/fnmatch_h.m4])
|
||||
m4_include([import/m4/fpieee.m4])
|
||||
m4_include([import/m4/frexp.m4])
|
||||
m4_include([import/m4/frexpl.m4])
|
||||
@ -1305,14 +1230,15 @@ m4_include([import/m4/getcwd-abort-bug.m4])
|
||||
m4_include([import/m4/getcwd-path-max.m4])
|
||||
m4_include([import/m4/getcwd.m4])
|
||||
m4_include([import/m4/getdtablesize.m4])
|
||||
m4_include([import/m4/getlogin.m4])
|
||||
m4_include([import/m4/getlogin_r.m4])
|
||||
m4_include([import/m4/getpagesize.m4])
|
||||
m4_include([import/m4/getprogname.m4])
|
||||
m4_include([import/m4/gettimeofday.m4])
|
||||
m4_include([import/m4/glibc21.m4])
|
||||
m4_include([import/m4/glob.m4])
|
||||
m4_include([import/m4/glob_h.m4])
|
||||
m4_include([import/m4/gnulib-common.m4])
|
||||
m4_include([import/m4/gnulib-comp.m4])
|
||||
m4_include([import/m4/hard-locale.m4])
|
||||
m4_include([import/m4/include_next.m4])
|
||||
m4_include([import/m4/inet_ntop.m4])
|
||||
m4_include([import/m4/inttypes-pri.m4])
|
||||
@ -1320,14 +1246,12 @@ m4_include([import/m4/inttypes.m4])
|
||||
m4_include([import/m4/isnand.m4])
|
||||
m4_include([import/m4/isnanl.m4])
|
||||
m4_include([import/m4/largefile.m4])
|
||||
m4_include([import/m4/lib-ld.m4])
|
||||
m4_include([import/m4/lib-link.m4])
|
||||
m4_include([import/m4/lib-prefix.m4])
|
||||
m4_include([import/m4/limits-h.m4])
|
||||
m4_include([import/m4/localcharset.m4])
|
||||
m4_include([import/m4/locale-fr.m4])
|
||||
m4_include([import/m4/locale-ja.m4])
|
||||
m4_include([import/m4/locale-zh.m4])
|
||||
m4_include([import/m4/localtime-buffer.m4])
|
||||
m4_include([import/m4/lock.m4])
|
||||
m4_include([import/m4/longlong.m4])
|
||||
m4_include([import/m4/lstat.m4])
|
||||
@ -1353,11 +1277,13 @@ m4_include([import/m4/multiarch.m4])
|
||||
m4_include([import/m4/netinet_in_h.m4])
|
||||
m4_include([import/m4/nocrash.m4])
|
||||
m4_include([import/m4/off_t.m4])
|
||||
m4_include([import/m4/onceonly.m4])
|
||||
m4_include([import/m4/open-cloexec.m4])
|
||||
m4_include([import/m4/open-slash.m4])
|
||||
m4_include([import/m4/open.m4])
|
||||
m4_include([import/m4/openat.m4])
|
||||
m4_include([import/m4/opendir.m4])
|
||||
m4_include([import/m4/pathmax.m4])
|
||||
m4_include([import/m4/pthread_rwlock_rdlock.m4])
|
||||
m4_include([import/m4/rawmemchr.m4])
|
||||
m4_include([import/m4/readdir.m4])
|
||||
m4_include([import/m4/readlink.m4])
|
||||
@ -1366,13 +1292,14 @@ m4_include([import/m4/rename.m4])
|
||||
m4_include([import/m4/rewinddir.m4])
|
||||
m4_include([import/m4/rmdir.m4])
|
||||
m4_include([import/m4/save-cwd.m4])
|
||||
m4_include([import/m4/secure_getenv.m4])
|
||||
m4_include([import/m4/setenv.m4])
|
||||
m4_include([import/m4/signal_h.m4])
|
||||
m4_include([import/m4/socklen.m4])
|
||||
m4_include([import/m4/sockpfaf.m4])
|
||||
m4_include([import/m4/ssize_t.m4])
|
||||
m4_include([import/m4/stat-time.m4])
|
||||
m4_include([import/m4/stat.m4])
|
||||
m4_include([import/m4/std-gnu11.m4])
|
||||
m4_include([import/m4/stdalign.m4])
|
||||
m4_include([import/m4/stdbool.m4])
|
||||
m4_include([import/m4/stddef_h.m4])
|
||||
|
||||
1232
gnulib/config.in
1232
gnulib/config.in
File diff suppressed because it is too large
Load Diff
8812
gnulib/configure
vendored
8812
gnulib/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
## DO NOT EDIT! GENERATED AUTOMATICALLY!
|
||||
## Process this file with automake to produce Makefile.in.
|
||||
# Copyright (C) 2002-2016 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2019 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -13,7 +13,7 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this file. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this file. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# As a special exception to the GNU General Public License,
|
||||
# this file may be distributed as part of a program that
|
||||
@ -21,9 +21,55 @@
|
||||
# the same distribution terms as the rest of that program.
|
||||
#
|
||||
# Generated by gnulib-tool.
|
||||
# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=import --m4-base=import/m4 --doc-base=doc --tests-base=tests --aux-dir=import/extra --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca canonicalize-lgpl dirent dirfd errno fnmatch-gnu frexpl getcwd glob inet_ntop inttypes limits-h lstat memchr memmem mkdir mkdtemp mkostemp pathmax rawmemchr readlink rename setenv signal-h strchrnul strerror_r-posix strstr strtok_r sys_stat time_r unistd unsetenv update-copyright wchar wctype-h
|
||||
# Reproduce by:
|
||||
# gnulib-tool --import \
|
||||
# --lib=libgnu \
|
||||
# --source-base=import \
|
||||
# --m4-base=import/m4 \
|
||||
# --doc-base=doc \
|
||||
# --tests-base=tests \
|
||||
# --aux-dir=import/extra \
|
||||
# --no-conditional-dependencies \
|
||||
# --no-libtool \
|
||||
# --macro-prefix=gl \
|
||||
# --no-vc-files \
|
||||
# alloca \
|
||||
# canonicalize-lgpl \
|
||||
# dirent \
|
||||
# dirfd \
|
||||
# errno \
|
||||
# fnmatch-gnu \
|
||||
# frexpl \
|
||||
# getcwd \
|
||||
# glob \
|
||||
# inet_ntop \
|
||||
# inttypes \
|
||||
# limits-h \
|
||||
# lstat \
|
||||
# memchr \
|
||||
# memmem \
|
||||
# mkdir \
|
||||
# mkdtemp \
|
||||
# mkostemp \
|
||||
# pathmax \
|
||||
# rawmemchr \
|
||||
# readlink \
|
||||
# rename \
|
||||
# setenv \
|
||||
# signal-h \
|
||||
# strchrnul \
|
||||
# strerror_r-posix \
|
||||
# strstr \
|
||||
# strtok_r \
|
||||
# sys_stat \
|
||||
# time_r \
|
||||
# unistd \
|
||||
# unsetenv \
|
||||
# update-copyright \
|
||||
# wchar \
|
||||
# wctype-h
|
||||
|
||||
AUTOMAKE_OPTIONS = 1.9.6 gnits subdir-objects
|
||||
AUTOMAKE_OPTIONS = 1.11 gnits subdir-objects
|
||||
|
||||
SUBDIRS =
|
||||
noinst_HEADERS =
|
||||
@ -37,6 +83,7 @@ MOSTLYCLEANDIRS =
|
||||
CLEANFILES =
|
||||
DISTCLEANFILES =
|
||||
MAINTAINERCLEANFILES =
|
||||
# No GNU Make output.
|
||||
EXTRA_DIST += m4/gnulib-cache.m4
|
||||
|
||||
AM_CPPFLAGS =
|
||||
@ -79,7 +126,7 @@ if GL_GENERATE_ALLOCA_H
|
||||
alloca.h: alloca.in.h $(top_builddir)/config.status
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
cat $(srcdir)/alloca.in.h; \
|
||||
sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' < $(srcdir)/alloca.in.h; \
|
||||
} > $@-t && \
|
||||
mv -f $@-t $@
|
||||
else
|
||||
@ -111,6 +158,7 @@ arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON
|
||||
-e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
|
||||
-e 's/@''GNULIB_INET_NTOP''@/$(GNULIB_INET_NTOP)/g' \
|
||||
-e 's/@''GNULIB_INET_PTON''@/$(GNULIB_INET_PTON)/g' \
|
||||
-e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
|
||||
-e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
|
||||
-e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
|
||||
-e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \
|
||||
@ -188,51 +236,6 @@ EXTRA_libgnu_a_SOURCES += closedir.c
|
||||
|
||||
## end gnulib module closedir
|
||||
|
||||
## begin gnulib module configmake
|
||||
|
||||
# Listed in the same order as the GNU makefile conventions, and
|
||||
# provided by autoconf 2.59c+ or 2.70.
|
||||
# The Automake-defined pkg* macros are appended, in the order
|
||||
# listed in the Automake 1.10a+ documentation.
|
||||
configmake.h: Makefile
|
||||
$(AM_V_GEN)rm -f $@-t && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
echo '#define PREFIX "$(prefix)"'; \
|
||||
echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
|
||||
echo '#define BINDIR "$(bindir)"'; \
|
||||
echo '#define SBINDIR "$(sbindir)"'; \
|
||||
echo '#define LIBEXECDIR "$(libexecdir)"'; \
|
||||
echo '#define DATAROOTDIR "$(datarootdir)"'; \
|
||||
echo '#define DATADIR "$(datadir)"'; \
|
||||
echo '#define SYSCONFDIR "$(sysconfdir)"'; \
|
||||
echo '#define SHAREDSTATEDIR "$(sharedstatedir)"'; \
|
||||
echo '#define LOCALSTATEDIR "$(localstatedir)"'; \
|
||||
echo '#define RUNSTATEDIR "$(runstatedir)"'; \
|
||||
echo '#define INCLUDEDIR "$(includedir)"'; \
|
||||
echo '#define OLDINCLUDEDIR "$(oldincludedir)"'; \
|
||||
echo '#define DOCDIR "$(docdir)"'; \
|
||||
echo '#define INFODIR "$(infodir)"'; \
|
||||
echo '#define HTMLDIR "$(htmldir)"'; \
|
||||
echo '#define DVIDIR "$(dvidir)"'; \
|
||||
echo '#define PDFDIR "$(pdfdir)"'; \
|
||||
echo '#define PSDIR "$(psdir)"'; \
|
||||
echo '#define LIBDIR "$(libdir)"'; \
|
||||
echo '#define LISPDIR "$(lispdir)"'; \
|
||||
echo '#define LOCALEDIR "$(localedir)"'; \
|
||||
echo '#define MANDIR "$(mandir)"'; \
|
||||
echo '#define MANEXT "$(manext)"'; \
|
||||
echo '#define PKGDATADIR "$(pkgdatadir)"'; \
|
||||
echo '#define PKGINCLUDEDIR "$(pkgincludedir)"'; \
|
||||
echo '#define PKGLIBDIR "$(pkglibdir)"'; \
|
||||
echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
|
||||
} | sed '/""/d' > $@-t && \
|
||||
mv -f $@-t $@
|
||||
|
||||
BUILT_SOURCES += configmake.h
|
||||
CLEANFILES += configmake.h configmake.h-t
|
||||
|
||||
## end gnulib module configmake
|
||||
|
||||
## begin gnulib module dirent
|
||||
|
||||
BUILT_SOURCES += dirent.h
|
||||
@ -406,12 +409,14 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
|
||||
-e 's/@''GNULIB_CREAT''@/$(GNULIB_CREAT)/g' \
|
||||
-e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
|
||||
-e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
|
||||
-e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
|
||||
-e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
|
||||
-e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
|
||||
-e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
|
||||
-e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
|
||||
-e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
|
||||
-e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
|
||||
-e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
|
||||
@ -435,6 +440,12 @@ EXTRA_DIST += fd-hook.h
|
||||
|
||||
## end gnulib module fd-hook
|
||||
|
||||
## begin gnulib module fd-safer-flag
|
||||
|
||||
libgnu_a_SOURCES += fd-safer-flag.c dup-safer-flag.c
|
||||
|
||||
## end gnulib module fd-safer-flag
|
||||
|
||||
## begin gnulib module fdopendir
|
||||
|
||||
|
||||
@ -499,29 +510,46 @@ EXTRA_libgnu_a_SOURCES += float.c itold.c
|
||||
|
||||
## begin gnulib module fnmatch
|
||||
|
||||
|
||||
EXTRA_DIST += fnmatch.c fnmatch_loop.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += fnmatch.c fnmatch_loop.c
|
||||
|
||||
## end gnulib module fnmatch
|
||||
|
||||
## begin gnulib module fnmatch-h
|
||||
|
||||
BUILT_SOURCES += $(FNMATCH_H)
|
||||
|
||||
# We need the following in order to create <fnmatch.h> when the system
|
||||
# doesn't have one that supports the required API.
|
||||
# We need the following in order to create <fnmatch.h>.
|
||||
if GL_GENERATE_FNMATCH_H
|
||||
fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
|
||||
fnmatch.h: fnmatch.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
|
||||
-e 's|@''HAVE_FNMATCH_H''@|$(HAVE_FNMATCH_H)|g' \
|
||||
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_FNMATCH_H''@|$(NEXT_FNMATCH_H)|g' \
|
||||
-e 's/@''GNULIB_FNMATCH''@/$(GNULIB_FNMATCH)/g' \
|
||||
-e 's|@''HAVE_FNMATCH''@|$(HAVE_FNMATCH)|g' \
|
||||
-e 's|@''REPLACE_FNMATCH''@|$(REPLACE_FNMATCH)|g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
||||
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
|
||||
< $(srcdir)/fnmatch.in.h; \
|
||||
} > $@-t && \
|
||||
mv -f $@-t $@
|
||||
mv $@-t $@
|
||||
else
|
||||
fnmatch.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += fnmatch.h fnmatch.h-t
|
||||
|
||||
EXTRA_DIST += fnmatch.c fnmatch.in.h fnmatch_loop.c
|
||||
EXTRA_DIST += fnmatch.in.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += fnmatch.c fnmatch_loop.c
|
||||
|
||||
## end gnulib module fnmatch
|
||||
## end gnulib module fnmatch-h
|
||||
|
||||
## begin gnulib module fpucw
|
||||
|
||||
@ -551,9 +579,9 @@ EXTRA_libgnu_a_SOURCES += frexp.c frexpl.c
|
||||
## begin gnulib module fstat
|
||||
|
||||
|
||||
EXTRA_DIST += fstat.c
|
||||
EXTRA_DIST += fstat.c stat-w32.c stat-w32.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += fstat.c
|
||||
EXTRA_libgnu_a_SOURCES += fstat.c stat-w32.c
|
||||
|
||||
## end gnulib module fstat
|
||||
|
||||
@ -625,32 +653,48 @@ EXTRA_libgnu_a_SOURCES += gettimeofday.c
|
||||
|
||||
## begin gnulib module glob
|
||||
|
||||
|
||||
EXTRA_DIST += glob.c glob_internal.h glob_pattern_p.c globfree.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += glob.c glob_pattern_p.c globfree.c
|
||||
|
||||
## end gnulib module glob
|
||||
|
||||
## begin gnulib module glob-h
|
||||
|
||||
BUILT_SOURCES += $(GLOB_H)
|
||||
|
||||
# We need the following in order to create <glob.h> when the system
|
||||
# doesn't have one that works with the given compiler.
|
||||
# We need the following in order to create <glob.h>.
|
||||
if GL_GENERATE_GLOB_H
|
||||
glob.h: glob.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
|
||||
sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
|
||||
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
|
||||
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
|
||||
-e 's|@''HAVE_GLOB_H''@|$(HAVE_GLOB_H)|g' \
|
||||
-e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_GLOB_H''@|$(NEXT_GLOB_H)|g' \
|
||||
-e 's/@''GNULIB_GLOB''@/$(GNULIB_GLOB)/g' \
|
||||
-e 's|@''HAVE_GLOB''@|$(HAVE_GLOB)|g' \
|
||||
-e 's|@''HAVE_GLOB_PATTERN_P''@|$(HAVE_GLOB_PATTERN_P)|g' \
|
||||
-e 's|@''REPLACE_GLOB''@|$(REPLACE_GLOB)|g' \
|
||||
-e 's|@''REPLACE_GLOB_PATTERN_P''@|$(REPLACE_GLOB_PATTERN_P)|g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
||||
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
|
||||
< $(srcdir)/glob.in.h; \
|
||||
} > $@-t && \
|
||||
mv -f $@-t $@
|
||||
mv $@-t $@
|
||||
else
|
||||
glob.h: $(top_builddir)/config.status
|
||||
rm -f $@
|
||||
endif
|
||||
MOSTLYCLEANFILES += glob.h glob.h-t
|
||||
|
||||
EXTRA_DIST += glob-libc.h glob.c glob.in.h
|
||||
EXTRA_DIST += glob-libc.h glob.in.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += glob.c
|
||||
|
||||
## end gnulib module glob
|
||||
## end gnulib module glob-h
|
||||
|
||||
## begin gnulib module hard-locale
|
||||
|
||||
@ -710,6 +754,7 @@ inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
|
||||
-e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
|
||||
-e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
|
||||
-e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
|
||||
-e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
|
||||
-e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
|
||||
-e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
|
||||
-e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
|
||||
@ -746,6 +791,13 @@ EXTRA_libgnu_a_SOURCES += isnan.c isnanl.c
|
||||
|
||||
## end gnulib module isnanl-nolibm
|
||||
|
||||
## begin gnulib module libc-config
|
||||
|
||||
|
||||
EXTRA_DIST += cdefs.h libc-config.h
|
||||
|
||||
## end gnulib module libc-config
|
||||
|
||||
## begin gnulib module limits-h
|
||||
|
||||
BUILT_SOURCES += $(LIMITS_H)
|
||||
@ -776,78 +828,21 @@ EXTRA_DIST += limits.in.h
|
||||
|
||||
## begin gnulib module localcharset
|
||||
|
||||
libgnu_a_SOURCES += localcharset.h localcharset.c
|
||||
libgnu_a_SOURCES += localcharset.c
|
||||
|
||||
# We need the following in order to install a simple file in $(libdir)
|
||||
# which is shared with other installed packages. We use a list of referencing
|
||||
# packages so that "make uninstall" will remove the file if and only if it
|
||||
# is not used by another installed package.
|
||||
# On systems with glibc-2.1 or newer, the file is redundant, therefore we
|
||||
# avoid installing it.
|
||||
|
||||
all-local: charset.alias ref-add.sed ref-del.sed
|
||||
|
||||
charset_alias = $(DESTDIR)$(libdir)/charset.alias
|
||||
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
|
||||
install-exec-local: install-exec-localcharset
|
||||
install-exec-localcharset: all-local
|
||||
if test $(GLIBC21) = no; then \
|
||||
case '$(host_os)' in \
|
||||
darwin[56]*) \
|
||||
need_charset_alias=true ;; \
|
||||
darwin* | cygwin* | mingw* | pw32* | cegcc*) \
|
||||
need_charset_alias=false ;; \
|
||||
*) \
|
||||
need_charset_alias=true ;; \
|
||||
esac ; \
|
||||
else \
|
||||
need_charset_alias=false ; \
|
||||
fi ; \
|
||||
if $$need_charset_alias; then \
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir) ; \
|
||||
fi ; \
|
||||
if test -f $(charset_alias); then \
|
||||
sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
|
||||
rm -f $(charset_tmp) ; \
|
||||
else \
|
||||
if $$need_charset_alias; then \
|
||||
sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
|
||||
rm -f $(charset_tmp) ; \
|
||||
fi ; \
|
||||
fi
|
||||
|
||||
uninstall-local: uninstall-localcharset
|
||||
uninstall-localcharset: all-local
|
||||
if test -f $(charset_alias); then \
|
||||
sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
|
||||
if grep '^# Packages using this file: $$' $(charset_tmp) \
|
||||
> /dev/null; then \
|
||||
rm -f $(charset_alias); \
|
||||
else \
|
||||
$(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
|
||||
fi; \
|
||||
rm -f $(charset_tmp); \
|
||||
fi
|
||||
|
||||
charset.alias: config.charset
|
||||
$(AM_V_GEN)rm -f t-$@ $@ && \
|
||||
$(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
|
||||
mv t-$@ $@
|
||||
|
||||
SUFFIXES += .sed .sin
|
||||
.sin.sed:
|
||||
$(AM_V_GEN)rm -f t-$@ $@ && \
|
||||
sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
|
||||
mv t-$@ $@
|
||||
|
||||
CLEANFILES += charset.alias ref-add.sed ref-del.sed
|
||||
|
||||
EXTRA_DIST += config.charset ref-add.sin ref-del.sin
|
||||
EXTRA_DIST += localcharset.h
|
||||
|
||||
## end gnulib module localcharset
|
||||
|
||||
## begin gnulib module localtime-buffer
|
||||
|
||||
|
||||
EXTRA_DIST += localtime-buffer.c localtime-buffer.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += localtime-buffer.c
|
||||
|
||||
## end gnulib module localtime-buffer
|
||||
|
||||
## begin gnulib module lock
|
||||
|
||||
libgnu_a_SOURCES += glthread/lock.h glthread/lock.c
|
||||
@ -876,7 +871,7 @@ EXTRA_libgnu_a_SOURCES += malloc.c
|
||||
|
||||
libgnu_a_SOURCES += malloca.c
|
||||
|
||||
EXTRA_DIST += malloca.h malloca.valgrind
|
||||
EXTRA_DIST += malloca.h
|
||||
|
||||
## end gnulib module malloca
|
||||
|
||||
@ -1089,13 +1084,22 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
|
||||
-e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
|
||||
-e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
|
||||
| \
|
||||
sed -e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
|
||||
sed -e 's|@''REPLACE_ACOSF''@|$(REPLACE_ACOSF)|g' \
|
||||
-e 's|@''REPLACE_ASINF''@|$(REPLACE_ASINF)|g' \
|
||||
-e 's|@''REPLACE_ATANF''@|$(REPLACE_ATANF)|g' \
|
||||
-e 's|@''REPLACE_ATAN2F''@|$(REPLACE_ATAN2F)|g' \
|
||||
-e 's|@''REPLACE_CBRTF''@|$(REPLACE_CBRTF)|g' \
|
||||
-e 's|@''REPLACE_CBRTL''@|$(REPLACE_CBRTL)|g' \
|
||||
-e 's|@''REPLACE_CEIL''@|$(REPLACE_CEIL)|g' \
|
||||
-e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
|
||||
-e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
|
||||
-e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \
|
||||
-e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \
|
||||
-e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \
|
||||
-e 's|@''REPLACE_EXPL''@|$(REPLACE_EXPL)|g' \
|
||||
-e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
|
||||
-e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
|
||||
-e 's|@''REPLACE_EXPM1L''@|$(REPLACE_EXPM1L)|g' \
|
||||
-e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
|
||||
-e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \
|
||||
-e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \
|
||||
@ -1117,6 +1121,7 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
|
||||
-e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \
|
||||
-e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \
|
||||
-e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \
|
||||
-e 's|@''REPLACE_ILOGBL''@|$(REPLACE_ILOGBL)|g' \
|
||||
-e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
|
||||
-e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
|
||||
-e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
|
||||
@ -1144,12 +1149,18 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
|
||||
-e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \
|
||||
-e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \
|
||||
-e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \
|
||||
-e 's|@''REPLACE_RINTL''@|$(REPLACE_RINTL)|g' \
|
||||
-e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
|
||||
-e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
|
||||
-e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
|
||||
-e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
|
||||
-e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
|
||||
-e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \
|
||||
-e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \
|
||||
-e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \
|
||||
-e 's|@''REPLACE_SQRTL''@|$(REPLACE_SQRTL)|g' \
|
||||
-e 's|@''REPLACE_TANF''@|$(REPLACE_TANF)|g' \
|
||||
-e 's|@''REPLACE_TANHF''@|$(REPLACE_TANHF)|g' \
|
||||
-e 's|@''REPLACE_TRUNC''@|$(REPLACE_TRUNC)|g' \
|
||||
-e 's|@''REPLACE_TRUNCF''@|$(REPLACE_TRUNCF)|g' \
|
||||
-e 's|@''REPLACE_TRUNCL''@|$(REPLACE_TRUNCL)|g' \
|
||||
@ -1428,14 +1439,13 @@ EXTRA_DIST += save-cwd.h
|
||||
|
||||
## end gnulib module save-cwd
|
||||
|
||||
## begin gnulib module secure_getenv
|
||||
## begin gnulib module scratch_buffer
|
||||
|
||||
libgnu_a_SOURCES += malloc/scratch_buffer_grow.c malloc/scratch_buffer_grow_preserve.c malloc/scratch_buffer_set_array_size.c
|
||||
|
||||
EXTRA_DIST += secure_getenv.c
|
||||
EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += secure_getenv.c
|
||||
|
||||
## end gnulib module secure_getenv
|
||||
## end gnulib module scratch_buffer
|
||||
|
||||
## begin gnulib module setenv
|
||||
|
||||
@ -1460,8 +1470,8 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
|
||||
-e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
|
||||
-e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \
|
||||
-e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \
|
||||
-e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \
|
||||
-e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
|
||||
-e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
|
||||
-e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
|
||||
@ -1491,93 +1501,68 @@ EXTRA_DIST += signal.in.h
|
||||
## begin gnulib module snippet/_Noreturn
|
||||
|
||||
# Because this Makefile snippet defines a variable used by other
|
||||
# gnulib Makefile snippets, it must be present in all Makefile.am that
|
||||
# gnulib Makefile snippets, it must be present in all makefiles that
|
||||
# need it. This is ensured by the applicability 'all' defined above.
|
||||
|
||||
_NORETURN_H=$(top_srcdir)/import/extra/snippet/_Noreturn.h
|
||||
_NORETURN_H=$(srcdir)/_Noreturn.h
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/import/extra/snippet/_Noreturn.h
|
||||
EXTRA_DIST += _Noreturn.h
|
||||
|
||||
## end gnulib module snippet/_Noreturn
|
||||
|
||||
## begin gnulib module snippet/arg-nonnull
|
||||
|
||||
# The BUILT_SOURCES created by this Makefile snippet are not used via #include
|
||||
# statements but through direct file reference. Therefore this snippet must be
|
||||
# present in all Makefile.am that need it. This is ensured by the applicability
|
||||
# 'all' defined above.
|
||||
# Because this Makefile snippet defines a variable used by other
|
||||
# gnulib Makefile snippets, it must be present in all makefiles that
|
||||
# need it. This is ensured by the applicability 'all' defined above.
|
||||
|
||||
BUILT_SOURCES += arg-nonnull.h
|
||||
# The arg-nonnull.h that gets inserted into generated .h files is the same as
|
||||
# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
|
||||
# off.
|
||||
arg-nonnull.h: $(top_srcdir)/import/extra/snippet/arg-nonnull.h
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
sed -n -e '/GL_ARG_NONNULL/,$$p' \
|
||||
< $(top_srcdir)/import/extra/snippet/arg-nonnull.h \
|
||||
> $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
|
||||
ARG_NONNULL_H=$(srcdir)/arg-nonnull.h
|
||||
|
||||
ARG_NONNULL_H=arg-nonnull.h
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/import/extra/snippet/arg-nonnull.h
|
||||
EXTRA_DIST += arg-nonnull.h
|
||||
|
||||
## end gnulib module snippet/arg-nonnull
|
||||
|
||||
## begin gnulib module snippet/c++defs
|
||||
|
||||
# The BUILT_SOURCES created by this Makefile snippet are not used via #include
|
||||
# statements but through direct file reference. Therefore this snippet must be
|
||||
# present in all Makefile.am that need it. This is ensured by the applicability
|
||||
# 'all' defined above.
|
||||
# Because this Makefile snippet defines a variable used by other
|
||||
# gnulib Makefile snippets, it must be present in all makefiles that
|
||||
# need it. This is ensured by the applicability 'all' defined above.
|
||||
|
||||
BUILT_SOURCES += c++defs.h
|
||||
# The c++defs.h that gets inserted into generated .h files is the same as
|
||||
# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
|
||||
c++defs.h: $(top_srcdir)/import/extra/snippet/c++defs.h
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
sed -n -e '/_GL_CXXDEFS/,$$p' \
|
||||
< $(top_srcdir)/import/extra/snippet/c++defs.h \
|
||||
> $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += c++defs.h c++defs.h-t
|
||||
CXXDEFS_H=$(srcdir)/c++defs.h
|
||||
|
||||
CXXDEFS_H=c++defs.h
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/import/extra/snippet/c++defs.h
|
||||
EXTRA_DIST += c++defs.h
|
||||
|
||||
## end gnulib module snippet/c++defs
|
||||
|
||||
## begin gnulib module snippet/warn-on-use
|
||||
|
||||
BUILT_SOURCES += warn-on-use.h
|
||||
# The warn-on-use.h that gets inserted into generated .h files is the same as
|
||||
# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
|
||||
# off.
|
||||
warn-on-use.h: $(top_srcdir)/import/extra/snippet/warn-on-use.h
|
||||
$(AM_V_GEN)rm -f $@-t $@ && \
|
||||
sed -n -e '/^.ifndef/,$$p' \
|
||||
< $(top_srcdir)/import/extra/snippet/warn-on-use.h \
|
||||
> $@-t && \
|
||||
mv $@-t $@
|
||||
MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
|
||||
# Because this Makefile snippet defines a variable used by other
|
||||
# gnulib Makefile snippets, it must be present in all makefiles that
|
||||
# need it. This is ensured by the applicability 'all' defined above.
|
||||
|
||||
WARN_ON_USE_H=warn-on-use.h
|
||||
WARN_ON_USE_H=$(srcdir)/warn-on-use.h
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/import/extra/snippet/warn-on-use.h
|
||||
EXTRA_DIST += warn-on-use.h
|
||||
|
||||
## end gnulib module snippet/warn-on-use
|
||||
|
||||
## begin gnulib module stat
|
||||
|
||||
|
||||
EXTRA_DIST += stat.c
|
||||
EXTRA_DIST += stat-w32.c stat-w32.h stat.c
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += stat.c
|
||||
EXTRA_libgnu_a_SOURCES += stat-w32.c stat.c
|
||||
|
||||
## end gnulib module stat
|
||||
|
||||
## begin gnulib module stat-time
|
||||
|
||||
libgnu_a_SOURCES += stat-time.c
|
||||
|
||||
EXTRA_DIST += stat-time.h
|
||||
|
||||
## end gnulib module stat-time
|
||||
|
||||
## begin gnulib module stdalign
|
||||
|
||||
BUILT_SOURCES += $(STDALIGN_H)
|
||||
@ -1693,6 +1678,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status
|
||||
-e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
|
||||
-e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
|
||||
-e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
|
||||
-e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
|
||||
< $(srcdir)/stdint.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
@ -1871,11 +1857,13 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
||||
-e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
|
||||
-e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
|
||||
-e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
|
||||
-e 's/@''GNULIB_REALLOCARRAY''@/$(GNULIB_REALLOCARRAY)/g' \
|
||||
-e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
|
||||
-e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
|
||||
-e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
|
||||
-e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
|
||||
-e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
|
||||
-e 's/@''GNULIB_STRTOLD''@/$(GNULIB_STRTOLD)/g' \
|
||||
-e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
|
||||
-e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
|
||||
-e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
|
||||
@ -1889,6 +1877,9 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
||||
-e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
|
||||
-e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
|
||||
-e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
|
||||
-e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
|
||||
-e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
|
||||
-e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \
|
||||
-e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
|
||||
-e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
|
||||
-e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
|
||||
@ -1901,11 +1892,15 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
||||
-e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
|
||||
-e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
|
||||
-e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
|
||||
-e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \
|
||||
-e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
|
||||
-e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
|
||||
-e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
|
||||
-e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
|
||||
-e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
|
||||
-e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
|
||||
-e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
|
||||
-e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
|
||||
-e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
|
||||
-e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
|
||||
-e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
|
||||
@ -1914,6 +1909,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
||||
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
|
||||
-e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
|
||||
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
|
||||
-e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
|
||||
-e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
|
||||
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
|
||||
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
|
||||
@ -1921,11 +1917,14 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
|
||||
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
|
||||
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
|
||||
-e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
|
||||
-e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
|
||||
-e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
|
||||
-e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
|
||||
-e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
|
||||
-e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
|
||||
-e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
|
||||
-e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
|
||||
-e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
|
||||
-e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
|
||||
-e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
@ -2006,6 +2005,7 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
|
||||
-e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GNULIB_EXPLICIT_BZERO)/g' \
|
||||
-e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
|
||||
-e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
|
||||
-e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
|
||||
@ -2044,7 +2044,8 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
|
||||
-e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
|
||||
< $(srcdir)/string.in.h | \
|
||||
sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
|
||||
sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
|
||||
-e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
|
||||
-e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
|
||||
-e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
|
||||
-e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
|
||||
@ -2065,20 +2066,20 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
|
||||
-e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
|
||||
-e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
|
||||
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
|
||||
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
|
||||
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
|
||||
-e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
|
||||
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
|
||||
-e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
|
||||
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
|
||||
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
|
||||
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
|
||||
-e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
|
||||
-e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
|
||||
-e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
|
||||
-e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
|
||||
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
|
||||
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
|
||||
-e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
|
||||
-e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
|
||||
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
|
||||
-e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
|
||||
-e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
|
||||
-e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
||||
@ -2184,6 +2185,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
|
||||
-e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
|
||||
-e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \
|
||||
-e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
|
||||
-e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
|
||||
-e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
|
||||
@ -2197,6 +2199,7 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
|
||||
-e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
|
||||
-e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
|
||||
-e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
|
||||
-e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GNULIB_OVERRIDES_STRUCT_STAT)/g' \
|
||||
-e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
|
||||
-e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
|
||||
-e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
|
||||
@ -2280,6 +2283,7 @@ sys/types.h: sys_types.in.h $(top_builddir)/config.status
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
|
||||
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
|
||||
-e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
|
||||
< $(srcdir)/sys_types.in.h; \
|
||||
} > $@-t && \
|
||||
mv $@-t $@
|
||||
@ -2327,8 +2331,6 @@ EXTRA_DIST += tempname.h
|
||||
|
||||
libgnu_a_SOURCES += glthread/threadlib.c
|
||||
|
||||
EXTRA_DIST += $(top_srcdir)/import/extra/config.rpath
|
||||
|
||||
## end gnulib module threadlib
|
||||
|
||||
## begin gnulib module time
|
||||
@ -2345,24 +2347,31 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
|
||||
-e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
|
||||
-e 's/@''GNULIB_CTIME''@/$(GNULIB_CTIME)/g' \
|
||||
-e 's/@''GNULIB_LOCALTIME''@/$(GNULIB_LOCALTIME)/g' \
|
||||
-e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
|
||||
-e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
|
||||
-e 's/@''GNULIB_STRFTIME''@/$(GNULIB_STRFTIME)/g' \
|
||||
-e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
|
||||
-e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
|
||||
-e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
|
||||
-e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \
|
||||
-e 's/@''GNULIB_TZSET''@/$(GNULIB_TZSET)/g' \
|
||||
-e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
|
||||
-e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
|
||||
-e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
|
||||
-e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
|
||||
-e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
|
||||
-e 's|@''HAVE_TZSET''@|$(HAVE_TZSET)|g' \
|
||||
-e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
|
||||
-e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
|
||||
-e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
|
||||
-e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
|
||||
-e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
|
||||
-e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
|
||||
-e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
|
||||
-e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
|
||||
-e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
|
||||
-e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
||||
-e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
||||
-e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
|
||||
@ -2405,9 +2414,11 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
|
||||
-e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
|
||||
-e 's/@''GNULIB_ACCESS''@/$(GNULIB_ACCESS)/g' \
|
||||
-e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
|
||||
-e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
|
||||
-e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
|
||||
-e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GNULIB_COPY_FILE_RANGE)/g' \
|
||||
-e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
|
||||
-e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
|
||||
-e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
|
||||
@ -2427,6 +2438,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
|
||||
-e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
|
||||
-e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
|
||||
-e 's/@''GNULIB_GETPASS''@/$(GNULIB_GETPASS)/g' \
|
||||
-e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
|
||||
-e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
|
||||
-e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
|
||||
@ -2446,6 +2458,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
|
||||
-e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
|
||||
-e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
|
||||
-e 's/@''GNULIB_TRUNCATE''@/$(GNULIB_TRUNCATE)/g' \
|
||||
-e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
|
||||
-e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_UNISTD_H_GETOPT)/g' \
|
||||
-e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
|
||||
@ -2456,6 +2469,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
|
||||
< $(srcdir)/unistd.in.h | \
|
||||
sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
|
||||
-e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
|
||||
-e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
|
||||
-e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
|
||||
-e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
|
||||
@ -2468,8 +2482,8 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
|
||||
-e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
|
||||
-e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
|
||||
-e 's|@''HAVE_GETLOGIN''@|$(HAVE_GETLOGIN)|g' \
|
||||
-e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
|
||||
-e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
|
||||
-e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
|
||||
-e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
|
||||
-e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
|
||||
@ -2490,18 +2504,22 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
|
||||
-e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
|
||||
-e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
|
||||
-e 's|@''HAVE_DECL_GETLOGIN''@|$(HAVE_DECL_GETLOGIN)|g' \
|
||||
-e 's|@''HAVE_DECL_GETLOGIN_R''@|$(HAVE_DECL_GETLOGIN_R)|g' \
|
||||
-e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
|
||||
-e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
|
||||
-e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
|
||||
-e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \
|
||||
-e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
|
||||
-e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
|
||||
-e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
|
||||
| \
|
||||
sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
|
||||
sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
|
||||
-e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
|
||||
-e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
|
||||
-e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
|
||||
-e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
|
||||
-e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
|
||||
-e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
|
||||
-e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
|
||||
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
|
||||
@ -2510,6 +2528,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
|
||||
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
|
||||
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
|
||||
-e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
|
||||
-e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
|
||||
-e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
|
||||
-e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
|
||||
@ -2524,6 +2543,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
|
||||
-e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
|
||||
-e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
|
||||
-e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
|
||||
-e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \
|
||||
-e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
|
||||
-e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
|
||||
-e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
|
||||
@ -2589,6 +2609,8 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
|
||||
-e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
|
||||
-e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
|
||||
-e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
|
||||
-e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
|
||||
-e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
|
||||
-e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
|
||||
-e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
|
||||
-e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
|
||||
@ -2628,6 +2650,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
|
||||
-e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \
|
||||
-e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \
|
||||
-e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \
|
||||
-e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \
|
||||
< $(srcdir)/wchar.in.h | \
|
||||
sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
|
||||
-e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
|
||||
@ -2667,6 +2690,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
|
||||
-e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
|
||||
-e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
|
||||
-e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
|
||||
-e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \
|
||||
-e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
|
||||
-e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
|
||||
| \
|
||||
@ -2683,6 +2707,8 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
|
||||
-e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
|
||||
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
|
||||
-e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
|
||||
-e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
|
||||
-e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
|
||||
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
|
||||
-e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
|
||||
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
|
||||
@ -2710,6 +2736,8 @@ wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H
|
||||
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
|
||||
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
|
||||
-e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
|
||||
-e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
|
||||
-e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
|
||||
-e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
|
||||
-e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
|
||||
-e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
|
||||
@ -2734,6 +2762,49 @@ EXTRA_DIST += wctype.in.h
|
||||
|
||||
## end gnulib module wctype-h
|
||||
|
||||
## begin gnulib module windows-mutex
|
||||
|
||||
|
||||
EXTRA_DIST += windows-initguard.h windows-mutex.c windows-mutex.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += windows-mutex.c
|
||||
|
||||
## end gnulib module windows-mutex
|
||||
|
||||
## begin gnulib module windows-once
|
||||
|
||||
|
||||
EXTRA_DIST += windows-once.c windows-once.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += windows-once.c
|
||||
|
||||
## end gnulib module windows-once
|
||||
|
||||
## begin gnulib module windows-recmutex
|
||||
|
||||
|
||||
EXTRA_DIST += windows-initguard.h windows-recmutex.c windows-recmutex.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += windows-recmutex.c
|
||||
|
||||
## end gnulib module windows-recmutex
|
||||
|
||||
## begin gnulib module windows-rwlock
|
||||
|
||||
|
||||
EXTRA_DIST += windows-initguard.h windows-rwlock.c windows-rwlock.h
|
||||
|
||||
EXTRA_libgnu_a_SOURCES += windows-rwlock.c
|
||||
|
||||
## end gnulib module windows-rwlock
|
||||
|
||||
## begin gnulib module xalloc-oversized
|
||||
|
||||
|
||||
EXTRA_DIST += xalloc-oversized.h
|
||||
|
||||
## end gnulib module xalloc-oversized
|
||||
|
||||
|
||||
mostlyclean-local: mostlyclean-generic
|
||||
@for dir in '' $(MOSTLYCLEANDIRS); do \
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
40
gnulib/import/_Noreturn.h
Normal file
40
gnulib/import/_Noreturn.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* A C macro for declaring that a function does not return.
|
||||
Copyright (C) 2011-2019 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 3 of the License, 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, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _Noreturn
|
||||
# if (defined __cplusplus \
|
||||
&& ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
|
||||
|| (defined _MSC_VER && 1900 <= _MSC_VER)) \
|
||||
&& 0)
|
||||
/* [[noreturn]] is not practically usable, because with it the syntax
|
||||
extern _Noreturn void func (...);
|
||||
would not be valid; such a declaration would only be valid with 'extern'
|
||||
and '_Noreturn' swapped, or without the 'extern' keyword. However, some
|
||||
AIX system header files and several gnulib header files use precisely
|
||||
this syntax with 'extern'. */
|
||||
# define _Noreturn [[noreturn]]
|
||||
# elif ((!defined __cplusplus || defined __clang__) \
|
||||
&& (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
|
||||
|| 4 < __GNUC__ + (7 <= __GNUC_MINOR__)))
|
||||
/* _Noreturn works as-is. */
|
||||
# elif 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
|
||||
# define _Noreturn __declspec (noreturn)
|
||||
# else
|
||||
# define _Noreturn
|
||||
# endif
|
||||
#endif
|
||||
@ -350,16 +350,16 @@ i00afunc (long *address)
|
||||
/* There must be at least one stack segment. Therefore it is
|
||||
a fatal error if "trailer" is null. */
|
||||
|
||||
if (trailer == 0)
|
||||
if (trailer == NULL)
|
||||
abort ();
|
||||
|
||||
/* Discard segments that do not contain our argument address. */
|
||||
|
||||
while (trailer != 0)
|
||||
while (trailer != NULL)
|
||||
{
|
||||
block = (long *) trailer->this_address;
|
||||
size = trailer->this_size;
|
||||
if (block == 0 || size == 0)
|
||||
if (block == NULL || size == 0)
|
||||
abort ();
|
||||
trailer = (struct stk_trailer *) trailer->link;
|
||||
if ((block <= address) && (address < (block + size)))
|
||||
@ -371,7 +371,7 @@ i00afunc (long *address)
|
||||
|
||||
result = address - block;
|
||||
|
||||
if (trailer == 0)
|
||||
if (trailer == NULL)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
@ -383,7 +383,7 @@ i00afunc (long *address)
|
||||
result += trailer->this_size;
|
||||
trailer = (struct stk_trailer *) trailer->link;
|
||||
}
|
||||
while (trailer != 0);
|
||||
while (trailer != NULL);
|
||||
|
||||
/* We are done. Note that if you present a bogus address (one
|
||||
not in any segment), you will get a different number back, formed
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Memory allocation on the stack.
|
||||
|
||||
Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
|
||||
Copyright (C) 1995, 1999, 2001-2004, 2006-2019 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
@ -15,7 +15,7 @@
|
||||
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with this program; if not, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
<https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
|
||||
@ -36,6 +36,12 @@
|
||||
|
||||
#ifndef alloca
|
||||
# ifdef __GNUC__
|
||||
/* Some version of mingw have an <alloca.h> that causes trouble when
|
||||
included after 'alloca' gets defined as a macro. As a workaround, include
|
||||
this <alloca.h> first and define 'alloca' as a macro afterwards. */
|
||||
# if (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@
|
||||
# include_next <alloca.h>
|
||||
# endif
|
||||
# define alloca __builtin_alloca
|
||||
# elif defined _AIX
|
||||
# define alloca __alloca
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* A C macro for declaring that specific arguments must not be NULL.
|
||||
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
|
||||
that the values passed as arguments n, ..., m must be non-NULL pointers.
|
||||
@ -1,6 +1,6 @@
|
||||
/* A GNU-like <arpa/inet.h>.
|
||||
|
||||
Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2006, 2008-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
|
||||
|
||||
@ -49,6 +49,12 @@
|
||||
#ifndef _@GUARD_PREFIX@_ARPA_INET_H
|
||||
#define _@GUARD_PREFIX@_ARPA_INET_H
|
||||
|
||||
/* Get all possible declarations of inet_ntop() and inet_pton(). */
|
||||
#if (@GNULIB_INET_NTOP@ || @GNULIB_INET_PTON@ || defined GNULIB_POSIXCHECK) \
|
||||
&& @HAVE_WS2TCPIP_H@
|
||||
# include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
/* The definition of _GL_ARG_NONNULL is copied here. */
|
||||
@ -70,8 +76,8 @@
|
||||
the return value is NULL and errno is set to ENOSPC. A good value
|
||||
for CNT is 46.
|
||||
|
||||
For more details, see the POSIX:2001 specification
|
||||
<http://www.opengroup.org/susv3xsh/inet_ntop.html>. */
|
||||
For more details, see the POSIX:2008 specification
|
||||
<https://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_ntop.html>. */
|
||||
# if @REPLACE_INET_NTOP@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef inet_ntop
|
||||
@ -97,7 +103,9 @@ _GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
|
||||
(int af, const void *restrict src,
|
||||
char *restrict dst, socklen_t cnt));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (inet_ntop);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef inet_ntop
|
||||
# if HAVE_RAW_DECL_INET_NTOP
|
||||
@ -126,7 +134,9 @@ _GL_FUNCDECL_SYS (inet_pton, int,
|
||||
_GL_CXXALIAS_SYS (inet_pton, int,
|
||||
(int af, const char *restrict src, void *restrict dst));
|
||||
# endif
|
||||
# if __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (inet_pton);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef inet_pton
|
||||
# if HAVE_RAW_DECL_INET_PTON
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Run-time assert-like macros.
|
||||
|
||||
Copyright (C) 2014-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2014-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
/* Check E's value at runtime, and report an error and abort if not.
|
||||
However, do nothng if NDEBUG is defined.
|
||||
However, do nothing if NDEBUG is defined.
|
||||
|
||||
Unlike standard 'assert', this macro always compiles E even when NDEBUG
|
||||
is defined, so as to catch typos and avoid some GCC warnings. */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Define at-style functions like fstatat, unlinkat, fchownat, etc.
|
||||
Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* written by Jim Meyering */
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* basename.c -- return the last element in a file name
|
||||
|
||||
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
|
||||
Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2019 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -14,7 +14,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* C++ compatible function declaration macros.
|
||||
Copyright (C) 2010-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2010-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GL_CXXDEFS_H
|
||||
#define _GL_CXXDEFS_H
|
||||
@ -133,8 +133,11 @@
|
||||
static const struct _gl_ ## func ## _wrapper \
|
||||
{ \
|
||||
typedef rettype (*type) parameters; \
|
||||
inline type rpl () const { return ::rpl_func; } \
|
||||
inline operator type () const { return rpl (); } \
|
||||
\
|
||||
inline operator type () const \
|
||||
{ \
|
||||
return ::rpl_func; \
|
||||
} \
|
||||
} func = {}; \
|
||||
} \
|
||||
_GL_EXTERN_C int _gl_cxxalias_dummy
|
||||
@ -155,9 +158,11 @@
|
||||
static const struct _gl_ ## func ## _wrapper \
|
||||
{ \
|
||||
typedef rettype (*type) parameters; \
|
||||
inline type rpl () const \
|
||||
{ return reinterpret_cast<type>(::rpl_func); } \
|
||||
inline operator type () const { return rpl (); } \
|
||||
\
|
||||
inline operator type () const \
|
||||
{ \
|
||||
return reinterpret_cast<type>(::rpl_func); \
|
||||
} \
|
||||
} func = {}; \
|
||||
} \
|
||||
_GL_EXTERN_C int _gl_cxxalias_dummy
|
||||
@ -183,10 +188,13 @@
|
||||
static const struct _gl_ ## func ## _wrapper \
|
||||
{ \
|
||||
typedef rettype (*type) parameters; \
|
||||
inline type rpl () const { return ::func; } \
|
||||
inline operator type () const { return rpl (); } \
|
||||
\
|
||||
inline operator type () const \
|
||||
{ \
|
||||
return ::func; \
|
||||
} \
|
||||
} func = {}; \
|
||||
} \
|
||||
} \
|
||||
_GL_EXTERN_C int _gl_cxxalias_dummy
|
||||
#else
|
||||
# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
|
||||
@ -205,9 +213,11 @@
|
||||
static const struct _gl_ ## func ## _wrapper \
|
||||
{ \
|
||||
typedef rettype (*type) parameters; \
|
||||
inline type rpl () const \
|
||||
{ return reinterpret_cast<type>(::func); } \
|
||||
inline operator type () const { return rpl (); }\
|
||||
\
|
||||
inline operator type () const \
|
||||
{ \
|
||||
return reinterpret_cast<type>(::func); \
|
||||
} \
|
||||
} func = {}; \
|
||||
} \
|
||||
_GL_EXTERN_C int _gl_cxxalias_dummy
|
||||
@ -235,10 +245,10 @@
|
||||
{ \
|
||||
typedef rettype (*type) parameters; \
|
||||
\
|
||||
inline type rpl () const \
|
||||
{ return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); }\
|
||||
\
|
||||
inline operator type () const { return rpl (); } \
|
||||
inline operator type () const \
|
||||
{ \
|
||||
return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
|
||||
} \
|
||||
} func = {}; \
|
||||
} \
|
||||
_GL_EXTERN_C int _gl_cxxalias_dummy
|
||||
@ -256,7 +266,7 @@
|
||||
_GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
|
||||
# define _GL_CXXALIASWARN_1(func,namespace) \
|
||||
_GL_CXXALIASWARN_2 (func, namespace)
|
||||
/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
|
||||
/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
|
||||
we enable the warning only when not optimizing. */
|
||||
# if !__OPTIMIZE__
|
||||
# define _GL_CXXALIASWARN_2(func,namespace) \
|
||||
@ -284,7 +294,7 @@
|
||||
GNULIB_NAMESPACE)
|
||||
# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
|
||||
_GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
|
||||
/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
|
||||
/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
|
||||
we enable the warning only when not optimizing. */
|
||||
# if !__OPTIMIZE__
|
||||
# define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
|
||||
@ -1,5 +1,5 @@
|
||||
/* Return the canonical absolute name of a given file.
|
||||
Copyright (C) 1996-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIBC
|
||||
/* Don't use __attribute__ __nonnull__ in this compilation unit. Otherwise gcc
|
||||
@ -59,8 +59,10 @@
|
||||
*/
|
||||
# undef getcwd
|
||||
# endif
|
||||
# ifdef VMS
|
||||
/* We want the directory in Unix syntax, not in VMS syntax. */
|
||||
# if defined VMS && !defined getcwd
|
||||
/* We want the directory in Unix syntax, not in VMS syntax.
|
||||
The gnulib override of 'getcwd' takes 2 arguments; the original VMS
|
||||
'getcwd' takes 3 arguments. */
|
||||
# define __getcwd(buf, max) getcwd (buf, max, 0)
|
||||
# else
|
||||
# define __getcwd getcwd
|
||||
@ -93,9 +95,9 @@
|
||||
static void
|
||||
alloc_failed (void)
|
||||
{
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
/* Avoid errno problem without using the malloc or realloc modules; see:
|
||||
http://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00025.html */
|
||||
https://lists.gnu.org/r/bug-gnulib/2016-08/msg00025.html */
|
||||
errno = ENOMEM;
|
||||
#endif
|
||||
}
|
||||
@ -268,6 +270,8 @@ __realpath (const char *name, char *resolved)
|
||||
#endif
|
||||
*dest = '\0';
|
||||
|
||||
/* FIXME: if lstat fails with errno == EOVERFLOW,
|
||||
the entry exists. */
|
||||
#ifdef _LIBC
|
||||
if (__lxstat64 (_STAT_VER, rpath, &st) < 0)
|
||||
#else
|
||||
|
||||
514
gnulib/import/cdefs.h
Normal file
514
gnulib/import/cdefs.h
Normal file
@ -0,0 +1,514 @@
|
||||
/* Copyright (C) 1992-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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 the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _SYS_CDEFS_H
|
||||
#define _SYS_CDEFS_H 1
|
||||
|
||||
/* We are almost always included from features.h. */
|
||||
#ifndef _FEATURES_H
|
||||
# include <features.h>
|
||||
#endif
|
||||
|
||||
/* The GNU libc does not support any K&R compilers or the traditional mode
|
||||
of ISO C compilers anymore. Check for some of the combinations not
|
||||
anymore supported. */
|
||||
#if defined __GNUC__ && !defined __STDC__
|
||||
# error "You need a ISO C conforming compiler to use the glibc headers"
|
||||
#endif
|
||||
|
||||
/* Some user header file might have defined this before. */
|
||||
#undef __P
|
||||
#undef __PMT
|
||||
|
||||
#ifdef __GNUC__
|
||||
|
||||
/* All functions, except those with callbacks or those that
|
||||
synchronize memory, are leaf functions. */
|
||||
# if __GNUC_PREREQ (4, 6) && !defined _LIBC
|
||||
# define __LEAF , __leaf__
|
||||
# define __LEAF_ATTR __attribute__ ((__leaf__))
|
||||
# else
|
||||
# define __LEAF
|
||||
# define __LEAF_ATTR
|
||||
# endif
|
||||
|
||||
/* GCC can always grok prototypes. For C++ programs we add throw()
|
||||
to help it optimize the function calls. But this works only with
|
||||
gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions
|
||||
as non-throwing using a function attribute since programs can use
|
||||
the -fexceptions options for C code as well. */
|
||||
# if !defined __cplusplus && __GNUC_PREREQ (3, 3)
|
||||
# define __THROW __attribute__ ((__nothrow__ __LEAF))
|
||||
# define __THROWNL __attribute__ ((__nothrow__))
|
||||
# define __NTH(fct) __attribute__ ((__nothrow__ __LEAF)) fct
|
||||
# define __NTHNL(fct) __attribute__ ((__nothrow__)) fct
|
||||
# else
|
||||
# if defined __cplusplus && __GNUC_PREREQ (2,8)
|
||||
# define __THROW throw ()
|
||||
# define __THROWNL throw ()
|
||||
# define __NTH(fct) __LEAF_ATTR fct throw ()
|
||||
# define __NTHNL(fct) fct throw ()
|
||||
# else
|
||||
# define __THROW
|
||||
# define __THROWNL
|
||||
# define __NTH(fct) fct
|
||||
# define __NTHNL(fct) fct
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#else /* Not GCC. */
|
||||
|
||||
# if (defined __cplusplus \
|
||||
|| (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
|
||||
# define __inline inline
|
||||
# else
|
||||
# define __inline /* No inline functions. */
|
||||
# endif
|
||||
|
||||
# define __THROW
|
||||
# define __THROWNL
|
||||
# define __NTH(fct) fct
|
||||
|
||||
#endif /* GCC. */
|
||||
|
||||
/* Compilers that are not clang may object to
|
||||
#if defined __clang__ && __has_extension(...)
|
||||
even though they do not need to evaluate the right-hand side of the &&. */
|
||||
#if defined __clang__ && defined __has_extension
|
||||
# define __glibc_clang_has_extension(ext) __has_extension (ext)
|
||||
#else
|
||||
# define __glibc_clang_has_extension(ext) 0
|
||||
#endif
|
||||
|
||||
/* These two macros are not used in glibc anymore. They are kept here
|
||||
only because some other projects expect the macros to be defined. */
|
||||
#define __P(args) args
|
||||
#define __PMT(args) args
|
||||
|
||||
/* For these things, GCC behaves the ANSI way normally,
|
||||
and the non-ANSI way under -traditional. */
|
||||
|
||||
#define __CONCAT(x,y) x ## y
|
||||
#define __STRING(x) #x
|
||||
|
||||
/* This is not a typedef so `const __ptr_t' does the right thing. */
|
||||
#define __ptr_t void *
|
||||
|
||||
|
||||
/* C++ needs to know that types and declarations are C, not C++. */
|
||||
#ifdef __cplusplus
|
||||
# define __BEGIN_DECLS extern "C" {
|
||||
# define __END_DECLS }
|
||||
#else
|
||||
# define __BEGIN_DECLS
|
||||
# define __END_DECLS
|
||||
#endif
|
||||
|
||||
|
||||
/* Fortify support. */
|
||||
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
|
||||
#define __bos0(ptr) __builtin_object_size (ptr, 0)
|
||||
|
||||
#if __GNUC_PREREQ (4,3)
|
||||
# define __warndecl(name, msg) \
|
||||
extern void name (void) __attribute__((__warning__ (msg)))
|
||||
# define __warnattr(msg) __attribute__((__warning__ (msg)))
|
||||
# define __errordecl(name, msg) \
|
||||
extern void name (void) __attribute__((__error__ (msg)))
|
||||
#else
|
||||
# define __warndecl(name, msg) extern void name (void)
|
||||
# define __warnattr(msg)
|
||||
# define __errordecl(name, msg) extern void name (void)
|
||||
#endif
|
||||
|
||||
/* Support for flexible arrays.
|
||||
Headers that should use flexible arrays only if they're "real"
|
||||
(e.g. only if they won't affect sizeof()) should test
|
||||
#if __glibc_c99_flexarr_available. */
|
||||
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
|
||||
# define __flexarr []
|
||||
# define __glibc_c99_flexarr_available 1
|
||||
#elif __GNUC_PREREQ (2,97)
|
||||
/* GCC 2.97 supports C99 flexible array members as an extension,
|
||||
even when in C89 mode or compiling C++ (any version). */
|
||||
# define __flexarr []
|
||||
# define __glibc_c99_flexarr_available 1
|
||||
#elif defined __GNUC__
|
||||
/* Pre-2.97 GCC did not support C99 flexible arrays but did have
|
||||
an equivalent extension with slightly different notation. */
|
||||
# define __flexarr [0]
|
||||
# define __glibc_c99_flexarr_available 1
|
||||
#else
|
||||
/* Some other non-C99 compiler. Approximate with [1]. */
|
||||
# define __flexarr [1]
|
||||
# define __glibc_c99_flexarr_available 0
|
||||
#endif
|
||||
|
||||
|
||||
/* __asm__ ("xyz") is used throughout the headers to rename functions
|
||||
at the assembly language level. This is wrapped by the __REDIRECT
|
||||
macro, in order to support compilers that can do this some other
|
||||
way. When compilers don't support asm-names at all, we have to do
|
||||
preprocessor tricks instead (which don't have exactly the right
|
||||
semantics, but it's the best we can do).
|
||||
|
||||
Example:
|
||||
int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 2
|
||||
|
||||
# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
|
||||
# ifdef __cplusplus
|
||||
# define __REDIRECT_NTH(name, proto, alias) \
|
||||
name proto __THROW __asm__ (__ASMNAME (#alias))
|
||||
# define __REDIRECT_NTHNL(name, proto, alias) \
|
||||
name proto __THROWNL __asm__ (__ASMNAME (#alias))
|
||||
# else
|
||||
# define __REDIRECT_NTH(name, proto, alias) \
|
||||
name proto __asm__ (__ASMNAME (#alias)) __THROW
|
||||
# define __REDIRECT_NTHNL(name, proto, alias) \
|
||||
name proto __asm__ (__ASMNAME (#alias)) __THROWNL
|
||||
# endif
|
||||
# define __ASMNAME(cname) __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
|
||||
# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
|
||||
|
||||
/*
|
||||
#elif __SOME_OTHER_COMPILER__
|
||||
|
||||
# define __REDIRECT(name, proto, alias) name proto; \
|
||||
_Pragma("let " #name " = " #alias)
|
||||
*/
|
||||
#endif
|
||||
|
||||
/* GCC has various useful declarations that can be made with the
|
||||
`__attribute__' syntax. All of the ways we use this do fine if
|
||||
they are omitted for compilers that don't understand it. */
|
||||
#if !defined __GNUC__ || __GNUC__ < 2
|
||||
# define __attribute__(xyz) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.96 development the `malloc' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (2,96)
|
||||
# define __attribute_malloc__ __attribute__ ((__malloc__))
|
||||
#else
|
||||
# define __attribute_malloc__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Tell the compiler which arguments to an allocation function
|
||||
indicate the size of the allocation. */
|
||||
#if __GNUC_PREREQ (4, 3)
|
||||
# define __attribute_alloc_size__(params) \
|
||||
__attribute__ ((__alloc_size__ params))
|
||||
#else
|
||||
# define __attribute_alloc_size__(params) /* Ignore. */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.96 development the `pure' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (2,96)
|
||||
# define __attribute_pure__ __attribute__ ((__pure__))
|
||||
#else
|
||||
# define __attribute_pure__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* This declaration tells the compiler that the value is constant. */
|
||||
#if __GNUC_PREREQ (2,5)
|
||||
# define __attribute_const__ __attribute__ ((__const__))
|
||||
#else
|
||||
# define __attribute_const__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 3.1 development the `used' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings. */
|
||||
#if __GNUC_PREREQ (3,1)
|
||||
# define __attribute_used__ __attribute__ ((__used__))
|
||||
# define __attribute_noinline__ __attribute__ ((__noinline__))
|
||||
#else
|
||||
# define __attribute_used__ __attribute__ ((__unused__))
|
||||
# define __attribute_noinline__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Since version 3.2, gcc allows marking deprecated functions. */
|
||||
#if __GNUC_PREREQ (3,2)
|
||||
# define __attribute_deprecated__ __attribute__ ((__deprecated__))
|
||||
#else
|
||||
# define __attribute_deprecated__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Since version 4.5, gcc also allows one to specify the message printed
|
||||
when a deprecated function is used. clang claims to be gcc 4.2, but
|
||||
may also support this feature. */
|
||||
#if __GNUC_PREREQ (4,5) || \
|
||||
__glibc_clang_has_extension (__attribute_deprecated_with_message__)
|
||||
# define __attribute_deprecated_msg__(msg) \
|
||||
__attribute__ ((__deprecated__ (msg)))
|
||||
#else
|
||||
# define __attribute_deprecated_msg__(msg) __attribute_deprecated__
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.8 development the `format_arg' attribute
|
||||
for functions was introduced. We don't want to use it unconditionally
|
||||
(although this would be possible) since it generates warnings.
|
||||
If several `format_arg' attributes are given for the same function, in
|
||||
gcc-3.0 and older, all but the last one are ignored. In newer gccs,
|
||||
all designated arguments are considered. */
|
||||
#if __GNUC_PREREQ (2,8)
|
||||
# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
|
||||
#else
|
||||
# define __attribute_format_arg__(x) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* At some point during the gcc 2.97 development the `strfmon' format
|
||||
attribute for functions was introduced. We don't want to use it
|
||||
unconditionally (although this would be possible) since it
|
||||
generates warnings. */
|
||||
#if __GNUC_PREREQ (2,97)
|
||||
# define __attribute_format_strfmon__(a,b) \
|
||||
__attribute__ ((__format__ (__strfmon__, a, b)))
|
||||
#else
|
||||
# define __attribute_format_strfmon__(a,b) /* Ignore */
|
||||
#endif
|
||||
|
||||
/* The nonnull function attribute marks pointer parameters that
|
||||
must not be NULL. Do not define __nonnull if it is already defined,
|
||||
for portability when this file is used in Gnulib. */
|
||||
#ifndef __nonnull
|
||||
# if __GNUC_PREREQ (3,3)
|
||||
# define __nonnull(params) __attribute__ ((__nonnull__ params))
|
||||
# else
|
||||
# define __nonnull(params)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* If fortification mode, we warn about unused results of certain
|
||||
function calls which can lead to problems. */
|
||||
#if __GNUC_PREREQ (3,4)
|
||||
# define __attribute_warn_unused_result__ \
|
||||
__attribute__ ((__warn_unused_result__))
|
||||
# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
|
||||
# define __wur __attribute_warn_unused_result__
|
||||
# endif
|
||||
#else
|
||||
# define __attribute_warn_unused_result__ /* empty */
|
||||
#endif
|
||||
#ifndef __wur
|
||||
# define __wur /* Ignore */
|
||||
#endif
|
||||
|
||||
/* Forces a function to be always inlined. */
|
||||
#if __GNUC_PREREQ (3,2)
|
||||
/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
|
||||
it conflicts with this definition. Therefore undefine it first to
|
||||
allow either header to be included first. */
|
||||
# undef __always_inline
|
||||
# define __always_inline __inline __attribute__ ((__always_inline__))
|
||||
#else
|
||||
# undef __always_inline
|
||||
# define __always_inline __inline
|
||||
#endif
|
||||
|
||||
/* Associate error messages with the source location of the call site rather
|
||||
than with the source location inside the function. */
|
||||
#if __GNUC_PREREQ (4,3)
|
||||
# define __attribute_artificial__ __attribute__ ((__artificial__))
|
||||
#else
|
||||
# define __attribute_artificial__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
|
||||
inline semantics, unless -fgnu89-inline is used. Using __GNUC_STDC_INLINE__
|
||||
or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
|
||||
older than 4.3 may define these macros and still not guarantee GNU inlining
|
||||
semantics.
|
||||
|
||||
clang++ identifies itself as gcc-4.2, but has support for GNU inlining
|
||||
semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
|
||||
__GNUC_GNU_INLINE__ macro definitions. */
|
||||
#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
|
||||
|| (defined __clang__ && (defined __GNUC_STDC_INLINE__ \
|
||||
|| defined __GNUC_GNU_INLINE__)))
|
||||
# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
|
||||
# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
|
||||
# define __extern_always_inline \
|
||||
extern __always_inline __attribute__ ((__gnu_inline__))
|
||||
# else
|
||||
# define __extern_inline extern __inline
|
||||
# define __extern_always_inline extern __always_inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __extern_always_inline
|
||||
# define __fortify_function __extern_always_inline __attribute_artificial__
|
||||
#endif
|
||||
|
||||
/* GCC 4.3 and above allow passing all anonymous arguments of an
|
||||
__extern_always_inline function to some other vararg function. */
|
||||
#if __GNUC_PREREQ (4,3)
|
||||
# define __va_arg_pack() __builtin_va_arg_pack ()
|
||||
# define __va_arg_pack_len() __builtin_va_arg_pack_len ()
|
||||
#endif
|
||||
|
||||
/* It is possible to compile containing GCC extensions even if GCC is
|
||||
run in pedantic mode if the uses are carefully marked using the
|
||||
`__extension__' keyword. But this is not generally available before
|
||||
version 2.8. */
|
||||
#if !__GNUC_PREREQ (2,8)
|
||||
# define __extension__ /* Ignore */
|
||||
#endif
|
||||
|
||||
/* __restrict is known in EGCS 1.2 and above. */
|
||||
#if !__GNUC_PREREQ (2,92)
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
# define __restrict restrict
|
||||
# else
|
||||
# define __restrict /* Ignore */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ISO C99 also allows to declare arrays as non-overlapping. The syntax is
|
||||
array_name[restrict]
|
||||
GCC 3.1 supports this. */
|
||||
#if __GNUC_PREREQ (3,1) && !defined __GNUG__
|
||||
# define __restrict_arr __restrict
|
||||
#else
|
||||
# ifdef __GNUC__
|
||||
# define __restrict_arr /* Not supported in old GCC. */
|
||||
# else
|
||||
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
|
||||
# define __restrict_arr restrict
|
||||
# else
|
||||
/* Some other non-C99 compiler. */
|
||||
# define __restrict_arr /* Not supported. */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
# define __glibc_unlikely(cond) __builtin_expect ((cond), 0)
|
||||
# define __glibc_likely(cond) __builtin_expect ((cond), 1)
|
||||
#else
|
||||
# define __glibc_unlikely(cond) (cond)
|
||||
# define __glibc_likely(cond) (cond)
|
||||
#endif
|
||||
|
||||
#ifdef __has_attribute
|
||||
# define __glibc_has_attribute(attr) __has_attribute (attr)
|
||||
#else
|
||||
# define __glibc_has_attribute(attr) 0
|
||||
#endif
|
||||
|
||||
#if (!defined _Noreturn \
|
||||
&& (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
|
||||
&& !__GNUC_PREREQ (4,7))
|
||||
# if __GNUC_PREREQ (2,8)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# else
|
||||
# define _Noreturn
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ (8, 0)
|
||||
/* Describes a char array whose address can safely be passed as the first
|
||||
argument to strncpy and strncat, as the char array is not necessarily
|
||||
a NUL-terminated string. */
|
||||
# define __attribute_nonstring__ __attribute__ ((__nonstring__))
|
||||
#else
|
||||
# define __attribute_nonstring__
|
||||
#endif
|
||||
|
||||
#if (!defined _Static_assert && !defined __cplusplus \
|
||||
&& (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
|
||||
&& (!__GNUC_PREREQ (4, 6) || defined __STRICT_ANSI__))
|
||||
# define _Static_assert(expr, diagnostic) \
|
||||
extern int (*__Static_assert_function (void)) \
|
||||
[!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
|
||||
#endif
|
||||
|
||||
/* The #ifndef lets Gnulib avoid including these on non-glibc
|
||||
platforms, where the includes typically do not exist. */
|
||||
#ifndef __WORDSIZE
|
||||
# include <bits/wordsize.h>
|
||||
# include <bits/long-double.h>
|
||||
#endif
|
||||
|
||||
#if defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
|
||||
# define __LDBL_COMPAT 1
|
||||
# ifdef __REDIRECT
|
||||
# define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
|
||||
# define __LDBL_REDIR(name, proto) \
|
||||
__LDBL_REDIR1 (name, proto, __nldbl_##name)
|
||||
# define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
|
||||
# define __LDBL_REDIR_NTH(name, proto) \
|
||||
__LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
|
||||
# define __LDBL_REDIR1_DECL(name, alias) \
|
||||
extern __typeof (name) name __asm (__ASMNAME (#alias));
|
||||
# define __LDBL_REDIR_DECL(name) \
|
||||
extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
|
||||
# define __REDIRECT_LDBL(name, proto, alias) \
|
||||
__LDBL_REDIR1 (name, proto, __nldbl_##alias)
|
||||
# define __REDIRECT_NTH_LDBL(name, proto, alias) \
|
||||
__LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
|
||||
# endif
|
||||
#endif
|
||||
#if !defined __LDBL_COMPAT || !defined __REDIRECT
|
||||
# define __LDBL_REDIR1(name, proto, alias) name proto
|
||||
# define __LDBL_REDIR(name, proto) name proto
|
||||
# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
|
||||
# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
|
||||
# define __LDBL_REDIR_DECL(name)
|
||||
# ifdef __REDIRECT
|
||||
# define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
|
||||
# define __REDIRECT_NTH_LDBL(name, proto, alias) \
|
||||
__REDIRECT_NTH (name, proto, alias)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE. This is
|
||||
intended for use in preprocessor macros.
|
||||
|
||||
Note: MESSAGE must be a _single_ string; concatenation of string
|
||||
literals is not supported. */
|
||||
#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
|
||||
# define __glibc_macro_warning1(message) _Pragma (#message)
|
||||
# define __glibc_macro_warning(message) \
|
||||
__glibc_macro_warning1 (GCC warning message)
|
||||
#else
|
||||
# define __glibc_macro_warning(msg)
|
||||
#endif
|
||||
|
||||
/* Generic selection (ISO C11) is a C-only feature, available in GCC
|
||||
since version 4.9. Previous versions do not provide generic
|
||||
selection, even though they might set __STDC_VERSION__ to 201112L,
|
||||
when in -std=c11 mode. Thus, we must check for !defined __GNUC__
|
||||
when testing __STDC_VERSION__ for generic selection support.
|
||||
On the other hand, Clang also defines __GNUC__, so a clang-specific
|
||||
check is required to enable the use of generic selection. */
|
||||
#if !defined __cplusplus \
|
||||
&& (__GNUC_PREREQ (4, 9) \
|
||||
|| __glibc_clang_has_extension (c_generic_selections) \
|
||||
|| (!defined __GNUC__ && defined __STDC_VERSION__ \
|
||||
&& __STDC_VERSION__ >= 201112L))
|
||||
# define __HAVE_GENERIC_SELECTION 1
|
||||
#else
|
||||
# define __HAVE_GENERIC_SELECTION 0
|
||||
#endif
|
||||
|
||||
#endif /* sys/cdefs.h */
|
||||
@ -1,5 +1,5 @@
|
||||
/* provide a chdir function that tries not to fail due to ENAMETOOLONG
|
||||
Copyright (C) 2004-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* written by Jim Meyering */
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* provide a chdir function that tries not to fail due to ENAMETOOLONG
|
||||
Copyright (C) 2004-2005, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004-2005, 2009-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* closexec.c - set or clear the close-on-exec descriptor flag
|
||||
/* cloexec.c - set or clear the close-on-exec descriptor flag
|
||||
|
||||
Copyright (C) 1991, 2004-2006, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 2004-2006, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
The code is taken from glibc/manual/llio.texi */
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* closexec.c - set or clear the close-on-exec descriptor flag
|
||||
/* cloexec.c - set or clear the close-on-exec descriptor flag
|
||||
|
||||
Copyright (C) 2004, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* close replacement.
|
||||
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -22,7 +22,9 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "fd-hook.h"
|
||||
#include "msvc-inval.h"
|
||||
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
# include "msvc-inval.h"
|
||||
#endif
|
||||
|
||||
#undef close
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Stop reading the entries of a directory.
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,682 +0,0 @@
|
||||
#! /bin/sh
|
||||
# Output a system dependent table of character encoding aliases.
|
||||
#
|
||||
# Copyright (C) 2000-2004, 2006-2016 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 3, 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# The table consists of lines of the form
|
||||
# ALIAS CANONICAL
|
||||
#
|
||||
# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
|
||||
# ALIAS is compared in a case sensitive way.
|
||||
#
|
||||
# CANONICAL is the GNU canonical name for this character encoding.
|
||||
# It must be an encoding supported by libiconv. Support by GNU libc is
|
||||
# also desirable. CANONICAL is case insensitive. Usually an upper case
|
||||
# MIME charset name is preferred.
|
||||
# The current list of GNU canonical charset names is as follows.
|
||||
#
|
||||
# name MIME? used by which systems
|
||||
# (darwin = Mac OS X, woe32 = native Windows)
|
||||
#
|
||||
# ASCII, ANSI_X3.4-1968 glibc solaris freebsd netbsd darwin cygwin
|
||||
# ISO-8859-1 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# ISO-8859-2 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# ISO-8859-3 Y glibc solaris cygwin
|
||||
# ISO-8859-4 Y osf solaris freebsd netbsd openbsd darwin
|
||||
# ISO-8859-5 Y glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# ISO-8859-6 Y glibc aix hpux solaris cygwin
|
||||
# ISO-8859-7 Y glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
|
||||
# ISO-8859-8 Y glibc aix hpux osf solaris cygwin
|
||||
# ISO-8859-9 Y glibc aix hpux irix osf solaris darwin cygwin
|
||||
# ISO-8859-13 glibc netbsd openbsd darwin cygwin
|
||||
# ISO-8859-14 glibc cygwin
|
||||
# ISO-8859-15 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
|
||||
# KOI8-R Y glibc solaris freebsd netbsd openbsd darwin
|
||||
# KOI8-U Y glibc freebsd netbsd openbsd darwin cygwin
|
||||
# KOI8-T glibc
|
||||
# CP437 dos
|
||||
# CP775 dos
|
||||
# CP850 aix osf dos
|
||||
# CP852 dos
|
||||
# CP855 dos
|
||||
# CP856 aix
|
||||
# CP857 dos
|
||||
# CP861 dos
|
||||
# CP862 dos
|
||||
# CP864 dos
|
||||
# CP865 dos
|
||||
# CP866 freebsd netbsd openbsd darwin dos
|
||||
# CP869 dos
|
||||
# CP874 woe32 dos
|
||||
# CP922 aix
|
||||
# CP932 aix cygwin woe32 dos
|
||||
# CP943 aix
|
||||
# CP949 osf darwin woe32 dos
|
||||
# CP950 woe32 dos
|
||||
# CP1046 aix
|
||||
# CP1124 aix
|
||||
# CP1125 dos
|
||||
# CP1129 aix
|
||||
# CP1131 darwin
|
||||
# CP1250 woe32
|
||||
# CP1251 glibc solaris netbsd openbsd darwin cygwin woe32
|
||||
# CP1252 aix woe32
|
||||
# CP1253 woe32
|
||||
# CP1254 woe32
|
||||
# CP1255 glibc woe32
|
||||
# CP1256 woe32
|
||||
# CP1257 woe32
|
||||
# GB2312 Y glibc aix hpux irix solaris freebsd netbsd darwin
|
||||
# EUC-JP Y glibc aix hpux irix osf solaris freebsd netbsd darwin
|
||||
# EUC-KR Y glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
|
||||
# EUC-TW glibc aix hpux irix osf solaris netbsd
|
||||
# BIG5 Y glibc aix hpux osf solaris freebsd netbsd darwin cygwin
|
||||
# BIG5-HKSCS glibc solaris darwin
|
||||
# GBK glibc aix osf solaris darwin cygwin woe32 dos
|
||||
# GB18030 glibc solaris netbsd darwin
|
||||
# SHIFT_JIS Y hpux osf solaris freebsd netbsd darwin
|
||||
# JOHAB glibc solaris woe32
|
||||
# TIS-620 glibc aix hpux osf solaris cygwin
|
||||
# VISCII Y glibc
|
||||
# TCVN5712-1 glibc
|
||||
# ARMSCII-8 glibc darwin
|
||||
# GEORGIAN-PS glibc cygwin
|
||||
# PT154 glibc
|
||||
# HP-ROMAN8 hpux
|
||||
# HP-ARABIC8 hpux
|
||||
# HP-GREEK8 hpux
|
||||
# HP-HEBREW8 hpux
|
||||
# HP-TURKISH8 hpux
|
||||
# HP-KANA8 hpux
|
||||
# DEC-KANJI osf
|
||||
# DEC-HANYU osf
|
||||
# UTF-8 Y glibc aix hpux osf solaris netbsd darwin cygwin
|
||||
#
|
||||
# Note: Names which are not marked as being a MIME name should not be used in
|
||||
# Internet protocols for information interchange (mail, news, etc.).
|
||||
#
|
||||
# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
|
||||
# must understand both names and treat them as equivalent.
|
||||
#
|
||||
# The first argument passed to this file is the canonical host specification,
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
|
||||
host="$1"
|
||||
os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
|
||||
echo "# This file contains a table of character encoding aliases,"
|
||||
echo "# suitable for operating system '${os}'."
|
||||
echo "# It was automatically generated from config.charset."
|
||||
# List of references, updated during installation:
|
||||
echo "# Packages using this file: "
|
||||
case "$os" in
|
||||
linux-gnulibc1*)
|
||||
# Linux libc5 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "C ASCII"
|
||||
echo "POSIX ASCII"
|
||||
for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
|
||||
en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
|
||||
en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
|
||||
es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
|
||||
et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
|
||||
fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
|
||||
it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
|
||||
sv_FI sv_SE; do
|
||||
echo "$l ISO-8859-1"
|
||||
echo "$l.iso-8859-1 ISO-8859-1"
|
||||
echo "$l.iso-8859-15 ISO-8859-15"
|
||||
echo "$l.iso-8859-15@euro ISO-8859-15"
|
||||
echo "$l@euro ISO-8859-15"
|
||||
echo "$l.cp-437 CP437"
|
||||
echo "$l.cp-850 CP850"
|
||||
echo "$l.cp-1252 CP1252"
|
||||
echo "$l.cp-1252@euro CP1252"
|
||||
#echo "$l.atari-st ATARI-ST" # not a commonly used encoding
|
||||
echo "$l.utf-8 UTF-8"
|
||||
echo "$l.utf-8@euro UTF-8"
|
||||
done
|
||||
for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
|
||||
sl_SI sr sr_CS sr_YU; do
|
||||
echo "$l ISO-8859-2"
|
||||
echo "$l.iso-8859-2 ISO-8859-2"
|
||||
echo "$l.cp-852 CP852"
|
||||
echo "$l.cp-1250 CP1250"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in mk mk_MK ru ru_RU; do
|
||||
echo "$l ISO-8859-5"
|
||||
echo "$l.iso-8859-5 ISO-8859-5"
|
||||
echo "$l.koi8-r KOI8-R"
|
||||
echo "$l.cp-866 CP866"
|
||||
echo "$l.cp-1251 CP1251"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in ar ar_SA; do
|
||||
echo "$l ISO-8859-6"
|
||||
echo "$l.iso-8859-6 ISO-8859-6"
|
||||
echo "$l.cp-864 CP864"
|
||||
#echo "$l.cp-868 CP868" # not a commonly used encoding
|
||||
echo "$l.cp-1256 CP1256"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in el el_GR gr gr_GR; do
|
||||
echo "$l ISO-8859-7"
|
||||
echo "$l.iso-8859-7 ISO-8859-7"
|
||||
echo "$l.cp-869 CP869"
|
||||
echo "$l.cp-1253 CP1253"
|
||||
echo "$l.cp-1253@euro CP1253"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
echo "$l.utf-8@euro UTF-8"
|
||||
done
|
||||
for l in he he_IL iw iw_IL; do
|
||||
echo "$l ISO-8859-8"
|
||||
echo "$l.iso-8859-8 ISO-8859-8"
|
||||
echo "$l.cp-862 CP862"
|
||||
echo "$l.cp-1255 CP1255"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in tr tr_TR; do
|
||||
echo "$l ISO-8859-9"
|
||||
echo "$l.iso-8859-9 ISO-8859-9"
|
||||
echo "$l.cp-857 CP857"
|
||||
echo "$l.cp-1254 CP1254"
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
for l in lt lt_LT lv lv_LV; do
|
||||
#echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
|
||||
echo "$l ISO-8859-13"
|
||||
done
|
||||
for l in ru_UA uk uk_UA; do
|
||||
echo "$l KOI8-U"
|
||||
done
|
||||
for l in zh zh_CN; do
|
||||
#echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
|
||||
echo "$l GB2312"
|
||||
done
|
||||
for l in ja ja_JP ja_JP.EUC; do
|
||||
echo "$l EUC-JP"
|
||||
done
|
||||
for l in ko ko_KR; do
|
||||
echo "$l EUC-KR"
|
||||
done
|
||||
for l in th th_TH; do
|
||||
echo "$l TIS-620"
|
||||
done
|
||||
for l in fa fa_IR; do
|
||||
#echo "$l ISIRI-3342" # a broken encoding
|
||||
echo "$l.utf-8 UTF-8"
|
||||
done
|
||||
;;
|
||||
linux* | *-gnu*)
|
||||
# With glibc-2.1 or newer, we don't need any canonicalization,
|
||||
# because glibc has iconv and both glibc and libiconv support all
|
||||
# GNU canonical names directly. Therefore, the Makefile does not
|
||||
# need to install the alias file at all.
|
||||
# The following applies only to glibc-2.0.x and older libcs.
|
||||
echo "ISO_646.IRV:1983 ASCII"
|
||||
;;
|
||||
aix*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-6 ISO-8859-6"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "IBM-850 CP850"
|
||||
echo "IBM-856 CP856"
|
||||
echo "IBM-921 ISO-8859-13"
|
||||
echo "IBM-922 CP922"
|
||||
echo "IBM-932 CP932"
|
||||
echo "IBM-943 CP943"
|
||||
echo "IBM-1046 CP1046"
|
||||
echo "IBM-1124 CP1124"
|
||||
echo "IBM-1129 CP1129"
|
||||
echo "IBM-1252 CP1252"
|
||||
echo "IBM-eucCN GB2312"
|
||||
echo "IBM-eucJP EUC-JP"
|
||||
echo "IBM-eucKR EUC-KR"
|
||||
echo "IBM-eucTW EUC-TW"
|
||||
echo "big5 BIG5"
|
||||
echo "GBK GBK"
|
||||
echo "TIS-620 TIS-620"
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
hpux*)
|
||||
echo "iso88591 ISO-8859-1"
|
||||
echo "iso88592 ISO-8859-2"
|
||||
echo "iso88595 ISO-8859-5"
|
||||
echo "iso88596 ISO-8859-6"
|
||||
echo "iso88597 ISO-8859-7"
|
||||
echo "iso88598 ISO-8859-8"
|
||||
echo "iso88599 ISO-8859-9"
|
||||
echo "iso885915 ISO-8859-15"
|
||||
echo "roman8 HP-ROMAN8"
|
||||
echo "arabic8 HP-ARABIC8"
|
||||
echo "greek8 HP-GREEK8"
|
||||
echo "hebrew8 HP-HEBREW8"
|
||||
echo "turkish8 HP-TURKISH8"
|
||||
echo "kana8 HP-KANA8"
|
||||
echo "tis620 TIS-620"
|
||||
echo "big5 BIG5"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "hp15CN GB2312"
|
||||
#echo "ccdc ?" # what is this?
|
||||
echo "SJIS SHIFT_JIS"
|
||||
echo "utf8 UTF-8"
|
||||
;;
|
||||
irix*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "eucCN GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
;;
|
||||
osf*)
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "cp850 CP850"
|
||||
echo "big5 BIG5"
|
||||
echo "dechanyu DEC-HANYU"
|
||||
echo "dechanzi GB2312"
|
||||
echo "deckanji DEC-KANJI"
|
||||
echo "deckorean EUC-KR"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "GBK GBK"
|
||||
echo "KSC5601 CP949"
|
||||
echo "sdeckanji EUC-JP"
|
||||
echo "SJIS SHIFT_JIS"
|
||||
echo "TACTIS TIS-620"
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
solaris*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-3 ISO-8859-3"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-6 ISO-8859-6"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-8 ISO-8859-8"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "koi8-r KOI8-R"
|
||||
echo "ansi-1251 CP1251"
|
||||
echo "BIG5 BIG5"
|
||||
echo "Big5-HKSCS BIG5-HKSCS"
|
||||
echo "gb2312 GB2312"
|
||||
echo "GBK GBK"
|
||||
echo "GB18030 GB18030"
|
||||
echo "cns11643 EUC-TW"
|
||||
echo "5601 EUC-KR"
|
||||
echo "ko_KR.johap92 JOHAB"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "PCK SHIFT_JIS"
|
||||
echo "TIS620.2533 TIS-620"
|
||||
#echo "sun_eu_greek ?" # what is this?
|
||||
echo "UTF-8 UTF-8"
|
||||
;;
|
||||
freebsd*)
|
||||
# FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "C ASCII"
|
||||
echo "US-ASCII ASCII"
|
||||
for l in la_LN lt_LN; do
|
||||
echo "$l.ASCII ASCII"
|
||||
done
|
||||
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
|
||||
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
|
||||
lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
|
||||
echo "$l.ISO_8859-1 ISO-8859-1"
|
||||
echo "$l.DIS_8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
|
||||
echo "$l.ISO_8859-2 ISO-8859-2"
|
||||
done
|
||||
for l in la_LN lt_LT; do
|
||||
echo "$l.ISO_8859-4 ISO-8859-4"
|
||||
done
|
||||
for l in ru_RU ru_SU; do
|
||||
echo "$l.KOI8-R KOI8-R"
|
||||
echo "$l.ISO_8859-5 ISO-8859-5"
|
||||
echo "$l.CP866 CP866"
|
||||
done
|
||||
echo "uk_UA.KOI8-U KOI8-U"
|
||||
echo "zh_TW.BIG5 BIG5"
|
||||
echo "zh_TW.Big5 BIG5"
|
||||
echo "zh_CN.EUC GB2312"
|
||||
echo "ja_JP.EUC EUC-JP"
|
||||
echo "ja_JP.SJIS SHIFT_JIS"
|
||||
echo "ja_JP.Shift_JIS SHIFT_JIS"
|
||||
echo "ko_KR.EUC EUC-KR"
|
||||
;;
|
||||
netbsd*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-13 ISO-8859-13"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "eucCN GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "eucTW EUC-TW"
|
||||
echo "BIG5 BIG5"
|
||||
echo "SJIS SHIFT_JIS"
|
||||
;;
|
||||
openbsd*)
|
||||
echo "646 ASCII"
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-13 ISO-8859-13"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
;;
|
||||
darwin[56]*)
|
||||
# Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "C ASCII"
|
||||
for l in en_AU en_CA en_GB en_US la_LN; do
|
||||
echo "$l.US-ASCII ASCII"
|
||||
done
|
||||
for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
|
||||
fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
|
||||
nl_NL no_NO pt_PT sv_SE; do
|
||||
echo "$l ISO-8859-1"
|
||||
echo "$l.ISO8859-1 ISO-8859-1"
|
||||
echo "$l.ISO8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in la_LN; do
|
||||
echo "$l.ISO8859-1 ISO-8859-1"
|
||||
echo "$l.ISO8859-15 ISO-8859-15"
|
||||
done
|
||||
for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
|
||||
echo "$l.ISO8859-2 ISO-8859-2"
|
||||
done
|
||||
for l in la_LN lt_LT; do
|
||||
echo "$l.ISO8859-4 ISO-8859-4"
|
||||
done
|
||||
for l in ru_RU; do
|
||||
echo "$l.KOI8-R KOI8-R"
|
||||
echo "$l.ISO8859-5 ISO-8859-5"
|
||||
echo "$l.CP866 CP866"
|
||||
done
|
||||
for l in bg_BG; do
|
||||
echo "$l.CP1251 CP1251"
|
||||
done
|
||||
echo "uk_UA.KOI8-U KOI8-U"
|
||||
echo "zh_TW.BIG5 BIG5"
|
||||
echo "zh_TW.Big5 BIG5"
|
||||
echo "zh_CN.EUC GB2312"
|
||||
echo "ja_JP.EUC EUC-JP"
|
||||
echo "ja_JP.SJIS SHIFT_JIS"
|
||||
echo "ko_KR.EUC EUC-KR"
|
||||
;;
|
||||
darwin*)
|
||||
# Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
|
||||
# useless:
|
||||
# - It returns the empty string when LANG is set to a locale of the
|
||||
# form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
|
||||
# LC_CTYPE file.
|
||||
# - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
|
||||
# the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
|
||||
# - The documentation says:
|
||||
# "... all code that calls BSD system routines should ensure
|
||||
# that the const *char parameters of these routines are in UTF-8
|
||||
# encoding. All BSD system functions expect their string
|
||||
# parameters to be in UTF-8 encoding and nothing else."
|
||||
# It also says
|
||||
# "An additional caveat is that string parameters for files,
|
||||
# paths, and other file-system entities must be in canonical
|
||||
# UTF-8. In a canonical UTF-8 Unicode string, all decomposable
|
||||
# characters are decomposed ..."
|
||||
# but this is not true: You can pass non-decomposed UTF-8 strings
|
||||
# to file system functions, and it is the OS which will convert
|
||||
# them to decomposed UTF-8 before accessing the file system.
|
||||
# - The Apple Terminal application displays UTF-8 by default.
|
||||
# - However, other applications are free to use different encodings:
|
||||
# - xterm uses ISO-8859-1 by default.
|
||||
# - TextEdit uses MacRoman by default.
|
||||
# We prefer UTF-8 over decomposed UTF-8-MAC because one should
|
||||
# minimize the use of decomposed Unicode. Unfortunately, through the
|
||||
# Darwin file system, decomposed UTF-8 strings are leaked into user
|
||||
# space nevertheless.
|
||||
# Then there are also the locales with encodings other than US-ASCII
|
||||
# and UTF-8. These locales can be occasionally useful to users (e.g.
|
||||
# when grepping through ISO-8859-1 encoded text files), when all their
|
||||
# file names are in US-ASCII.
|
||||
echo "ISO8859-1 ISO-8859-1"
|
||||
echo "ISO8859-2 ISO-8859-2"
|
||||
echo "ISO8859-4 ISO-8859-4"
|
||||
echo "ISO8859-5 ISO-8859-5"
|
||||
echo "ISO8859-7 ISO-8859-7"
|
||||
echo "ISO8859-9 ISO-8859-9"
|
||||
echo "ISO8859-13 ISO-8859-13"
|
||||
echo "ISO8859-15 ISO-8859-15"
|
||||
echo "KOI8-R KOI8-R"
|
||||
echo "KOI8-U KOI8-U"
|
||||
echo "CP866 CP866"
|
||||
echo "CP949 CP949"
|
||||
echo "CP1131 CP1131"
|
||||
echo "CP1251 CP1251"
|
||||
echo "eucCN GB2312"
|
||||
echo "GB2312 GB2312"
|
||||
echo "eucJP EUC-JP"
|
||||
echo "eucKR EUC-KR"
|
||||
echo "Big5 BIG5"
|
||||
echo "Big5HKSCS BIG5-HKSCS"
|
||||
echo "GBK GBK"
|
||||
echo "GB18030 GB18030"
|
||||
echo "SJIS SHIFT_JIS"
|
||||
echo "ARMSCII-8 ARMSCII-8"
|
||||
echo "PT154 PT154"
|
||||
#echo "ISCII-DEV ?"
|
||||
echo "* UTF-8"
|
||||
;;
|
||||
beos* | haiku*)
|
||||
# BeOS and Haiku have a single locale, and it has UTF-8 encoding.
|
||||
echo "* UTF-8"
|
||||
;;
|
||||
msdosdjgpp*)
|
||||
# DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
|
||||
# localcharset.c falls back to using the full locale name
|
||||
# from the environment variables.
|
||||
echo "#"
|
||||
echo "# The encodings given here may not all be correct."
|
||||
echo "# If you find that the encoding given for your language and"
|
||||
echo "# country is not the one your DOS machine actually uses, just"
|
||||
echo "# correct it in this file, and send a mail to"
|
||||
echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
|
||||
echo "# and Bruno Haible <bruno@clisp.org>."
|
||||
echo "#"
|
||||
echo "C ASCII"
|
||||
# ISO-8859-1 languages
|
||||
echo "ca CP850"
|
||||
echo "ca_ES CP850"
|
||||
echo "da CP865" # not CP850 ??
|
||||
echo "da_DK CP865" # not CP850 ??
|
||||
echo "de CP850"
|
||||
echo "de_AT CP850"
|
||||
echo "de_CH CP850"
|
||||
echo "de_DE CP850"
|
||||
echo "en CP850"
|
||||
echo "en_AU CP850" # not CP437 ??
|
||||
echo "en_CA CP850"
|
||||
echo "en_GB CP850"
|
||||
echo "en_NZ CP437"
|
||||
echo "en_US CP437"
|
||||
echo "en_ZA CP850" # not CP437 ??
|
||||
echo "es CP850"
|
||||
echo "es_AR CP850"
|
||||
echo "es_BO CP850"
|
||||
echo "es_CL CP850"
|
||||
echo "es_CO CP850"
|
||||
echo "es_CR CP850"
|
||||
echo "es_CU CP850"
|
||||
echo "es_DO CP850"
|
||||
echo "es_EC CP850"
|
||||
echo "es_ES CP850"
|
||||
echo "es_GT CP850"
|
||||
echo "es_HN CP850"
|
||||
echo "es_MX CP850"
|
||||
echo "es_NI CP850"
|
||||
echo "es_PA CP850"
|
||||
echo "es_PY CP850"
|
||||
echo "es_PE CP850"
|
||||
echo "es_SV CP850"
|
||||
echo "es_UY CP850"
|
||||
echo "es_VE CP850"
|
||||
echo "et CP850"
|
||||
echo "et_EE CP850"
|
||||
echo "eu CP850"
|
||||
echo "eu_ES CP850"
|
||||
echo "fi CP850"
|
||||
echo "fi_FI CP850"
|
||||
echo "fr CP850"
|
||||
echo "fr_BE CP850"
|
||||
echo "fr_CA CP850"
|
||||
echo "fr_CH CP850"
|
||||
echo "fr_FR CP850"
|
||||
echo "ga CP850"
|
||||
echo "ga_IE CP850"
|
||||
echo "gd CP850"
|
||||
echo "gd_GB CP850"
|
||||
echo "gl CP850"
|
||||
echo "gl_ES CP850"
|
||||
echo "id CP850" # not CP437 ??
|
||||
echo "id_ID CP850" # not CP437 ??
|
||||
echo "is CP861" # not CP850 ??
|
||||
echo "is_IS CP861" # not CP850 ??
|
||||
echo "it CP850"
|
||||
echo "it_CH CP850"
|
||||
echo "it_IT CP850"
|
||||
echo "lt CP775"
|
||||
echo "lt_LT CP775"
|
||||
echo "lv CP775"
|
||||
echo "lv_LV CP775"
|
||||
echo "nb CP865" # not CP850 ??
|
||||
echo "nb_NO CP865" # not CP850 ??
|
||||
echo "nl CP850"
|
||||
echo "nl_BE CP850"
|
||||
echo "nl_NL CP850"
|
||||
echo "nn CP865" # not CP850 ??
|
||||
echo "nn_NO CP865" # not CP850 ??
|
||||
echo "no CP865" # not CP850 ??
|
||||
echo "no_NO CP865" # not CP850 ??
|
||||
echo "pt CP850"
|
||||
echo "pt_BR CP850"
|
||||
echo "pt_PT CP850"
|
||||
echo "sv CP850"
|
||||
echo "sv_SE CP850"
|
||||
# ISO-8859-2 languages
|
||||
echo "cs CP852"
|
||||
echo "cs_CZ CP852"
|
||||
echo "hr CP852"
|
||||
echo "hr_HR CP852"
|
||||
echo "hu CP852"
|
||||
echo "hu_HU CP852"
|
||||
echo "pl CP852"
|
||||
echo "pl_PL CP852"
|
||||
echo "ro CP852"
|
||||
echo "ro_RO CP852"
|
||||
echo "sk CP852"
|
||||
echo "sk_SK CP852"
|
||||
echo "sl CP852"
|
||||
echo "sl_SI CP852"
|
||||
echo "sq CP852"
|
||||
echo "sq_AL CP852"
|
||||
echo "sr CP852" # CP852 or CP866 or CP855 ??
|
||||
echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
|
||||
echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
|
||||
# ISO-8859-3 languages
|
||||
echo "mt CP850"
|
||||
echo "mt_MT CP850"
|
||||
# ISO-8859-5 languages
|
||||
echo "be CP866"
|
||||
echo "be_BE CP866"
|
||||
echo "bg CP866" # not CP855 ??
|
||||
echo "bg_BG CP866" # not CP855 ??
|
||||
echo "mk CP866" # not CP855 ??
|
||||
echo "mk_MK CP866" # not CP855 ??
|
||||
echo "ru CP866"
|
||||
echo "ru_RU CP866"
|
||||
echo "uk CP1125"
|
||||
echo "uk_UA CP1125"
|
||||
# ISO-8859-6 languages
|
||||
echo "ar CP864"
|
||||
echo "ar_AE CP864"
|
||||
echo "ar_DZ CP864"
|
||||
echo "ar_EG CP864"
|
||||
echo "ar_IQ CP864"
|
||||
echo "ar_IR CP864"
|
||||
echo "ar_JO CP864"
|
||||
echo "ar_KW CP864"
|
||||
echo "ar_MA CP864"
|
||||
echo "ar_OM CP864"
|
||||
echo "ar_QA CP864"
|
||||
echo "ar_SA CP864"
|
||||
echo "ar_SY CP864"
|
||||
# ISO-8859-7 languages
|
||||
echo "el CP869"
|
||||
echo "el_GR CP869"
|
||||
# ISO-8859-8 languages
|
||||
echo "he CP862"
|
||||
echo "he_IL CP862"
|
||||
# ISO-8859-9 languages
|
||||
echo "tr CP857"
|
||||
echo "tr_TR CP857"
|
||||
# Japanese
|
||||
echo "ja CP932"
|
||||
echo "ja_JP CP932"
|
||||
# Chinese
|
||||
echo "zh_CN GBK"
|
||||
echo "zh_TW CP950" # not CP938 ??
|
||||
# Korean
|
||||
echo "kr CP949" # not CP934 ??
|
||||
echo "kr_KR CP949" # not CP934 ??
|
||||
# Thai
|
||||
echo "th CP874"
|
||||
echo "th_TH CP874"
|
||||
# Other
|
||||
echo "eo CP850"
|
||||
echo "eo_EO CP850"
|
||||
;;
|
||||
esac
|
||||
@ -1,5 +1,5 @@
|
||||
/* Private details of the DIR type.
|
||||
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _DIRENT_PRIVATE_H
|
||||
#define _DIRENT_PRIVATE_H 1
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* A GNU-like <dirent.h>.
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_DIRENT_H
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* dirfd.c -- return the file descriptor associated with an open DIR*
|
||||
|
||||
Copyright (C) 2001, 2006, 2008-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001, 2006, 2008-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* dirname.c -- return all but the last element in a file name
|
||||
|
||||
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2016 Free Software
|
||||
Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2019 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -14,7 +14,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Take file names apart into directory and base names.
|
||||
|
||||
Copyright (C) 1998, 2001, 2003-2006, 2009-2016 Free Software Foundation,
|
||||
Copyright (C) 1998, 2001, 2003-2006, 2009-2019 Free Software Foundation,
|
||||
Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -14,7 +14,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef DIRNAME_H_
|
||||
# define DIRNAME_H_ 1
|
||||
@ -36,7 +36,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
# if GNULIB_DIRNAME
|
||||
char *base_name (char const *file);
|
||||
char *base_name (char const *file) _GL_ATTRIBUTE_MALLOC;
|
||||
char *dir_name (char const *file);
|
||||
# endif
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* File names on MS-DOS/Windows systems.
|
||||
|
||||
Copyright (C) 2000-2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2000-2001, 2004-2006, 2009-2019 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
|
||||
@ -13,16 +13,15 @@
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
From Paul Eggert and Jim Meyering. */
|
||||
|
||||
#ifndef _DOSNAME_H
|
||||
#define _DOSNAME_H
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__ || \
|
||||
defined __MSDOS__ || defined __CYGWIN__ || \
|
||||
defined __EMX__ || defined __DJGPP__)
|
||||
#if (defined _WIN32 || defined __CYGWIN__ \
|
||||
|| defined __EMX__ || defined __MSDOS__ || defined __DJGPP__)
|
||||
/* This internal macro assumes ASCII, but all hosts that support drive
|
||||
letters use ASCII. */
|
||||
# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a' \
|
||||
|
||||
38
gnulib/import/dup-safer-flag.c
Normal file
38
gnulib/import/dup-safer-flag.c
Normal file
@ -0,0 +1,38 @@
|
||||
/* Duplicate a file descriptor result, avoiding clobbering
|
||||
STD{IN,OUT,ERR}_FILENO, with specific flags.
|
||||
|
||||
Copyright (C) 2001, 2004-2006, 2009-2019 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 3 of the License, 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, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert and Eric Blake. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "unistd-safer.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* Like dup, but do not return STDIN_FILENO, STDOUT_FILENO, or
|
||||
STDERR_FILENO. If FLAG contains O_CLOEXEC, behave like
|
||||
fcntl(F_DUPFD_CLOEXEC) rather than fcntl(F_DUPFD). */
|
||||
|
||||
int
|
||||
dup_safer_flag (int fd, int flag)
|
||||
{
|
||||
return fcntl (fd, (flag & O_CLOEXEC) ? F_DUPFD_CLOEXEC : F_DUPFD,
|
||||
STDERR_FILENO + 1);
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
/* Invoke dup, but avoid some glitches.
|
||||
|
||||
Copyright (C) 2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001, 2004-2006, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Duplicate an open file descriptor.
|
||||
|
||||
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -22,7 +22,9 @@
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "msvc-inval.h"
|
||||
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
# include "msvc-inval.h"
|
||||
#endif
|
||||
|
||||
#undef dup
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Duplicate an open file descriptor to a specified file descriptor.
|
||||
|
||||
Copyright (C) 1999, 2004-2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2004-2007, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* written by Paul Eggert */
|
||||
|
||||
@ -29,16 +29,45 @@
|
||||
|
||||
# undef dup2
|
||||
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
# if defined _WIN32 && ! defined __CYGWIN__
|
||||
|
||||
/* Get declarations of the native Windows API functions. */
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
|
||||
# include "msvc-inval.h"
|
||||
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
# include "msvc-inval.h"
|
||||
# endif
|
||||
|
||||
/* Get _get_osfhandle. */
|
||||
# include "msvc-nothrow.h"
|
||||
# if GNULIB_MSVC_NOTHROW
|
||||
# include "msvc-nothrow.h"
|
||||
# else
|
||||
# include <io.h>
|
||||
# endif
|
||||
|
||||
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
static int
|
||||
dup2_nothrow (int fd, int desired_fd)
|
||||
{
|
||||
int result;
|
||||
|
||||
TRY_MSVC_INVAL
|
||||
{
|
||||
result = dup2 (fd, desired_fd);
|
||||
}
|
||||
CATCH_MSVC_INVAL
|
||||
{
|
||||
errno = EBADF;
|
||||
result = -1;
|
||||
}
|
||||
DONE_MSVC_INVAL;
|
||||
|
||||
return result;
|
||||
}
|
||||
# else
|
||||
# define dup2_nothrow dup2
|
||||
# endif
|
||||
|
||||
static int
|
||||
ms_windows_dup2 (int fd, int desired_fd)
|
||||
@ -59,23 +88,14 @@ ms_windows_dup2 (int fd, int desired_fd)
|
||||
}
|
||||
|
||||
/* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
|
||||
http://bugs.winehq.org/show_bug.cgi?id=21289 */
|
||||
https://bugs.winehq.org/show_bug.cgi?id=21289 */
|
||||
if (desired_fd < 0)
|
||||
{
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
TRY_MSVC_INVAL
|
||||
{
|
||||
result = dup2 (fd, desired_fd);
|
||||
}
|
||||
CATCH_MSVC_INVAL
|
||||
{
|
||||
errno = EBADF;
|
||||
result = -1;
|
||||
}
|
||||
DONE_MSVC_INVAL;
|
||||
result = dup2_nothrow (fd, desired_fd);
|
||||
|
||||
if (result == 0)
|
||||
result = desired_fd;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* A POSIX-like <errno.h>.
|
||||
|
||||
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_ERRNO_H
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
|
||||
/* On native Windows platforms, many macros are not defined. */
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
# if defined _WIN32 && ! defined __CYGWIN__
|
||||
|
||||
/* These are the same values as defined by MSVC 10, for interoperability. */
|
||||
|
||||
@ -248,7 +248,7 @@
|
||||
interoperability. */
|
||||
# define EOWNERDEAD 58
|
||||
# define ENOTRECOVERABLE 59
|
||||
# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
# elif defined _WIN32 && ! defined __CYGWIN__
|
||||
/* We have a conflict here: pthreads-win32 defines these values
|
||||
differently than MSVC 10. It's hairy to decide which one to use. */
|
||||
# if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Error handler for noninteractive utilities
|
||||
Copyright (C) 1990-1998, 2000-2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990-1998, 2000-2007, 2009-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
|
||||
|
||||
@ -93,33 +93,37 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
|
||||
# include <fcntl.h>
|
||||
# include <unistd.h>
|
||||
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
# if defined _WIN32 && ! defined __CYGWIN__
|
||||
/* Get declarations of the native Windows API functions. */
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
/* Get _get_osfhandle. */
|
||||
# include "msvc-nothrow.h"
|
||||
# if GNULIB_MSVC_NOTHROW
|
||||
# include "msvc-nothrow.h"
|
||||
# else
|
||||
# include <io.h>
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* The gnulib override of fcntl is not needed in this file. */
|
||||
# undef fcntl
|
||||
|
||||
# if !HAVE_DECL_STRERROR_R
|
||||
# if !(GNULIB_STRERROR_R_POSIX || HAVE_DECL_STRERROR_R)
|
||||
# ifndef HAVE_DECL_STRERROR_R
|
||||
"this configure-time declaration test was not run"
|
||||
# endif
|
||||
# if STRERROR_R_CHAR_P
|
||||
char *strerror_r ();
|
||||
char *strerror_r (int errnum, char *buf, size_t buflen);
|
||||
# else
|
||||
int strerror_r ();
|
||||
int strerror_r (int errnum, char *buf, size_t buflen);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#define program_name getprogname ()
|
||||
# define program_name getprogname ()
|
||||
|
||||
# if HAVE_STRERROR_R || defined strerror_r
|
||||
# if GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r
|
||||
# define __strerror_r strerror_r
|
||||
# endif /* HAVE_STRERROR_R || defined strerror_r */
|
||||
# endif /* GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r */
|
||||
#endif /* not _LIBC */
|
||||
|
||||
#if !_LIBC
|
||||
@ -127,7 +131,7 @@ int strerror_r ();
|
||||
static int
|
||||
is_open (int fd)
|
||||
{
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
# if defined _WIN32 && ! defined __CYGWIN__
|
||||
/* On native Windows: The initial state of unassigned standard file
|
||||
descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
|
||||
There is no fcntl, and the gnulib replacement fcntl does not support
|
||||
@ -172,9 +176,9 @@ print_errno_message (int errnum)
|
||||
{
|
||||
char const *s;
|
||||
|
||||
#if defined HAVE_STRERROR_R || _LIBC
|
||||
#if _LIBC || GNULIB_STRERROR_R_POSIX || defined HAVE_STRERROR_R
|
||||
char errbuf[1024];
|
||||
# if _LIBC || STRERROR_R_CHAR_P
|
||||
# if _LIBC || (!GNULIB_STRERROR_R_POSIX && STRERROR_R_CHAR_P)
|
||||
s = __strerror_r (errnum, errbuf, sizeof errbuf);
|
||||
# else
|
||||
if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
|
||||
@ -268,7 +272,6 @@ error_tail (int status, int errnum, const char *message, va_list args)
|
||||
else
|
||||
#endif
|
||||
vfprintf (stderr, message, args);
|
||||
va_end (args);
|
||||
|
||||
++error_message_count;
|
||||
if (errnum)
|
||||
@ -318,6 +321,7 @@ error (int status, int errnum, const char *message, ...)
|
||||
|
||||
va_start (args, message);
|
||||
error_tail (status, errnum, message, args);
|
||||
va_end (args);
|
||||
|
||||
#ifdef _LIBC
|
||||
_IO_funlockfile (stderr);
|
||||
@ -388,6 +392,7 @@ error_at_line (int status, int errnum, const char *file_name,
|
||||
|
||||
va_start (args, message);
|
||||
error_tail (status, errnum, message, args);
|
||||
va_end (args);
|
||||
|
||||
#ifdef _LIBC
|
||||
_IO_funlockfile (stderr);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Declaration for error-reporting function
|
||||
Copyright (C) 1995-1997, 2003, 2006, 2008-2016 Free Software Foundation,
|
||||
Copyright (C) 1995-1997, 2003, 2006, 2008-2019 Free Software Foundation,
|
||||
Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _ERROR_H
|
||||
#define _ERROR_H 1
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Failure exit status
|
||||
|
||||
Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002-2003, 2005-2007, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Failure exit status
|
||||
|
||||
Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2002, 2009-2019 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
|
||||
@ -13,6 +13,6 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
extern int volatile exit_failure;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2016 Free Software Foundation, Inc.
|
||||
# Copyright 1996-2019 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
#if !defined _Noreturn && __STDC_VERSION__ < 201112
|
||||
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|
||||
|| 0x5110 <= __SUNPRO_C)
|
||||
# define _Noreturn __attribute__ ((__noreturn__))
|
||||
# elif 1200 <= _MSC_VER
|
||||
# define _Noreturn __declspec (noreturn)
|
||||
# else
|
||||
# define _Noreturn
|
||||
# endif
|
||||
#endif
|
||||
@ -1,11 +1,9 @@
|
||||
eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
|
||||
& eval 'exec perl -wS -0777 -pi "$0" $argv:q'
|
||||
if 0;
|
||||
#!/bin/sh
|
||||
#! -*-perl-*-
|
||||
|
||||
# Update an FSF copyright year list to include the current year.
|
||||
|
||||
my $VERSION = '2016-01-12.23:13'; # UTC
|
||||
|
||||
# Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2019 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
|
||||
@ -18,10 +16,13 @@ my $VERSION = '2016-01-12.23:13'; # UTC
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Written by Jim Meyering and Joel E. Denny
|
||||
|
||||
# This script updates an FSF copyright year list to include the current year.
|
||||
# Usage: update-copyright [FILE...]
|
||||
#
|
||||
# The arguments to this script should be names of files that contain
|
||||
# copyright statements to be updated. The copyright holder's name
|
||||
# defaults to "Free Software Foundation, Inc." but may be changed to
|
||||
@ -81,6 +82,7 @@ my $VERSION = '2016-01-12.23:13'; # UTC
|
||||
# B. (c)
|
||||
# C. @copyright{}
|
||||
# D. ©
|
||||
# E. ©
|
||||
#
|
||||
# 4. The "Copyright" appears at the beginning of a line, except that it
|
||||
# may be prefixed by any sequence (e.g., a comment) of no more than
|
||||
@ -96,7 +98,7 @@ my $VERSION = '2016-01-12.23:13'; # UTC
|
||||
# 6. Blank lines, even if preceded by the prefix, do not appear
|
||||
# within the FSF copyright statement.
|
||||
# 7. Each copyright year is 2 or 4 digits, and years are separated by
|
||||
# commas or dashes. Whitespace may appear after commas.
|
||||
# commas, "-", or "--". Whitespace may appear after commas.
|
||||
#
|
||||
# Environment variables:
|
||||
#
|
||||
@ -120,11 +122,32 @@ my $VERSION = '2016-01-12.23:13'; # UTC
|
||||
# 5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
|
||||
# than "Free Software Foundation, Inc.".
|
||||
|
||||
# This is a prologue that allows to run a perl script as an executable
|
||||
# on systems that are compliant to a POSIX version before POSIX:2017.
|
||||
# On such systems, the usual invocation of an executable through execlp()
|
||||
# or execvp() fails with ENOEXEC if it is a script that does not start
|
||||
# with a #! line. The script interpreter mentioned in the #! line has
|
||||
# to be /bin/sh, because on GuixSD systems that is the only program that
|
||||
# has a fixed file name. The second line is essential for perl and is
|
||||
# also useful for editing this file in Emacs. The next two lines below
|
||||
# are valid code in both sh and perl. When executed by sh, they re-execute
|
||||
# the script through the perl program found in $PATH. The '-x' option
|
||||
# is essential as well; without it, perl would re-execute the script
|
||||
# through /bin/sh. When executed by perl, the next two lines are a no-op.
|
||||
eval 'exec perl -wSx -0777 -pi "$0" "$@"'
|
||||
if 0;
|
||||
|
||||
my $VERSION = '2018-03-07.03:47'; # UTC
|
||||
# The definition above must lie within the first 8 lines in order
|
||||
# for the Emacs time-stamp write hook (at end) to update it.
|
||||
# If you change this file with Emacs, please let the write hook
|
||||
# do its job. Otherwise, update this string manually.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $copyright_re = 'Copyright';
|
||||
my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©)';
|
||||
my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|©|©)';
|
||||
my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
|
||||
$holder ||= 'Free Software Foundation, Inc.';
|
||||
my $prefix_max = 5;
|
||||
@ -169,7 +192,7 @@ while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
|
||||
$holder_re =~ s/\s/$ws_re/g;
|
||||
my $stmt_remainder_re =
|
||||
"(?:$ws_re$circle_c_re)?"
|
||||
. "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
|
||||
. "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|--?))*"
|
||||
. "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
|
||||
if (/\G$stmt_remainder_re/)
|
||||
{
|
||||
@ -208,26 +231,28 @@ if (defined $stmt_re)
|
||||
# Make the use of intervals consistent.
|
||||
if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
|
||||
{
|
||||
$stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
|
||||
$stmt =~ s/(\d{4})--?(\d{4})/join(', ', $1..$2)/eg;
|
||||
}
|
||||
else
|
||||
{
|
||||
my $ndash = $ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" : "-";
|
||||
|
||||
$stmt =~
|
||||
s/
|
||||
(\d{4})
|
||||
(?:
|
||||
(,\ |-)
|
||||
(,\ |--?)
|
||||
((??{
|
||||
if ($2 eq '-') { '\d{4}'; }
|
||||
if ($2 ne ', ') { '\d{4}'; }
|
||||
elsif (!$3) { $1 + 1; }
|
||||
else { $3 + 1; }
|
||||
}))
|
||||
)+
|
||||
/$1-$3/gx;
|
||||
/$1$ndash$3/gx;
|
||||
|
||||
# When it's 2, emit a single range encompassing all year numbers.
|
||||
$ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
|
||||
and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
|
||||
and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1$ndash$2/;
|
||||
}
|
||||
|
||||
# Format within margin.
|
||||
@ -263,10 +288,13 @@ else
|
||||
print STDERR "$ARGV: warning: copyright statement not found\n";
|
||||
}
|
||||
|
||||
# Hey Emacs!
|
||||
# Local variables:
|
||||
# coding: utf-8
|
||||
# mode: perl
|
||||
# indent-tabs-mode: nil
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-line-limit: 200
|
||||
# time-stamp-start: "my $VERSION = '"
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* fchdir replacement.
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Provide file descriptor control.
|
||||
|
||||
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Eric Blake <ebb9@byu.net>. */
|
||||
|
||||
@ -25,20 +25,25 @@
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if !HAVE_FCNTL
|
||||
# define rpl_fcntl fcntl
|
||||
#ifdef __KLIBC__
|
||||
# define INCL_DOS
|
||||
# include <os2.h>
|
||||
#endif
|
||||
#undef fcntl
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
/* Get declarations of the native Windows API functions. */
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
|
||||
/* Get _get_osfhandle. */
|
||||
# include "msvc-nothrow.h"
|
||||
# if GNULIB_MSVC_NOTHROW
|
||||
# include "msvc-nothrow.h"
|
||||
# else
|
||||
# include <io.h>
|
||||
# endif
|
||||
|
||||
/* Upper bound on getdtablesize(). See lib/getdtablesize.c. */
|
||||
# define OPEN_MAX_MAX 0x10000
|
||||
@ -162,93 +167,18 @@ dupfd (int oldfd, int newfd, int flags)
|
||||
}
|
||||
#endif /* W32 */
|
||||
|
||||
/* Forward declarations, because we '#undef fcntl' in the middle of this
|
||||
compilation unit. */
|
||||
/* Our implementation of fcntl (fd, F_DUPFD, target). */
|
||||
static int rpl_fcntl_DUPFD (int fd, int target);
|
||||
/* Our implementation of fcntl (fd, F_DUPFD_CLOEXEC, target). */
|
||||
static int rpl_fcntl_DUPFD_CLOEXEC (int fd, int target);
|
||||
#ifdef __KLIBC__
|
||||
|
||||
# define INCL_DOS
|
||||
# include <os2.h>
|
||||
|
||||
static int
|
||||
klibc_fcntl (int fd, int action, /* arg */...)
|
||||
{
|
||||
va_list arg_ptr;
|
||||
int arg;
|
||||
struct stat sbuf;
|
||||
int result = -1;
|
||||
|
||||
va_start (arg_ptr, action);
|
||||
arg = va_arg (arg_ptr, int);
|
||||
result = fcntl (fd, action, arg);
|
||||
/* EPERM for F_DUPFD, ENOTSUP for others */
|
||||
if (result == -1 && (errno == EPERM || errno == ENOTSUP)
|
||||
&& !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
|
||||
{
|
||||
ULONG ulMode;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case F_DUPFD:
|
||||
/* Find available fd */
|
||||
while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
|
||||
arg++;
|
||||
|
||||
result = dup2 (fd, arg);
|
||||
break;
|
||||
|
||||
/* Using underlying APIs is right ? */
|
||||
case F_GETFD:
|
||||
if (DosQueryFHState (fd, &ulMode))
|
||||
break;
|
||||
|
||||
result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
|
||||
break;
|
||||
|
||||
case F_SETFD:
|
||||
if (arg & ~FD_CLOEXEC)
|
||||
break;
|
||||
|
||||
if (DosQueryFHState (fd, &ulMode))
|
||||
break;
|
||||
|
||||
if (arg & FD_CLOEXEC)
|
||||
ulMode |= OPEN_FLAGS_NOINHERIT;
|
||||
else
|
||||
ulMode &= ~OPEN_FLAGS_NOINHERIT;
|
||||
|
||||
/* Filter supported flags. */
|
||||
ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
|
||||
| OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
|
||||
|
||||
if (DosSetFHState (fd, ulMode))
|
||||
break;
|
||||
|
||||
result = 0;
|
||||
break;
|
||||
|
||||
case F_GETFL:
|
||||
result = 0;
|
||||
break;
|
||||
|
||||
case F_SETFL:
|
||||
if (arg != 0)
|
||||
break;
|
||||
|
||||
result = 0;
|
||||
break;
|
||||
|
||||
default :
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
va_end (arg_ptr);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
# define fcntl klibc_fcntl
|
||||
/* Adds support for fcntl on directories. */
|
||||
static int klibc_fcntl (int fd, int action, /* arg */...);
|
||||
#endif
|
||||
|
||||
|
||||
/* Perform the specified ACTION on the file descriptor FD, possibly
|
||||
using the argument ARG further described below. This replacement
|
||||
handles the following actions, and forwards all others on to the
|
||||
@ -269,110 +199,35 @@ klibc_fcntl (int fd, int action, /* arg */...)
|
||||
return -1 and set errno. */
|
||||
|
||||
int
|
||||
rpl_fcntl (int fd, int action, /* arg */...)
|
||||
fcntl (int fd, int action, /* arg */...)
|
||||
#undef fcntl
|
||||
#ifdef __KLIBC__
|
||||
# define fcntl klibc_fcntl
|
||||
#endif
|
||||
{
|
||||
va_list arg;
|
||||
int result = -1;
|
||||
va_start (arg, action);
|
||||
switch (action)
|
||||
{
|
||||
|
||||
#if !HAVE_FCNTL
|
||||
case F_DUPFD:
|
||||
{
|
||||
int target = va_arg (arg, int);
|
||||
result = dupfd (fd, target, 0);
|
||||
result = rpl_fcntl_DUPFD (fd, target);
|
||||
break;
|
||||
}
|
||||
#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
|
||||
case F_DUPFD:
|
||||
{
|
||||
int target = va_arg (arg, int);
|
||||
/* Detect invalid target; needed for cygwin 1.5.x. */
|
||||
if (target < 0 || getdtablesize () <= target)
|
||||
errno = EINVAL;
|
||||
else
|
||||
{
|
||||
/* Haiku alpha 2 loses fd flags on original. */
|
||||
int flags = fcntl (fd, F_GETFD);
|
||||
if (flags < 0)
|
||||
{
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
result = fcntl (fd, action, target);
|
||||
if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
close (result);
|
||||
result = -1;
|
||||
errno = saved_errno;
|
||||
}
|
||||
# if REPLACE_FCHDIR
|
||||
if (0 <= result)
|
||||
result = _gl_register_dup (fd, result);
|
||||
# endif
|
||||
}
|
||||
break;
|
||||
} /* F_DUPFD */
|
||||
#endif /* FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR */
|
||||
|
||||
case F_DUPFD_CLOEXEC:
|
||||
{
|
||||
int target = va_arg (arg, int);
|
||||
|
||||
#if !HAVE_FCNTL
|
||||
result = dupfd (fd, target, O_CLOEXEC);
|
||||
result = rpl_fcntl_DUPFD_CLOEXEC (fd, target);
|
||||
break;
|
||||
#else /* HAVE_FCNTL */
|
||||
/* Try the system call first, if the headers claim it exists
|
||||
(that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
|
||||
may be running with a glibc that has the macro but with an
|
||||
older kernel that does not support it. Cache the
|
||||
information on whether the system call really works, but
|
||||
avoid caching failure if the corresponding F_DUPFD fails
|
||||
for any reason. 0 = unknown, 1 = yes, -1 = no. */
|
||||
static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
|
||||
if (0 <= have_dupfd_cloexec)
|
||||
{
|
||||
result = fcntl (fd, action, target);
|
||||
if (0 <= result || errno != EINVAL)
|
||||
{
|
||||
have_dupfd_cloexec = 1;
|
||||
# if REPLACE_FCHDIR
|
||||
if (0 <= result)
|
||||
result = _gl_register_dup (fd, result);
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
result = rpl_fcntl (fd, F_DUPFD, target);
|
||||
if (result < 0)
|
||||
break;
|
||||
have_dupfd_cloexec = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
result = rpl_fcntl (fd, F_DUPFD, target);
|
||||
if (0 <= result && have_dupfd_cloexec == -1)
|
||||
{
|
||||
int flags = fcntl (result, F_GETFD);
|
||||
if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
close (result);
|
||||
errno = saved_errno;
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif /* HAVE_FCNTL */
|
||||
} /* F_DUPFD_CLOEXEC */
|
||||
}
|
||||
|
||||
#if !HAVE_FCNTL
|
||||
case F_GETFD:
|
||||
{
|
||||
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
# if defined _WIN32 && ! defined __CYGWIN__
|
||||
HANDLE handle = (HANDLE) _get_osfhandle (fd);
|
||||
DWORD flags;
|
||||
if (handle == INVALID_HANDLE_VALUE
|
||||
@ -401,8 +256,183 @@ rpl_fcntl (int fd, int action, /* arg */...)
|
||||
default:
|
||||
{
|
||||
#if HAVE_FCNTL
|
||||
void *p = va_arg (arg, void *);
|
||||
result = fcntl (fd, action, p);
|
||||
switch (action)
|
||||
{
|
||||
#ifdef F_BARRIERFSYNC /* macOS */
|
||||
case F_BARRIERFSYNC:
|
||||
#endif
|
||||
#ifdef F_CHKCLEAN /* macOS */
|
||||
case F_CHKCLEAN:
|
||||
#endif
|
||||
#ifdef F_CLOSEM /* NetBSD, HP-UX */
|
||||
case F_CLOSEM:
|
||||
#endif
|
||||
#ifdef F_FLUSH_DATA /* macOS */
|
||||
case F_FLUSH_DATA:
|
||||
#endif
|
||||
#ifdef F_FREEZE_FS /* macOS */
|
||||
case F_FREEZE_FS:
|
||||
#endif
|
||||
#ifdef F_FULLFSYNC /* macOS */
|
||||
case F_FULLFSYNC:
|
||||
#endif
|
||||
#ifdef F_GETCONFINED /* macOS */
|
||||
case F_GETCONFINED:
|
||||
#endif
|
||||
#ifdef F_GETDEFAULTPROTLEVEL /* macOS */
|
||||
case F_GETDEFAULTPROTLEVEL:
|
||||
#endif
|
||||
#ifdef F_GETFD /* POSIX */
|
||||
case F_GETFD:
|
||||
#endif
|
||||
#ifdef F_GETFL /* POSIX */
|
||||
case F_GETFL:
|
||||
#endif
|
||||
#ifdef F_GETLEASE /* Linux */
|
||||
case F_GETLEASE:
|
||||
#endif
|
||||
#ifdef F_GETNOSIGPIPE /* macOS */
|
||||
case F_GETNOSIGPIPE:
|
||||
#endif
|
||||
#ifdef F_GETOWN /* POSIX */
|
||||
case F_GETOWN:
|
||||
#endif
|
||||
#ifdef F_GETPIPE_SZ /* Linux */
|
||||
case F_GETPIPE_SZ:
|
||||
#endif
|
||||
#ifdef F_GETPROTECTIONCLASS /* macOS */
|
||||
case F_GETPROTECTIONCLASS:
|
||||
#endif
|
||||
#ifdef F_GETPROTECTIONLEVEL /* macOS */
|
||||
case F_GETPROTECTIONLEVEL:
|
||||
#endif
|
||||
#ifdef F_GET_SEALS /* Linux */
|
||||
case F_GET_SEALS:
|
||||
#endif
|
||||
#ifdef F_GETSIG /* Linux */
|
||||
case F_GETSIG:
|
||||
#endif
|
||||
#ifdef F_MAXFD /* NetBSD */
|
||||
case F_MAXFD:
|
||||
#endif
|
||||
#ifdef F_RECYCLE /* macOS */
|
||||
case F_RECYCLE:
|
||||
#endif
|
||||
#ifdef F_SETFIFOENH /* HP-UX */
|
||||
case F_SETFIFOENH:
|
||||
#endif
|
||||
#ifdef F_THAW_FS /* macOS */
|
||||
case F_THAW_FS:
|
||||
#endif
|
||||
/* These actions take no argument. */
|
||||
result = fcntl (fd, action);
|
||||
break;
|
||||
|
||||
#ifdef F_ADD_SEALS /* Linux */
|
||||
case F_ADD_SEALS:
|
||||
#endif
|
||||
#ifdef F_BADFD /* Solaris */
|
||||
case F_BADFD:
|
||||
#endif
|
||||
#ifdef F_CHECK_OPENEVT /* macOS */
|
||||
case F_CHECK_OPENEVT:
|
||||
#endif
|
||||
#ifdef F_DUP2FD /* FreeBSD, AIX, Solaris */
|
||||
case F_DUP2FD:
|
||||
#endif
|
||||
#ifdef F_DUP2FD_CLOEXEC /* FreeBSD, Solaris */
|
||||
case F_DUP2FD_CLOEXEC:
|
||||
#endif
|
||||
#ifdef F_DUP2FD_CLOFORK /* Solaris */
|
||||
case F_DUP2FD_CLOFORK:
|
||||
#endif
|
||||
#ifdef F_DUPFD /* POSIX */
|
||||
case F_DUPFD:
|
||||
#endif
|
||||
#ifdef F_DUPFD_CLOEXEC /* POSIX */
|
||||
case F_DUPFD_CLOEXEC:
|
||||
#endif
|
||||
#ifdef F_DUPFD_CLOFORK /* Solaris */
|
||||
case F_DUPFD_CLOFORK:
|
||||
#endif
|
||||
#ifdef F_GETXFL /* Solaris */
|
||||
case F_GETXFL:
|
||||
#endif
|
||||
#ifdef F_GLOBAL_NOCACHE /* macOS */
|
||||
case F_GLOBAL_NOCACHE:
|
||||
#endif
|
||||
#ifdef F_MAKECOMPRESSED /* macOS */
|
||||
case F_MAKECOMPRESSED:
|
||||
#endif
|
||||
#ifdef F_MOVEDATAEXTENTS /* macOS */
|
||||
case F_MOVEDATAEXTENTS:
|
||||
#endif
|
||||
#ifdef F_NOCACHE /* macOS */
|
||||
case F_NOCACHE:
|
||||
#endif
|
||||
#ifdef F_NODIRECT /* macOS */
|
||||
case F_NODIRECT:
|
||||
#endif
|
||||
#ifdef F_NOTIFY /* Linux */
|
||||
case F_NOTIFY:
|
||||
#endif
|
||||
#ifdef F_OPLKACK /* IRIX */
|
||||
case F_OPLKACK:
|
||||
#endif
|
||||
#ifdef F_OPLKREG /* IRIX */
|
||||
case F_OPLKREG:
|
||||
#endif
|
||||
#ifdef F_RDAHEAD /* macOS */
|
||||
case F_RDAHEAD:
|
||||
#endif
|
||||
#ifdef F_SETBACKINGSTORE /* macOS */
|
||||
case F_SETBACKINGSTORE:
|
||||
#endif
|
||||
#ifdef F_SETCONFINED /* macOS */
|
||||
case F_SETCONFINED:
|
||||
#endif
|
||||
#ifdef F_SETFD /* POSIX */
|
||||
case F_SETFD:
|
||||
#endif
|
||||
#ifdef F_SETFL /* POSIX */
|
||||
case F_SETFL:
|
||||
#endif
|
||||
#ifdef F_SETLEASE /* Linux */
|
||||
case F_SETLEASE:
|
||||
#endif
|
||||
#ifdef F_SETNOSIGPIPE /* macOS */
|
||||
case F_SETNOSIGPIPE:
|
||||
#endif
|
||||
#ifdef F_SETOWN /* POSIX */
|
||||
case F_SETOWN:
|
||||
#endif
|
||||
#ifdef F_SETPIPE_SZ /* Linux */
|
||||
case F_SETPIPE_SZ:
|
||||
#endif
|
||||
#ifdef F_SETPROTECTIONCLASS /* macOS */
|
||||
case F_SETPROTECTIONCLASS:
|
||||
#endif
|
||||
#ifdef F_SETSIG /* Linux */
|
||||
case F_SETSIG:
|
||||
#endif
|
||||
#ifdef F_SINGLE_WRITER /* macOS */
|
||||
case F_SINGLE_WRITER:
|
||||
#endif
|
||||
/* These actions take an 'int' argument. */
|
||||
{
|
||||
int x = va_arg (arg, int);
|
||||
result = fcntl (fd, action, x);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Other actions take a pointer argument. */
|
||||
{
|
||||
void *p = va_arg (arg, void *);
|
||||
result = fcntl (fd, action, p);
|
||||
}
|
||||
break;
|
||||
}
|
||||
#else
|
||||
errno = EINVAL;
|
||||
#endif
|
||||
@ -412,3 +442,186 @@ rpl_fcntl (int fd, int action, /* arg */...)
|
||||
va_end (arg);
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
rpl_fcntl_DUPFD (int fd, int target)
|
||||
{
|
||||
int result;
|
||||
#if !HAVE_FCNTL
|
||||
result = dupfd (fd, target, 0);
|
||||
#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
|
||||
/* Detect invalid target; needed for cygwin 1.5.x. */
|
||||
if (target < 0 || getdtablesize () <= target)
|
||||
{
|
||||
result = -1;
|
||||
errno = EINVAL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Haiku alpha 2 loses fd flags on original. */
|
||||
int flags = fcntl (fd, F_GETFD);
|
||||
if (flags < 0)
|
||||
result = -1;
|
||||
else
|
||||
{
|
||||
result = fcntl (fd, F_DUPFD, target);
|
||||
if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
close (result);
|
||||
result = -1;
|
||||
errno = saved_errno;
|
||||
}
|
||||
# if REPLACE_FCHDIR
|
||||
if (0 <= result)
|
||||
result = _gl_register_dup (fd, result);
|
||||
# endif
|
||||
}
|
||||
}
|
||||
#else
|
||||
result = fcntl (fd, F_DUPFD, target);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
static int
|
||||
rpl_fcntl_DUPFD_CLOEXEC (int fd, int target)
|
||||
{
|
||||
int result;
|
||||
#if !HAVE_FCNTL
|
||||
result = dupfd (fd, target, O_CLOEXEC);
|
||||
#else /* HAVE_FCNTL */
|
||||
# if defined __HAIKU__
|
||||
/* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets
|
||||
the FD_CLOEXEC flag on fd, not on target. Therefore avoid the
|
||||
system fcntl in this case. */
|
||||
# define have_dupfd_cloexec -1
|
||||
# else
|
||||
/* Try the system call first, if the headers claim it exists
|
||||
(that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
|
||||
may be running with a glibc that has the macro but with an
|
||||
older kernel that does not support it. Cache the
|
||||
information on whether the system call really works, but
|
||||
avoid caching failure if the corresponding F_DUPFD fails
|
||||
for any reason. 0 = unknown, 1 = yes, -1 = no. */
|
||||
static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
|
||||
if (0 <= have_dupfd_cloexec)
|
||||
{
|
||||
result = fcntl (fd, F_DUPFD_CLOEXEC, target);
|
||||
if (0 <= result || errno != EINVAL)
|
||||
{
|
||||
have_dupfd_cloexec = 1;
|
||||
# if REPLACE_FCHDIR
|
||||
if (0 <= result)
|
||||
result = _gl_register_dup (fd, result);
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
result = rpl_fcntl_DUPFD (fd, target);
|
||||
if (result >= 0)
|
||||
have_dupfd_cloexec = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
# endif
|
||||
result = rpl_fcntl_DUPFD (fd, target);
|
||||
if (0 <= result && have_dupfd_cloexec == -1)
|
||||
{
|
||||
int flags = fcntl (result, F_GETFD);
|
||||
if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
close (result);
|
||||
errno = saved_errno;
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_FCNTL */
|
||||
return result;
|
||||
}
|
||||
|
||||
#undef fcntl
|
||||
|
||||
#ifdef __KLIBC__
|
||||
|
||||
static int
|
||||
klibc_fcntl (int fd, int action, /* arg */...)
|
||||
{
|
||||
va_list arg_ptr;
|
||||
int arg;
|
||||
struct stat sbuf;
|
||||
int result;
|
||||
|
||||
va_start (arg_ptr, action);
|
||||
arg = va_arg (arg_ptr, int);
|
||||
result = fcntl (fd, action, arg);
|
||||
/* EPERM for F_DUPFD, ENOTSUP for others */
|
||||
if (result == -1 && (errno == EPERM || errno == ENOTSUP)
|
||||
&& !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
|
||||
{
|
||||
ULONG ulMode;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case F_DUPFD:
|
||||
/* Find available fd */
|
||||
while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
|
||||
arg++;
|
||||
|
||||
result = dup2 (fd, arg);
|
||||
break;
|
||||
|
||||
/* Using underlying APIs is right ? */
|
||||
case F_GETFD:
|
||||
if (DosQueryFHState (fd, &ulMode))
|
||||
break;
|
||||
|
||||
result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
|
||||
break;
|
||||
|
||||
case F_SETFD:
|
||||
if (arg & ~FD_CLOEXEC)
|
||||
break;
|
||||
|
||||
if (DosQueryFHState (fd, &ulMode))
|
||||
break;
|
||||
|
||||
if (arg & FD_CLOEXEC)
|
||||
ulMode |= OPEN_FLAGS_NOINHERIT;
|
||||
else
|
||||
ulMode &= ~OPEN_FLAGS_NOINHERIT;
|
||||
|
||||
/* Filter supported flags. */
|
||||
ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
|
||||
| OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
|
||||
|
||||
if (DosSetFHState (fd, ulMode))
|
||||
break;
|
||||
|
||||
result = 0;
|
||||
break;
|
||||
|
||||
case F_GETFL:
|
||||
result = 0;
|
||||
break;
|
||||
|
||||
case F_SETFL:
|
||||
if (arg != 0)
|
||||
break;
|
||||
|
||||
result = 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
errno = EINVAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
va_end (arg_ptr);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Like <fcntl.h>, but with non-working flags defined to 0.
|
||||
|
||||
Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* written by Paul Eggert */
|
||||
|
||||
@ -39,6 +39,12 @@
|
||||
#endif
|
||||
#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
|
||||
|
||||
/* Native Windows platforms declare open(), creat() in <io.h>. */
|
||||
#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
|
||||
&& (defined _WIN32 && ! defined __CYGWIN__)
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#else
|
||||
/* Normal invocation convention. */
|
||||
|
||||
@ -59,6 +65,12 @@
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#@INCLUDE_NEXT@ @NEXT_FCNTL_H@
|
||||
|
||||
/* Native Windows platforms declare open(), creat() in <io.h>. */
|
||||
#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
|
||||
&& (defined _WIN32 && ! defined __CYGWIN__)
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_FCNTL_H
|
||||
#define _@GUARD_PREFIX@_FCNTL_H
|
||||
|
||||
@ -66,12 +78,6 @@
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
/* Native Windows platforms declare open(), creat() in <io.h>. */
|
||||
#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
|
||||
&& ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
|
||||
# include <io.h>
|
||||
#endif
|
||||
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
@ -82,6 +88,26 @@
|
||||
|
||||
/* Declare overridden functions. */
|
||||
|
||||
#if @GNULIB_CREAT@
|
||||
# if @REPLACE_CREAT@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# undef creat
|
||||
# define creat rpl_creat
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode)
|
||||
_GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
|
||||
# else
|
||||
_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (creat);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef creat
|
||||
/* Assume creat is always declared. */
|
||||
_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
|
||||
"use gnulib module creat for portability");
|
||||
#endif
|
||||
|
||||
#if @GNULIB_FCNTL@
|
||||
# if @REPLACE_FCNTL@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
@ -213,7 +239,10 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
|
||||
#endif
|
||||
|
||||
#ifndef O_CLOEXEC
|
||||
# define O_CLOEXEC 0
|
||||
# define O_CLOEXEC 0x40000000 /* Try to not collide with system O_* flags. */
|
||||
# define GNULIB_defined_O_CLOEXEC 1
|
||||
#else
|
||||
# define GNULIB_defined_O_CLOEXEC 0
|
||||
#endif
|
||||
|
||||
#ifndef O_DIRECT
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Hook for making making file descriptor functions close(), ioctl() extensible.
|
||||
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||
/* Hook for making file descriptor functions close(), ioctl() extensible.
|
||||
Copyright (C) 2009-2019 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2009.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
@ -13,7 +13,7 @@
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Hook for making making file descriptor functions close(), ioctl() extensible.
|
||||
Copyright (C) 2009-2016 Free Software Foundation, Inc.
|
||||
/* Hook for making file descriptor functions close(), ioctl() extensible.
|
||||
Copyright (C) 2009-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
#ifndef FD_HOOK_H
|
||||
|
||||
52
gnulib/import/fd-safer-flag.c
Normal file
52
gnulib/import/fd-safer-flag.c
Normal file
@ -0,0 +1,52 @@
|
||||
/* Adjust a file descriptor result so that it avoids clobbering
|
||||
STD{IN,OUT,ERR}_FILENO, with specific flags.
|
||||
|
||||
Copyright (C) 2005-2006, 2009-2019 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 3 of the License, 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, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert and Eric Blake. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include "unistd-safer.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* Return FD, unless FD would be a copy of standard input, output, or
|
||||
error; in that case, return a duplicate of FD, closing FD. If FLAG
|
||||
contains O_CLOEXEC, the returned FD will have close-on-exec
|
||||
semantics. On failure to duplicate, close FD, set errno, and
|
||||
return -1. Preserve errno if FD is negative, so that the caller
|
||||
can always inspect errno when the returned value is negative.
|
||||
|
||||
This function is usefully wrapped around functions that return file
|
||||
descriptors, e.g., fd_safer_flag (open ("file", O_RDONLY | flag), flag). */
|
||||
|
||||
int
|
||||
fd_safer_flag (int fd, int flag)
|
||||
{
|
||||
if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
|
||||
{
|
||||
int f = dup_safer_flag (fd, flag);
|
||||
int e = errno;
|
||||
close (fd);
|
||||
errno = e;
|
||||
fd = f;
|
||||
}
|
||||
|
||||
return fd;
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
/* Return a safer copy of a file descriptor.
|
||||
|
||||
Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2006, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* provide a replacement fdopendir function
|
||||
Copyright (C) 2004-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2004-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* written by Jim Meyering */
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Basic filename support macros.
|
||||
Copyright (C) 2001-2004, 2007-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2004, 2007-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FILENAME_H
|
||||
#define _FILENAME_H
|
||||
@ -28,7 +28,7 @@ extern "C" {
|
||||
it may be concatenated to a directory pathname.
|
||||
IS_PATH_WITH_DIR(P) tests whether P contains a directory specification.
|
||||
*/
|
||||
#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
|
||||
#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
|
||||
/* Native Windows, Cygwin, OS/2, DOS */
|
||||
# define ISSLASH(C) ((C) == '/' || (C) == '\\')
|
||||
# define HAS_DEVICE(P) \
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Concatenate two arbitrary file names.
|
||||
|
||||
Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996-2007, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
@ -31,55 +31,54 @@
|
||||
# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
|
||||
#endif
|
||||
|
||||
/* Return the longest suffix of F that is a relative file name.
|
||||
If it has no such suffix, return the empty string. */
|
||||
|
||||
static char const * _GL_ATTRIBUTE_PURE
|
||||
longest_relative_suffix (char const *f)
|
||||
{
|
||||
for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++)
|
||||
continue;
|
||||
return f;
|
||||
}
|
||||
|
||||
/* Concatenate two file name components, DIR and ABASE, in
|
||||
/* Concatenate two file name components, DIR and BASE, in
|
||||
newly-allocated storage and return the result.
|
||||
The resulting file name F is such that the commands "ls F" and "(cd
|
||||
DIR; ls BASE)" refer to the same file, where BASE is ABASE with any
|
||||
file system prefixes and leading separators removed.
|
||||
Arrange for a directory separator if necessary between DIR and BASE
|
||||
in the result, removing any redundant separators.
|
||||
DIR; ls ./BASE)" refer to the same file. If necessary, put
|
||||
a separator between DIR and BASE in the result. Typically this
|
||||
separator is "/", but in rare cases it might be ".".
|
||||
In any case, if BASE_IN_RESULT is non-NULL, set
|
||||
*BASE_IN_RESULT to point to the copy of ABASE in the returned
|
||||
concatenation. However, if ABASE begins with more than one slash,
|
||||
set *BASE_IN_RESULT to point to the sole corresponding slash that
|
||||
is copied into the result buffer.
|
||||
*BASE_IN_RESULT to point to the copy of BASE at the end of the
|
||||
returned concatenation.
|
||||
|
||||
Return NULL if malloc fails. */
|
||||
|
||||
char *
|
||||
mfile_name_concat (char const *dir, char const *abase, char **base_in_result)
|
||||
mfile_name_concat (char const *dir, char const *base, char **base_in_result)
|
||||
{
|
||||
char const *dirbase = last_component (dir);
|
||||
size_t dirbaselen = base_len (dirbase);
|
||||
size_t dirlen = dirbase - dir + dirbaselen;
|
||||
size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
|
||||
|
||||
char const *base = longest_relative_suffix (abase);
|
||||
size_t baselen = strlen (base);
|
||||
char sep = '\0';
|
||||
if (dirbaselen)
|
||||
{
|
||||
/* DIR is not a file system root, so separate with / if needed. */
|
||||
if (! ISSLASH (dir[dirlen - 1]) && ! ISSLASH (*base))
|
||||
sep = '/';
|
||||
}
|
||||
else if (ISSLASH (*base))
|
||||
{
|
||||
/* DIR is a file system root and BASE begins with a slash, so
|
||||
separate with ".". For example, if DIR is "/" and BASE is
|
||||
"/foo" then return "/./foo", as "//foo" would be wrong on
|
||||
some POSIX systems. A fancier algorithm could omit "." in
|
||||
some cases but is not worth the trouble. */
|
||||
sep = '.';
|
||||
}
|
||||
|
||||
char *p_concat = malloc (dirlen + needs_separator + baselen + 1);
|
||||
char *p_concat = malloc (dirlen + (sep != '\0') + baselen + 1);
|
||||
char *p;
|
||||
|
||||
if (p_concat == NULL)
|
||||
return NULL;
|
||||
|
||||
p = mempcpy (p_concat, dir, dirlen);
|
||||
*p = DIRECTORY_SEPARATOR;
|
||||
p += needs_separator;
|
||||
*p = sep;
|
||||
p += sep != '\0';
|
||||
|
||||
if (base_in_result)
|
||||
*base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
|
||||
*base_in_result = p;
|
||||
|
||||
p = mempcpy (p, base, baselen);
|
||||
*p = '\0';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Concatenate two arbitrary file names.
|
||||
|
||||
Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2016 Free Software
|
||||
Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2019 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -14,7 +14,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Jim Meyering. */
|
||||
|
||||
|
||||
@ -1,19 +1,22 @@
|
||||
/* Sizes of structs with flexible array members.
|
||||
|
||||
Copyright 2016 Free Software Foundation, Inc.
|
||||
Copyright 2016-2019 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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
The GNU C Library 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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.
|
||||
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, see <http://www.gnu.org/licenses/>.
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
Written by Paul Eggert. */
|
||||
|
||||
@ -30,11 +33,26 @@
|
||||
# define FLEXALIGNOF(type) _Alignof (type)
|
||||
#endif
|
||||
|
||||
/* Upper bound on the size of a struct of type TYPE with a flexible
|
||||
array member named MEMBER that is followed by N bytes of other data.
|
||||
This is not simply sizeof (TYPE) + N, since it may require
|
||||
alignment on unusually picky C11 platforms, and
|
||||
FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms.
|
||||
/* Yield a properly aligned upper bound on the size of a struct of
|
||||
type TYPE with a flexible array member named MEMBER that is
|
||||
followed by N bytes of other data. The result is suitable as an
|
||||
argument to malloc. For example:
|
||||
|
||||
struct s { int n; char d[FLEXIBLE_ARRAY_MEMBER]; };
|
||||
struct s *p = malloc (FLEXSIZEOF (struct s, d, n * sizeof (char)));
|
||||
|
||||
FLEXSIZEOF (TYPE, MEMBER, N) is not simply (sizeof (TYPE) + N),
|
||||
since FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms. Nor is
|
||||
it simply (offsetof (TYPE, MEMBER) + N), as that might yield a size
|
||||
that causes malloc to yield a pointer that is not properly aligned
|
||||
for TYPE; for example, if sizeof (int) == alignof (int) == 4,
|
||||
malloc (offsetof (struct s, d) + 3 * sizeof (char)) is equivalent
|
||||
to malloc (7) and might yield a pointer that is not a multiple of 4
|
||||
(which means the pointer is not properly aligned for struct s),
|
||||
whereas malloc (FLEXSIZEOF (struct s, d, 3 * sizeof (char))) is
|
||||
equivalent to malloc (8) and must yield a pointer that is a
|
||||
multiple of 4.
|
||||
|
||||
Yield a value less than N if and only if arithmetic overflow occurs. */
|
||||
|
||||
#define FLEXSIZEOF(type, member, n) \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Supplemental information about the floating-point formats.
|
||||
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007, 2009-2019 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FLOATPLUS_H
|
||||
#define _FLOATPLUS_H
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Auxiliary definitions for <float.h>.
|
||||
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2019 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* A correct <float.h>.
|
||||
|
||||
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_FLOAT_H
|
||||
|
||||
@ -62,8 +62,8 @@
|
||||
|
||||
/* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
|
||||
precision in the compiler but 64 bits of precision at runtime. See
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2008-07/msg00063.html>. */
|
||||
#if defined __i386__ && defined __FreeBSD__
|
||||
<https://lists.gnu.org/r/bug-gnulib/2008-07/msg00063.html>. */
|
||||
#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
|
||||
/* Number of mantissa units, in base FLT_RADIX. */
|
||||
# undef LDBL_MANT_DIG
|
||||
# define LDBL_MANT_DIG 64
|
||||
@ -81,7 +81,7 @@
|
||||
# define LDBL_MAX_EXP 16384
|
||||
/* Minimum positive normalized number. */
|
||||
# undef LDBL_MIN
|
||||
# define LDBL_MIN 3.3621031431120935E-4932L /* = 0x1p-16382L */
|
||||
# define LDBL_MIN 3.362103143112093506262677817321752E-4932L /* = 0x1p-16382L */
|
||||
/* Maximum representable finite number. */
|
||||
# undef LDBL_MAX
|
||||
/* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991-1993, 1996-2007, 2009-2016 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-1993, 1996-2007, 2009-2019 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
|
||||
@ -11,7 +11,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIBC
|
||||
# include <config.h>
|
||||
@ -22,10 +22,6 @@
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#if ! defined __builtin_expect && defined __GNUC__ && __GNUC__ < 3
|
||||
# define __builtin_expect(expr, expected) (expr)
|
||||
#endif
|
||||
|
||||
#include <fnmatch.h>
|
||||
|
||||
#include <alloca.h>
|
||||
@ -69,6 +65,14 @@ extern int fnmatch (const char *pattern, const char *string, int flags);
|
||||
|
||||
#include "flexmember.h"
|
||||
|
||||
#ifndef FALLTHROUGH
|
||||
# if __GNUC__ < 7
|
||||
# define FALLTHROUGH ((void) 0)
|
||||
# else
|
||||
# define FALLTHROUGH __attribute__ ((__fallthrough__))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */
|
||||
#define NO_LEADING_PERIOD(flags) \
|
||||
((flags & (FNM_FILE_NAME | FNM_PERIOD)) == (FNM_FILE_NAME | FNM_PERIOD))
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
/* Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2016 Free
|
||||
/* Substitute for and wrapper around <fnmatch.h>.
|
||||
Copyright (C) 1991-1993, 1996-1999, 2001-2003, 2005, 2007, 2009-2019 Free
|
||||
Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU C Library.
|
||||
@ -14,16 +15,30 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FNMATCH_H
|
||||
#define _FNMATCH_H 1
|
||||
#ifndef _@GUARD_PREFIX@_FNMATCH_H
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#if @HAVE_FNMATCH_H@ && !@REPLACE_FNMATCH@
|
||||
# @INCLUDE_NEXT@ @NEXT_FNMATCH_H@
|
||||
#endif
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_FNMATCH_H
|
||||
#define _@GUARD_PREFIX@_FNMATCH_H
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
/* The definition of _GL_ARG_NONNULL is copied here. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* The definition of _GL_WARN_ON_USE is copied here. */
|
||||
|
||||
#if !@HAVE_FNMATCH_H@ || @REPLACE_FNMATCH@
|
||||
|
||||
/* We #undef these before defining them because some losing systems
|
||||
(HP-UX A.08.07 for example) define these in <unistd.h>. */
|
||||
@ -54,14 +69,42 @@ extern "C" {
|
||||
# define FNM_NOSYS (-1)
|
||||
#endif
|
||||
|
||||
/* Match NAME against the file name pattern PATTERN,
|
||||
returning zero if it matches, FNM_NOMATCH if not. */
|
||||
extern int fnmatch (const char *__pattern, const char *__name,
|
||||
int __flags)
|
||||
_GL_ARG_NONNULL ((1, 2));
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* fnmatch.h */
|
||||
|
||||
#if @GNULIB_FNMATCH@
|
||||
/* Match NAME against the file name pattern PATTERN,
|
||||
returning zero if it matches, FNM_NOMATCH if not. */
|
||||
# if @REPLACE_FNMATCH@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define fnmatch rpl_fnmatch
|
||||
# endif
|
||||
_GL_FUNCDECL_RPL (fnmatch, int,
|
||||
(const char *pattern, const char *name, int flags)
|
||||
_GL_ARG_NONNULL ((1, 2)));
|
||||
_GL_CXXALIAS_RPL (fnmatch, int,
|
||||
(const char *pattern, const char *name, int flags));
|
||||
# else
|
||||
# if !@HAVE_FNMATCH@
|
||||
_GL_FUNCDECL_SYS (fnmatch, int,
|
||||
(const char *pattern, const char *name, int flags)
|
||||
_GL_ARG_NONNULL ((1, 2)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (fnmatch, int,
|
||||
(const char *pattern, const char *name, int flags));
|
||||
# endif
|
||||
# if !GNULIB_FNMATCH_GNU && __GLIBC__ >= 2
|
||||
_GL_CXXALIASWARN (fnmatch);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef fnmatch
|
||||
# if HAVE_RAW_DECL_FNMATCH
|
||||
_GL_WARN_ON_USE (fnmatch,
|
||||
"fnmatch does not portably work - "
|
||||
"use gnulib module fnmatch for portability or gnulib module fnmatch-gnu for a glibc compatible implementation");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_FNMATCH_H */
|
||||
#endif /* _@GUARD_PREFIX@_FNMATCH_H */
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991-1993, 1996-2006, 2009-2016 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-1993, 1996-2006, 2009-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Match STRING against the file name pattern PATTERN, returning zero if
|
||||
it matches, nonzero if not. */
|
||||
@ -960,7 +960,7 @@ FCT (const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
||||
new_no_leading_period = true;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
FALLTHROUGH;
|
||||
default:
|
||||
normal_match:
|
||||
if (n == string_end || c != FOLD ((UCHAR) *n))
|
||||
@ -1114,8 +1114,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
||||
case L_('*'):
|
||||
if (FCT (p, string, string_end, no_leading_period, flags) == 0)
|
||||
return 0;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
FALLTHROUGH;
|
||||
case L_('+'):
|
||||
do
|
||||
{
|
||||
@ -1151,8 +1150,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end,
|
||||
case L_('?'):
|
||||
if (FCT (p, string, string_end, no_leading_period, flags) == 0)
|
||||
return 0;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
FALLTHROUGH;
|
||||
case L_('@'):
|
||||
do
|
||||
/* I cannot believe it but 'strcat' is actually acceptable
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Manipulating the FPU control word. -*- coding: utf-8 -*-
|
||||
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2019 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2007.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _FPUCW_H
|
||||
#define _FPUCW_H
|
||||
@ -35,15 +35,15 @@
|
||||
|
||||
The FPU control word is under control of the application, i.e. it is
|
||||
not required to be set either way by the ABI. (In fact, the i386 ABI
|
||||
http://refspecs.freestandards.org/elf/abi386-4.pdf page 3-12 = page 38
|
||||
https://www.linux-mips.org/pub/linux/mips/doc/ABI/abi386-4.pdf page 3-12 = page 38
|
||||
is not clear about it. But in any case, gcc treats the control word
|
||||
like a "preserved" register: it emits code that assumes that the control
|
||||
word is preserved across calls, and it restores the control word at the
|
||||
end of functions that modify it.)
|
||||
|
||||
See Vincent Lefèvre's page http://www.vinc17.org/research/extended.en.html
|
||||
See Vincent Lefèvre's page https://www.vinc17.net/research/extended.en.html
|
||||
for a good explanation.
|
||||
See http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html for
|
||||
See https://web.archive.org/web/20060905133417/http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html
|
||||
some argumentation which setting should be the default. */
|
||||
|
||||
/* This header file provides the following facilities:
|
||||
@ -70,12 +70,12 @@ typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
|
||||
# define FPU_PC_DOUBLE 0x200 /* glibc calls this _FPU_DOUBLE */
|
||||
# define FPU_PC_EXTENDED 0x300 /* glibc calls this _FPU_EXTENDED */
|
||||
|
||||
# define GET_FPUCW() \
|
||||
# define GET_FPUCW() __extension__ \
|
||||
({ fpucw_t _cw; \
|
||||
__asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw)); \
|
||||
_cw; \
|
||||
})
|
||||
# define SET_FPUCW(word) \
|
||||
# define SET_FPUCW(word) __extension__ \
|
||||
(void)({ fpucw_t _ncw = (word); \
|
||||
__asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw)); \
|
||||
})
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Split a double into fraction and mantissa.
|
||||
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paolo Bonzini <bonzini@gnu.org>, 2003, and
|
||||
Bruno Haible <bruno@clisp.org>, 2007. */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Split a 'long double' into fraction and mantissa.
|
||||
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007, 2009-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* fstat() replacement.
|
||||
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* If the user's config.h happens to include <sys/stat.h>, let it include only
|
||||
the system's <sys/stat.h> here, so that orig_fstat doesn't recurse to
|
||||
@ -23,54 +23,45 @@
|
||||
/* Get the original definition of fstat. It might be defined as a macro. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#if _GL_WINDOWS_64_BIT_ST_SIZE
|
||||
# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
|
||||
# define stat _stati64
|
||||
# undef fstat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
|
||||
# define fstat _fstati64
|
||||
#endif
|
||||
#undef __need_system_sys_stat_h
|
||||
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
# define WINDOWS_NATIVE
|
||||
#endif
|
||||
|
||||
#if !defined WINDOWS_NATIVE
|
||||
|
||||
static int
|
||||
orig_fstat (int fd, struct stat *buf)
|
||||
{
|
||||
return fstat (fd, buf);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Specification. */
|
||||
#ifdef __osf__
|
||||
/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
|
||||
eliminates this include because of the preliminary #include <sys/stat.h>
|
||||
above. */
|
||||
#include "sys/stat.h"
|
||||
# include "sys/stat.h"
|
||||
#else
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "stat-time.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
# include "msvc-inval.h"
|
||||
#endif
|
||||
|
||||
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
static int
|
||||
fstat_nothrow (int fd, struct stat *buf)
|
||||
{
|
||||
int result;
|
||||
|
||||
TRY_MSVC_INVAL
|
||||
{
|
||||
result = orig_fstat (fd, buf);
|
||||
}
|
||||
CATCH_MSVC_INVAL
|
||||
{
|
||||
result = -1;
|
||||
errno = EBADF;
|
||||
}
|
||||
DONE_MSVC_INVAL;
|
||||
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
# define fstat_nothrow orig_fstat
|
||||
#ifdef WINDOWS_NATIVE
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
# if GNULIB_MSVC_NOTHROW
|
||||
# include "msvc-nothrow.h"
|
||||
# else
|
||||
# include <io.h>
|
||||
# endif
|
||||
# include "stat-w32.h"
|
||||
#endif
|
||||
|
||||
int
|
||||
@ -84,5 +75,20 @@ rpl_fstat (int fd, struct stat *buf)
|
||||
return stat (name, buf);
|
||||
#endif
|
||||
|
||||
return fstat_nothrow (fd, buf);
|
||||
#ifdef WINDOWS_NATIVE
|
||||
/* Fill the fields ourselves, because the original fstat function returns
|
||||
values for st_atime, st_mtime, st_ctime that depend on the current time
|
||||
zone. See
|
||||
<https://lists.gnu.org/r/bug-gnulib/2017-04/msg00134.html> */
|
||||
HANDLE h = (HANDLE) _get_osfhandle (fd);
|
||||
|
||||
if (h == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
return _gl_fstat_by_handle (h, NULL, buf);
|
||||
#else
|
||||
return stat_time_normalize (orig_fstat (fd, buf), buf);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Work around an fstatat bug on Solaris 9.
|
||||
|
||||
Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2006, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert and Jim Meyering. */
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#include <sys/stat.h>
|
||||
#undef __need_system_sys_stat_h
|
||||
|
||||
#if HAVE_FSTATAT
|
||||
#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG
|
||||
static int
|
||||
orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
|
||||
{
|
||||
@ -36,13 +36,20 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __osf__
|
||||
/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
|
||||
eliminates this include because of the preliminary #include <sys/stat.h>
|
||||
above. */
|
||||
#include "sys/stat.h"
|
||||
# include "sys/stat.h"
|
||||
#else
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "stat-time.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG
|
||||
@ -51,6 +58,12 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
|
||||
# define LSTAT_FOLLOWS_SLASHED_SYMLINK 0
|
||||
# endif
|
||||
|
||||
static int
|
||||
normal_fstatat (int fd, char const *file, struct stat *st, int flag)
|
||||
{
|
||||
return stat_time_normalize (orig_fstatat (fd, file, st, flag), st);
|
||||
}
|
||||
|
||||
/* fstatat should always follow symbolic links that end in /, but on
|
||||
Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified.
|
||||
Likewise, trailing slash on a non-directory should be an error.
|
||||
@ -63,7 +76,7 @@ orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
|
||||
int
|
||||
rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
|
||||
{
|
||||
int result = orig_fstatat (fd, file, st, flag);
|
||||
int result = normal_fstatat (fd, file, st, flag);
|
||||
size_t len;
|
||||
|
||||
if (LSTAT_FOLLOWS_SLASHED_SYMLINK || result != 0)
|
||||
@ -79,7 +92,7 @@ rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
|
||||
errno = ENOTDIR;
|
||||
return -1;
|
||||
}
|
||||
result = orig_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
|
||||
result = normal_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
|
||||
}
|
||||
/* Fix stat behavior. */
|
||||
if (result == 0 && !S_ISDIR (st->st_mode) && file[len - 1] == '/')
|
||||
@ -111,7 +124,7 @@ stat_func (char const *name, struct stat *st)
|
||||
# endif
|
||||
|
||||
/* Replacement for Solaris' function by the same name.
|
||||
<http://www.google.com/search?q=fstatat+site:docs.sun.com>
|
||||
<https://www.google.com/search?q=fstatat+site:docs.oracle.com>
|
||||
First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
|
||||
Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd.
|
||||
If either the save_cwd or the restore_cwd fails (relatively unlikely),
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2011-2019 Free Software Foundation, Inc.
|
||||
This file is part of gnulib.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -115,10 +115,15 @@ rpl_getcwd (char *buf, size_t size)
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Trim to fit, if possible. */
|
||||
result = realloc (buf, strlen (buf) + 1);
|
||||
if (!result)
|
||||
result = buf;
|
||||
/* Here result == buf. */
|
||||
/* Shrink result before returning it. */
|
||||
size_t actual_size = strlen (result) + 1;
|
||||
if (actual_size < size)
|
||||
{
|
||||
char *shrinked_result = realloc (result, actual_size);
|
||||
if (shrinked_result != NULL)
|
||||
result = shrinked_result;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991-1999, 2004-2016 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-1999, 2004-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#if !_LIBC
|
||||
# include <config.h>
|
||||
@ -79,6 +79,10 @@
|
||||
# define MATCHING_INO(dp, ino) true
|
||||
#endif
|
||||
|
||||
#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
# include "msvc-inval.h"
|
||||
#endif
|
||||
|
||||
#if !_LIBC
|
||||
# define __getcwd rpl_getcwd
|
||||
# define __lstat lstat
|
||||
@ -100,6 +104,34 @@
|
||||
# undef closedir
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
static char *
|
||||
getcwd_nothrow (char *buf, size_t size)
|
||||
{
|
||||
char *result;
|
||||
|
||||
TRY_MSVC_INVAL
|
||||
{
|
||||
result = _getcwd (buf, size);
|
||||
}
|
||||
CATCH_MSVC_INVAL
|
||||
{
|
||||
result = NULL;
|
||||
errno = ERANGE;
|
||||
}
|
||||
DONE_MSVC_INVAL;
|
||||
|
||||
return result;
|
||||
}
|
||||
# else
|
||||
# define getcwd_nothrow _getcwd
|
||||
# endif
|
||||
# define getcwd_system getcwd_nothrow
|
||||
#else
|
||||
# define getcwd_system getcwd
|
||||
#endif
|
||||
|
||||
/* Get the name of the current working directory, and put it in SIZE
|
||||
bytes of BUF. Returns NULL if the directory couldn't be determined or
|
||||
SIZE was too small. If successful, returns BUF. In GNU, if BUF is
|
||||
@ -155,7 +187,7 @@ __getcwd (char *buf, size_t size)
|
||||
this wrong result with errno = 0. */
|
||||
|
||||
# undef getcwd
|
||||
dir = getcwd (buf, size);
|
||||
dir = getcwd_system (buf, size);
|
||||
if (dir || (size && errno == ERANGE))
|
||||
return dir;
|
||||
|
||||
@ -166,7 +198,7 @@ __getcwd (char *buf, size_t size)
|
||||
if (errno == EINVAL && buf == NULL && size == 0)
|
||||
{
|
||||
char big_buffer[BIG_FILE_NAME_LENGTH + 1];
|
||||
dir = getcwd (big_buffer, sizeof big_buffer);
|
||||
dir = getcwd_system (big_buffer, sizeof big_buffer);
|
||||
if (dir)
|
||||
return strdup (dir);
|
||||
}
|
||||
@ -411,7 +443,7 @@ __getcwd (char *buf, size_t size)
|
||||
|
||||
if (size == 0)
|
||||
/* Ensure that the buffer is only as large as necessary. */
|
||||
buf = realloc (dir, used);
|
||||
buf = (used < allocated ? realloc (dir, used) : dir);
|
||||
|
||||
if (buf == NULL)
|
||||
/* Either buf was NULL all along, or 'realloc' failed but
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* getdtablesize() function for platforms that don't have it.
|
||||
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||
/* getdtablesize() function: Return maximum possible file descriptor value + 1.
|
||||
Copyright (C) 2008-2019 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2008.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -13,18 +13,20 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* Specification. */
|
||||
#include <unistd.h>
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
|
||||
# include <stdio.h>
|
||||
|
||||
# include "msvc-inval.h"
|
||||
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
# include "msvc-inval.h"
|
||||
# endif
|
||||
|
||||
# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
|
||||
static int
|
||||
@ -44,7 +46,8 @@ _setmaxstdio_nothrow (int newmax)
|
||||
|
||||
return result;
|
||||
}
|
||||
# define _setmaxstdio _setmaxstdio_nothrow
|
||||
# else
|
||||
# define _setmaxstdio_nothrow _setmaxstdio
|
||||
# endif
|
||||
|
||||
/* Cache for the previous getdtablesize () result. Safe to cache because
|
||||
@ -76,9 +79,9 @@ getdtablesize (void)
|
||||
freed when we call _setmaxstdio with the original value. */
|
||||
int orig_max_stdio = _getmaxstdio ();
|
||||
unsigned int bound;
|
||||
for (bound = 0x10000; _setmaxstdio (bound) < 0; bound = bound / 2)
|
||||
for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2)
|
||||
;
|
||||
_setmaxstdio (orig_max_stdio);
|
||||
_setmaxstdio_nothrow (orig_max_stdio);
|
||||
dtablesize = bound;
|
||||
}
|
||||
return dtablesize;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Provide a working getlogin_r for systems which lack it.
|
||||
|
||||
Copyright (C) 2005-2007, 2010-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2007, 2010-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert, Derek Price, and Bruno Haible. */
|
||||
|
||||
@ -25,7 +25,9 @@
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
#include "malloca.h"
|
||||
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
# include <windows.h>
|
||||
#else
|
||||
@ -39,7 +41,7 @@ int
|
||||
getlogin_r (char *name, size_t size)
|
||||
{
|
||||
#undef getlogin_r
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
/* Native Windows platform. */
|
||||
DWORD sz;
|
||||
|
||||
@ -63,9 +65,27 @@ getlogin_r (char *name, size_t size)
|
||||
/* Platform with a getlogin_r() function. */
|
||||
int ret = getlogin_r (name, size);
|
||||
|
||||
if (ret == 0 && memchr (name, '\0', size) == NULL)
|
||||
/* name contains a truncated result. */
|
||||
return ERANGE;
|
||||
if (ret == 0)
|
||||
{
|
||||
const char *nul = memchr (name, '\0', size);
|
||||
if (nul == NULL)
|
||||
/* name contains a truncated result. */
|
||||
return ERANGE;
|
||||
if (size > 0 && nul == name + size - 1)
|
||||
{
|
||||
/* strlen(name) == size-1. Determine whether the untruncated result
|
||||
would have had length size-1 or size. */
|
||||
char *room = (char *) malloca (size + 1);
|
||||
if (room == NULL)
|
||||
return ENOMEM;
|
||||
ret = getlogin_r (room, size + 1);
|
||||
/* The untruncated result should be the same as in the first call. */
|
||||
if (ret == 0 && memcmp (name, room, size) != 0)
|
||||
/* The untruncated result would have been different. */
|
||||
ret = ERANGE;
|
||||
freea (room);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
#else
|
||||
/* Platform with a getlogin() function. */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Program name management.
|
||||
Copyright (C) 2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2016-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -43,6 +43,14 @@
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#ifdef __sgi
|
||||
# include <string.h>
|
||||
# include <unistd.h>
|
||||
# include <stdio.h>
|
||||
# include <fcntl.h>
|
||||
# include <sys/procfs.h>
|
||||
#endif
|
||||
|
||||
#include "dirname.h"
|
||||
|
||||
#ifndef HAVE_GETPROGNAME /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
|
||||
@ -56,17 +64,17 @@ getprogname (void)
|
||||
/* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
|
||||
return last_component (program_invocation_name);
|
||||
# elif HAVE_GETEXECNAME /* Solaris */
|
||||
/* http://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */
|
||||
/* https://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */
|
||||
const char *p = getexecname ();
|
||||
if (!p)
|
||||
p = "?";
|
||||
return last_component (p);
|
||||
# elif HAVE_DECL___ARGV /* mingw, MSVC */
|
||||
/* https://msdn.microsoft.com/en-us/library/dn727674.aspx */
|
||||
/* https://docs.microsoft.com/en-us/cpp/c-runtime-library/argc-argv-wargv */
|
||||
const char *p = __argv && __argv[0] ? __argv[0] : "?";
|
||||
return last_component (p);
|
||||
# elif HAVE_VAR___PROGNAME /* OpenBSD, QNX */
|
||||
/* http://man.openbsd.org/style.9 */
|
||||
# elif HAVE_VAR___PROGNAME /* OpenBSD, Android, QNX */
|
||||
/* https://man.openbsd.org/style.9 */
|
||||
/* http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html */
|
||||
/* Be careful to declare this only when we absolutely need it
|
||||
(OpenBSD 5.1), rather than when it's available. Otherwise,
|
||||
@ -74,12 +82,15 @@ getprogname (void)
|
||||
malfunction (have zero length) with Fedora 25's glibc. */
|
||||
extern char *__progname;
|
||||
const char *p = __progname;
|
||||
# if defined __ANDROID__
|
||||
return last_component (p);
|
||||
# else
|
||||
return p && p[0] ? p : "?";
|
||||
# endif
|
||||
# elif _AIX /* AIX */
|
||||
/* Idea by Bastien ROUCARIÈS,
|
||||
http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00095.html
|
||||
Reference: http://
|
||||
ibm.biz/knowctr#ssw_aix_53/com.ibm.aix.basetechref/doc/basetrf1/getprocs.htm
|
||||
https://lists.gnu.org/r/bug-gnulib/2010-12/msg00095.html
|
||||
Reference: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/getprocs.htm
|
||||
*/
|
||||
static char *p;
|
||||
static int first = 1;
|
||||
@ -103,9 +114,73 @@ getprogname (void)
|
||||
first = 0;
|
||||
pid_t pid = getpid ();
|
||||
struct pst_status status;
|
||||
p = (0 < pstat_getproc (&status, sizeof status, 0, pid)
|
||||
? strdup (status.pst_ucomm)
|
||||
: NULL);
|
||||
if (pstat_getproc (&status, sizeof status, 0, pid) > 0)
|
||||
{
|
||||
char *ucomm = status.pst_ucomm;
|
||||
char *cmd = status.pst_cmd;
|
||||
if (strlen (ucomm) < PST_UCOMMLEN - 1)
|
||||
p = ucomm;
|
||||
else
|
||||
{
|
||||
/* ucomm is truncated to length PST_UCOMMLEN - 1.
|
||||
Look at cmd instead. */
|
||||
char *space = strchr (cmd, ' ');
|
||||
if (space != NULL)
|
||||
*space = '\0';
|
||||
p = strrchr (cmd, '/');
|
||||
if (p != NULL)
|
||||
p++;
|
||||
else
|
||||
p = cmd;
|
||||
if (strlen (p) > PST_UCOMMLEN - 1
|
||||
&& memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
|
||||
/* p is less truncated than ucomm. */
|
||||
;
|
||||
else
|
||||
p = ucomm;
|
||||
}
|
||||
p = strdup (p);
|
||||
}
|
||||
else
|
||||
{
|
||||
# if !defined __LP64__
|
||||
/* Support for 32-bit programs running in 64-bit HP-UX.
|
||||
The documented way to do this is to use the same source code
|
||||
as above, but in a compilation unit where '#define _PSTAT64 1'
|
||||
is in effect. I prefer a single compilation unit; the struct
|
||||
size and the offsets are not going to change. */
|
||||
char status64[1216];
|
||||
if (__pstat_getproc64 (status64, sizeof status64, 0, pid) > 0)
|
||||
{
|
||||
char *ucomm = status64 + 288;
|
||||
char *cmd = status64 + 168;
|
||||
if (strlen (ucomm) < PST_UCOMMLEN - 1)
|
||||
p = ucomm;
|
||||
else
|
||||
{
|
||||
/* ucomm is truncated to length PST_UCOMMLEN - 1.
|
||||
Look at cmd instead. */
|
||||
char *space = strchr (cmd, ' ');
|
||||
if (space != NULL)
|
||||
*space = '\0';
|
||||
p = strrchr (cmd, '/');
|
||||
if (p != NULL)
|
||||
p++;
|
||||
else
|
||||
p = cmd;
|
||||
if (strlen (p) > PST_UCOMMLEN - 1
|
||||
&& memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
|
||||
/* p is less truncated than ucomm. */
|
||||
;
|
||||
else
|
||||
p = ucomm;
|
||||
}
|
||||
p = strdup (p);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
p = NULL;
|
||||
}
|
||||
if (!p)
|
||||
p = "?";
|
||||
}
|
||||
@ -143,9 +218,43 @@ getprogname (void)
|
||||
free (buf.ps_pathptr);
|
||||
}
|
||||
return p;
|
||||
# elif defined __sgi /* IRIX */
|
||||
char filename[50];
|
||||
int fd;
|
||||
|
||||
sprintf (filename, "/proc/pinfo/%d", (int) getpid ());
|
||||
fd = open (filename, O_RDONLY);
|
||||
if (0 <= fd)
|
||||
{
|
||||
prpsinfo_t buf;
|
||||
int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf);
|
||||
close (fd);
|
||||
if (ioctl_ok)
|
||||
{
|
||||
char *name = buf.pr_fname;
|
||||
size_t namesize = sizeof buf.pr_fname;
|
||||
/* It may not be NUL-terminated. */
|
||||
char *namenul = memchr (name, '\0', namesize);
|
||||
size_t namelen = namenul ? namenul - name : namesize;
|
||||
char *namecopy = malloc (namelen + 1);
|
||||
if (namecopy)
|
||||
{
|
||||
namecopy[namelen] = '\0';
|
||||
return memcpy (namecopy, name, namelen);
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
# else
|
||||
# error "getprogname module not ported to this OS"
|
||||
# endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Hey Emacs!
|
||||
* Local Variables:
|
||||
* coding: utf-8
|
||||
* End:
|
||||
*/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Program name management.
|
||||
Copyright (C) 2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2016-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GL_GETPROGNAME_H
|
||||
#define _GL_GETPROGNAME_H
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
|
||||
Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2019 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -13,13 +13,14 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIBGETTEXT_H
|
||||
#define _LIBGETTEXT_H 1
|
||||
|
||||
/* NLS can be disabled through the configure --disable-nls option. */
|
||||
#if ENABLE_NLS
|
||||
/* NLS can be disabled through the configure --disable-nls option
|
||||
or through "#define ENABLE NLS 0" before including this file. */
|
||||
#if defined ENABLE_NLS && ENABLE_NLS
|
||||
|
||||
/* Get declarations of GNU message catalog functions. */
|
||||
# include <libintl.h>
|
||||
@ -183,8 +184,16 @@ npgettext_aux (const char *domain,
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
|
||||
/* || __STDC_VERSION__ >= 199901L */ )
|
||||
/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported.
|
||||
This relates to the -Wvla and -Wvla-larger-than warnings, enabled in
|
||||
the default GCC many warnings set. This allows programs to disable use
|
||||
of VLAs, which may be unintended, or may be awkward to support portably,
|
||||
or may have security implications due to non-deterministic stack usage. */
|
||||
|
||||
#if (!defined GNULIB_NO_VLA \
|
||||
&& (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
|
||||
/* || (__STDC_VERSION__ == 199901L && !defined __HP_cc)
|
||||
|| (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ ))
|
||||
# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
|
||||
#else
|
||||
# define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Provide gettimeofday for systems that don't have it or for which it's broken.
|
||||
|
||||
Copyright (C) 2001-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2003, 2005-2007, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* written by Jim Meyering */
|
||||
|
||||
@ -24,93 +24,99 @@
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if HAVE_SYS_TIMEB_H
|
||||
# include <sys/timeb.h>
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
# define WINDOWS_NATIVE
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME
|
||||
#include "localtime-buffer.h"
|
||||
|
||||
/* Work around the bug in some systems whereby gettimeofday clobbers
|
||||
the static buffer that localtime uses for its return value. The
|
||||
gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has
|
||||
this problem. The tzset replacement is necessary for at least
|
||||
Solaris 2.5, 2.5.1, and 2.6. */
|
||||
#ifdef WINDOWS_NATIVE
|
||||
|
||||
static struct tm tm_zero_buffer;
|
||||
static struct tm *localtime_buffer_addr = &tm_zero_buffer;
|
||||
/* Avoid warnings from gcc -Wcast-function-type. */
|
||||
# define GetProcAddress \
|
||||
(void *) GetProcAddress
|
||||
|
||||
# undef localtime
|
||||
extern struct tm *localtime (time_t const *);
|
||||
/* GetSystemTimePreciseAsFileTime was introduced only in Windows 8. */
|
||||
typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime);
|
||||
static GetSystemTimePreciseAsFileTimeFuncType GetSystemTimePreciseAsFileTimeFunc = NULL;
|
||||
static BOOL initialized = FALSE;
|
||||
|
||||
# undef gmtime
|
||||
extern struct tm *gmtime (time_t const *);
|
||||
|
||||
/* This is a wrapper for localtime. It is used only on systems for which
|
||||
gettimeofday clobbers the static buffer used for localtime's result.
|
||||
|
||||
On the first call, record the address of the static buffer that
|
||||
localtime uses for its result. */
|
||||
|
||||
struct tm *
|
||||
rpl_localtime (time_t const *timep)
|
||||
static void
|
||||
initialize (void)
|
||||
{
|
||||
struct tm *tm = localtime (timep);
|
||||
|
||||
if (localtime_buffer_addr == &tm_zero_buffer)
|
||||
localtime_buffer_addr = tm;
|
||||
|
||||
return tm;
|
||||
HMODULE kernel32 = LoadLibrary ("kernel32.dll");
|
||||
if (kernel32 != NULL)
|
||||
{
|
||||
GetSystemTimePreciseAsFileTimeFunc =
|
||||
(GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");
|
||||
}
|
||||
initialized = TRUE;
|
||||
}
|
||||
|
||||
/* Same as above, since gmtime and localtime use the same buffer. */
|
||||
struct tm *
|
||||
rpl_gmtime (time_t const *timep)
|
||||
{
|
||||
struct tm *tm = gmtime (timep);
|
||||
|
||||
if (localtime_buffer_addr == &tm_zero_buffer)
|
||||
localtime_buffer_addr = tm;
|
||||
|
||||
return tm;
|
||||
}
|
||||
|
||||
#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */
|
||||
|
||||
#if TZSET_CLOBBERS_LOCALTIME
|
||||
|
||||
# undef tzset
|
||||
extern void tzset (void);
|
||||
|
||||
/* This is a wrapper for tzset, for systems on which tzset may clobber
|
||||
the static buffer used for localtime's result. */
|
||||
void
|
||||
rpl_tzset (void)
|
||||
{
|
||||
/* Save and restore the contents of the buffer used for localtime's
|
||||
result around the call to tzset. */
|
||||
struct tm save = *localtime_buffer_addr;
|
||||
tzset ();
|
||||
*localtime_buffer_addr = save;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This is a wrapper for gettimeofday. It is used only on systems
|
||||
that lack this function, or whose implementation of this function
|
||||
causes problems. */
|
||||
causes problems.
|
||||
Work around the bug in some systems whereby gettimeofday clobbers
|
||||
the static buffer that localtime uses for its return value. The
|
||||
gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has
|
||||
this problem. */
|
||||
|
||||
int
|
||||
gettimeofday (struct timeval *restrict tv, void *restrict tz)
|
||||
{
|
||||
#undef gettimeofday
|
||||
#if HAVE_GETTIMEOFDAY
|
||||
# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
|
||||
#ifdef WINDOWS_NATIVE
|
||||
|
||||
/* On native Windows, there are two ways to get the current time:
|
||||
GetSystemTimeAsFileTime
|
||||
<https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>
|
||||
or
|
||||
GetSystemTimePreciseAsFileTime
|
||||
<https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>.
|
||||
GetSystemTimeAsFileTime produces values that jump by increments of
|
||||
15.627 milliseconds (!) on average.
|
||||
Whereas GetSystemTimePreciseAsFileTime values usually jump by 1 or 2
|
||||
microseconds.
|
||||
More discussion on this topic:
|
||||
<http://www.windowstimestamp.com/description>. */
|
||||
FILETIME current_time;
|
||||
|
||||
if (!initialized)
|
||||
initialize ();
|
||||
if (GetSystemTimePreciseAsFileTimeFunc != NULL)
|
||||
GetSystemTimePreciseAsFileTimeFunc (¤t_time);
|
||||
else
|
||||
GetSystemTimeAsFileTime (¤t_time);
|
||||
|
||||
/* Convert from FILETIME to 'struct timeval'. */
|
||||
/* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
|
||||
ULONGLONG since_1601 =
|
||||
((ULONGLONG) current_time.dwHighDateTime << 32)
|
||||
| (ULONGLONG) current_time.dwLowDateTime;
|
||||
/* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89 leap
|
||||
years, in total 134774 days. */
|
||||
ULONGLONG since_1970 =
|
||||
since_1601 - (ULONGLONG) 134774 * (ULONGLONG) 86400 * (ULONGLONG) 10000000;
|
||||
ULONGLONG microseconds_since_1970 = since_1970 / (ULONGLONG) 10;
|
||||
tv->tv_sec = microseconds_since_1970 / (ULONGLONG) 1000000;
|
||||
tv->tv_usec = microseconds_since_1970 % (ULONGLONG) 1000000;
|
||||
|
||||
return 0;
|
||||
|
||||
#else
|
||||
|
||||
# if HAVE_GETTIMEOFDAY
|
||||
# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
|
||||
/* Save and restore the contents of the buffer used for localtime's
|
||||
result around the call to gettimeofday. */
|
||||
struct tm save = *localtime_buffer_addr;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if defined timeval /* 'struct timeval' overridden by gnulib? */
|
||||
# undef timeval
|
||||
# if defined timeval /* 'struct timeval' overridden by gnulib? */
|
||||
# undef timeval
|
||||
struct timeval otv;
|
||||
int result = gettimeofday (&otv, (struct timezone *) tz);
|
||||
if (result == 0)
|
||||
@ -118,25 +124,16 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz)
|
||||
tv->tv_sec = otv.tv_sec;
|
||||
tv->tv_usec = otv.tv_usec;
|
||||
}
|
||||
# else
|
||||
# else
|
||||
int result = gettimeofday (tv, (struct timezone *) tz);
|
||||
# endif
|
||||
# endif
|
||||
|
||||
# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
|
||||
# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
|
||||
*localtime_buffer_addr = save;
|
||||
# endif
|
||||
# endif
|
||||
|
||||
return result;
|
||||
|
||||
#else
|
||||
|
||||
# if HAVE__FTIME
|
||||
|
||||
struct _timeb timebuf;
|
||||
_ftime (&timebuf);
|
||||
tv->tv_sec = timebuf.time;
|
||||
tv->tv_usec = timebuf.millitm * 1000;
|
||||
|
||||
# else
|
||||
|
||||
# if !defined OK_TO_USE_1S_CLOCK
|
||||
@ -146,9 +143,8 @@ gettimeofday (struct timeval *restrict tv, void *restrict tz)
|
||||
tv->tv_sec = time (NULL);
|
||||
tv->tv_usec = 0;
|
||||
|
||||
# endif
|
||||
|
||||
return 0;
|
||||
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
/* Copyright (C) 1991-1992, 1995-1998, 2000-2001, 2004-2007, 2009-2016 Free
|
||||
Software Foundation, Inc.
|
||||
/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
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 3 of the License, or
|
||||
(at your option) any later version.
|
||||
The GNU C Library 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
The GNU C Library 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.
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
You should have received a copy of the GNU General Public
|
||||
License along with the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GLOB_H
|
||||
#define _GLOB_H 1
|
||||
@ -22,42 +22,10 @@
|
||||
# include <sys/cdefs.h>
|
||||
#endif
|
||||
|
||||
/* GCC 2.95 and later have "__restrict"; C99 compilers have
|
||||
"restrict", and "configure" may have defined "restrict".
|
||||
Other compilers use __restrict, __restrict__, and _Restrict, and
|
||||
'configure' might #define 'restrict' to those words, so pick a
|
||||
different name. */
|
||||
#ifndef _Restrict_
|
||||
# if 199901L <= __STDC_VERSION__
|
||||
# define _Restrict_ restrict
|
||||
# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
|
||||
# define _Restrict_ __restrict
|
||||
# else
|
||||
# define _Restrict_
|
||||
# endif
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* We need 'size_t' for the following definitions. */
|
||||
#ifndef __size_t
|
||||
# if defined __GNUC__ && __GNUC__ >= 2
|
||||
typedef __SIZE_TYPE__ __size_t;
|
||||
# ifdef __USE_XOPEN
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
# endif
|
||||
# else
|
||||
# include <stddef.h>
|
||||
# ifndef __size_t
|
||||
# define __size_t size_t
|
||||
# endif
|
||||
# endif
|
||||
#else
|
||||
/* The GNU CC stddef.h version defines __size_t as empty. We need a real
|
||||
definition. */
|
||||
# undef __size_t
|
||||
# define __size_t size_t
|
||||
#endif
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
/* Bits set in the FLAGS argument to 'glob'. */
|
||||
#define GLOB_ERR (1 << 0)/* Return on read errors. */
|
||||
@ -69,7 +37,7 @@ typedef __SIZE_TYPE__ size_t;
|
||||
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
|
||||
#define GLOB_PERIOD (1 << 7)/* Leading '.' can be matched by metachars. */
|
||||
|
||||
#if !defined __USE_POSIX2 || defined __USE_BSD || defined __USE_GNU
|
||||
#if !defined __USE_POSIX2 || defined __USE_MISC
|
||||
# define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
|
||||
# define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
|
||||
# define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
|
||||
@ -105,9 +73,9 @@ struct stat;
|
||||
#endif
|
||||
typedef struct
|
||||
{
|
||||
__size_t gl_pathc; /* Count of paths matched by the pattern. */
|
||||
size_t gl_pathc; /* Count of paths matched by the pattern. */
|
||||
char **gl_pathv; /* List of matched pathnames. */
|
||||
__size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */
|
||||
size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */
|
||||
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
@ -120,23 +88,23 @@ typedef struct
|
||||
#endif
|
||||
void *(*gl_opendir) (const char *);
|
||||
#ifdef __USE_GNU
|
||||
int (*gl_lstat) (const char *_Restrict_, struct stat *_Restrict_);
|
||||
int (*gl_stat) (const char *_Restrict_, struct stat *_Restrict_);
|
||||
int (*gl_lstat) (const char *__restrict, struct stat *__restrict);
|
||||
int (*gl_stat) (const char *__restrict, struct stat *__restrict);
|
||||
#else
|
||||
int (*gl_lstat) (const char *_Restrict_, void *_Restrict_);
|
||||
int (*gl_stat) (const char *_Restrict_, void *_Restrict_);
|
||||
int (*gl_lstat) (const char *__restrict, void *__restrict);
|
||||
int (*gl_stat) (const char *__restrict, void *__restrict);
|
||||
#endif
|
||||
} glob_t;
|
||||
|
||||
#if defined __USE_LARGEFILE64 && !defined __GLOB_GNULIB
|
||||
#ifdef __USE_LARGEFILE64
|
||||
# ifdef __USE_GNU
|
||||
struct stat64;
|
||||
# endif
|
||||
typedef struct
|
||||
{
|
||||
__size_t gl_pathc;
|
||||
size_t gl_pathc;
|
||||
char **gl_pathv;
|
||||
__size_t gl_offs;
|
||||
size_t gl_offs;
|
||||
int gl_flags;
|
||||
|
||||
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
|
||||
@ -149,20 +117,15 @@ typedef struct
|
||||
# endif
|
||||
void *(*gl_opendir) (const char *);
|
||||
# ifdef __USE_GNU
|
||||
int (*gl_lstat) (const char *_Restrict_, struct stat64 *_Restrict_);
|
||||
int (*gl_stat) (const char *_Restrict_, struct stat64 *_Restrict_);
|
||||
int (*gl_lstat) (const char *__restrict, struct stat64 *__restrict);
|
||||
int (*gl_stat) (const char *__restrict, struct stat64 *__restrict);
|
||||
# else
|
||||
int (*gl_lstat) (const char *_Restrict_, void *_Restrict_);
|
||||
int (*gl_stat) (const char *_Restrict_, void *_Restrict_);
|
||||
int (*gl_lstat) (const char *__restrict, void *__restrict);
|
||||
int (*gl_stat) (const char *__restrict, void *__restrict);
|
||||
# endif
|
||||
} glob64_t;
|
||||
#endif
|
||||
|
||||
#if __USE_FILE_OFFSET64 && __GNUC__ < 2 && !defined __GLOB_GNULIB
|
||||
# define glob glob64
|
||||
# define globfree globfree64
|
||||
#endif
|
||||
|
||||
/* Do glob searching for PATTERN, placing results in PGLOB.
|
||||
The bits defined above may be set in FLAGS.
|
||||
If a directory cannot be opened or read and ERRFUNC is not nil,
|
||||
@ -171,29 +134,28 @@ typedef struct
|
||||
'glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
|
||||
If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
|
||||
Otherwise, 'glob' returns zero. */
|
||||
#if !defined __USE_FILE_OFFSET64 || __GNUC__ < 2 || defined __GLOB_GNULIB
|
||||
extern int glob (const char *_Restrict_ __pattern, int __flags,
|
||||
#if !defined __USE_FILE_OFFSET64 || defined __GLOB_GNULIB
|
||||
extern int glob (const char *__restrict __pattern, int __flags,
|
||||
int (*__errfunc) (const char *, int),
|
||||
glob_t *_Restrict_ __pglob) __THROW _GL_ARG_NONNULL ((1, 4));
|
||||
glob_t *__restrict __pglob) __THROW;
|
||||
|
||||
/* Free storage allocated in PGLOB by a previous 'glob' call. */
|
||||
extern void globfree (glob_t *__pglob) __THROW _GL_ARG_NONNULL ((1));
|
||||
extern void globfree (glob_t *__pglob) __THROW;
|
||||
#else
|
||||
extern int __REDIRECT_NTH (glob, (const char *_Restrict_ __pattern,
|
||||
extern int __REDIRECT_NTH (glob, (const char *__restrict __pattern,
|
||||
int __flags,
|
||||
int (*__errfunc) (const char *, int),
|
||||
glob_t *_Restrict_ __pglob), glob64);
|
||||
glob_t *__restrict __pglob), glob64);
|
||||
|
||||
extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
|
||||
#endif
|
||||
|
||||
#if defined __USE_LARGEFILE64 && !defined __GLOB_GNULIB
|
||||
extern int glob64 (const char *_Restrict_ __pattern, int __flags,
|
||||
#ifdef __USE_LARGEFILE64
|
||||
extern int glob64 (const char *__restrict __pattern, int __flags,
|
||||
int (*__errfunc) (const char *, int),
|
||||
glob64_t *_Restrict_ __pglob)
|
||||
__THROW _GL_ARG_NONNULL ((1, 4));
|
||||
glob64_t *__restrict __pglob) __THROW;
|
||||
|
||||
extern void globfree64 (glob64_t *__pglob) __THROW _GL_ARG_NONNULL ((1));
|
||||
extern void globfree64 (glob64_t *__pglob) __THROW;
|
||||
#endif
|
||||
|
||||
|
||||
@ -203,8 +165,7 @@ extern void globfree64 (glob64_t *__pglob) __THROW _GL_ARG_NONNULL ((1));
|
||||
|
||||
This function is not part of the interface specified by POSIX.2
|
||||
but several programs want to use it. */
|
||||
extern int glob_pattern_p (const char *__pattern, int __quote)
|
||||
__THROW _GL_ARG_NONNULL ((1));
|
||||
extern int glob_pattern_p (const char *__pattern, int __quote) __THROW;
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
/* glob.h -- Find a path matching a pattern.
|
||||
|
||||
Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2007, 2009-2019 Free Software Foundation, Inc.
|
||||
|
||||
Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU>
|
||||
|
||||
@ -15,37 +15,22 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GL_GLOB_H
|
||||
#define _GL_GLOB_H
|
||||
#ifndef _@GUARD_PREFIX@_GLOB_H
|
||||
|
||||
#if @HAVE_SYS_CDEFS_H@
|
||||
# include <sys/cdefs.h>
|
||||
#if __GNUC__ >= 3
|
||||
@PRAGMA_SYSTEM_HEADER@
|
||||
#endif
|
||||
@PRAGMA_COLUMNS@
|
||||
|
||||
/* The include_next requires a split double-inclusion guard. */
|
||||
#if @HAVE_GLOB_H@ && !@REPLACE_GLOB@
|
||||
# @INCLUDE_NEXT@ @NEXT_GLOB_H@
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
/* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64".
|
||||
Make sure this definition is seen before glob-libc.h defines types that
|
||||
rely on 'struct stat'. */
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifndef __BEGIN_DECLS
|
||||
# ifdef __cplusplus
|
||||
# define __BEGIN_DECLS extern "C" {
|
||||
# define __END_DECLS }
|
||||
# else
|
||||
# define __BEGIN_DECLS
|
||||
# define __END_DECLS
|
||||
# endif
|
||||
#endif
|
||||
#ifndef __THROW
|
||||
# define __THROW
|
||||
#endif
|
||||
#ifndef __THROWNL
|
||||
# define __THROWNL
|
||||
#endif
|
||||
#ifndef _@GUARD_PREFIX@_GLOB_H
|
||||
#define _@GUARD_PREFIX@_GLOB_H
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
|
||||
@ -53,41 +38,143 @@
|
||||
|
||||
/* The definition of _GL_WARN_ON_USE is copied here. */
|
||||
|
||||
#ifndef __size_t
|
||||
# define __size_t size_t
|
||||
#endif
|
||||
#ifndef __USE_GNU
|
||||
# define __USE_GNU 1
|
||||
#endif
|
||||
|
||||
|
||||
#define glob rpl_glob
|
||||
#define globfree rpl_globfree
|
||||
#define glob_pattern_p rpl_glob_pattern_p
|
||||
|
||||
#define __GLOB_GNULIB 1
|
||||
|
||||
/* Now the standard GNU C Library header should work. */
|
||||
#include "glob-libc.h"
|
||||
|
||||
__BEGIN_DECLS
|
||||
typedef int (*_gl_glob_errfunc_fn) (const char *, int);
|
||||
__END_DECLS
|
||||
|
||||
#if defined __cplusplus && defined GNULIB_NAMESPACE
|
||||
# undef glob
|
||||
# undef globfree
|
||||
# undef glob_pattern_p
|
||||
_GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
|
||||
_gl_glob_errfunc_fn __errfunc,
|
||||
glob_t *_Restrict_ __pglob));
|
||||
_GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
|
||||
_GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
|
||||
# if 0 /* The C function name is rpl_glob, not glob. */
|
||||
_GL_CXXALIASWARN (glob);
|
||||
_GL_CXXALIASWARN (globfree);
|
||||
_GL_CXXALIASWARN (glob_pattern_p);
|
||||
/* GCC 2.95 and later have "__restrict"; C99 compilers have
|
||||
"restrict", and "configure" may have defined "restrict".
|
||||
Other compilers use __restrict, __restrict__, and _Restrict, and
|
||||
'configure' might #define 'restrict' to those words, so pick a
|
||||
different name. */
|
||||
#ifndef _Restrict_
|
||||
# if 199901L <= __STDC_VERSION__
|
||||
# define _Restrict_ restrict
|
||||
# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
|
||||
# define _Restrict_ __restrict
|
||||
# else
|
||||
# define _Restrict_
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#endif /* _GL_GLOB_H */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
typedef int (*_gl_glob_errfunc_fn) (const char *, int);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if !@HAVE_GLOB_H@ || @REPLACE_GLOB@
|
||||
|
||||
|
||||
/* Preparations for including the standard GNU C Library header. */
|
||||
|
||||
# include <libc-config.h>
|
||||
|
||||
# include <stddef.h>
|
||||
|
||||
/* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64".
|
||||
Make sure this definition is seen before glob-libc.h defines types that
|
||||
rely on 'struct stat'. */
|
||||
# include <sys/stat.h>
|
||||
|
||||
# ifndef __USE_GNU
|
||||
# define __USE_GNU 1
|
||||
# endif
|
||||
|
||||
# if @REPLACE_GLOB@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define glob rpl_glob
|
||||
# define globfree rpl_globfree
|
||||
# endif
|
||||
# endif
|
||||
# if @REPLACE_GLOB_PATTERN_P@
|
||||
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
# define glob_pattern_p rpl_glob_pattern_p
|
||||
# endif
|
||||
# endif
|
||||
# define __glob_pattern_p glob_pattern_p
|
||||
|
||||
# define __GLOB_GNULIB 1
|
||||
|
||||
|
||||
/* Now the standard GNU C Library header should work. */
|
||||
# include "glob-libc.h"
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if @GNULIB_GLOB@
|
||||
# if @REPLACE_GLOB@
|
||||
_GL_FUNCDECL_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
|
||||
_gl_glob_errfunc_fn __errfunc,
|
||||
glob_t *_Restrict_ __pglob)
|
||||
_GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
|
||||
_gl_glob_errfunc_fn __errfunc,
|
||||
glob_t *_Restrict_ __pglob));
|
||||
# else
|
||||
# if !@HAVE_GLOB@
|
||||
_GL_FUNCDECL_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags,
|
||||
_gl_glob_errfunc_fn __errfunc,
|
||||
glob_t *_Restrict_ __pglob)
|
||||
_GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags,
|
||||
_gl_glob_errfunc_fn __errfunc,
|
||||
glob_t *_Restrict_ __pglob));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (glob);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef glob
|
||||
# if HAVE_RAW_DECL_GLOB
|
||||
_GL_WARN_ON_USE (glob,
|
||||
"glob is unportable - "
|
||||
"use gnulib module glob for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_GLOB@
|
||||
# if @REPLACE_GLOB@
|
||||
_GL_FUNCDECL_RPL (globfree, void, (glob_t *__pglob) _GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
|
||||
# else
|
||||
# if !@HAVE_GLOB@
|
||||
_GL_FUNCDECL_SYS (globfree, void, (glob_t *__pglob) _GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (globfree, void, (glob_t *__pglob));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (globfree);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef globfree
|
||||
# if HAVE_RAW_DECL_GLOBFREE
|
||||
_GL_WARN_ON_USE (globfree,
|
||||
"globfree is unportable - "
|
||||
"use gnulib module glob for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if @GNULIB_GLOB@
|
||||
# if @REPLACE_GLOB_PATTERN_P@
|
||||
_GL_FUNCDECL_RPL (glob_pattern_p, int, (const char *__pattern, int __quote)
|
||||
_GL_ARG_NONNULL ((1)));
|
||||
_GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
|
||||
# else
|
||||
# if !@HAVE_GLOB_PATTERN_P@
|
||||
_GL_FUNCDECL_SYS (glob_pattern_p, int, (const char *__pattern, int __quote)
|
||||
_GL_ARG_NONNULL ((1)));
|
||||
# endif
|
||||
_GL_CXXALIAS_SYS (glob_pattern_p, int, (const char *__pattern, int __quote));
|
||||
# endif
|
||||
_GL_CXXALIASWARN (glob_pattern_p);
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
# undef glob_pattern_p
|
||||
# if HAVE_RAW_DECL_GLOB_PATTERN_P
|
||||
_GL_WARN_ON_USE (glob_pattern_p,
|
||||
"glob_pattern_p is unportable - "
|
||||
"use gnulib module glob for portability");
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _@GUARD_PREFIX@_GLOB_H */
|
||||
#endif /* _@GUARD_PREFIX@_GLOB_H */
|
||||
|
||||
65
gnulib/import/glob_internal.h
Normal file
65
gnulib/import/glob_internal.h
Normal file
@ -0,0 +1,65 @@
|
||||
/* Shared definition for glob and glob_pattern_p.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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 the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GLOB_INTERNAL_H
|
||||
# define GLOB_INTERNAL_H
|
||||
|
||||
enum
|
||||
{
|
||||
GLOBPAT_NONE = 0x0,
|
||||
GLOBPAT_SPECIAL = 0x1,
|
||||
GLOBPAT_BACKSLASH = 0x2,
|
||||
GLOBPAT_BRACKET = 0x4
|
||||
};
|
||||
|
||||
static inline int
|
||||
__glob_pattern_type (const char *pattern, int quote)
|
||||
{
|
||||
const char *p;
|
||||
int ret = GLOBPAT_NONE;
|
||||
|
||||
for (p = pattern; *p != '\0'; ++p)
|
||||
switch (*p)
|
||||
{
|
||||
case '?':
|
||||
case '*':
|
||||
return GLOBPAT_SPECIAL;
|
||||
|
||||
case '\\':
|
||||
if (quote)
|
||||
{
|
||||
if (p[1] != '\0')
|
||||
++p;
|
||||
ret |= GLOBPAT_BACKSLASH;
|
||||
}
|
||||
break;
|
||||
|
||||
case '[':
|
||||
ret |= GLOBPAT_BRACKET;
|
||||
break;
|
||||
|
||||
case ']':
|
||||
if (ret & 4)
|
||||
return GLOBPAT_SPECIAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* GLOB_INTERNAL_H */
|
||||
33
gnulib/import/glob_pattern_p.c
Normal file
33
gnulib/import/glob_pattern_p.c
Normal file
@ -0,0 +1,33 @@
|
||||
/* Return nonzero if PATTERN contains any metacharacters.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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 the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIBC
|
||||
# include <libc-config.h>
|
||||
#endif
|
||||
|
||||
#include <glob.h>
|
||||
#include "glob_internal.h"
|
||||
|
||||
/* Return nonzero if PATTERN contains any metacharacters.
|
||||
Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
|
||||
int
|
||||
__glob_pattern_p (const char *pattern, int quote)
|
||||
{
|
||||
return __glob_pattern_type (pattern, quote) == GLOBPAT_SPECIAL;
|
||||
}
|
||||
weak_alias (__glob_pattern_p, glob_pattern_p)
|
||||
41
gnulib/import/globfree.c
Normal file
41
gnulib/import/globfree.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* Frees the dynamically allocated storage from an earlier call to glob.
|
||||
Copyright (C) 2017-2019 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library 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 3 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library 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 the GNU C Library; if not, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIBC
|
||||
# include <libc-config.h>
|
||||
#endif
|
||||
|
||||
#include <glob.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Free storage allocated in PGLOB by a previous `glob' call. */
|
||||
void
|
||||
globfree (glob_t *pglob)
|
||||
{
|
||||
if (pglob->gl_pathv != NULL)
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < pglob->gl_pathc; ++i)
|
||||
free (pglob->gl_pathv[pglob->gl_offs + i]);
|
||||
free (pglob->gl_pathv);
|
||||
pglob->gl_pathv = NULL;
|
||||
}
|
||||
}
|
||||
#ifndef globfree
|
||||
libc_hidden_def (globfree)
|
||||
#endif
|
||||
@ -1,5 +1,5 @@
|
||||
/* Locking in multithreaded situations.
|
||||
Copyright (C) 2005-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2019 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
|
||||
@ -12,11 +12,10 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
|
||||
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
|
||||
gthr-win32.h. */
|
||||
Based on GCC's gthr-posix.h, gthr-posix95.h. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@ -24,15 +23,267 @@
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
int
|
||||
glthread_lock_init (gl_lock_t *lock)
|
||||
{
|
||||
if (mtx_init (&lock->mutex, mtx_plain) != thrd_success)
|
||||
return ENOMEM;
|
||||
lock->init_needed = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_lock_lock (gl_lock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
if (mtx_lock (&lock->mutex) != thrd_success)
|
||||
return EAGAIN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_lock_unlock (gl_lock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
if (mtx_unlock (&lock->mutex) != thrd_success)
|
||||
return EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_lock_destroy (gl_lock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
mtx_destroy (&lock->mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
int
|
||||
glthread_rwlock_init (gl_rwlock_t *lock)
|
||||
{
|
||||
if (mtx_init (&lock->lock, mtx_plain) != thrd_success
|
||||
|| cnd_init (&lock->waiting_readers) != thrd_success
|
||||
|| cnd_init (&lock->waiting_writers) != thrd_success)
|
||||
return ENOMEM;
|
||||
lock->waiting_writers_count = 0;
|
||||
lock->runcount = 0;
|
||||
lock->init_needed = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_rwlock_rdlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
if (mtx_lock (&lock->lock) != thrd_success)
|
||||
return EAGAIN;
|
||||
/* Test whether only readers are currently running, and whether the runcount
|
||||
field will not overflow, and whether no writer is waiting. The latter
|
||||
condition is because POSIX recommends that "write locks shall take
|
||||
precedence over read locks", to avoid "writer starvation". */
|
||||
while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
waiting_readers. */
|
||||
if (cnd_wait (&lock->waiting_readers, &lock->lock) != thrd_success)
|
||||
{
|
||||
mtx_unlock (&lock->lock);
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
lock->runcount++;
|
||||
if (mtx_unlock (&lock->lock) != thrd_success)
|
||||
return EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_rwlock_wrlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
if (mtx_lock (&lock->lock) != thrd_success)
|
||||
return EAGAIN;
|
||||
/* Test whether no readers or writers are currently running. */
|
||||
while (!(lock->runcount == 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
waiting_writers. */
|
||||
lock->waiting_writers_count++;
|
||||
if (cnd_wait (&lock->waiting_writers, &lock->lock) != thrd_success)
|
||||
{
|
||||
lock->waiting_writers_count--;
|
||||
mtx_unlock (&lock->lock);
|
||||
return EINVAL;
|
||||
}
|
||||
lock->waiting_writers_count--;
|
||||
}
|
||||
lock->runcount--; /* runcount becomes -1 */
|
||||
if (mtx_unlock (&lock->lock) != thrd_success)
|
||||
return EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_rwlock_unlock (gl_rwlock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
if (mtx_lock (&lock->lock) != thrd_success)
|
||||
return EAGAIN;
|
||||
if (lock->runcount < 0)
|
||||
{
|
||||
/* Drop a writer lock. */
|
||||
if (!(lock->runcount == -1))
|
||||
{
|
||||
mtx_unlock (&lock->lock);
|
||||
return EINVAL;
|
||||
}
|
||||
lock->runcount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Drop a reader lock. */
|
||||
if (!(lock->runcount > 0))
|
||||
{
|
||||
mtx_unlock (&lock->lock);
|
||||
return EINVAL;
|
||||
}
|
||||
lock->runcount--;
|
||||
}
|
||||
if (lock->runcount == 0)
|
||||
{
|
||||
/* POSIX recommends that "write locks shall take precedence over read
|
||||
locks", to avoid "writer starvation". */
|
||||
if (lock->waiting_writers_count > 0)
|
||||
{
|
||||
/* Wake up one of the waiting writers. */
|
||||
if (cnd_signal (&lock->waiting_writers) != thrd_success)
|
||||
{
|
||||
mtx_unlock (&lock->lock);
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Wake up all waiting readers. */
|
||||
if (cnd_broadcast (&lock->waiting_readers) != thrd_success)
|
||||
{
|
||||
mtx_unlock (&lock->lock);
|
||||
return EINVAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mtx_unlock (&lock->lock) != thrd_success)
|
||||
return EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_rwlock_destroy (gl_rwlock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
mtx_destroy (&lock->lock);
|
||||
cnd_destroy (&lock->waiting_readers);
|
||||
cnd_destroy (&lock->waiting_writers);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
int
|
||||
glthread_recursive_lock_init (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (mtx_init (&lock->mutex, mtx_plain | mtx_recursive) != thrd_success)
|
||||
return ENOMEM;
|
||||
lock->init_needed = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
if (mtx_lock (&lock->mutex) != thrd_success)
|
||||
return EAGAIN;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
if (mtx_unlock (&lock->mutex) != thrd_success)
|
||||
return EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->init_needed)
|
||||
call_once (&lock->init_once, lock->init_func);
|
||||
mtx_destroy (&lock->mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_POSIX_THREADS
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
# if HAVE_PTHREAD_RWLOCK
|
||||
# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
|
||||
|
||||
# if !defined PTHREAD_RWLOCK_INITIALIZER
|
||||
# ifdef PTHREAD_RWLOCK_INITIALIZER
|
||||
|
||||
# if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
|
||||
/* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
|
||||
|
||||
int
|
||||
glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock)
|
||||
{
|
||||
pthread_rwlockattr_t attributes;
|
||||
int err;
|
||||
|
||||
err = pthread_rwlockattr_init (&attributes);
|
||||
if (err != 0)
|
||||
return err;
|
||||
/* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that
|
||||
causes the writer to be preferred. PTHREAD_RWLOCK_PREFER_WRITER_NP does not
|
||||
do this; see
|
||||
http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html */
|
||||
err = pthread_rwlockattr_setkind_np (&attributes,
|
||||
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
|
||||
if (err == 0)
|
||||
err = pthread_rwlock_init(lock, &attributes);
|
||||
/* pthread_rwlockattr_destroy always returns 0. It cannot influence the
|
||||
return value. */
|
||||
pthread_rwlockattr_destroy (&attributes);
|
||||
return err;
|
||||
}
|
||||
|
||||
# endif
|
||||
# else
|
||||
|
||||
int
|
||||
glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
|
||||
@ -152,11 +403,9 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
|
||||
if (err != 0)
|
||||
return err;
|
||||
/* Test whether only readers are currently running, and whether the runcount
|
||||
field will not overflow. */
|
||||
/* POSIX says: "It is implementation-defined whether the calling thread
|
||||
acquires the lock when a writer does not hold the lock and there are
|
||||
writers blocked on the lock." Let's say, no: give the writers a higher
|
||||
priority. */
|
||||
field will not overflow, and whether no writer is waiting. The latter
|
||||
condition is because POSIX recommends that "write locks shall take
|
||||
precedence over read locks", to avoid "writer starvation". */
|
||||
while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
@ -473,585 +722,8 @@ glthread_once_singlethreaded (pthread_once_t *once_control)
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_PTH_THREADS
|
||||
|
||||
/* Use the GNU Pth threads library. */
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
static void
|
||||
glthread_once_call (void *arg)
|
||||
{
|
||||
void (**gl_once_temp_addr) (void) = (void (**) (void)) arg;
|
||||
void (*initfunction) (void) = *gl_once_temp_addr;
|
||||
initfunction ();
|
||||
}
|
||||
|
||||
int
|
||||
glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void))
|
||||
{
|
||||
void (*temp) (void) = initfunction;
|
||||
return (!pth_once (once_control, glthread_once_call, &temp) ? errno : 0);
|
||||
}
|
||||
|
||||
int
|
||||
glthread_once_singlethreaded (pth_once_t *once_control)
|
||||
{
|
||||
/* We know that pth_once_t is an integer type. */
|
||||
if (*once_control == PTH_ONCE_INIT)
|
||||
{
|
||||
/* First time use of once_control. Invert the marker. */
|
||||
*once_control = ~ PTH_ONCE_INIT;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_SOLARIS_THREADS
|
||||
|
||||
/* Use the old Solaris threads library. */
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
int
|
||||
glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = mutex_init (&lock->mutex, USYNC_THREAD, NULL);
|
||||
if (err != 0)
|
||||
return err;
|
||||
lock->owner = (thread_t) 0;
|
||||
lock->depth = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
|
||||
{
|
||||
thread_t self = thr_self ();
|
||||
if (lock->owner != self)
|
||||
{
|
||||
int err;
|
||||
|
||||
err = mutex_lock (&lock->mutex);
|
||||
if (err != 0)
|
||||
return err;
|
||||
lock->owner = self;
|
||||
}
|
||||
if (++(lock->depth) == 0) /* wraparound? */
|
||||
{
|
||||
lock->depth--;
|
||||
return EAGAIN;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != thr_self ())
|
||||
return EPERM;
|
||||
if (lock->depth == 0)
|
||||
return EINVAL;
|
||||
if (--(lock->depth) == 0)
|
||||
{
|
||||
lock->owner = (thread_t) 0;
|
||||
return mutex_unlock (&lock->mutex);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != (thread_t) 0)
|
||||
return EBUSY;
|
||||
return mutex_destroy (&lock->mutex);
|
||||
}
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
int
|
||||
glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void))
|
||||
{
|
||||
if (!once_control->inited)
|
||||
{
|
||||
int err;
|
||||
|
||||
/* Use the mutex to guarantee that if another thread is already calling
|
||||
the initfunction, this thread waits until it's finished. */
|
||||
err = mutex_lock (&once_control->mutex);
|
||||
if (err != 0)
|
||||
return err;
|
||||
if (!once_control->inited)
|
||||
{
|
||||
once_control->inited = 1;
|
||||
initfunction ();
|
||||
}
|
||||
return mutex_unlock (&once_control->mutex);
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_once_singlethreaded (gl_once_t *once_control)
|
||||
{
|
||||
/* We know that gl_once_t contains an integer type. */
|
||||
if (!once_control->inited)
|
||||
{
|
||||
/* First time use of once_control. Invert the marker. */
|
||||
once_control->inited = ~ 0;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_WINDOWS_THREADS
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
void
|
||||
glthread_lock_init_func (gl_lock_t *lock)
|
||||
{
|
||||
InitializeCriticalSection (&lock->lock);
|
||||
lock->guard.done = 1;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_lock_lock_func (gl_lock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
{
|
||||
if (InterlockedIncrement (&lock->guard.started) == 0)
|
||||
/* This thread is the first one to need this lock. Initialize it. */
|
||||
glthread_lock_init (lock);
|
||||
else
|
||||
/* Yield the CPU while waiting for another thread to finish
|
||||
initializing this lock. */
|
||||
while (!lock->guard.done)
|
||||
Sleep (0);
|
||||
}
|
||||
EnterCriticalSection (&lock->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_lock_unlock_func (gl_lock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
return EINVAL;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_lock_destroy_func (gl_lock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
return EINVAL;
|
||||
DeleteCriticalSection (&lock->lock);
|
||||
lock->guard.done = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
/* In this file, the waitqueues are implemented as circular arrays. */
|
||||
#define gl_waitqueue_t gl_carray_waitqueue_t
|
||||
|
||||
static void
|
||||
gl_waitqueue_init (gl_waitqueue_t *wq)
|
||||
{
|
||||
wq->array = NULL;
|
||||
wq->count = 0;
|
||||
wq->alloc = 0;
|
||||
wq->offset = 0;
|
||||
}
|
||||
|
||||
/* Enqueues the current thread, represented by an event, in a wait queue.
|
||||
Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */
|
||||
static HANDLE
|
||||
gl_waitqueue_add (gl_waitqueue_t *wq)
|
||||
{
|
||||
HANDLE event;
|
||||
unsigned int index;
|
||||
|
||||
if (wq->count == wq->alloc)
|
||||
{
|
||||
unsigned int new_alloc = 2 * wq->alloc + 1;
|
||||
HANDLE *new_array =
|
||||
(HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
|
||||
if (new_array == NULL)
|
||||
/* No more memory. */
|
||||
return INVALID_HANDLE_VALUE;
|
||||
/* Now is a good opportunity to rotate the array so that its contents
|
||||
starts at offset 0. */
|
||||
if (wq->offset > 0)
|
||||
{
|
||||
unsigned int old_count = wq->count;
|
||||
unsigned int old_alloc = wq->alloc;
|
||||
unsigned int old_offset = wq->offset;
|
||||
unsigned int i;
|
||||
if (old_offset + old_count > old_alloc)
|
||||
{
|
||||
unsigned int limit = old_offset + old_count - old_alloc;
|
||||
for (i = 0; i < limit; i++)
|
||||
new_array[old_alloc + i] = new_array[i];
|
||||
}
|
||||
for (i = 0; i < old_count; i++)
|
||||
new_array[i] = new_array[old_offset + i];
|
||||
wq->offset = 0;
|
||||
}
|
||||
wq->array = new_array;
|
||||
wq->alloc = new_alloc;
|
||||
}
|
||||
/* Whether the created event is a manual-reset one or an auto-reset one,
|
||||
does not matter, since we will wait on it only once. */
|
||||
event = CreateEvent (NULL, TRUE, FALSE, NULL);
|
||||
if (event == INVALID_HANDLE_VALUE)
|
||||
/* No way to allocate an event. */
|
||||
return INVALID_HANDLE_VALUE;
|
||||
index = wq->offset + wq->count;
|
||||
if (index >= wq->alloc)
|
||||
index -= wq->alloc;
|
||||
wq->array[index] = event;
|
||||
wq->count++;
|
||||
return event;
|
||||
}
|
||||
|
||||
/* Notifies the first thread from a wait queue and dequeues it. */
|
||||
static void
|
||||
gl_waitqueue_notify_first (gl_waitqueue_t *wq)
|
||||
{
|
||||
SetEvent (wq->array[wq->offset + 0]);
|
||||
wq->offset++;
|
||||
wq->count--;
|
||||
if (wq->count == 0 || wq->offset == wq->alloc)
|
||||
wq->offset = 0;
|
||||
}
|
||||
|
||||
/* Notifies all threads from a wait queue and dequeues them all. */
|
||||
static void
|
||||
gl_waitqueue_notify_all (gl_waitqueue_t *wq)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < wq->count; i++)
|
||||
{
|
||||
unsigned int index = wq->offset + i;
|
||||
if (index >= wq->alloc)
|
||||
index -= wq->alloc;
|
||||
SetEvent (wq->array[index]);
|
||||
}
|
||||
wq->count = 0;
|
||||
wq->offset = 0;
|
||||
}
|
||||
|
||||
void
|
||||
glthread_rwlock_init_func (gl_rwlock_t *lock)
|
||||
{
|
||||
InitializeCriticalSection (&lock->lock);
|
||||
gl_waitqueue_init (&lock->waiting_readers);
|
||||
gl_waitqueue_init (&lock->waiting_writers);
|
||||
lock->runcount = 0;
|
||||
lock->guard.done = 1;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_rwlock_rdlock_func (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
{
|
||||
if (InterlockedIncrement (&lock->guard.started) == 0)
|
||||
/* This thread is the first one to need this lock. Initialize it. */
|
||||
glthread_rwlock_init (lock);
|
||||
else
|
||||
/* Yield the CPU while waiting for another thread to finish
|
||||
initializing this lock. */
|
||||
while (!lock->guard.done)
|
||||
Sleep (0);
|
||||
}
|
||||
EnterCriticalSection (&lock->lock);
|
||||
/* Test whether only readers are currently running, and whether the runcount
|
||||
field will not overflow. */
|
||||
if (!(lock->runcount + 1 > 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
waiting_readers. */
|
||||
HANDLE event = gl_waitqueue_add (&lock->waiting_readers);
|
||||
if (event != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD result;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
/* Wait until another thread signals this event. */
|
||||
result = WaitForSingleObject (event, INFINITE);
|
||||
if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
|
||||
abort ();
|
||||
CloseHandle (event);
|
||||
/* The thread which signalled the event already did the bookkeeping:
|
||||
removed us from the waiting_readers, incremented lock->runcount. */
|
||||
if (!(lock->runcount > 0))
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Allocation failure. Weird. */
|
||||
do
|
||||
{
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
Sleep (1);
|
||||
EnterCriticalSection (&lock->lock);
|
||||
}
|
||||
while (!(lock->runcount + 1 > 0));
|
||||
}
|
||||
}
|
||||
lock->runcount++;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_rwlock_wrlock_func (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
{
|
||||
if (InterlockedIncrement (&lock->guard.started) == 0)
|
||||
/* This thread is the first one to need this lock. Initialize it. */
|
||||
glthread_rwlock_init (lock);
|
||||
else
|
||||
/* Yield the CPU while waiting for another thread to finish
|
||||
initializing this lock. */
|
||||
while (!lock->guard.done)
|
||||
Sleep (0);
|
||||
}
|
||||
EnterCriticalSection (&lock->lock);
|
||||
/* Test whether no readers or writers are currently running. */
|
||||
if (!(lock->runcount == 0))
|
||||
{
|
||||
/* This thread has to wait for a while. Enqueue it among the
|
||||
waiting_writers. */
|
||||
HANDLE event = gl_waitqueue_add (&lock->waiting_writers);
|
||||
if (event != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD result;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
/* Wait until another thread signals this event. */
|
||||
result = WaitForSingleObject (event, INFINITE);
|
||||
if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
|
||||
abort ();
|
||||
CloseHandle (event);
|
||||
/* The thread which signalled the event already did the bookkeeping:
|
||||
removed us from the waiting_writers, set lock->runcount = -1. */
|
||||
if (!(lock->runcount == -1))
|
||||
abort ();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Allocation failure. Weird. */
|
||||
do
|
||||
{
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
Sleep (1);
|
||||
EnterCriticalSection (&lock->lock);
|
||||
}
|
||||
while (!(lock->runcount == 0));
|
||||
}
|
||||
}
|
||||
lock->runcount--; /* runcount becomes -1 */
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_rwlock_unlock_func (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
return EINVAL;
|
||||
EnterCriticalSection (&lock->lock);
|
||||
if (lock->runcount < 0)
|
||||
{
|
||||
/* Drop a writer lock. */
|
||||
if (!(lock->runcount == -1))
|
||||
abort ();
|
||||
lock->runcount = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Drop a reader lock. */
|
||||
if (!(lock->runcount > 0))
|
||||
{
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
return EPERM;
|
||||
}
|
||||
lock->runcount--;
|
||||
}
|
||||
if (lock->runcount == 0)
|
||||
{
|
||||
/* POSIX recommends that "write locks shall take precedence over read
|
||||
locks", to avoid "writer starvation". */
|
||||
if (lock->waiting_writers.count > 0)
|
||||
{
|
||||
/* Wake up one of the waiting writers. */
|
||||
lock->runcount--;
|
||||
gl_waitqueue_notify_first (&lock->waiting_writers);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Wake up all waiting readers. */
|
||||
lock->runcount += lock->waiting_readers.count;
|
||||
gl_waitqueue_notify_all (&lock->waiting_readers);
|
||||
}
|
||||
}
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_rwlock_destroy_func (gl_rwlock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
return EINVAL;
|
||||
if (lock->runcount != 0)
|
||||
return EBUSY;
|
||||
DeleteCriticalSection (&lock->lock);
|
||||
if (lock->waiting_readers.array != NULL)
|
||||
free (lock->waiting_readers.array);
|
||||
if (lock->waiting_writers.array != NULL)
|
||||
free (lock->waiting_writers.array);
|
||||
lock->guard.done = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
void
|
||||
glthread_recursive_lock_init_func (gl_recursive_lock_t *lock)
|
||||
{
|
||||
lock->owner = 0;
|
||||
lock->depth = 0;
|
||||
InitializeCriticalSection (&lock->lock);
|
||||
lock->guard.done = 1;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (!lock->guard.done)
|
||||
{
|
||||
if (InterlockedIncrement (&lock->guard.started) == 0)
|
||||
/* This thread is the first one to need this lock. Initialize it. */
|
||||
glthread_recursive_lock_init (lock);
|
||||
else
|
||||
/* Yield the CPU while waiting for another thread to finish
|
||||
initializing this lock. */
|
||||
while (!lock->guard.done)
|
||||
Sleep (0);
|
||||
}
|
||||
{
|
||||
DWORD self = GetCurrentThreadId ();
|
||||
if (lock->owner != self)
|
||||
{
|
||||
EnterCriticalSection (&lock->lock);
|
||||
lock->owner = self;
|
||||
}
|
||||
if (++(lock->depth) == 0) /* wraparound? */
|
||||
{
|
||||
lock->depth--;
|
||||
return EAGAIN;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != GetCurrentThreadId ())
|
||||
return EPERM;
|
||||
if (lock->depth == 0)
|
||||
return EINVAL;
|
||||
if (--(lock->depth) == 0)
|
||||
{
|
||||
lock->owner = 0;
|
||||
LeaveCriticalSection (&lock->lock);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock)
|
||||
{
|
||||
if (lock->owner != 0)
|
||||
return EBUSY;
|
||||
DeleteCriticalSection (&lock->lock);
|
||||
lock->guard.done = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
void
|
||||
glthread_once_func (gl_once_t *once_control, void (*initfunction) (void))
|
||||
{
|
||||
if (once_control->inited <= 0)
|
||||
{
|
||||
if (InterlockedIncrement (&once_control->started) == 0)
|
||||
{
|
||||
/* This thread is the first one to come to this once_control. */
|
||||
InitializeCriticalSection (&once_control->lock);
|
||||
EnterCriticalSection (&once_control->lock);
|
||||
once_control->inited = 0;
|
||||
initfunction ();
|
||||
once_control->inited = 1;
|
||||
LeaveCriticalSection (&once_control->lock);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Undo last operation. */
|
||||
InterlockedDecrement (&once_control->started);
|
||||
/* Some other thread has already started the initialization.
|
||||
Yield the CPU while waiting for the other thread to finish
|
||||
initializing and taking the lock. */
|
||||
while (once_control->inited < 0)
|
||||
Sleep (0);
|
||||
if (once_control->inited <= 0)
|
||||
{
|
||||
/* Take the lock. This blocks until the other thread has
|
||||
finished calling the initfunction. */
|
||||
EnterCriticalSection (&once_control->lock);
|
||||
LeaveCriticalSection (&once_control->lock);
|
||||
if (!(once_control->inited > 0))
|
||||
abort ();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Locking in multithreaded situations.
|
||||
Copyright (C) 2005-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2019 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
|
||||
@ -12,11 +12,10 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2005.
|
||||
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
|
||||
gthr-win32.h. */
|
||||
Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h. */
|
||||
|
||||
/* This file contains locking primitives for use with a given thread library.
|
||||
It does not contain primitives for creating threads or for other
|
||||
@ -81,6 +80,125 @@
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if !defined c11_threads_in_use
|
||||
# if HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
|
||||
# include <threads.h>
|
||||
# pragma weak thrd_exit
|
||||
# define c11_threads_in_use() (thrd_exit != NULL)
|
||||
# else
|
||||
# define c11_threads_in_use() 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
|
||||
|
||||
/* Use the ISO C threads library. */
|
||||
|
||||
# include <threads.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int volatile init_needed;
|
||||
once_flag init_once;
|
||||
void (*init_func) (void);
|
||||
mtx_t mutex;
|
||||
}
|
||||
gl_lock_t;
|
||||
# define gl_lock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_lock_t NAME;
|
||||
# define gl_lock_define_initialized(STORAGECLASS, NAME) \
|
||||
static void _atomic_init_##NAME (void); \
|
||||
STORAGECLASS gl_lock_t NAME = \
|
||||
{ 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
|
||||
static void _atomic_init_##NAME (void) \
|
||||
{ \
|
||||
if (glthread_lock_init (&(NAME))) \
|
||||
abort (); \
|
||||
}
|
||||
extern int glthread_lock_init (gl_lock_t *lock);
|
||||
extern int glthread_lock_lock (gl_lock_t *lock);
|
||||
extern int glthread_lock_unlock (gl_lock_t *lock);
|
||||
extern int glthread_lock_destroy (gl_lock_t *lock);
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int volatile init_needed;
|
||||
once_flag init_once;
|
||||
void (*init_func) (void);
|
||||
mtx_t lock; /* protects the remaining fields */
|
||||
cnd_t waiting_readers; /* waiting readers */
|
||||
cnd_t waiting_writers; /* waiting writers */
|
||||
unsigned int waiting_writers_count; /* number of waiting writers */
|
||||
int runcount; /* number of readers running, or -1 when a writer runs */
|
||||
}
|
||||
gl_rwlock_t;
|
||||
# define gl_rwlock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_rwlock_t NAME;
|
||||
# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
|
||||
static void _atomic_init_##NAME (void); \
|
||||
STORAGECLASS gl_rwlock_t NAME = \
|
||||
{ 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
|
||||
static void _atomic_init_##NAME (void) \
|
||||
{ \
|
||||
if (glthread_rwlock_init (&(NAME))) \
|
||||
abort (); \
|
||||
}
|
||||
extern int glthread_rwlock_init (gl_rwlock_t *lock);
|
||||
extern int glthread_rwlock_rdlock (gl_rwlock_t *lock);
|
||||
extern int glthread_rwlock_wrlock (gl_rwlock_t *lock);
|
||||
extern int glthread_rwlock_unlock (gl_rwlock_t *lock);
|
||||
extern int glthread_rwlock_destroy (gl_rwlock_t *lock);
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int volatile init_needed;
|
||||
once_flag init_once;
|
||||
void (*init_func) (void);
|
||||
mtx_t mutex;
|
||||
}
|
||||
gl_recursive_lock_t;
|
||||
# define gl_recursive_lock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_recursive_lock_t NAME;
|
||||
# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
|
||||
static void _atomic_init_##NAME (void); \
|
||||
STORAGECLASS gl_recursive_lock_t NAME = \
|
||||
{ 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
|
||||
static void _atomic_init_##NAME (void) \
|
||||
{ \
|
||||
if (glthread_recursive_lock_init (&(NAME))) \
|
||||
abort (); \
|
||||
}
|
||||
extern int glthread_recursive_lock_init (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
typedef once_flag gl_once_t;
|
||||
# define gl_once_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS once_flag NAME = ONCE_FLAG_INIT;
|
||||
# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
|
||||
(call_once (ONCE_CONTROL, INITFUNCTION), 0)
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_POSIX_THREADS
|
||||
@ -139,13 +257,25 @@ extern int glthread_in_use (void);
|
||||
# pragma weak pthread_mutexattr_init
|
||||
# pragma weak pthread_mutexattr_settype
|
||||
# pragma weak pthread_mutexattr_destroy
|
||||
# pragma weak pthread_rwlockattr_init
|
||||
# if __GNU_LIBRARY__ > 1
|
||||
# pragma weak pthread_rwlockattr_setkind_np
|
||||
# endif
|
||||
# pragma weak pthread_rwlockattr_destroy
|
||||
# ifndef pthread_self
|
||||
# pragma weak pthread_self
|
||||
# endif
|
||||
|
||||
# if !PTHREAD_IN_USE_DETECTION_HARD
|
||||
# pragma weak pthread_cancel
|
||||
# define pthread_in_use() (pthread_cancel != NULL)
|
||||
/* Considering all platforms with USE_POSIX_THREADS_WEAK, only few symbols
|
||||
can be used to determine whether libpthread is in use. These are:
|
||||
pthread_mutexattr_gettype
|
||||
pthread_rwlockattr_destroy
|
||||
pthread_rwlockattr_init
|
||||
*/
|
||||
# pragma weak pthread_mutexattr_gettype
|
||||
# define pthread_in_use() \
|
||||
(pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
|
||||
# endif
|
||||
|
||||
# else
|
||||
@ -176,7 +306,7 @@ typedef pthread_mutex_t gl_lock_t;
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
# if HAVE_PTHREAD_RWLOCK
|
||||
# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
|
||||
|
||||
# ifdef PTHREAD_RWLOCK_INITIALIZER
|
||||
|
||||
@ -185,10 +315,18 @@ typedef pthread_rwlock_t gl_rwlock_t;
|
||||
STORAGECLASS pthread_rwlock_t NAME;
|
||||
# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
|
||||
# define gl_rwlock_initializer \
|
||||
PTHREAD_RWLOCK_INITIALIZER
|
||||
# define glthread_rwlock_init(LOCK) \
|
||||
(pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
|
||||
# if HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
|
||||
# define gl_rwlock_initializer \
|
||||
PTHREAD_RWLOCK_INITIALIZER
|
||||
# define glthread_rwlock_init(LOCK) \
|
||||
(pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
|
||||
# else /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
|
||||
# define gl_rwlock_initializer \
|
||||
PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
|
||||
# define glthread_rwlock_init(LOCK) \
|
||||
(pthread_in_use () ? glthread_rwlock_init_for_glibc (LOCK) : 0)
|
||||
extern int glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock);
|
||||
# endif
|
||||
# define glthread_rwlock_rdlock(LOCK) \
|
||||
(pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
|
||||
# define glthread_rwlock_wrlock(LOCK) \
|
||||
@ -376,248 +514,16 @@ extern int glthread_once_singlethreaded (pthread_once_t *once_control);
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_PTH_THREADS
|
||||
|
||||
/* Use the GNU Pth threads library. */
|
||||
|
||||
# include <pth.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# if USE_PTH_THREADS_WEAK
|
||||
|
||||
/* Use weak references to the GNU Pth threads library. */
|
||||
|
||||
# pragma weak pth_mutex_init
|
||||
# pragma weak pth_mutex_acquire
|
||||
# pragma weak pth_mutex_release
|
||||
# pragma weak pth_rwlock_init
|
||||
# pragma weak pth_rwlock_acquire
|
||||
# pragma weak pth_rwlock_release
|
||||
# pragma weak pth_once
|
||||
|
||||
# pragma weak pth_cancel
|
||||
# define pth_in_use() (pth_cancel != NULL)
|
||||
|
||||
# else
|
||||
|
||||
# define pth_in_use() 1
|
||||
|
||||
# endif
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
typedef pth_mutex_t gl_lock_t;
|
||||
# define gl_lock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS pth_mutex_t NAME;
|
||||
# define gl_lock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS pth_mutex_t NAME = gl_lock_initializer;
|
||||
# define gl_lock_initializer \
|
||||
PTH_MUTEX_INIT
|
||||
# define glthread_lock_init(LOCK) \
|
||||
(pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
|
||||
# define glthread_lock_lock(LOCK) \
|
||||
(pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
|
||||
# define glthread_lock_unlock(LOCK) \
|
||||
(pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
|
||||
# define glthread_lock_destroy(LOCK) \
|
||||
((void)(LOCK), 0)
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
typedef pth_rwlock_t gl_rwlock_t;
|
||||
# define gl_rwlock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS pth_rwlock_t NAME;
|
||||
# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS pth_rwlock_t NAME = gl_rwlock_initializer;
|
||||
# define gl_rwlock_initializer \
|
||||
PTH_RWLOCK_INIT
|
||||
# define glthread_rwlock_init(LOCK) \
|
||||
(pth_in_use () && !pth_rwlock_init (LOCK) ? errno : 0)
|
||||
# define glthread_rwlock_rdlock(LOCK) \
|
||||
(pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0)
|
||||
# define glthread_rwlock_wrlock(LOCK) \
|
||||
(pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0)
|
||||
# define glthread_rwlock_unlock(LOCK) \
|
||||
(pth_in_use () && !pth_rwlock_release (LOCK) ? errno : 0)
|
||||
# define glthread_rwlock_destroy(LOCK) \
|
||||
((void)(LOCK), 0)
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
/* In Pth, mutexes are recursive by default. */
|
||||
typedef pth_mutex_t gl_recursive_lock_t;
|
||||
# define gl_recursive_lock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS pth_mutex_t NAME;
|
||||
# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS pth_mutex_t NAME = gl_recursive_lock_initializer;
|
||||
# define gl_recursive_lock_initializer \
|
||||
PTH_MUTEX_INIT
|
||||
# define glthread_recursive_lock_init(LOCK) \
|
||||
(pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
|
||||
# define glthread_recursive_lock_lock(LOCK) \
|
||||
(pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
|
||||
# define glthread_recursive_lock_unlock(LOCK) \
|
||||
(pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
|
||||
# define glthread_recursive_lock_destroy(LOCK) \
|
||||
((void)(LOCK), 0)
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
typedef pth_once_t gl_once_t;
|
||||
# define gl_once_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS pth_once_t NAME = PTH_ONCE_INIT;
|
||||
# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
|
||||
(pth_in_use () \
|
||||
? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
|
||||
: (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
|
||||
extern int glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void));
|
||||
extern int glthread_once_singlethreaded (pth_once_t *once_control);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_SOLARIS_THREADS
|
||||
|
||||
/* Use the old Solaris threads library. */
|
||||
|
||||
# include <thread.h>
|
||||
# include <synch.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
|
||||
# if USE_SOLARIS_THREADS_WEAK
|
||||
|
||||
/* Use weak references to the old Solaris threads library. */
|
||||
|
||||
# pragma weak mutex_init
|
||||
# pragma weak mutex_lock
|
||||
# pragma weak mutex_unlock
|
||||
# pragma weak mutex_destroy
|
||||
# pragma weak rwlock_init
|
||||
# pragma weak rw_rdlock
|
||||
# pragma weak rw_wrlock
|
||||
# pragma weak rw_unlock
|
||||
# pragma weak rwlock_destroy
|
||||
# pragma weak thr_self
|
||||
|
||||
# pragma weak thr_suspend
|
||||
# define thread_in_use() (thr_suspend != NULL)
|
||||
|
||||
# else
|
||||
|
||||
# define thread_in_use() 1
|
||||
|
||||
# endif
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
typedef mutex_t gl_lock_t;
|
||||
# define gl_lock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS mutex_t NAME;
|
||||
# define gl_lock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS mutex_t NAME = gl_lock_initializer;
|
||||
# define gl_lock_initializer \
|
||||
DEFAULTMUTEX
|
||||
# define glthread_lock_init(LOCK) \
|
||||
(thread_in_use () ? mutex_init (LOCK, USYNC_THREAD, NULL) : 0)
|
||||
# define glthread_lock_lock(LOCK) \
|
||||
(thread_in_use () ? mutex_lock (LOCK) : 0)
|
||||
# define glthread_lock_unlock(LOCK) \
|
||||
(thread_in_use () ? mutex_unlock (LOCK) : 0)
|
||||
# define glthread_lock_destroy(LOCK) \
|
||||
(thread_in_use () ? mutex_destroy (LOCK) : 0)
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
typedef rwlock_t gl_rwlock_t;
|
||||
# define gl_rwlock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS rwlock_t NAME;
|
||||
# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS rwlock_t NAME = gl_rwlock_initializer;
|
||||
# define gl_rwlock_initializer \
|
||||
DEFAULTRWLOCK
|
||||
# define glthread_rwlock_init(LOCK) \
|
||||
(thread_in_use () ? rwlock_init (LOCK, USYNC_THREAD, NULL) : 0)
|
||||
# define glthread_rwlock_rdlock(LOCK) \
|
||||
(thread_in_use () ? rw_rdlock (LOCK) : 0)
|
||||
# define glthread_rwlock_wrlock(LOCK) \
|
||||
(thread_in_use () ? rw_wrlock (LOCK) : 0)
|
||||
# define glthread_rwlock_unlock(LOCK) \
|
||||
(thread_in_use () ? rw_unlock (LOCK) : 0)
|
||||
# define glthread_rwlock_destroy(LOCK) \
|
||||
(thread_in_use () ? rwlock_destroy (LOCK) : 0)
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
/* Old Solaris threads did not have recursive locks.
|
||||
We have to implement them ourselves. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
mutex_t mutex;
|
||||
thread_t owner;
|
||||
unsigned long depth;
|
||||
}
|
||||
gl_recursive_lock_t;
|
||||
# define gl_recursive_lock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_recursive_lock_t NAME;
|
||||
# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
|
||||
# define gl_recursive_lock_initializer \
|
||||
{ DEFAULTMUTEX, (thread_t) 0, 0 }
|
||||
# define glthread_recursive_lock_init(LOCK) \
|
||||
(thread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
|
||||
# define glthread_recursive_lock_lock(LOCK) \
|
||||
(thread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
|
||||
# define glthread_recursive_lock_unlock(LOCK) \
|
||||
(thread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
|
||||
# define glthread_recursive_lock_destroy(LOCK) \
|
||||
(thread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
|
||||
extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile int inited;
|
||||
mutex_t mutex;
|
||||
}
|
||||
gl_once_t;
|
||||
# define gl_once_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX };
|
||||
# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
|
||||
(thread_in_use () \
|
||||
? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
|
||||
: (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
|
||||
extern int glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void));
|
||||
extern int glthread_once_singlethreaded (gl_once_t *once_control);
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_WINDOWS_THREADS
|
||||
|
||||
# define WIN32_LEAN_AND_MEAN /* avoid including junk */
|
||||
# include <windows.h>
|
||||
|
||||
# include "windows-mutex.h"
|
||||
# include "windows-rwlock.h"
|
||||
# include "windows-recmutex.h"
|
||||
# include "windows-once.h"
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
# endif
|
||||
@ -633,127 +539,69 @@ extern "C" {
|
||||
/* There is no way to statically initialize a CRITICAL_SECTION. It needs
|
||||
to be done lazily, once only. For this we need spinlocks. */
|
||||
|
||||
typedef struct { volatile int done; volatile long started; } gl_spinlock_t;
|
||||
|
||||
/* -------------------------- gl_lock_t datatype -------------------------- */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gl_spinlock_t guard; /* protects the initialization */
|
||||
CRITICAL_SECTION lock;
|
||||
}
|
||||
gl_lock_t;
|
||||
typedef glwthread_mutex_t gl_lock_t;
|
||||
# define gl_lock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_lock_t NAME;
|
||||
# define gl_lock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_lock_t NAME = gl_lock_initializer;
|
||||
# define gl_lock_initializer \
|
||||
{ { 0, -1 } }
|
||||
GLWTHREAD_MUTEX_INIT
|
||||
# define glthread_lock_init(LOCK) \
|
||||
(glthread_lock_init_func (LOCK), 0)
|
||||
(glwthread_mutex_init (LOCK), 0)
|
||||
# define glthread_lock_lock(LOCK) \
|
||||
glthread_lock_lock_func (LOCK)
|
||||
glwthread_mutex_lock (LOCK)
|
||||
# define glthread_lock_unlock(LOCK) \
|
||||
glthread_lock_unlock_func (LOCK)
|
||||
glwthread_mutex_unlock (LOCK)
|
||||
# define glthread_lock_destroy(LOCK) \
|
||||
glthread_lock_destroy_func (LOCK)
|
||||
extern void glthread_lock_init_func (gl_lock_t *lock);
|
||||
extern int glthread_lock_lock_func (gl_lock_t *lock);
|
||||
extern int glthread_lock_unlock_func (gl_lock_t *lock);
|
||||
extern int glthread_lock_destroy_func (gl_lock_t *lock);
|
||||
glwthread_mutex_destroy (LOCK)
|
||||
|
||||
/* ------------------------- gl_rwlock_t datatype ------------------------- */
|
||||
|
||||
/* It is impossible to implement read-write locks using plain locks, without
|
||||
introducing an extra thread dedicated to managing read-write locks.
|
||||
Therefore here we need to use the low-level Event type. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HANDLE *array; /* array of waiting threads, each represented by an event */
|
||||
unsigned int count; /* number of waiting threads */
|
||||
unsigned int alloc; /* length of allocated array */
|
||||
unsigned int offset; /* index of first waiting thread in array */
|
||||
}
|
||||
gl_carray_waitqueue_t;
|
||||
typedef struct
|
||||
{
|
||||
gl_spinlock_t guard; /* protects the initialization */
|
||||
CRITICAL_SECTION lock; /* protects the remaining fields */
|
||||
gl_carray_waitqueue_t waiting_readers; /* waiting readers */
|
||||
gl_carray_waitqueue_t waiting_writers; /* waiting writers */
|
||||
int runcount; /* number of readers running, or -1 when a writer runs */
|
||||
}
|
||||
gl_rwlock_t;
|
||||
typedef glwthread_rwlock_t gl_rwlock_t;
|
||||
# define gl_rwlock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_rwlock_t NAME;
|
||||
# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
|
||||
# define gl_rwlock_initializer \
|
||||
{ { 0, -1 } }
|
||||
GLWTHREAD_RWLOCK_INIT
|
||||
# define glthread_rwlock_init(LOCK) \
|
||||
(glthread_rwlock_init_func (LOCK), 0)
|
||||
(glwthread_rwlock_init (LOCK), 0)
|
||||
# define glthread_rwlock_rdlock(LOCK) \
|
||||
glthread_rwlock_rdlock_func (LOCK)
|
||||
glwthread_rwlock_rdlock (LOCK)
|
||||
# define glthread_rwlock_wrlock(LOCK) \
|
||||
glthread_rwlock_wrlock_func (LOCK)
|
||||
glwthread_rwlock_wrlock (LOCK)
|
||||
# define glthread_rwlock_unlock(LOCK) \
|
||||
glthread_rwlock_unlock_func (LOCK)
|
||||
glwthread_rwlock_unlock (LOCK)
|
||||
# define glthread_rwlock_destroy(LOCK) \
|
||||
glthread_rwlock_destroy_func (LOCK)
|
||||
extern void glthread_rwlock_init_func (gl_rwlock_t *lock);
|
||||
extern int glthread_rwlock_rdlock_func (gl_rwlock_t *lock);
|
||||
extern int glthread_rwlock_wrlock_func (gl_rwlock_t *lock);
|
||||
extern int glthread_rwlock_unlock_func (gl_rwlock_t *lock);
|
||||
extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock);
|
||||
glwthread_rwlock_destroy (LOCK)
|
||||
|
||||
/* --------------------- gl_recursive_lock_t datatype --------------------- */
|
||||
|
||||
/* The native Windows documentation says that CRITICAL_SECTION already
|
||||
implements a recursive lock. But we need not rely on it: It's easy to
|
||||
implement a recursive lock without this assumption. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gl_spinlock_t guard; /* protects the initialization */
|
||||
DWORD owner;
|
||||
unsigned long depth;
|
||||
CRITICAL_SECTION lock;
|
||||
}
|
||||
gl_recursive_lock_t;
|
||||
typedef glwthread_recmutex_t gl_recursive_lock_t;
|
||||
# define gl_recursive_lock_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_recursive_lock_t NAME;
|
||||
# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
|
||||
# define gl_recursive_lock_initializer \
|
||||
{ { 0, -1 }, 0, 0 }
|
||||
GLWTHREAD_RECMUTEX_INIT
|
||||
# define glthread_recursive_lock_init(LOCK) \
|
||||
(glthread_recursive_lock_init_func (LOCK), 0)
|
||||
(glwthread_recmutex_init (LOCK), 0)
|
||||
# define glthread_recursive_lock_lock(LOCK) \
|
||||
glthread_recursive_lock_lock_func (LOCK)
|
||||
glwthread_recmutex_lock (LOCK)
|
||||
# define glthread_recursive_lock_unlock(LOCK) \
|
||||
glthread_recursive_lock_unlock_func (LOCK)
|
||||
glwthread_recmutex_unlock (LOCK)
|
||||
# define glthread_recursive_lock_destroy(LOCK) \
|
||||
glthread_recursive_lock_destroy_func (LOCK)
|
||||
extern void glthread_recursive_lock_init_func (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock);
|
||||
extern int glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock);
|
||||
glwthread_recmutex_destroy (LOCK)
|
||||
|
||||
/* -------------------------- gl_once_t datatype -------------------------- */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
volatile int inited;
|
||||
volatile long started;
|
||||
CRITICAL_SECTION lock;
|
||||
}
|
||||
gl_once_t;
|
||||
typedef glwthread_once_t gl_once_t;
|
||||
# define gl_once_define(STORAGECLASS, NAME) \
|
||||
STORAGECLASS gl_once_t NAME = { -1, -1 };
|
||||
STORAGECLASS gl_once_t NAME = GLWTHREAD_ONCE_INIT;
|
||||
# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
|
||||
(glthread_once_func (ONCE_CONTROL, INITFUNCTION), 0)
|
||||
extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (void));
|
||||
(glwthread_once (ONCE_CONTROL, INITFUNCTION), 0)
|
||||
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
@ -763,7 +611,7 @@ extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (v
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
|
||||
#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
|
||||
|
||||
/* Provide dummy implementation if threads are not supported. */
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Multithreading primitives.
|
||||
Copyright (C) 2005-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2005. */
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
|
||||
/* ========================================================================= */
|
||||
|
||||
#if USE_POSIX_THREADS
|
||||
#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
|
||||
|
||||
/* Use the POSIX threads library. */
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* hard-locale.c -- Determine whether a locale is hard.
|
||||
|
||||
Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2016 Free Software
|
||||
Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2019 Free Software
|
||||
Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -14,7 +14,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* Determine whether a locale is hard.
|
||||
|
||||
Copyright (C) 1999, 2003-2004, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2003-2004, 2009-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef HARD_LOCALE_H_
|
||||
# define HARD_LOCALE_H_ 1
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
|
||||
|
||||
Copyright (C) 2005-2006, 2008-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2005-2006, 2008-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996-1999 by Internet Software Consortium.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/* intprops.h -- properties of integer types
|
||||
|
||||
Copyright (C) 2001-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
@ -21,18 +21,14 @@
|
||||
#define _GL_INTPROPS_H
|
||||
|
||||
#include <limits.h>
|
||||
#include <verify.h>
|
||||
|
||||
#ifndef __has_builtin
|
||||
# define __has_builtin(x) 0
|
||||
#endif
|
||||
|
||||
/* Return a value with the common real type of E and V and the value of V. */
|
||||
#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
|
||||
/* Return a value with the common real type of E and V and the value of V.
|
||||
Do not evaluate E. */
|
||||
#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
|
||||
|
||||
/* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>. */
|
||||
#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
|
||||
<https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>. */
|
||||
#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
|
||||
|
||||
/* The extra casts in the following macros work around compiler bugs,
|
||||
e.g., in Cray C 5.0.3.0. */
|
||||
@ -45,13 +41,14 @@
|
||||
#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
|
||||
|
||||
/* Return 1 if the real expression E, after promotion, has a
|
||||
signed or floating type. */
|
||||
signed or floating type. Do not evaluate E. */
|
||||
#define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
|
||||
|
||||
|
||||
/* Minimum and maximum values for integer types and expressions. */
|
||||
|
||||
/* The width in bits of the integer type or expression T.
|
||||
Do not evaluate T.
|
||||
Padding bits are not supported; this is checked at compile-time below. */
|
||||
#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
|
||||
|
||||
@ -63,7 +60,7 @@
|
||||
: ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
|
||||
|
||||
/* The maximum and minimum values for the type of the expression E,
|
||||
after integer promotion. E should not have side effects. */
|
||||
after integer promotion. E is not evaluated. */
|
||||
#define _GL_INT_MINIMUM(e) \
|
||||
(EXPR_SIGNED (e) \
|
||||
? ~ _GL_SIGNED_INT_MAXIMUM (e) \
|
||||
@ -84,24 +81,7 @@
|
||||
/* This include file assumes that signed types are two's complement without
|
||||
padding bits; the above macros have undefined behavior otherwise.
|
||||
If this is a problem for you, please let us know how to fix it for your host.
|
||||
As a sanity check, test the assumption for some signed types that
|
||||
<limits.h> bounds. */
|
||||
verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
|
||||
verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
|
||||
verify (TYPE_MINIMUM (short int) == SHRT_MIN);
|
||||
verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
|
||||
verify (TYPE_MINIMUM (int) == INT_MIN);
|
||||
verify (TYPE_MAXIMUM (int) == INT_MAX);
|
||||
verify (TYPE_MINIMUM (long int) == LONG_MIN);
|
||||
verify (TYPE_MAXIMUM (long int) == LONG_MAX);
|
||||
#ifdef LLONG_MAX
|
||||
verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
|
||||
verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
|
||||
#endif
|
||||
/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */
|
||||
#ifdef UINT_WIDTH
|
||||
verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
|
||||
#endif
|
||||
This assumption is tested by the intprops-tests module. */
|
||||
|
||||
/* Does the __typeof__ keyword work? This could be done by
|
||||
'configure', but for now it's easier to do it by hand. */
|
||||
@ -131,8 +111,8 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
|
||||
Subtract 1 for the sign bit if T is signed, and then add 1 more for
|
||||
a minus sign if needed.
|
||||
|
||||
Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is
|
||||
signed, this macro may overestimate the true bound by one byte when
|
||||
Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 1 when its argument is
|
||||
unsigned, this macro may overestimate the true bound by one byte when
|
||||
applied to unsigned types of size 2, 4, 16, ... bytes. */
|
||||
#define INT_STRLEN_BOUND(t) \
|
||||
(INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
|
||||
@ -201,7 +181,7 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
|
||||
/* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
|
||||
See above for restrictions. Avoid && and || as they tickle
|
||||
bugs in Sun C 5.11 2010/08/13 and other compilers; see
|
||||
<http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>. */
|
||||
<https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>. */
|
||||
#define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max) \
|
||||
((b) < 0 \
|
||||
? ((a) < 0 \
|
||||
@ -240,13 +220,27 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
|
||||
? (a) < (min) >> (b) \
|
||||
: (max) >> (b) < (a))
|
||||
|
||||
/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */
|
||||
#define _GL_HAS_BUILTIN_OVERFLOW \
|
||||
(5 <= __GNUC__ || __has_builtin (__builtin_add_overflow))
|
||||
/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
|
||||
(A, B, P) work when P is non-null. */
|
||||
#if 5 <= __GNUC__ && !defined __ICC
|
||||
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
|
||||
#elif defined __has_builtin
|
||||
# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
|
||||
#else
|
||||
# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
|
||||
#endif
|
||||
|
||||
/* True if __builtin_add_overflow_p (A, B, C) works. */
|
||||
#define _GL_HAS_BUILTIN_OVERFLOW_P \
|
||||
(7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p))
|
||||
/* True if __builtin_mul_overflow (A, B, P) works when P is non-null. */
|
||||
#ifdef __clang__
|
||||
/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>. */
|
||||
# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
|
||||
#else
|
||||
# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
|
||||
#endif
|
||||
|
||||
/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
|
||||
__builtin_mul_overflow_p and __builtin_mul_overflow_p. */
|
||||
#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
|
||||
|
||||
/* The _GL*_OVERFLOW macros have the same restrictions as the
|
||||
*_RANGE_OVERFLOW macros, except that they do not assume that operands
|
||||
@ -299,7 +293,9 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
|
||||
|
||||
The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
|
||||
might not yield numerically correct answers due to arithmetic overflow.
|
||||
The INT_<op>_WRAPV macros also store the low-order bits of the answer.
|
||||
The INT_<op>_WRAPV macros compute the low-order bits of the sum,
|
||||
difference, and product of two C integers, and return 1 if these
|
||||
low-order bits are not numerically correct.
|
||||
These macros work correctly on all known practical hosts, and do not rely
|
||||
on undefined behavior due to signed arithmetic overflow.
|
||||
|
||||
@ -327,9 +323,11 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
|
||||
arguments should not have side effects.
|
||||
|
||||
The WRAPV macros are not constant expressions. They support only
|
||||
+, binary -, and *. The result type must be signed.
|
||||
+, binary -, and *. Because the WRAPV macros convert the result,
|
||||
they report overflow in different circumstances than the OVERFLOW
|
||||
macros do.
|
||||
|
||||
These macros are tuned for their last argument being a constant.
|
||||
These macros are tuned for their last input argument being a constant.
|
||||
|
||||
Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
|
||||
A % B, and A << B would overflow, respectively. */
|
||||
@ -360,24 +358,43 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
|
||||
Arguments should be free of side effects. */
|
||||
#define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow) \
|
||||
op_result_overflow (a, b, \
|
||||
_GL_INT_MINIMUM (0 * (b) + (a)), \
|
||||
_GL_INT_MAXIMUM (0 * (b) + (a)))
|
||||
_GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \
|
||||
_GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b)))
|
||||
|
||||
/* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
|
||||
Return 1 if the result overflows. See above for restrictions. */
|
||||
#define INT_ADD_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
|
||||
#define INT_SUBTRACT_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW)
|
||||
#define INT_MULTIPLY_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
|
||||
#if _GL_HAS_BUILTIN_ADD_OVERFLOW
|
||||
# define INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r)
|
||||
# define INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r)
|
||||
#else
|
||||
# define INT_ADD_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
|
||||
# define INT_SUBTRACT_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
|
||||
#endif
|
||||
#if _GL_HAS_BUILTIN_MUL_OVERFLOW
|
||||
# if (9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
|
||||
|| (__GNUC__ == 8 && 4 <= __GNUC_MINOR__))
|
||||
# define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
|
||||
# else
|
||||
/* Work around GCC bug 91450. */
|
||||
# define INT_MULTIPLY_WRAPV(a, b, r) \
|
||||
((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
|
||||
&& _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
|
||||
? ((void) __builtin_mul_overflow (a, b, r), 1) \
|
||||
: __builtin_mul_overflow (a, b, r))
|
||||
# endif
|
||||
#else
|
||||
# define INT_MULTIPLY_WRAPV(a, b, r) \
|
||||
_GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
|
||||
#endif
|
||||
|
||||
/* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See:
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
|
||||
https://llvm.org/bugs/show_bug.cgi?id=25390
|
||||
For now, assume all versions of GCC-like compilers generate bogus
|
||||
warnings for _Generic. This matters only for older compilers that
|
||||
lack __builtin_add_overflow. */
|
||||
warnings for _Generic. This matters only for compilers that
|
||||
lack relevant builtins. */
|
||||
#if __GNUC__
|
||||
# define _GL__GENERIC_BOGUS 1
|
||||
#else
|
||||
@ -385,80 +402,183 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
|
||||
#endif
|
||||
|
||||
/* Store the low-order bits of A <op> B into *R, where OP specifies
|
||||
the operation. BUILTIN is the builtin operation, and OVERFLOW the
|
||||
overflow predicate. Return 1 if the result overflows. See above
|
||||
for restrictions. */
|
||||
#if _GL_HAS_BUILTIN_OVERFLOW
|
||||
# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
|
||||
#elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
|
||||
# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
|
||||
the operation and OVERFLOW the overflow predicate. Return 1 if the
|
||||
result overflows. See above for restrictions. */
|
||||
#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
|
||||
# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
|
||||
(_Generic \
|
||||
(*(r), \
|
||||
signed char: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
signed char, SCHAR_MIN, SCHAR_MAX), \
|
||||
unsigned char: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
unsigned char, 0, UCHAR_MAX), \
|
||||
short int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
short int, SHRT_MIN, SHRT_MAX), \
|
||||
unsigned short int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
unsigned short int, 0, USHRT_MAX), \
|
||||
int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
int, INT_MIN, INT_MAX), \
|
||||
unsigned int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
unsigned int, 0, UINT_MAX), \
|
||||
long int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
long int, LONG_MIN, LONG_MAX), \
|
||||
unsigned long int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
unsigned long int, 0, ULONG_MAX), \
|
||||
long long int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
long long int, LLONG_MIN, LLONG_MAX)))
|
||||
long long int, LLONG_MIN, LLONG_MAX), \
|
||||
unsigned long long int: \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
unsigned long long int, 0, ULLONG_MAX)))
|
||||
#else
|
||||
# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
|
||||
/* Store the low-order bits of A <op> B into *R, where OP specifies
|
||||
the operation and OVERFLOW the overflow predicate. If *R is
|
||||
signed, its type is ST with bounds SMIN..SMAX; otherwise its type
|
||||
is UT with bounds U..UMAX. ST and UT are narrower than int.
|
||||
Return 1 if the result overflows. See above for restrictions. */
|
||||
# if _GL_HAVE___TYPEOF__
|
||||
# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
|
||||
(TYPE_SIGNED (__typeof__ (*(r))) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
|
||||
# else
|
||||
# define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
|
||||
(overflow (a, b, smin, smax) \
|
||||
? (overflow (a, b, 0, umax) \
|
||||
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
|
||||
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
|
||||
: (overflow (a, b, 0, umax) \
|
||||
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
|
||||
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
|
||||
# endif
|
||||
|
||||
# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
|
||||
(sizeof *(r) == sizeof (signed char) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
|
||||
signed char, SCHAR_MIN, SCHAR_MAX) \
|
||||
? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
|
||||
signed char, SCHAR_MIN, SCHAR_MAX, \
|
||||
unsigned char, UCHAR_MAX) \
|
||||
: sizeof *(r) == sizeof (short int) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
|
||||
short int, SHRT_MIN, SHRT_MAX) \
|
||||
? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
|
||||
short int, SHRT_MIN, SHRT_MAX, \
|
||||
unsigned short int, USHRT_MAX) \
|
||||
: sizeof *(r) == sizeof (int) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
int, INT_MIN, INT_MAX) \
|
||||
? (EXPR_SIGNED (*(r)) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
int, INT_MIN, INT_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
|
||||
unsigned int, 0, UINT_MAX)) \
|
||||
: _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
|
||||
# ifdef LLONG_MAX
|
||||
# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
|
||||
(sizeof *(r) == sizeof (long int) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
long int, LONG_MIN, LONG_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
long long int, LLONG_MIN, LLONG_MAX))
|
||||
? (EXPR_SIGNED (*(r)) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
long int, LONG_MIN, LONG_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
unsigned long int, 0, ULONG_MAX)) \
|
||||
: (EXPR_SIGNED (*(r)) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
long long int, LLONG_MIN, LLONG_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
|
||||
unsigned long long int, 0, ULLONG_MAX)))
|
||||
# else
|
||||
# define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
|
||||
_GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
long int, LONG_MIN, LONG_MAX)
|
||||
(EXPR_SIGNED (*(r)) \
|
||||
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
long int, LONG_MIN, LONG_MAX) \
|
||||
: _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
|
||||
unsigned long int, 0, ULONG_MAX))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Store the low-order bits of A <op> B into *R, where the operation
|
||||
is given by OP. Use the unsigned type UT for calculation to avoid
|
||||
overflow problems. *R's type is T, with extremal values TMIN and
|
||||
TMAX. T must be a signed integer type. Return 1 if the result
|
||||
overflows. */
|
||||
overflow problems. *R's type is T, with extrema TMIN and TMAX.
|
||||
T must be a signed integer type. Return 1 if the result overflows. */
|
||||
#define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
|
||||
(sizeof ((a) op (b)) < sizeof (t) \
|
||||
? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
|
||||
: _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax))
|
||||
#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \
|
||||
((overflow (a, b) \
|
||||
|| (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \
|
||||
|| (tmax) < ((a) op (b))) \
|
||||
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 1) \
|
||||
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 0))
|
||||
(overflow (a, b, tmin, tmax) \
|
||||
? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
|
||||
: (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
|
||||
|
||||
/* Return A <op> B, where the operation is given by OP. Use the
|
||||
unsigned type UT for calculation to avoid overflow problems.
|
||||
Convert the result to type T without overflow by subtracting TMIN
|
||||
from large values before converting, and adding it afterwards.
|
||||
Compilers can optimize all the operations except OP. */
|
||||
#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax) \
|
||||
(((ut) (a) op (ut) (b)) <= (tmax) \
|
||||
? (t) ((ut) (a) op (ut) (b)) \
|
||||
: ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin)))
|
||||
/* Return the low-order bits of A <op> B, where the operation is given
|
||||
by OP. Use the unsigned type UT for calculation to avoid undefined
|
||||
behavior on signed integer overflow, and convert the result to type T.
|
||||
UT is at least as wide as T and is no narrower than unsigned int,
|
||||
T is two's complement, and there is no padding or trap representations.
|
||||
Assume that converting UT to T yields the low-order bits, as is
|
||||
done in all known two's-complement C compilers. E.g., see:
|
||||
https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
|
||||
|
||||
According to the C standard, converting UT to T yields an
|
||||
implementation-defined result or signal for values outside T's
|
||||
range. However, code that works around this theoretical problem
|
||||
runs afoul of a compiler bug in Oracle Studio 12.3 x86. See:
|
||||
https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
|
||||
As the compiler bug is real, don't try to work around the
|
||||
theoretical problem. */
|
||||
|
||||
#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
|
||||
((t) ((ut) (a) op (ut) (b)))
|
||||
|
||||
/* Return true if the numeric values A + B, A - B, A * B fall outside
|
||||
the range TMIN..TMAX. Arguments should be integer expressions
|
||||
without side effects. TMIN should be signed and nonpositive.
|
||||
TMAX should be positive, and should be signed unless TMIN is zero. */
|
||||
#define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \
|
||||
((b) < 0 \
|
||||
? (((tmin) \
|
||||
? ((EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \
|
||||
&& (a) < (tmin) - (b)) \
|
||||
: (a) <= -1 - (b)) \
|
||||
|| ((EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \
|
||||
: (a) < 0 \
|
||||
? (((tmin) \
|
||||
? ((EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \
|
||||
&& (b) < (tmin) - (a)) \
|
||||
: (b) <= -1 - (a)) \
|
||||
|| ((EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \
|
||||
&& (tmax) < (a) + (b))) \
|
||||
: (tmax) < (b) || (tmax) - (b) < (a))
|
||||
#define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \
|
||||
(((a) < 0) == ((b) < 0) \
|
||||
? ((a) < (b) \
|
||||
? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \
|
||||
: (tmax) < (a) - (b)) \
|
||||
: (a) < 0 \
|
||||
? ((!EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \
|
||||
|| (a) - (tmin) < (b)) \
|
||||
: ((! (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
|
||||
&& EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \
|
||||
&& (tmax) <= -1 - (b)) \
|
||||
|| (tmax) + (b) < (a)))
|
||||
#define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \
|
||||
((b) < 0 \
|
||||
? ((a) < 0 \
|
||||
? (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
|
||||
? (a) < (tmax) / (b) \
|
||||
: ((INT_NEGATE_OVERFLOW (b) \
|
||||
? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (b) - 1) \
|
||||
: (tmax) / -(b)) \
|
||||
<= -1 - (a))) \
|
||||
: INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
|
||||
? (EXPR_SIGNED (a) \
|
||||
? 0 < (a) + (tmin) \
|
||||
: 0 < (a) && -1 - (tmin) < (a) - 1) \
|
||||
: (tmin) / (b) < (a)) \
|
||||
: (b) == 0 \
|
||||
? 0 \
|
||||
: ((a) < 0 \
|
||||
? (INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \
|
||||
? (EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \
|
||||
: (tmin) / (a) < (b)) \
|
||||
: (tmax) / (b) < (a)))
|
||||
|
||||
#endif /* _GL_INTPROPS_H */
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 2006-2019 Free Software Foundation, Inc.
|
||||
Written by Paul Eggert, Bruno Haible, Derek Price.
|
||||
This file is part of gnulib.
|
||||
|
||||
@ -13,11 +13,11 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C 99 <inttypes.h> for platforms that lack it.
|
||||
* <http://www.opengroup.org/susv3xbd/inttypes.h.html>
|
||||
* <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html>
|
||||
*/
|
||||
|
||||
#if __GNUC__ >= 3
|
||||
@ -49,15 +49,15 @@
|
||||
#ifndef __GLIBC__
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
/* Get CHAR_BIT. */
|
||||
/* Get CHAR_BIT, INT_MAX, LONG_MAX, etc. */
|
||||
#include <limits.h>
|
||||
/* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
|
||||
#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
|
||||
#if defined _WIN32 && ! defined __CYGWIN__
|
||||
# include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX)
|
||||
# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>."
|
||||
#if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1)
|
||||
# error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to <bug-gnulib@gnu.org>."
|
||||
#endif
|
||||
|
||||
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
||||
@ -1067,11 +1067,13 @@ _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
|
||||
#endif
|
||||
|
||||
#if @GNULIB_IMAXDIV@
|
||||
# if !@HAVE_DECL_IMAXDIV@
|
||||
# if !@HAVE_IMAXDIV_T@
|
||||
# if !GNULIB_defined_imaxdiv_t
|
||||
typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
|
||||
# define GNULIB_defined_imaxdiv_t 1
|
||||
# endif
|
||||
# endif
|
||||
# if !@HAVE_DECL_IMAXDIV@
|
||||
extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
|
||||
# endif
|
||||
#elif defined GNULIB_POSIXCHECK
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#if HAVE_ISNAND_IN_LIBC
|
||||
/* Get declaration of isnan macro. */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2008-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2008-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2008. */
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#if HAVE_ISNANL_IN_LIBC
|
||||
/* Get declaration of isnan macro or (older) isnanl function. */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Test for NaN that does not need libm.
|
||||
Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2007, 2009-2019 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
|
||||
@ -12,7 +12,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/* Replacement for 'int' to 'long double' conversion routine.
|
||||
Copyright (C) 2011-2016 Free Software Foundation, Inc.
|
||||
Copyright (C) 2011-2019 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2011.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
174
gnulib/import/libc-config.h
Normal file
174
gnulib/import/libc-config.h
Normal file
@ -0,0 +1,174 @@
|
||||
/* System definitions for code taken from the GNU C Library
|
||||
|
||||
Copyright 2017-2019 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 3 of the License, 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, see
|
||||
<https://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Written by Paul Eggert. */
|
||||
|
||||
/* This is intended to be a good-enough substitute for glibc system
|
||||
macros like those defined in <sys/cdefs.h>, so that Gnulib code
|
||||
shared with glibc can do this as the first #include:
|
||||
|
||||
#ifndef _LIBC
|
||||
# include <libc-config.h>
|
||||
#endif
|
||||
|
||||
When compiled as part of glibc this is a no-op; when compiled as
|
||||
part of Gnulib this includes Gnulib's <config.h> and defines macros
|
||||
that glibc library code would normally assume. */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* On glibc this includes <features.h> and <sys/cdefs.h> and #defines
|
||||
_FEATURES_H, __WORDSIZE, and __set_errno. On FreeBSD 11 it
|
||||
includes <sys/cdefs.h> which defines __nonnull. Elsewhere it
|
||||
is harmless. */
|
||||
#include <errno.h>
|
||||
|
||||
/* From glibc <errno.h>. */
|
||||
#ifndef __set_errno
|
||||
# define __set_errno(val) (errno = (val))
|
||||
#endif
|
||||
|
||||
/* From glibc <features.h>. */
|
||||
|
||||
#ifndef __GNUC_PREREQ
|
||||
# if defined __GNUC__ && defined __GNUC_MINOR__
|
||||
# define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__))
|
||||
# else
|
||||
# define __GNUC_PREREQ(maj, min) 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef __glibc_clang_prereq
|
||||
# if defined __clang_major__ && defined __clang_minor__
|
||||
# define __glibc_clang_prereq(maj, min) \
|
||||
((maj) < __clang_major__ + ((min) <= __clang_minor__))
|
||||
# else
|
||||
# define __glibc_clang_prereq(maj, min) 0
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Prepare to include <cdefs.h>, which is our copy of glibc
|
||||
<sys/cdefs.h>. */
|
||||
|
||||
/* Define _FEATURES_H so that <cdefs.h> does not include <features.h>. */
|
||||
#ifndef _FEATURES_H
|
||||
# define _FEATURES_H 1
|
||||
#endif
|
||||
/* Define __WORDSIZE so that <cdefs.h> does not attempt to include
|
||||
nonexistent files. Make it a syntax error, since Gnulib does not
|
||||
use __WORDSIZE now, and if Gnulib uses it later the syntax error
|
||||
will let us know that __WORDSIZE needs configuring. */
|
||||
#ifndef __WORDSIZE
|
||||
# define __WORDSIZE %%%
|
||||
#endif
|
||||
/* Undef the macros unconditionally defined by our copy of glibc
|
||||
<sys/cdefs.h>, so that they do not clash with any system-defined
|
||||
versions. */
|
||||
#undef _SYS_CDEFS_H
|
||||
#undef __ASMNAME
|
||||
#undef __ASMNAME2
|
||||
#undef __BEGIN_DECLS
|
||||
#undef __CONCAT
|
||||
#undef __END_DECLS
|
||||
#undef __HAVE_GENERIC_SELECTION
|
||||
#undef __LDBL_COMPAT
|
||||
#undef __LDBL_REDIR
|
||||
#undef __LDBL_REDIR1
|
||||
#undef __LDBL_REDIR1_DECL
|
||||
#undef __LDBL_REDIR1_NTH
|
||||
#undef __LDBL_REDIR_DECL
|
||||
#undef __LDBL_REDIR_NTH
|
||||
#undef __LEAF
|
||||
#undef __LEAF_ATTR
|
||||
#undef __NTH
|
||||
#undef __NTHNL
|
||||
#undef __P
|
||||
#undef __PMT
|
||||
#undef __REDIRECT
|
||||
#undef __REDIRECT_LDBL
|
||||
#undef __REDIRECT_NTH
|
||||
#undef __REDIRECT_NTHNL
|
||||
#undef __REDIRECT_NTH_LDBL
|
||||
#undef __STRING
|
||||
#undef __THROW
|
||||
#undef __THROWNL
|
||||
#undef __always_inline
|
||||
#undef __attribute__
|
||||
#undef __attribute_alloc_size__
|
||||
#undef __attribute_artificial__
|
||||
#undef __attribute_const__
|
||||
#undef __attribute_deprecated__
|
||||
#undef __attribute_deprecated_msg__
|
||||
#undef __attribute_format_arg__
|
||||
#undef __attribute_format_strfmon__
|
||||
#undef __attribute_malloc__
|
||||
#undef __attribute_noinline__
|
||||
#undef __attribute_nonstring__
|
||||
#undef __attribute_pure__
|
||||
#undef __attribute_used__
|
||||
#undef __attribute_warn_unused_result__
|
||||
#undef __bos
|
||||
#undef __bos0
|
||||
#undef __errordecl
|
||||
#undef __extension__
|
||||
#undef __extern_always_inline
|
||||
#undef __extern_inline
|
||||
#undef __flexarr
|
||||
#undef __fortify_function
|
||||
#undef __glibc_c99_flexarr_available
|
||||
#undef __glibc_clang_has_extension
|
||||
#undef __glibc_likely
|
||||
#undef __glibc_macro_warning
|
||||
#undef __glibc_macro_warning1
|
||||
#undef __glibc_unlikely
|
||||
#undef __inline
|
||||
#undef __ptr_t
|
||||
#undef __restrict
|
||||
#undef __restrict_arr
|
||||
#undef __va_arg_pack
|
||||
#undef __va_arg_pack_len
|
||||
#undef __warnattr
|
||||
#undef __warndecl
|
||||
|
||||
/* Include our copy of glibc <sys/cdefs.h>. */
|
||||
#include <cdefs.h>
|
||||
|
||||
/* <cdefs.h> __inline is too pessimistic for non-GCC. */
|
||||
#undef __inline
|
||||
#ifndef HAVE___INLINE
|
||||
# if 199901 <= __STDC_VERSION__ || defined inline
|
||||
# define __inline inline
|
||||
# else
|
||||
# define __inline
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* A substitute for glibc <libc-symbols.h>, good enough for Gnulib. */
|
||||
#define attribute_hidden
|
||||
#define libc_hidden_proto(name, ...)
|
||||
#define libc_hidden_def(name)
|
||||
#define libc_hidden_weak(name)
|
||||
#define libc_hidden_ver(local, name)
|
||||
#define strong_alias(name, aliasname)
|
||||
#define weak_alias(name, aliasname)
|
||||
|
||||
/* A substitute for glibc <shlib-compat.h>, good enough for Gnulib. */
|
||||
#define SHLIB_COMPAT(lib, introduced, obsoleted) 0
|
||||
#define versioned_symbol(lib, local, symbol, version)
|
||||
@ -1,6 +1,6 @@
|
||||
/* A GNU-like <limits.h>.
|
||||
|
||||
Copyright 2016 Free Software Foundation, Inc.
|
||||
Copyright 2016-2019 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
|
||||
@ -13,7 +13,7 @@
|
||||
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, see <http://www.gnu.org/licenses/>. */
|
||||
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _@GUARD_PREFIX@_LIMITS_H
|
||||
|
||||
@ -28,6 +28,34 @@
|
||||
#ifndef _@GUARD_PREFIX@_LIMITS_H
|
||||
#define _@GUARD_PREFIX@_LIMITS_H
|
||||
|
||||
#ifndef LLONG_MIN
|
||||
# if defined LONG_LONG_MIN /* HP-UX 11.31 */
|
||||
# define LLONG_MIN LONG_LONG_MIN
|
||||
# elif defined LONGLONG_MIN /* IRIX 6.5 */
|
||||
# define LLONG_MIN LONGLONG_MIN
|
||||
# elif defined __GNUC__
|
||||
# define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL)
|
||||
# endif
|
||||
#endif
|
||||
#ifndef LLONG_MAX
|
||||
# if defined LONG_LONG_MAX /* HP-UX 11.31 */
|
||||
# define LLONG_MAX LONG_LONG_MAX
|
||||
# elif defined LONGLONG_MAX /* IRIX 6.5 */
|
||||
# define LLONG_MAX LONGLONG_MAX
|
||||
# elif defined __GNUC__
|
||||
# define LLONG_MAX __LONG_LONG_MAX__
|
||||
# endif
|
||||
#endif
|
||||
#ifndef ULLONG_MAX
|
||||
# if defined ULONG_LONG_MAX /* HP-UX 11.31 */
|
||||
# define ULLONG_MAX ULONG_LONG_MAX
|
||||
# elif defined ULONGLONG_MAX /* IRIX 6.5 */
|
||||
# define ULLONG_MAX ULONGLONG_MAX
|
||||
# elif defined __GNUC__
|
||||
# define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* The number of usable bits in an unsigned or signed integer type
|
||||
with minimum value MIN and maximum value MAX, as an int expression
|
||||
suitable in #if. Cover all known practical hosts. This
|
||||
@ -42,6 +70,19 @@
|
||||
#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
|
||||
#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
|
||||
|
||||
#ifndef WORD_BIT
|
||||
/* Assume 'int' is 32 bits wide. */
|
||||
# define WORD_BIT 32
|
||||
#endif
|
||||
#ifndef LONG_BIT
|
||||
/* Assume 'long' is 32 or 64 bits wide. */
|
||||
# if LONG_MAX == INT_MAX
|
||||
# define LONG_BIT 32
|
||||
# else
|
||||
# define LONG_BIT 64
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Macros specified by ISO/IEC TS 18661-1:2014. */
|
||||
|
||||
#if (! defined ULLONG_WIDTH \
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user