summaryrefslogtreecommitdiff
path: root/xdelta3/xdelta3-internal.h
diff options
context:
space:
mode:
authorJosh MacDonald <josh.macdonald@gmail.com>2015-07-08 00:39:11 -0700
committerJosh MacDonald <josh.macdonald@gmail.com>2015-07-08 00:39:11 -0700
commitf56eeca9241a1dc570f77a419a98766e868301d5 (patch)
treeb74bcb59e8550078f6b73e1114a7205e229d5f86 /xdelta3/xdelta3-internal.h
parent33340a986e29ed681f71729901bf43309c745c15 (diff)
Build for mingw, work underway
Diffstat (limited to 'xdelta3/xdelta3-internal.h')
-rw-r--r--xdelta3/xdelta3-internal.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/xdelta3/xdelta3-internal.h b/xdelta3/xdelta3-internal.h
index f30df80..72bf141 100644
--- a/xdelta3/xdelta3-internal.h
+++ b/xdelta3/xdelta3-internal.h
@@ -107,19 +107,9 @@ struct _main_file
107 int seek_failed; /* after seek fails once, try FIFO */ 107 int seek_failed; /* after seek fails once, try FIFO */
108}; 108};
109 109
110/* According to the internet, Windows vsnprintf() differs from most
111 * Unix implementations regarding the terminating 0 when the boundary
112 * condition is met. It doesn't matter here, we don't rely on the
113 * trailing 0. Besides, both Windows and DJGPP vsnprintf return -1
114 * upon truncation, which isn't C99 compliant. To overcome this,
115 * recent MinGW runtimes provided their own vsnprintf (notice the
116 * absence of the '_' prefix) but they were initially buggy. So,
117 * always use the native '_'-prefixed version with Win32. */
118#ifdef _WIN32 110#ifdef _WIN32
119#define vsnprintf_func(str,size,fmt,args) \ 111#define vsnprintf_func _vsnprintf
120 _vsnprintf_s(str,size,size-1,fmt,args) 112#define snprintf_func _snprintf
121#define snprintf_func(str,size,fmt,...) \
122 _snprintf_s(str,size,size-1,fmt,__VA_ARGS__)
123#else 113#else
124#define vsnprintf_func vsnprintf 114#define vsnprintf_func vsnprintf
125#define snprintf_func snprintf 115#define snprintf_func snprintf