Changeset 79b6213


Ignore:
Timestamp:
2006-05-28T23:07:00Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
4ff0966, c38e965
Parents:
42616d1 (diff), 574af7e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Dropping GLib <2 support.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • configure

    r42616d1 r79b6213  
    163163fi
    164164
    165 GLIB=0
    166 
    167165if $PKG_CONFIG --version > /dev/null 2>/dev/null && $PKG_CONFIG glib-2.0; then
    168166        cat<<EOF>>Makefile.settings
     
    170168CFLAGS+=`$PKG_CONFIG --cflags glib-2.0 gmodule-2.0`
    171169EOF
    172         echo '#define GLIB2' >> config.h
    173         GLIB=2
    174 elif type glib-config > /dev/null 2> /dev/null; then
    175         cat<<EOF>>Makefile.settings
    176 EFLAGS+=`glib-config --libs`
    177 CFLAGS+=`glib-config --cflags`
    178 EOF
    179         echo '#define GLIB1' >> config.h
    180         GLIB=1
    181 else
    182         echo 'Cannot find glib development libraries, aborting. (Install libglib-dev?)'
     170else
     171        echo 'Cannot find glib2 development libraries, aborting. (Install libglib2-dev?)'
    183172        exit 1;
    184173fi
    185 
    186 if [ GLIB = 1 -o -r /usr/include/iconv.h ]; then
    187         :;
    188 elif [ -r /usr/local/include/iconv.h ]; then
    189         echo CFLAGS+=-I/usr/local/include >> Makefile.settings;
    190 else
    191         echo
    192         echo 'Warning: Could not find iconv.h, you might have to install it and/or modify'
    193         echo 'Makefile.settings to tell where this file is.';
    194 fi
    195 
    196174
    197175detect_gnutls()
     
    390368;;
    391369*BSD )
    392         echo 'EFLAGS+=-liconv' >> Makefile.settings;
     370;;
     371Darwin )
     372;;
     373IRIX )
    393374;;
    394375SunOS )
    395376        echo 'EFLAGS+=-lresolv -lnsl -lsocket' >> Makefile.settings
    396377        echo 'STRIP=\# skip strip' >> Makefile.settings
    397         echo 'EFLAGS+=-liconv' >> Makefile.settings;
    398 ;;
    399 Darwin )
    400         echo 'EFLAGS+=-liconv' >> Makefile.settings;
    401 ;;
    402 IRIX )
    403378;;
    404379CYGWIN* )
  • doc/README

    r42616d1 r79b6213  
    4747
    4848BitlBee's only real dependency is GLib. This is available on virtually every
    49 platform. Any recent version of GLib (including 1.x versions) will work.
     49platform. Any recent version of GLib (2.0 or higher) will work.
    5050
    5151These days, MSN Messenger clients have to connect to the MS Passport servers
  • irc.c

    r42616d1 r79b6213  
    5555        irc->fd = fd;
    5656        irc->io_channel = g_io_channel_unix_new( fd );
    57 #ifdef GLIB2
    5857        g_io_channel_set_encoding (irc->io_channel, NULL, NULL);
    5958        g_io_channel_set_buffered (irc->io_channel, FALSE);
    6059        g_io_channel_set_flags( irc->io_channel, G_IO_FLAG_NONBLOCK, NULL );
    61 #else
    62         fcntl( irc->fd, F_SETFL, O_NONBLOCK);
    63 #endif
    6460        irc->r_watch_source_id = g_io_add_watch( irc->io_channel, G_IO_IN | G_IO_ERR | G_IO_HUP, bitlbee_io_current_client_read, irc );
    6561       
  • util.c

    r42616d1 r79b6213  
    3939#include <glib.h>
    4040#include <time.h>
    41 #ifdef GLIB2
    42 #define iconv_t GIConv
    43 #define iconv_open g_iconv_open
    44 #define iconv_close g_iconv_close
    45 #define iconv g_iconv
    46 #else
    47 #include <iconv.h>
    48 #endif
    4941
    5042void strip_linefeed(gchar *text)
     
    465457signed int do_iconv( char *from_cs, char *to_cs, char *src, char *dst, size_t size, size_t maxbuf )
    466458{
    467         iconv_t cd;
     459        GIConv cd;
    468460        size_t res;
    469461        size_t inbytesleft, outbytesleft;
     
    471463        char *outbuf = dst;
    472464       
    473         cd = iconv_open( to_cs, from_cs );
    474         if( cd == (iconv_t) -1 )
     465        cd = g_iconv_open( to_cs, from_cs );
     466        if( cd == (GIConv) -1 )
    475467                return( -1 );
    476468       
    477469        inbytesleft = size ? size : strlen( src );
    478470        outbytesleft = maxbuf - 1;
    479         res = iconv( cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft );
     471        res = g_iconv( cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft );
    480472        *outbuf = '\0';
    481         iconv_close( cd );
     473        g_iconv_close( cd );
    482474       
    483475        if( res == (size_t) -1 )
     
    489481char *set_eval_charset( irc_t *irc, set_t *set, char *value )
    490482{
    491         iconv_t cd;
     483        GIConv cd;
    492484
    493485        if ( g_strncasecmp( value, "none", 4 ) == 0 )
    494486                return( value );
    495487
    496         cd = iconv_open( "UTF-8", value );
    497         if( cd == (iconv_t) -1 )
     488        cd = g_iconv_open( "UTF-8", value );
     489        if( cd == (GIConv) -1 )
    498490                return( NULL );
    499491
    500         iconv_close( cd );
     492        g_iconv_close( cd );
    501493        return( value );
    502494}
Note: See TracChangeset for help on using the changeset viewer.