blob: 8699309b7cc5a63cd1f2d079c8a1786eb31cb060 [file] [log] [blame]
Jeff Thompsonf418fe02013-06-27 17:28:55 -07001/*
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
10void 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 Thompson2275e602013-06-28 22:24:47 -070017#else
18int ndn_memcpy_stub_to_avoid_empty_file_warning = 0;
Jeff Thompsonf418fe02013-06-27 17:28:55 -070019#endif
20
21#if !HAVE_MEMSET
22void 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 Thompson2275e602013-06-28 22:24:47 -070029#else
30int ndn_memset_stub_to_avoid_empty_file_warning = 0;
Jeff Thompsonf418fe02013-06-27 17:28:55 -070031#endif