diff options
Diffstat (limited to 'wsutil')
-rw-r--r-- | wsutil/Makefile.am | 35 | ||||
-rw-r--r-- | wsutil/strncasecmp.c | 2 | ||||
-rw-r--r-- | wsutil/strncasecmp.h | 32 | ||||
-rw-r--r-- | wsutil/strptime.c | 4 |
4 files changed, 47 insertions, 26 deletions
diff --git a/wsutil/Makefile.am b/wsutil/Makefile.am index 385acc6e73..c2e0c22186 100644 --- a/wsutil/Makefile.am +++ b/wsutil/Makefile.am @@ -25,32 +25,14 @@ DIST_SUBDIRS = $(SUBDIRS) ACLOCAL_AMFLAGS = `../aclocal-flags` # Optional objects that I know how to build. These will be -# linked into libwsutil. -wsutil_optional_objects = - -if NEED_GETOPT_LO -wsutil_optional_objects += @GETOPT_LO@ -endif - -if NEED_INET_ATON_LO -wsutil_optional_objects += @INET_ATON_LO@ -endif - -if NEED_INET_NTOP_LO -wsutil_optional_objects += @INET_NTOP_LO@ -endif - -if NEED_INET_PTON_LO -wsutil_optional_objects += @INET_PTON_LO@ -endif - -if NEED_STRNCASECMP_LO -wsutil_optional_objects += @STRNCASECMP_LO@ -endif - -if NEED_STRPTIME_LO -wsutil_optional_objects += @STRPTIME_LO@ -endif +# linked into libwsutil if necessary. +wsutil_optional_objects = \ + @GETOPT_LO@ \ + @INET_ATON_LO@ \ + @INET_NTOP_LO@ \ + @INET_PTON_LO@ \ + @STRNCASECMP_LO@ \ + @STRPTIME_LO@ if SSE42_SUPPORTED wsutil_optional_objects += libwsutil_sse42.la @@ -92,6 +74,7 @@ EXTRA_libwsutil_la_SOURCES= \ inet_pton.c \ inet_v6defs.h \ strncasecmp.c \ + strncasecmp.h \ strptime.c \ strptime.h \ wsgetopt.c \ diff --git a/wsutil/strncasecmp.c b/wsutil/strncasecmp.c index da8b862482..57953b9f04 100644 --- a/wsutil/strncasecmp.c +++ b/wsutil/strncasecmp.c @@ -21,6 +21,8 @@ #include <string.h> #include <ctype.h> +#include "wsutil/strncasecmp.h" + /* Compare no more than N characters of S1 and S2, ignoring case, returning less than, equal to or greater than zero if S1 is lexicographically less diff --git a/wsutil/strncasecmp.h b/wsutil/strncasecmp.h new file mode 100644 index 0000000000..bfc3b63561 --- /dev/null +++ b/wsutil/strncasecmp.h @@ -0,0 +1,32 @@ +/* strncasecmp.h + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __STRNCASECMP_H__ +#define __STRNCASECMP_H__ + +#include "ws_symbol_export.h" + +/* + * Version of "strncasecmp()", for the benefit of OSes that don't have it. + */ +WS_DLL_PUBLIC int strncasecmp (const char *, const char *, size_t); + +#endif diff --git a/wsutil/strptime.c b/wsutil/strptime.c index d6603a9d53..7a8fe2a13e 100644 --- a/wsutil/strptime.c +++ b/wsutil/strptime.c @@ -31,6 +31,10 @@ #include <string.h> #include <time.h> +#ifndef HAVE_STRNCASECMP +#include "wsutil/strncasecmp.h" +#endif + #ifdef _LIBC # include "../locale/localeinfo.h" #endif |