]> git.sesse.net Git - vlc/commitdiff
libstream_out_standard_plugin: fix linkage on OS/2
authorKO Myung-Hun <komh78@gmail.com>
Sat, 22 Nov 2014 09:11:51 +0000 (18:11 +0900)
committerRémi Denis-Courmont <remi@remlab.net>
Sat, 22 Nov 2014 09:17:31 +0000 (11:17 +0200)
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@remlab.net>
compat/freeaddrinfo.c [new file with mode: 0644]
configure.ac
include/vlc_fixups.h
include/vlc_network.h
src/os2/getaddrinfo.c

diff --git a/compat/freeaddrinfo.c b/compat/freeaddrinfo.c
new file mode 100644 (file)
index 0000000..0d5a1d8
--- /dev/null
@@ -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@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);
+}
index 6e25605e10633fd9242e8f6653f4ceb19305d2c5..b7a4c741ceb6de0da54ea1b2f8f71642795f44db 100644 (file)
@@ -556,7 +556,7 @@ need_libc=false
 dnl Check for usual libc functions
 AC_CHECK_DECLS([nanosleep],,,[#include <time.h>])
 AC_CHECK_FUNCS([daemon fcntl fstatvfs fork getenv getpwuid_r isatty lstat memalign mmap open_memstream openat pread posix_fadvise posix_madvise setlocale stricmp strnicmp strptime uselocale pthread_cond_timedwait_monotonic_np pthread_condattr_setclock])
-AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
+AC_REPLACE_FUNCS([atof atoll dirfd fdopendir flockfile freeaddrinfo fsync getdelim getpid gmtime_r lldiv localtime_r nrand48 poll posix_memalign rewind setenv strcasecmp strcasestr strdup strlcpy strndup strnlen strsep strtof strtok_r strtoll swab tdestroy strverscmp])
 AC_CHECK_FUNCS(fdatasync,,
   [AC_DEFINE(fdatasync, fsync, [Alias fdatasync() to fsync() if missing.])
 ])
index e515763c432c0e55a842912b460802ed7a1c8755..cee12546ba2b21111951f5c6a8af2d25fd5af6e1 100644 (file)
@@ -349,6 +349,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 */
index d1c63b1e76dbf462062cb6c1a36b2c8c7fd4427a..70281a229d0acf031b71e0d22ac0a08be0712c68 100644 (file)
@@ -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
index 1a3f8a46141fa355fd6615a8b7908d1872b4f576..49b46f621b430aeeb21df210879c1db537bcad43 100644 (file)
@@ -150,19 +150,6 @@ gai_error_from_herrno (void)
     return EAI_SYSTEM;
 }
 
-/*
- * 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.
  */