Skip to content

Commit

Permalink
misc. tinkering
Browse files Browse the repository at this point in the history
  • Loading branch information
cooljeanius committed Jun 29, 2024
1 parent 34a3b03 commit 550cd74
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 13 deletions.
6 changes: 5 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,11 @@ distclean-local:
rm -rf $(AM_V_v) autom4te.cache || rmdir autom4te.cache
rm -rf $(AM_V_v) .deps || rmdir .deps
-(test -d sys && test -z "`ls sys`" && rmdir sys) || test -e sys
-(test -d scan_build_output && test -z "`ls scan_build_output`" && rmdir scan_build_output) || test -e scan_build_output
-if test -x "`which scan-build`"; then \
(test -d scan_build_output && test -z "`ls scan_build_output`" && rmdir scan_build_output) || (test -e scan_build_output && stat scan_build_output) || (ls | grep "scan_build") || echo "nothing found from scan-build to clean"; \
else \
echo "scan-build missing; skipping any attempts to clean its output"; \
fi
-(test -w @PACKAGE_TARNAME@-@PACKAGE_VERSION@ && (rm -rf @PACKAGE_TARNAME@-@PACKAGE_VERSION@ || rmdir @PACKAGE_TARNAME@-@PACKAGE_VERSION@)) || stat @PACKAGE_TARNAME@-*.*.* 2>&1 || echo "it can be difficult to distclean the results of distcheck"
-(find . -name .DS_Store -delete 2>&1) || test -x "`which find`"
.PHONY: distclean-local
Expand Down
6 changes: 5 additions & 1 deletion Makefile.in

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ TODO list:
* catopen
* catgets
* catclose
* crypt
* ecvt
* fcvt
* setmntent
* addmntent
* endmntent
* hasmntopt
* sbrk
* brk
* sbrk (currently in brk.c; split out to a separate file)
* shmget
* swapon
* swapoff
Expand Down
5 changes: 5 additions & 0 deletions argp/argp-standalone-1.3/argp.h
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,11 @@ __argp_short_program_name(const struct argp_state *state) __THROW;
# endif /* !_LIBC */

# ifndef ARGP_EI
/* in case __inline__ is defined as a macro to be an attribute, force it to be
* a keyword instead: */
# if defined(__inline__) && defined(__GNUC__) && defined(HAVE_INLINE)
# undef __inline__
# endif /* __inline__ && __GNUC__ && HAVE_INLINE */
# define ARGP_EI extern __inline__
# endif /* !ARGP_EI */

Expand Down
4 changes: 4 additions & 0 deletions careadlinkat.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@

#include "allocator.h"

#if defined(_GL_GNUC_PREREQ) && _GL_GNUC_PREREQ(12, 1)
# pragma GCC diagnostic ignored "-Wreturn-local-addr"
#endif /* GCC 12.1+ */

/* Get the symbolic link value of FILENAME and put it into BUFFER, with
* size BUFFER_SIZE. This function acts like readlink but has
* readlinkat's signature. */
Expand Down
4 changes: 4 additions & 0 deletions crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,10 @@ static C_block *CF6464;
static C_block constdatablock; /* encryption constant */
static char cryptresult[1+4+4+11+1]; /* encrypted result */

#ifndef _PASSWORD_EFMT1
# define _PASSWORD_EFMT1 '_'
#endif /* !_PASSWORD_EFMT1 */

/*
* Return a pointer to static data consisting of the "setting"
* followed by an encryption produced by the "key" and "setting".
Expand Down
18 changes: 11 additions & 7 deletions fflush.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
#undef fflush


#if defined _IO_ftrylockfile || (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ == 1)) /* GNU libc, BeOS, Haiku, Linux libc5 */
#if defined(_IO_EOF_SEEN) || defined(_IO_ftrylockfile) || (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ == 1))
/* GNU libc, BeOS, Haiku, Linux libc5 */

/* Clear the stream's ungetc buffer, preserving the value of ftello (fp): */
static inline void clear_ungetc_buffer_preserving_position(FILE *fp)
Expand All @@ -63,7 +64,8 @@ static inline void clear_ungetc_buffer_preserving_position(FILE *fp)
static inline void
clear_ungetc_buffer(FILE *fp)
{
# if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
# if defined __sferror || defined __DragonFly__ || defined __ANDROID__
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
if (HASUB(fp)) {
fp_->_p += fp_->_r;
fp_->_r = 0;
Expand All @@ -82,7 +84,8 @@ clear_ungetc_buffer(FILE *fp)

#endif /* different C libraries */

#if (defined __sferror || defined __DragonFly__) && defined __SNPT /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
#if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */

static inline int
disable_seek_optimization(FILE *fp)
Expand All @@ -103,9 +106,9 @@ restore_seek_optimization(FILE *fp, int saved_flags)
static inline void
update_fpos_cache(FILE *fp, off_t pos)
{
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin: */
#if defined(__sferror) || defined(__DragonFly__)
# if defined(__CYGWIN__)
/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android: */
#if defined(__sferror) || defined(__DragonFly__) || defined(__ANDROID__)
# if defined(__CYGWIN__) || defined(__ANDROID__)
/* fp_->_offset is typed as an integer: */
fp_->_offset = pos;
# else
Expand Down Expand Up @@ -156,7 +159,8 @@ rpl_fflush(FILE *stream)
return fflush(stream);
}

#if defined _IO_ftrylockfile || (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ == 1)) /* GNU libc, BeOS, Haiku, Linux libc5 */
#if defined(_IO_EOF_SEEN) || defined(_IO_ftrylockfile) || (defined(__GNU_LIBRARY__) && (__GNU_LIBRARY__ == 1))
/* GNU libc, BeOS, Haiku, Linux libc5 */
clear_ungetc_buffer_preserving_position(stream);

return fflush(stream);
Expand Down
2 changes: 1 addition & 1 deletion strerror_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ safe_copy (char *buf, size_t buflen, const char *msg)
return ret;
}


/* FIXME: ought to return char * instead? */
int
strerror_r (int errnum, char *buf, size_t buflen)
#undef strerror_r
Expand Down
4 changes: 4 additions & 0 deletions xalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ extern "C" {
# endif /* !_GL_ATTRIBUTE_ALLOC_SIZE */
# endif /* gcc 4.3+ */

# if defined(__has_include) && __has_include("build-aux/snippet/_Noreturn.h")
# include "build-aux/snippet/_Noreturn.h"
# endif /* relevant snippet available */

/* This function is always triggered when memory is exhausted.
It must be defined by the application, either explicitly
or by using gnulib's xalloc-die module. This is the
Expand Down

0 comments on commit 550cd74

Please sign in to comment.