Minor fixes for Win32 build. It now builds, but doesn't link.

This commit is contained in:
Jack Moffitt
2005-06-14 22:35:15 +00:00
parent d07094c090
commit e6fa890d3d
8 changed files with 49 additions and 8 deletions

View File

@@ -21,6 +21,10 @@
#include "common.h" #include "common.h"
#include "util.h" #include "util.h"
#ifdef _WIN32
#define vsnprintf _vsnprintf
#endif
/** version **/ /** version **/
/* TODO: update from the build system? */ /* TODO: update from the build system? */
@@ -75,7 +79,7 @@ void *xmpp_alloc(const xmpp_ctx_t * const ctx, const size_t size)
void xmpp_free(const xmpp_ctx_t * const ctx, void *p) void xmpp_free(const xmpp_ctx_t * const ctx, void *p)
{ {
return ctx->mem->free(p); ctx->mem->free(p);
} }
void *xmpp_realloc(const xmpp_ctx_t * const ctx, void *p, void *xmpp_realloc(const xmpp_ctx_t * const ctx, void *p,

View File

@@ -16,7 +16,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifndef _WIN32
#include <sys/select.h> #include <sys/select.h>
#endif
#include "strophe.h" #include "strophe.h"
#include "common.h" #include "common.h"

View File

@@ -15,7 +15,12 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifndef _WIN32
#include <stdint.h> #include <stdint.h>
#else
#include "ostypes.h"
#endif
#include "strophe.h" #include "strophe.h"
#include "common.h" #include "common.h"

22
src/ostypes.h Normal file
View File

@@ -0,0 +1,22 @@
/* ostypes.h
** XMPP client library -- type definitions for platforms without stdint.h
**
** Copyright (C) 2005 OGG, LCC. All rights reserved.
**
** This software is provided AS-IS with no warranty, either express
** or implied.
**
** This software is distributed under license and may not be copied,
** modified or distributed except as expressly authorized under the
** terms of the license contained in the file LICENSE.txt in this
** distribution.
*/
#ifndef __LIBSTROPHE_OSTYPES_H__
#define __LIBSTROPHE_OSTYPES_H__
#ifdef _WIN32
typedef unsigned __int64 uint64_t;
#endif
#endif /* __LIBSTROPHE_OSTYPES_H__ */

View File

@@ -18,6 +18,7 @@
#ifdef _WIN32 #ifdef _WIN32
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h>
#define snprintf _snprintf #define snprintf _snprintf
#else #else
#include <errno.h> #include <errno.h>

View File

@@ -20,6 +20,7 @@
#ifndef _WIN32 #ifndef _WIN32
typedef int sock_t; typedef int sock_t;
#else #else
#include <winsock2.h>
typedef SOCKET sock_t; typedef SOCKET sock_t;
#endif #endif

View File

@@ -19,6 +19,10 @@
#include "common.h" #include "common.h"
#include "hash.h" #include "hash.h"
#ifdef _WIN32
#define inline __inline
#endif
/* allocate an initialize a blank stanza */ /* allocate an initialize a blank stanza */
xmpp_stanza_t *xmpp_stanza_new(xmpp_ctx_t *ctx) xmpp_stanza_t *xmpp_stanza_new(xmpp_ctx_t *ctx)
{ {
@@ -303,7 +307,7 @@ char *xmpp_stanza_get_name(xmpp_stanza_t * const stanza)
/* convinience function to copy attributes from the xml parser /* convinience function to copy attributes from the xml parser
* callback into a stanza. this replaces all previous attributes */ * callback into a stanza. this replaces all previous attributes */
void xmpp_stanza_set_attributes(xmpp_stanza_t *stanza, void xmpp_stanza_set_attributes(xmpp_stanza_t * const stanza,
const char * const * const attr) const char * const * const attr)
{ {
int i; int i;

View File

@@ -17,6 +17,8 @@
#ifndef _WIN32 #ifndef _WIN32
#include <stdint.h> #include <stdint.h>
#else
#include "ostypes.h"
#endif #endif
/* timing functions */ /* timing functions */