Skip to content

Commit

Permalink
header for memrchr (and stuff)
Browse files Browse the repository at this point in the history
  • Loading branch information
cooljeanius committed Jun 29, 2024
1 parent bc2ed8b commit 34a3b03
Show file tree
Hide file tree
Showing 13 changed files with 177 additions and 64 deletions.
9 changes: 6 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1642,8 +1642,10 @@ getopttest_CFLAGS = $(getopttest_CPPFLAGS) -Wall -Wextra -ggdb3

## extra test dependencies:
check-local: all
if test -x "`which machocheck`" -a -d .libs; then \
if test -x "`which machocheck`" -a -d .libs -a -r .libs/libUnixToOSX.dylib; then \
machocheck -progress .libs/libUnixToOSX.dylib; \
else \
echo "skipping checks of mach-o format validity"; \
fi

## build just the test programs without also running them:
Expand Down Expand Up @@ -1813,7 +1815,8 @@ canonicalize-lgpl.o: canonicalize-lgpl.c config.h canonicalize.h \
canonicalize.o: canonicalize.c config.h canonicalize.h areadlink.h \
$(file_set_h) hash-triple.h pathmax.h $(xalloc_h) xgetcwd.h
careadlinkat.o: careadlinkat.c config.h careadlinkat.h allocator.h
chdir-long.o: chdir-long.c config.h chdir-long.h closeout.h error.h
chdir-long.o: chdir-long.c config.h chdir-long.h closeout.h error.h \
memrchr.h
chdir-safer.o: chdir-safer.c config.h chdir-safer.h same-inode.h
chown.o: chown.c config.h rpl_misc_funcs.h
cloexec.o: cloexec.c config.h cloexec.h
Expand Down Expand Up @@ -1904,7 +1907,7 @@ memchr2.o: memchr2.c config.h memchr2.h
memcmp.o: memcmp.c config.h
memcmp2.o: memcmp2.c config.h memcmp2.h
mempcpy.o: mempcpy.c config.h
memrchr.o: memrchr.c config.h
memrchr.o: memrchr.c config.h memrchr.h
mktime.o: mktime.c config.h mktime-internal.h
mountlist.o: mountlist.c config.h mntent.h mountlist.h $(xalloc_h) \
unlocked-io.h
Expand Down
9 changes: 6 additions & 3 deletions Makefile.in

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

3 changes: 2 additions & 1 deletion brk.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void *sbrk(int size)

if (size <= 0)
return((void *)sbrk_curbrk);
else if (size > sbrk_region_size) {
else if ((vm_size_t)size > sbrk_region_size) {
errno = ENOMEM;
return((void *)-1);
}
Expand All @@ -78,5 +78,6 @@ void *sbrk(int size)
void *brk(const void *x)
{
errno = ENOMEM;
(void)x;
return((void *)-1);
}
2 changes: 2 additions & 0 deletions chdir-long.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <string.h>
#include <stdio.h>

#include "memrchr.h"

#ifndef PATH_MAX
# error "compile this file only if your system defines PATH_MAX"
#endif /* !PATH_MAX (i.e. GNU/Hurd) */
Expand Down
6 changes: 6 additions & 0 deletions config.h.in

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

53 changes: 42 additions & 11 deletions configure

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

22 changes: 16 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,20 @@ if test x${CFLAGS+set} = xset; then
warnings_to_skip="${warnings_to_skip} -Wcoverage-mismatch"
;;
esac
case "${CFLAGS}" in
*"-fstack-protector"*)
;;
*)
warnings_to_skip="${warnings_to_skip} -Wstack-protector"
;;
esac
else
warnings_to_skip="${warnings_to_skip} -Wunsafe-loop-optimizations"
warnings_to_skip="${warnings_to_skip} -Waggressive-loop-optimizations"
warnings_to_skip="${warnings_to_skip} -Wdisabled-optimization"
warnings_to_skip="${warnings_to_skip} -Wvector-operation-performance"
warnings_to_skip="${warnings_to_skip} -Wcoverage-mismatch"
warnings_to_skip="${warnings_to_skip} -Wstack-protector"
fi
gl_MANYWARN_COMPLEMENT([actual_warnings_to_check],
[${warnings_to_check}],
Expand Down Expand Up @@ -254,11 +262,11 @@ AC_CHECK_HEADERS([_types/_nl_item.h \
fts.h ftw.h gnu-versions.h iconv.h io.h iostream.h \
lcrypt.h libcharset.h libintl.h \
libio/iolibio.h libio/libioP.h limits.h locale.h \
mach/mach.h malloc.h malloc/malloc.h memcopy.h mm.h \
mntent.h mnttab.h module.h netdb.h nl_types.h os2.h \
process.h ptms.h publib.h publib/strutil.h \
shlib-compat.h stdarg.h stddef.h stream.h \
stropts.h strutil.h swapctl.h swap.h \
mach/mach.h malloc.h malloc/malloc.h memcopy.h \
memrchr.h mm.h mntent.h mnttab.h module.h netdb.h \
nl_types.h os2.h process.h ptms.h publib.h \
publib/strutil.h shlib-compat.h stdarg.h stddef.h \
stream.h stropts.h strutil.h swapctl.h swap.h \
sys/_types/_ct_rune_t.h sys/_types/_mbstate_t.h \
sys/_types/_null.h sys/_types/_rune_t.h \
sys/_types/_size_t.h sys/_types/_time_t.h \
Expand Down Expand Up @@ -291,6 +299,8 @@ dnl# might have to get rid of the "_ONCE"s if they jump elsewehere...
AC_CHECK_DECLS_ONCE([__fpending])dnl
AC_CHECK_DECLS_ONCE([cuserid])dnl
AC_CHECK_DECLS_ONCE([exit_failure])dnl
AC_CHECK_DECLS_ONCE([memrchr],[],[],
[#include <string.h>])dnl
AC_CHECK_DECLS_ONCE([program_invocation_name],[],[],
[#include <errno.h>])dnl
AC_CHECK_DECLS_ONCE([program_invocation_short_name],[],[],
Expand Down Expand Up @@ -417,7 +427,7 @@ unset ac_cv_func_wctob
unset ac_cv_func_getmntent
unset ac_cv_func_poll
AC_REPLACE_FUNCS([btowc wctob dysize fclose fcloseall getmntent poll \
cuserid brk crypt])dnl
cuserid brk crypt fpending])dnl
## keep autoscan happy:
if test "x" = "Y0"; then
test -x "`which autoscan`" || echo "no autoscan!" >&2
Expand Down
Loading

0 comments on commit 34a3b03

Please sign in to comment.