From 17feefe78a43f2d16adea2035b9bd014dbb9ccad Mon Sep 17 00:00:00 2001 From: Jack Moffitt Date: Tue, 14 Jun 2005 23:27:58 +0000 Subject: [PATCH] More minor win32 build fixes. The only linking problem is now expat.lib. --- SConstruct | 6 ++++-- src/auth.c | 4 ++++ src/parser.c | 4 ++++ src/stanza.c | 1 + 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 0d9a48b..72d0ef4 100644 --- a/SConstruct +++ b/SConstruct @@ -80,7 +80,7 @@ expatenv.Append(CCFLAGS=" -DHAVE_UNISTD") expat = expatenv.Library('expat', path(join('expat', 'lib'), ExpatSources)) Default(expat) -stropheenv = env.Copy() +stropheenv = env.Copy() stropheenv.Append(CPPPATH=['.', 'src', join('expat','lib')]) strophe = stropheenv.Library('strophe', path("src", Sources)) @@ -89,13 +89,15 @@ Default(strophe) exenv = stropheenv.Copy() exenv.Append(LIBS=["strophe", "expat"]) exenv.Append(LIBPATH=["."]) +if exenv["PLATFORM"] == "win32": + exenv.Append(LIBS=["ws2_32", "winmm"]) for e in path("examples", Examples): example = exenv.Program(e) Default(example) # generate a MSVC project for convenience # TODO: this doesn't seem to be implemented? -#env.MSVSProject(target = 'strophe' + env['MSVSPROJECTSUFFIX'], +#env.MSVSProject(target = 'strophe' + env['MSVSPROJECTSUFFIX'], # srcs = path("src", Sources), incs = path("src", Headers), # variant = 'Release', buildtarget = strophe) diff --git a/src/auth.c b/src/auth.c index b44f5f0..1272bb0 100644 --- a/src/auth.c +++ b/src/auth.c @@ -20,6 +20,10 @@ #include "common.h" #include "sasl.h" +#ifdef _WIN32 +#define strcasecmp stricmp +#endif + #define FEATURES_TIMEOUT 2000 /* 2 seconds */ #define BIND_TIMEOUT 2000 /* 2 seconds */ #define LEGACY_TIMEOUT 2000 /* 2 seconds */ diff --git a/src/parser.c b/src/parser.c index 483404e..9d3ac9b 100644 --- a/src/parser.c +++ b/src/parser.c @@ -21,6 +21,10 @@ #include "strophe.h" #include "common.h" +#ifdef _WIN32 +#define snprintf _snprintf +#endif + static void _log_open_tag(xmpp_conn_t * const conn, const XML_Char **attr) { diff --git a/src/stanza.c b/src/stanza.c index f838953..a28b20a 100644 --- a/src/stanza.c +++ b/src/stanza.c @@ -20,6 +20,7 @@ #include "hash.h" #ifdef _WIN32 +#define snprintf _snprintf #define inline __inline #endif