1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Merge pull request #15 from doughdemon/musl

Musl compatibility
This commit is contained in:
rkd77 2017-11-24 15:19:55 +01:00 committed by GitHub
commit 26d1759d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 9 additions and 37 deletions

View File

@ -198,7 +198,6 @@ AC_CHECK_HEADERS(sys/fmutex.h)
AC_CHECK_HEADERS(sys/ioctl.h sys/sockio.h)
AC_CHECK_HEADERS(sys/resource.h)
AC_CHECK_HEADERS(sys/select.h)
AC_CHECK_HEADERS(sys/signal.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(sys/utsname.h)
@ -323,13 +322,6 @@ if test x"$HAVE_RAISE" = x; then
fi
fi
AC_CACHE_CHECK([for __va_copy],el_cv_HAVE_VA_COPY,[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdarg.h>
va_list ap1,ap2;]], [[__va_copy(ap1,ap2);]])],[el_cv_HAVE_VA_COPY=yes],[el_cv_HAVE_VA_COPY=no])])
if test x"$el_cv_HAVE_VA_COPY" = x"yes"; then
EL_DEFINE(HAVE_VA_COPY, __va_copy)
fi
AC_CACHE_CHECK([for sysconf(_SC_PAGE_SIZE)],el_cv_HAVE_SC_PAGE_SIZE,[
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
]], [[int page_size = sysconf(_SC_PAGE_SIZE);]])],[el_cv_HAVE_SC_PAGE_SIZE=yes],[el_cv_HAVE_SC_PAGE_SIZE=no])])

View File

@ -100,7 +100,7 @@ msg_text_do(unsigned char *format, va_list ap)
int infolen, len;
va_list ap2;
VA_COPY(ap2, ap);
va_copy(ap2, ap);
infolen = vsnprintf(NULL, 0, format, ap2);
info = mem_alloc(infolen + 1);

View File

@ -162,7 +162,7 @@ trigger_event_va(int id, va_list ap_init)
enum evhook_status ret;
va_list ap;
VA_COPY(ap, ap_init);
va_copy(ap, ap_init);
ret = ev_handler->callback(ap, ev_handler->data);
va_end(ap);

View File

@ -7,9 +7,6 @@
#include <errno.h>
#include <signal.h>
#include <string.h> /* FreeBSD FD_ZERO() macro calls bzero() */
#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif
#ifdef __GNU__ /* For GNU Hurd bug workaround in set_handlers() */
#include <sys/stat.h> /* OS/2 needs this after sys/types.h */
#endif

View File

@ -7,18 +7,10 @@
#include <limits.h> /* may contain PIPE_BUF definition on some systems */
#endif
#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h> /* may contain SA_RESTART */
#endif
#ifdef HAVE_STDDEF_H
#include <stddef.h> /* may contain offsetof() */
#endif
#ifndef SA_RESTART
#define SA_RESTART 0
#endif
#ifndef PIPE_BUF
#define PIPE_BUF 512 /* POSIX says that. -- Mikulas */
#endif

View File

@ -15,9 +15,6 @@
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h> /* Need to be after sys/types.h */

View File

@ -8,9 +8,6 @@
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif
#include <sys/types.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>

View File

@ -178,7 +178,7 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args_in)
size_t currlen;
va_list args;
VA_COPY(args, args_in);
va_copy(args, args_in);
state = DP_S_DEFAULT;
currlen = 0;
@ -825,7 +825,7 @@ elinks_vasprintf(char **ptr, const char *format, va_list ap)
int ret;
va_list ap2;
VA_COPY(ap2, ap);
va_copy(ap2, ap);
ret = vsnprintf(NULL, 0, format, ap2);
if (ret <= 0) return ret;
@ -842,7 +842,7 @@ elinks_vasprintf(char **ptr, const char *format, va_list ap)
(*ptr) = (char *) malloc(ret + 1);
if (!*ptr) return -1;
VA_COPY(ap2, ap);
va_copy(ap2, ap);
return vsnprintf(*ptr, ret + 1, format, ap2);
}

View File

@ -11,11 +11,11 @@
/* XXX: This is not quite the best place for it, perhaps. But do we have
* a better one now? --pasky */
#ifndef VA_COPY
#ifdef HAVE_VA_COPY
#define VA_COPY(dest, src) __va_copy(dest, src)
#ifndef va_copy
#ifdef __va_copy
#define va_copy(dest, src) __va_copy(dest, src)
#else
#define VA_COPY(dest, src) (dest) = (src)
#define va_copy(dest, src) (dest) = (src)
#endif
#endif

View File

@ -8,9 +8,6 @@
#include <stdio.h>
#include <string.h>
#include <sys/types.h> /* NetBSD flavour */
#ifdef HAVE_SYS_SIGNAL_H
#include <sys/signal.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h> /* OS/2 needs this after sys/types.h */
#endif