OLD | NEW |
---|---|
1 diff -c -r talloc-2.0.1/talloc.c talloc/talloc.c | 1 diff -c -r talloc-2.0.1/talloc.c talloc/talloc.c |
2 *** talloc-2.0.1/talloc.c Tue Dec 15 06:16:57 2009 | 2 *** talloc-2.0.1/talloc.c Tue Dec 15 06:16:57 2009 |
3 --- talloc/talloc.c Fri Mar 18 13:03:11 2011 | 3 --- talloc/talloc.c Fri Mar 18 13:03:11 2011 |
4 *************** | 4 *************** |
5 *** 30,36 **** | 5 *** 30,36 **** |
6 inspired by http://swapped.cc/halloc/ | 6 inspired by http://swapped.cc/halloc/ |
7 */ | 7 */ |
8 | 8 |
9 ! #include "replace.h" | 9 ! #include "replace.h" |
10 #include "talloc.h" | 10 #include "talloc.h" |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 { | 247 { |
248 char *ret; | 248 char *ret; |
249 | 249 |
250 *************** | 250 *************** |
251 *** 1581,1586 **** | 251 *** 1581,1586 **** |
252 --- 1593,1609 ---- | 252 --- 1593,1609 ---- |
253 return __talloc_strlendup(t, p, strlen(p)); | 253 return __talloc_strlendup(t, p, strlen(p)); |
254 } | 254 } |
255 | 255 |
256 + #ifndef HAVE_STRNLEN | 256 + #ifndef HAVE_STRNLEN |
257 + static size_t strnlen(const char* s, size_t n) | 257 + #define strnlen rep_strnlen |
258 + static size_t rep_strnlen(const char* s, size_t n) | |
Mark Mentovai
2012/07/27 01:10:14
Bet you broke this patch.
| |
258 + { | 259 + { |
259 + if (unlikely(!s)) return 0; | 260 + if (unlikely(!s)) return 0; |
260 + int i = 0; | 261 + int i = 0; |
261 + while (i < n && *s++ != '\0') | 262 + while (i < n && *s++ != '\0') |
262 + ++i; | 263 + ++i; |
263 + return i; | 264 + return i; |
264 + } | 265 + } |
265 + #endif | 266 + #endif |
266 + | 267 + |
267 /* | 268 /* |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 #include <stdlib.h> | 362 #include <stdlib.h> |
362 #include <stdio.h> | 363 #include <stdio.h> |
363 #include <stdarg.h> | 364 #include <stdarg.h> |
364 + #ifndef _MSC_VER | 365 + #ifndef _MSC_VER |
365 + #include <stdint.h> | 366 + #include <stdint.h> |
366 + #endif | 367 + #endif |
367 + #include <string.h> | 368 + #include <string.h> |
368 | 369 |
369 #define TALLOC_VERSION_MAJOR 2 | 370 #define TALLOC_VERSION_MAJOR 2 |
370 #define TALLOC_VERSION_MINOR 0 | 371 #define TALLOC_VERSION_MINOR 0 |
OLD | NEW |