]> git.sesse.net Git - vlc/commitdiff
debut de portage sous solaris
authorBenoit Steiner <benny@videolan.org>
Sun, 10 Dec 2000 03:55:47 +0000 (03:55 +0000)
committerBenoit Steiner <benny@videolan.org>
Sun, 10 Dec 2000 03:55:47 +0000 (03:55 +0000)
include/common.h
include/netutils.h
src/interface/interface.c
src/interface/intf_msg.c
src/interface/main.c
src/misc/netutils.c
src/video_output/video_output.c

index f6c12087d484f373886a92b94ee9afbb4e456c79..7dae4a886db77346ff11239f80666f7115bba9f5 100644 (file)
 typedef u8                  byte_t;
 
 /* Boolean type */
+#ifndef SYS_SOLARIS
 typedef int                 boolean_t;
+#else
+#include <sys/types.h>
+#endif
 #ifdef SYS_GNU
 #define _MACH_I386_BOOLEAN_H_
 #endif
index da55869b94bd162873b38cccc5cee91484b8aadf..1fe0790cb034630f8e2954cb72d69993dff9d0fb 100644 (file)
@@ -25,6 +25,7 @@
 /*****************************************************************************
  * Required headers:
  *  <netinet/in.h>
+ *  <sys/socket.h>
  *****************************************************************************/
 
 
index d901bc6a6e616729b0efe5c3a9629986ca001338..01741b34de6070e53c2b26b89da97bd38597a6b0 100644 (file)
@@ -128,6 +128,7 @@ intf_thread_t* intf_Create( void )
     if( i_best_score == 0 )
     {
         free( p_intf );
+       intf_ErrMsg( "error: no suitable plugin to create interface\n" );
         return( NULL );
     }
 
index 720c7a287941d9ed6f469b5461202f0c7f58fa03..4b503c2f9976b76cb2e687369a6f17dacaf9edb7 100644 (file)
@@ -383,7 +383,7 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a
     /*
      * Convert message to string
      */
-#ifdef SYS_BEOS
+#if defined SYS_BEOS || defined SYS_SOLARIS
     psz_str = (char*) malloc( strlen(psz_format) + INTF_MAX_MSG_SIZE );
     vsprintf( psz_str, psz_format, ap );
 #else
@@ -447,7 +447,7 @@ static void QueueDbgMsg(intf_msg_t *p_msg, char *psz_file, char *psz_function,
     /*
      * Convert message to string
      */
-#ifdef SYS_BEOS
+#if defined SYS_BEOS || defined SYS_SOLARIS
     psz_str = (char*) malloc( INTF_MAX_MSG_SIZE );
     vsprintf( psz_str, psz_format, ap );
 #else
index 5f59c94cc50fe4526dcc0bdda7849c762ddbe535..4b6530d6d871b6afc0d13466ca80ae2baea1501a 100644 (file)
 #include "defs.h"
 
 #include <signal.h>                               /* SIGHUP, SIGINT, SIGKILL */
-#include <getopt.h>                                              /* getopt() */
 #include <stdio.h>                                              /* sprintf() */
 
+#ifdef HAVE_LIBGNUGETOPT
+#include <getopt.h>                                              /* getopt() */
+#endif
+
 #include <errno.h>                                                 /* ENOMEM */
 #include <stdlib.h>                                  /* getenv(), strtol(),  */
 #include <string.h>                                            /* strerror() */
@@ -91,6 +94,7 @@
 #define LONG_HELP                 2
 
 /* Long options */
+#ifdef HAVE_LIBGNUGETOPT
 static const struct option longopts[] =
 {
     /*  name,               has_arg,    flag,   val */
@@ -137,6 +141,8 @@ static const struct option longopts[] =
 
 /* Short options */
 static const char *psz_shortopts = "hHvga:s:c:";
+#endif
+
 
 /*****************************************************************************
  * Global variable program_data - this is the one and only, see main.h
@@ -465,6 +471,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     }
 
     /* Parse command line options */
+#ifdef HAVE_LIBGNUGETOPT
     opterr = 0;
     while( ( c = getopt_long( i_argc, ppsz_argv, psz_shortopts, longopts, 0 ) ) != EOF )
     {
@@ -579,6 +586,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
             break;
         }
     }
+#endif
 
     /* Parse command line parameters - no check is made for these options */
     for( i_opt = optind; i_opt < i_argc; i_opt++ )
index 1bed4f448ae9c7f757678f8c9797d02cf1b7c665..90bccc025faac235af0a3a795df7dde28cc9435b 100644 (file)
 #include <arpa/inet.h>                           /* inet_ntoa(), inet_aton() */
 #endif
 
-#if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
+#if defined (HAVE_SYS_IOCTL_H)
 #include <sys/ioctl.h>                                            /* ioctl() */
+#endif
+
+#include <unistd.h>                           /* needed for ioctl on Solaris */
+#include <stropts.h>
+
+#if defined (HAVE_NET_IF_H)
 #include <net/if.h>                            /* interface (arch-dependent) */
 #endif
+//#ifdef HAVE_SYS_SOCKIO_H
+#include <sys/sockio.h>
+//#endif
 
 #include "config.h"
 #include "common.h"
@@ -73,7 +82,7 @@ int BuildInetAddr( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port )
     }
     /* Try to convert address directly from in_addr - this will work if
      * psz_in_addr is dotted decimal. */
-#ifdef HAVE_ARPA_INET_H
+#if defined HAVE_ARPA_INET_H && !defined SYS_SOLARIS
     else if( !inet_aton( psz_in_addr, &p_sa_in->sin_addr) )
 #else
     else if( (p_sa_in->sin_addr.s_addr = inet_addr( psz_in_addr )) == -1 )
@@ -154,7 +163,11 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
     }
 
    /* Read physical address of the interface and store it in our description */
+#ifdef SYS_SOLARIS
+    i_rc = ioctl(i_sockfd, SIOCGENADDR, (byte_t *)&ifr_config);
+#else
     i_rc = ioctl(i_sockfd, SIOCGIFHWADDR, (byte_t *)&ifr_config);
+#endif
     if( !i_rc )
     {
         memcpy(&p_ifdescr->sa_phys_addr, &ifr_config.ifr_addr, sizeof(struct sockaddr));
@@ -226,6 +239,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
  *****************************************************************************/
 int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
 {
+    int i_rc = 0;
+
 #if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
     struct ifreq* a_ifr_ifconf = NULL;
     struct ifreq* p_ifr_current_if;
@@ -233,10 +248,7 @@ int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
 
     int i_if_number;
     int i_remaining;
-#endif
-    int i_rc = 0;
 
-#if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
     ASSERT(p_net_descr);
 
     /* Start by assuming we have few than 3 interfaces (i_if_number will
index 80859b56957107f7bd0325710ae4efced8276b61..488b7f76447305be8c5cf63d4b2cf6999c05e046 100644 (file)
@@ -104,7 +104,7 @@ vout_thread_t * vout_CreateThread   ( char *psz_display, int i_root_window,
     p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) );
     if( p_vout == NULL )
     {
-        intf_ErrMsg( "error: %s\n", strerror(ENOMEM) );
+        intf_ErrMsg( "vout error: %s\n", strerror(ENOMEM) );
         return( NULL );
     }
 
@@ -261,7 +261,7 @@ vout_thread_t * vout_CreateThread   ( char *psz_display, int i_root_window,
     if( vlc_thread_create( &p_vout->thread_id, "video output",
                            (void *) RunThread, (void *) p_vout) )
     {
-        intf_ErrMsg("error: %s\n", strerror(ENOMEM));
+        intf_ErrMsg("vout error: %s\n", strerror(ENOMEM));
         vout_UnloadFont( p_vout->p_default_font );
         vout_UnloadFont( p_vout->p_large_font );
         p_vout->p_sys_destroy( p_vout );