]> git.sesse.net Git - vlc/commitdiff
* ./include/vlc_common.h: if we don't have strndup but gnome.h defines it
authorSam Hocevar <sam@videolan.org>
Mon, 27 Jan 2003 22:42:36 +0000 (22:42 +0000)
committerSam Hocevar <sam@videolan.org>
Mon, 27 Jan 2003 22:42:36 +0000 (22:42 +0000)
    anyway, do not provide our custom version.

configure.ac.in
include/vlc_common.h

index c8db276b73baece621ba1c9e5135db9c91919fd4..352d22654c77173932b56d0dc483379b89bb707e 100644 (file)
@@ -2313,6 +2313,13 @@ AC_ARG_ENABLE(gnome,
       NEED_GTK_MAIN=yes
       NEED_GNOME_MAIN=yes
       ALIASES="${ALIASES} gnome-vlc"
+      dnl We need this because of some moronic gnomesupport.h flavours
+      AC_MSG_CHECKING(for strndup in gnome.h)
+      AC_EGREP_HEADER(strndup,gnome.h,[
+        AC_MSG_RESULT(yes)
+        AC_DEFINE(STRNDUP_IN_GNOME_H, 1,
+                  Define if <gnome.h> defines strndup.)],[
+        AC_MSG_RESULT(no)])
      ],[
       AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
 developement tools or remove the --enable-gnome option])
index b57e934b06d03e5093f42f159bef6a1dff545566..77be3b1cb19c0051855f7846f1f85057df6b9e49 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.48 2003/01/16 09:02:46 sam Exp $
+ * $Id: vlc_common.h,v 1.49 2003/01/27 22:42:36 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -493,8 +493,13 @@ static inline uint64_t U64_AT( void * _p )
 #endif
 
 #ifndef HAVE_STRNDUP
-#   define strndup vlc_strndup
-    VLC_EXPORT( char *, vlc_strndup, ( const char *s, size_t n ) );
+#   if defined(STRNDUP_IN_GNOME_H) && \
+        (defined(MODULE_NAME_IS_gnome)||defined(MODULE_NAME_IS_gnome_main))
+        /* Do nothing: gnome.h defines strndup for us */
+#   else
+#       define strndup vlc_strndup
+        VLC_EXPORT( char *, vlc_strndup, ( const char *s, size_t n ) );
+#   endif
 #elif !defined(__PLUGIN__)
 #   define vlc_strndup NULL
 #endif