diff options
Diffstat (limited to 'xdelta3/xdelta3-internal.h')
-rw-r--r-- | xdelta3/xdelta3-internal.h | 14 |
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 |