new client plans and libpurple

Zoltán Sólyom z-ismeretlen at
Fri Mar 29 12:39:11 EDT 2013

> Inspired by Pidgin's own script in 
> pidgin/win32/nsis, I realized that much of the BuildingWinPidgin 
> instructions could be automated into a script using wget to download 
> and tar/unzip to extract the files automatically.
> [...]
> It could probably be extended to handle most of Zoltán's instructions 
> too, though Visual Studio developers may not want to install MinGW 
> just to run this script.
Some of the instructions on BuildingWinPidgin for what to download could 
be automated for a Visual Studio project, though I had to get an Apple 
Id just to get the Bonjour package. Getting the zip and tar.gz files and 
extracting them took almost no time compared to all the pain finding out 
what to do after that. Doing what needs to be done is still not 
difficult if someone is not willing to install MinGW for an automated 

I haven't tried compiling Pidgin, only libpurple, so that's all I can 
help with. In the current state, all the needed DLLs are created, but no 
symbols have been exported yet. This is not entirely true, because a lot 
of symbols had to be exported from libpurple.dll (and some other DLLs) 
for the protocols to compile. (There is no "export all symbols" setting 
in VS as far as I know.) Exporting is simple, I'll just create .def 
files and list what's needed. Once I'm done and rearranged the directory 
structure of the DLL projects a little (it's a mess right now because I 
didn't expect so many) I will share the VS project.

In the attached text you will find the complete list of my changes to 
the libpurple source code.

The next step will be to create a C# project and make a very simple 
program that lets me sign in to my xmpp account. If it succeeds I'll 
probably ask for help to try out all the other protocols because that's 
a lot of registrations.

-------------- next part --------------
// I list here which parts of the code had to be changed in libpurple
// to compile with Visual Studio Express 2012.
// I won't provide line numbers because I haven't looked into the
// latest source, and finding the problems is easy anyway. The
// ifdef/ifndef _MSC_VER was added by me, together with the code in
// the ifdef block, or the else block of ifndef.

// Just look for !RUNNING_ON_VALGRIND. It always evaluates
// to true when not using Valgrind.
#ifndef _MSC_VER
        if (!g_getenv("PURPLE_LEAKCHECK_HELP"))

// This is added after all the includes. (I'm not familiar with the C syntax,
// just guessed this is what the replacement should be in VS)
// Replace the gg_debug_dcc define with:
#ifndef _MSC_VER
#define gg_debug_dcc(dcc, level, fmt...) \
    gg_debug_session(((dcc) != NULL) ? (dcc)->sess : NULL, level, fmt)
#define gg_debug_dcc(dcc, level, ...) \
    gg_debug_session(((dcc) != NULL) ? (dcc)->sess : NULL, level, __VA_ARGS__)


// Add at the top right after #define __GG_LIBGADU_H
#ifdef _MSC_VER
#include "config.h"
#include "internal.h"
#define strcasecmp stricmp
#define strncasecmp strnicmp

// VS complained that empty structs and unions are not valid C.
// I haven't found references to this struct in the whole source.
// If it is added as some kind of packing this can potentially break
// things, though GG_PACKED when not compiled under gcc is an empty define.
#ifndef _MSC_VER
struct gg_dcc7_dunno1 {
    // XXX


// Add at the top:
#ifdef _MSC_VER
#include "config.h"


// Add to the top:
#ifdef _MSC_VER
#include "config.h"


// Add after the includes. I copied this out from a different source
// file in libpurple, so hopefully this is what it should be.
#ifdef _MSC_VER
#ifdef  _WIN64
typedef __int64    ssize_t;
typedef _W64 int   ssize_t;


// Add after the includes.
#ifdef _MSC_VER
#include "cipher.h"
#define strtoll _strtoi64;

// In the function dump_bytes, replace the char msg declaration to:
#ifndef _MSC_VER
    char        msg[( len * 3 ) + 1];
    char *msg = (char*)malloc(sizeof(char) * ((len * 3)  + 1));

// Add to the end of the same function:
#ifdef _MSC_VER

// Same in mxit_write_http_post function:
#ifndef _MSC_VER
    char        request[256 + packet->datalen];
    char *request = (char*)malloc(sizeof(char) * (256 + packet->datalen));

// Add to the end of the same function:
#ifdef _MSC_VER

// Look for the mxit_send_packet function. I added the next code on
// the 16th line after the /* socket connection */  comment.
// Replace the declaration of char data with:
#ifndef _MSC_VER
        char        data[packet->datalen + packet->headerlen];
        char *data = (char*)malloc(sizeof(char) * (packet->datalen + packet->headerlen));

// Add to the end of the if block:
#ifdef _MSC_VER


// The following files had includes not in the SDK on Windows. Most can
// be ifndef-ed. If something is still missing, add #include <io.h> in
// an else block. (io.h had to be added to files marked with *)

unistd.h not found in:
    dcc7.c (already mentioned above)



inttypes.h not found in:


utsname.h not found in:

More information about the Devel mailing list