fix strsup.h, vsprintf, calloc

This commit is contained in:
bebbo 2018-01-04 19:14:30 +01:00
parent 480d298f6e
commit fbbb3080e1
7 changed files with 23 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
*~
.DS_Store
.project
.settings

13
configure vendored
View File

@ -639,6 +639,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
with_cross_host
'
ac_precious_vars='build_alias
host_alias
@ -1252,6 +1253,11 @@ if test -n "$ac_init_help"; then
cat <<\_ACEOF
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-cross-host=HOST Configuring with a cross compiler
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
@ -1769,6 +1775,13 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Check whether --with-cross-host was given.
if test "${with_cross_host+set}" = set; then :
withval=$with_cross_host;
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'

View File

@ -2,6 +2,9 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT()
AC_ARG_WITH(cross-host,
[ --with-cross-host=HOST Configuring with a cross compiler])
AC_PROG_CC(CC, gcc, c1 cc)
AC_PROG_RANLIB
AC_CHECK_PROG(AR, ar, ar, ar)

View File

@ -12,8 +12,6 @@
#define __MY_INLINE__ extern inline
#endif
#define memcpy(s1, s2, n) CopyMem(s2, s1, n)
__MY_INLINE__ void *memmove(void *s1,const void *s2,size_t n)
{ extern void bcopy();

View File

@ -11,7 +11,7 @@ int vsnprintf(char *s,size_t size,const char *format,va_list args)
buffer.flags=__SSTR|__SWR;
buffer.linebufsize=0;
retval=vfprintf(&buffer,format,args);
buffer.outcount++;
buffer.outcount = retval;
fputc('\0',&buffer);
return retval;
}

View File

@ -11,6 +11,7 @@ int vsprintf(char *s,const char *format,va_list args)
buffer.flags=__SSTR|__SWR;
buffer.linebufsize=0;
retval=vfprintf(&buffer,format,args);
buffer.outcount = retval;
fputc('\0',&buffer);
return retval;
}

View File

@ -9,9 +9,10 @@ void *calloc(size_t nmemb,size_t size)
a=(size_t *)(b=malloc(l));
if(b!=NULL)
{
do
size_t * end = a + l/sizeof(size_t);
do
*a++=0;
while((l-=sizeof(size_t))!=0);
while (a != end);
}
return b;
}