[vlc-commits] libstream_out_standard_plugin: fix linkage on OS/2
KO Myung-Hun
git at videolan.org
Wed Dec 3 12:15:15 CET 2014
vlc/vlc-2.2 | branch: master | KO Myung-Hun <komh78 at gmail.com> | Wed Dec 3 11:47:01 2014 +0900| [de5943f9c867275329c2c417f8654b43d2cc10a5] | committer: Jean-Baptiste Kempf
libstream_out_standard_plugin: fix linkage on OS/2
Move freeaddrinfo() to compat/.
-----
CCLD libstream_out_standard_plugin.la
weakld: error: Unresolved symbol (UNDEF) '_freeaddrinfo'.
weakld: info: The symbol is referenced by:
P:\tmp\ldconv_libstream_out_standard_plugin_48c454704dac1660d0.obj
Ignoring unresolved externals reported from weak prelinker.
Error! E2028: _freeaddrinfo is an undefined reference
file P:/tmp\ldconv_libstream_out_standard_plugin_48c454704dac1660d0.obj(ldconv_libstream_out_standard_plugin_48c454704dac1660d0.obj): undefined symbol _freeaddrinfo
-----
Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>
(cherry picked from commit 3180272a56bdb3933219e1cc2c57d0285a7adbd3)
Signed-off-by: KO Myung-Hun <komh at chollian.net>
Conflicts:
configure.ac
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=de5943f9c867275329c2c417f8654b43d2cc10a5
---
compat/freeaddrinfo.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 1 +
include/vlc_fixups.h | 12 ++++++++++++
include/vlc_network.h | 12 ------------
src/os2/getaddrinfo.c | 13 -------------
5 files changed, 58 insertions(+), 25 deletions(-)
diff --git a/compat/freeaddrinfo.c b/compat/freeaddrinfo.c
new file mode 100644
index 0000000..0d5a1d8
--- /dev/null
+++ b/compat/freeaddrinfo.c
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * freeaddrinfo.c: freeaddrinfo() replacement functions
+ *****************************************************************************
+ * Copyright (C) 2005 the VideoLAN team
+ * Copyright (C) 2002-2007 Rémi Denis-Courmont
+ * Copyright (C) 2011-2014 KO Myung-Hun
+ *
+ * Authors: KO Myung-Hun <komh at chollian.net>
+ * Rémi Denis-Courmont <rem # videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser 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.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+
+/*
+ * This function must be used to free the memory allocated by getaddrinfo().
+ */
+void freeaddrinfo (struct addrinfo *res)
+{
+ if (res == NULL)
+ return;
+
+ freeaddrinfo (res->ai_next);
+
+ free (res->ai_canonname);
+ free (res->ai_addr);
+ free (res);
+}
diff --git a/configure.ac b/configure.ac
index b309ba1..fd4fecc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -293,6 +293,7 @@ case "${host_os}" in
*os2*)
SYS=os2
LDFLAGS="${LDFLAGS} -Zomf -Zbin-files -Zargs-wild -Zhigh-mem"
+ AC_LIBOBJ([freeaddrinfo])
;;
*)
SYS="${host_os}"
diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index c3d5fac..b448d83 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -341,6 +341,18 @@ long nrand48 (unsigned short subi[3]);
#ifdef __OS2__
# undef HAVE_FORK /* Implementation of fork() is imperfect on OS/2 */
+
+struct addrinfo
+{
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ size_t ai_addrlen;
+ struct sockaddr *ai_addr;
+ char *ai_canonname;
+ struct addrinfo *ai_next;
+};
#endif
/* math.h */
diff --git a/include/vlc_network.h b/include/vlc_network.h
index d1c63b1..70281a2 100644
--- a/include/vlc_network.h
+++ b/include/vlc_network.h
@@ -239,18 +239,6 @@ VLC_API ssize_t net_vaPrintf( vlc_object_t *p_this, int fd, const v_socket_t *,
# define NI_DGRAM 0x10
# endif
-struct addrinfo
-{
- int ai_flags;
- int ai_family;
- int ai_socktype;
- int ai_protocol;
- size_t ai_addrlen;
- struct sockaddr *ai_addr;
- char *ai_canonname;
- struct addrinfo *ai_next;
-};
-
# define AI_PASSIVE 1
# define AI_CANONNAME 2
# define AI_NUMERICHOST 4
diff --git a/src/os2/getaddrinfo.c b/src/os2/getaddrinfo.c
index 1a3f8a4..49b46f6 100644
--- a/src/os2/getaddrinfo.c
+++ b/src/os2/getaddrinfo.c
@@ -151,19 +151,6 @@ gai_error_from_herrno (void)
}
/*
- * This functions must be used to free the memory allocated by getaddrinfo().
- */
-void freeaddrinfo (struct addrinfo *res)
-{
- if (res == NULL)
- return;
- free (res->ai_canonname);
- free (res->ai_addr);
- free (res->ai_next);
- free (res);
-}
-
-/*
* Internal function that builds an addrinfo struct.
*/
static struct addrinfo *
More information about the vlc-commits
mailing list