aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-03-27 00:32:57 +0000
committerJoão Valverde <j@v6e.pt>2016-04-04 23:58:41 +0000
commit7f873d92cb7038247ab578d14d7e4794dcd6d98b (patch)
tree1fa9d97f7b1576529242b77aa0a758cd360a6b1a /wsutil
parentcd1d1377430aa50fb1363fad7ab9de7026b4f716 (diff)
Use AC_REPLACE_FUNCS and LTLIBOBJS
Change-Id: I0f46167fe900c39d678560809cd5391c2a9bc4d2 Reviewed-on: https://code.wireshark.org/review/14809 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/CMakeLists.txt2
-rw-r--r--wsutil/Makefile.am25
-rw-r--r--wsutil/getopt_long.c (renamed from wsutil/wsgetopt.c)2
-rw-r--r--wsutil/getopt_long.h (renamed from wsutil/wsgetopt_int.h)0
-rw-r--r--wsutil/inet_addr-int.h2
-rw-r--r--wsutil/inet_ntop.c2
6 files changed, 10 insertions, 23 deletions
diff --git a/wsutil/CMakeLists.txt b/wsutil/CMakeLists.txt
index c134037d1f..9eeda808bc 100644
--- a/wsutil/CMakeLists.txt
+++ b/wsutil/CMakeLists.txt
@@ -146,7 +146,7 @@ if(HAVE_SSE4_2)
endif()
if(NOT HAVE_GETOPT_LONG)
- set(WSUTIL_FILES ${WSUTIL_FILES} wsgetopt.c)
+ set(WSUTIL_FILES ${WSUTIL_FILES} getopt_long.c)
endif()
if(NOT HAVE_INET_ATON)
diff --git a/wsutil/Makefile.am b/wsutil/Makefile.am
index 434457ccd8..6b8de84d28 100644
--- a/wsutil/Makefile.am
+++ b/wsutil/Makefile.am
@@ -42,13 +42,7 @@ libwsutil_abi_INCLUDES = \
# Optional objects that I know how to build. These will be
# linked into libwsutil if necessary.
-wsutil_optional_objects = \
- @GETOPT_LO@ \
- @INET_ATON_LO@ \
- @INET_NTOP_LO@ \
- @INET_PTON_LO@ \
- @POPCOUNT_LO@ \
- @STRPTIME_LO@
+wsutil_optional_objects =
if SSE42_SUPPORTED
wsutil_optional_objects += libwsutil_sse42.la
@@ -78,23 +72,14 @@ libwsutil_sse42_la_SOURCES = \
libwsutil_sse42_la_CFLAGS = $(AM_CFLAGS) $(CFLAGS_SSE42)
EXTRA_libwsutil_la_SOURCES = \
- inet_aton.c \
- inet_aton.h \
- inet_ntop.c \
- inet_pton.c \
inet_addr-int.h \
- popcount.c \
- popcount.h \
- strptime.c \
- strptime.h \
- wsgetopt.c \
- wsgetopt.h \
- wsgetopt_int.h
-
-libwsutil_la_DEPENDENCIES = \
+ wsgetopt.h
+
+EXTRA_libwsutil_la_DEPENDENCIES = \
$(wsutil_optional_objects)
libwsutil_la_LIBADD = \
+ $(LTLIBOBJS) \
@COREFOUNDATION_FRAMEWORKS@ \
@GLIB_LIBS@ \
@LIBGCRYPT_LIBS@ \
diff --git a/wsutil/wsgetopt.c b/wsutil/getopt_long.c
index 5302bc7563..c44db3cb7d 100644
--- a/wsutil/wsgetopt.c
+++ b/wsutil/getopt_long.c
@@ -103,7 +103,7 @@
they can distinguish the relative order of options and other arguments. */
#include "wsgetopt.h"
-#include "wsgetopt_int.h"
+#include "getopt_long.h"
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
diff --git a/wsutil/wsgetopt_int.h b/wsutil/getopt_long.h
index 42afeb9793..42afeb9793 100644
--- a/wsutil/wsgetopt_int.h
+++ b/wsutil/getopt_long.h
diff --git a/wsutil/inet_addr-int.h b/wsutil/inet_addr-int.h
index c71b1cd4ad..25f698d1df 100644
--- a/wsutil/inet_addr-int.h
+++ b/wsutil/inet_addr-int.h
@@ -51,7 +51,7 @@
extern int inet_pton(int af, const char *src, void *dst);
#endif
-#ifndef HAVE_INET_NTOP_PROTO
+#ifndef HAVE_INET_NTOP
extern const char *inet_ntop(int af, const void *src, char *dst, size_t size);
#endif
diff --git a/wsutil/inet_ntop.c b/wsutil/inet_ntop.c
index 3fe730bcc6..1d82f30142 100644
--- a/wsutil/inet_ntop.c
+++ b/wsutil/inet_ntop.c
@@ -125,6 +125,8 @@ inet_ntop6(const u_char *src, char *dst, size_t size)
* Copy the input (bytewise) array into a wordwise array.
* Find the longest run of 0x00's in src[] for :: shorthanding.
*/
+ memset(&best, 0, sizeof best);
+ memset(&cur, 0, sizeof cur);
memset(words, '\0', sizeof words);
for (i = 0; i < NS_IN6ADDRSZ; i++)
words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3));