Browse Source

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

personal/stbuehler/mod-csrf
Glenn Strauss 5 years ago
parent
commit
2986221cab
  1. 1
      SConstruct
  2. 2
      configure.ac
  3. 1
      src/CMakeLists.txt
  4. 3
      src/Makefile.am
  5. 1
      src/http-header-glue.c
  6. 2
      src/mod_compress.c
  7. 2
      src/mod_ssi.c
  8. 20
      src/sys-strings.h

1
SConstruct

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

2
configure.ac

@ -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 \

1
src/CMakeLists.txt

@ -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

3
src/Makefile.am

@ -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

1
src/http-header-glue.c

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

2
src/mod_compress.c

@ -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>

2
src/mod_ssi.c

@ -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

@ -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
Loading…
Cancel
Save