blob: d0e8bf44e5486eb24078a721d90b17f43516c69b [file] [log] [blame]
Jeff Thompson47eecfc2013-07-07 22:56:46 -07001/**
2 * @author: Jeff Thompson
3 * See COPYING for copyright and distribution information.
Jeff Thompsonf418fe02013-06-27 17:28:55 -07004 */
5
6#include "ndn_memory.h"
7
8#if !HAVE_MEMCPY
9void ndn_memcpy(unsigned char *dest, unsigned char *src, unsigned int len)
10{
11 unsigned int i;
12
13 for (i = 0; i < len; i++)
14 dest[i] = src[i];
15}
Jeff Thompson2275e602013-06-28 22:24:47 -070016#else
17int ndn_memcpy_stub_to_avoid_empty_file_warning = 0;
Jeff Thompsonf418fe02013-06-27 17:28:55 -070018#endif
19
20#if !HAVE_MEMSET
21void ndn_memset(unsigned char *dest, int val, unsigned int len)
22{
23 unsigned int i;
24
25 for (i = 0; i < len; i++)
26 dest[i] = (unsigned char)val;
27}
Jeff Thompson2275e602013-06-28 22:24:47 -070028#else
29int ndn_memset_stub_to_avoid_empty_file_warning = 0;
Jeff Thompsonf418fe02013-06-27 17:28:55 -070030#endif