Jeff Thompson | f418fe0 | 2013-06-27 17:28:55 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Author: Jeff Thompson |
| 3 | * |
| 4 | * BSD license, See the LICENSE file for more information. |
| 5 | */ |
| 6 | |
| 7 | #include "ndn_memory.h" |
| 8 | |
| 9 | #if !HAVE_MEMCPY |
| 10 | void ndn_memcpy(unsigned char *dest, unsigned char *src, unsigned int len) |
| 11 | { |
| 12 | unsigned int i; |
| 13 | |
| 14 | for (i = 0; i < len; i++) |
| 15 | dest[i] = src[i]; |
| 16 | } |
Jeff Thompson | 2275e60 | 2013-06-28 22:24:47 -0700 | [diff] [blame] | 17 | #else |
| 18 | int ndn_memcpy_stub_to_avoid_empty_file_warning = 0; |
Jeff Thompson | f418fe0 | 2013-06-27 17:28:55 -0700 | [diff] [blame] | 19 | #endif |
| 20 | |
| 21 | #if !HAVE_MEMSET |
| 22 | void ndn_memset(unsigned char *dest, int val, unsigned int len) |
| 23 | { |
| 24 | unsigned int i; |
| 25 | |
| 26 | for (i = 0; i < len; i++) |
| 27 | dest[i] = (unsigned char)val; |
| 28 | } |
Jeff Thompson | 2275e60 | 2013-06-28 22:24:47 -0700 | [diff] [blame] | 29 | #else |
| 30 | int ndn_memset_stub_to_avoid_empty_file_warning = 0; |
Jeff Thompson | f418fe0 | 2013-06-27 17:28:55 -0700 | [diff] [blame] | 31 | #endif |