Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
compatibility with Microsoft compiler
  • Loading branch information
MetaMemoryT committed Sep 18, 2015
1 parent 40b4588 commit 0c1b7b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tnetstring/tns_core.c
Expand Up @@ -291,7 +291,7 @@ static int tns_parse_dict(const tns_ops *ops, void *val, const char *data, size_



static inline size_t
static INLINE size_t
tns_strtosz(const char *data, size_t len, size_t *sz, char **end)
{
char c;
Expand Down Expand Up @@ -351,7 +351,7 @@ size_t tns_outbuf_size(tns_outbuf *outbuf)
}


static inline int tns_outbuf_itoa(tns_outbuf *outbuf, size_t n)
static INLINE int tns_outbuf_itoa(tns_outbuf *outbuf, size_t n)
{
do {
check(tns_outbuf_putc(outbuf, n%10+'0') != -1,
Expand Down Expand Up @@ -382,7 +382,7 @@ int tns_outbuf_init(tns_outbuf *outbuf)
}


static inline void tns_outbuf_free(tns_outbuf *outbuf)
static INLINE void tns_outbuf_free(tns_outbuf *outbuf)
{
if(outbuf) {
free(outbuf->buffer);
Expand All @@ -393,7 +393,7 @@ static inline void tns_outbuf_free(tns_outbuf *outbuf)
}


static inline int tns_outbuf_extend(tns_outbuf *outbuf, size_t free_size)
static INLINE int tns_outbuf_extend(tns_outbuf *outbuf, size_t free_size)
{
char *new_buf = NULL;
char *new_head = NULL;
Expand Down Expand Up @@ -486,7 +486,7 @@ static char* tns_outbuf_finalize(tns_outbuf *outbuf, size_t *len)
}


static inline int tns_outbuf_clamp(tns_outbuf *outbuf, size_t orig_size)
static INLINE int tns_outbuf_clamp(tns_outbuf *outbuf, size_t orig_size)
{
size_t datalen = tns_outbuf_size(outbuf) - orig_size;

Expand Down
7 changes: 7 additions & 0 deletions tnetstring/tns_core.h
Expand Up @@ -13,6 +13,13 @@
#include <stddef.h>
#include <ctype.h>

#ifdef _MSC_VER
#define INLINE __forceinline /* use __forceinline (VC++ specific) */
#else
#define INLINE inline /* use standard inline */
#endif


// tnetstring rendering is done using an "outbuf" struct, which combines
// a malloced string with its allocation information. Rendering is done
// from back to front; the details are deliberately hidden here since
Expand Down

0 comments on commit 0c1b7b6

Please sign in to comment.