[core] sys-strings.h abstraction for strings.h

personal/stbuehler/mod-csrf
Glenn Strauss 2017-04-24 10:13:41 -04:00
parent 05c34ce464
commit 2986221cab
8 changed files with 28 additions and 4 deletions

View File

@ -189,6 +189,7 @@ if 1:
stdint.h
stdlib.h
string.h
strings.h
sys/devpoll.h
sys/epoll.h
sys/event.h

View File

@ -110,7 +110,7 @@ CPPFLAGS="${CPPFLAGS} -D_REENTRANT -D__EXTENSIONS__"
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h \
AC_CHECK_HEADERS([arpa/inet.h fcntl.h netinet/in.h stdlib.h string.h strings.h \
sys/socket.h sys/time.h unistd.h sys/sendfile.h sys/uio.h \
getopt.h sys/epoll.h sys/select.h poll.h sys/poll.h sys/devpoll.h sys/filio.h \
sys/mman.h sys/event.h port.h pwd.h \

View File

@ -93,6 +93,7 @@ check_include_files(poll.h HAVE_POLL_H)
check_include_files(pwd.h HAVE_PWD_H)
check_include_files(stddef.h HAVE_STDDEF_H)
check_include_files(stdint.h HAVE_STDINT_H)
check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(syslog.h HAVE_SYSLOG_H)
# check for fastcgi lib, for the tests only

View File

@ -381,7 +381,8 @@ hdr = server.h base64.h buffer.h network.h log.h keyvalue.h \
mod_ssi.h mod_ssi_expr.h inet_ntop_cache.h \
configparser.h mod_ssi_exprparser.h \
rand.h \
sys-endian.h sys-mmap.h sys-socket.h mod_cml.h mod_cml_funcs.h \
sys-endian.h sys-mmap.h sys-socket.h sys-strings.h \
mod_cml.h mod_cml_funcs.h \
safe_memclear.h splaytree.h proc_open.h status_counter.h \
mod_magnet_cache.h

View File

@ -16,6 +16,7 @@
#include <time.h>
#include "sys-strings.h"
#include "sys-socket.h"
#ifndef _WIN32
#include <netdb.h>

View File

@ -13,12 +13,12 @@
#include <sys/types.h>
#include <sys/stat.h>
#include "sys-strings.h"
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <time.h>

View File

@ -13,11 +13,11 @@
#include "sys-socket.h"
#include <sys/types.h>
#include "sys-strings.h"
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <fcntl.h>
#include <time.h>

20
src/sys-strings.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef LI_SYS_STRINGS_H
#define LI_SYS_STRINGS_H
#include "first.h"
#if defined(HAVE_STRINGS_H)
#include <strings.h>
#else /* HAVE_STRINGS_H */
#ifdef _MSC_VER
#define strcasecmp(s1,s2) _stricmp(s1,s2)
#define strncasecmp(s1,s2,n) _strnicmp(s1,s2,n)
#else
/* ??? */
#endif
#endif /* HAVE_STRINGS_H */
#endif