summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3-internal.h
diff options
context:
space:
mode:
authorjosh.macdonald@gmail.com <josh.macdonald@gmail.com@a3eca27d-f21b-0410-9b4a-6511e771f64e>2012-06-27 09:32:08 +0000
committerjosh.macdonald@gmail.com <josh.macdonald@gmail.com@a3eca27d-f21b-0410-9b4a-6511e771f64e>2012-06-27 09:32:08 +0000
commitcfb1068766390147371c14211da6d8cfac47db5c (patch)
treef0c678831f846758d0daf672a54565ed0853599a /xdelta3/xdelta3-internal.h
parentdf30203f7af37f3a81033300f4a4790cd330d784 (diff)
Fix a few more string shenanigans. Basic tests in WIN32, builds in cygwin too.
Comments out Python/Swig, will make them conditional later (I can't figure this out).
Diffstat (limited to 'xdelta3/xdelta3-internal.h')
-rw-r--r--xdelta3/xdelta3-internal.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/xdelta3/xdelta3-internal.h b/xdelta3/xdelta3-internal.h
index 871bcfb..9a728ff 100644
--- a/xdelta3/xdelta3-internal.h
+++ b/xdelta3/xdelta3-internal.h
@@ -19,6 +19,7 @@
19#define XDELTA3_INTERNAL_H__ 19#define XDELTA3_INTERNAL_H__
20 20
21#include <stdio.h> 21#include <stdio.h>
22#include <stdlib.h>
22#include <stdarg.h> 23#include <stdarg.h>
23 24
24#ifndef _XDELTA3_INTERNAL_H_ 25#ifndef _XDELTA3_INTERNAL_H_
@@ -97,11 +98,14 @@ struct _main_file
97#ifdef _WIN32 98#ifdef _WIN32
98#define vsnprintf_func(str,size,fmt,args) \ 99#define vsnprintf_func(str,size,fmt,args) \
99 _vsnprintf_s(str,size,size-1,fmt,args) 100 _vsnprintf_s(str,size,size-1,fmt,args)
101#define snprintf_func(str,size,fmt,...) \
102 _snprintf_s(str,size,size-1,fmt,__VA_ARGS__)
100#else 103#else
101#define vsnprintf_func vsnprintf 104#define vsnprintf_func vsnprintf
102#define short_sprintf(sb,fmt,...) \ 105#define snprintf_func snprintf
103 snprintf((sb).buf,sizeof((sb).buf),fmt,__VA_ARGS__)
104#endif 106#endif
107#define short_sprintf(sb,fmt,...) \
108 snprintf_func((sb).buf,sizeof((sb).buf),fmt,__VA_ARGS__)
105 109
106/* Type used for short snprintf calls. */ 110/* Type used for short snprintf calls. */
107typedef struct { 111typedef struct {